:root {
  color-scheme: dark;
  --bg: #061014;
  --panel: #0d1b20;
  --line: #244048;
  --text: #f4fbfc;
  --muted: #9ab1b7;
  --cyan: #38e9ff;
  --green: #6cff9b;
  --yellow: #ffe36c;
  --red: #ff6b78;
  --radius: 18px;
  --state: var(--muted);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, #0f2a31 0, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.4;
}
.shell { width: min(560px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 44px; }
.brand { color: var(--cyan); font-weight: 900; letter-spacing: .16em; text-decoration: none; font-size: .78rem; }
h1 { margin: .35rem 0 0; font-size: clamp(2.2rem, 8vw, 3.2rem); line-height: 1; letter-spacing: -.04em; }
.subtitle { margin: .6rem 0 18px; color: var(--muted); }

.card {
  background: linear-gradient(180deg, rgba(17,37,43,.96), rgba(10,24,29,.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,.2);
}
.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.controls label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .75rem; font-weight: 700; flex: 1 1 140px; }
.controls label:last-child { flex: 0 1 110px; }
select {
  background: #08171b; color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 10px; font: inherit; font-size: .95rem;
}

.meter { margin: 14px auto 0; max-width: 380px; }
.meter svg { display: block; width: 100%; height: auto; }
.meter-track { fill: none; stroke: #183038; stroke-width: 12; stroke-linecap: round; }
.meter-zone { fill: none; stroke: var(--green); stroke-width: 12; opacity: .55; }
.meter-tick { stroke: #3e6671; stroke-width: 1.5; }
.meter-tick.major { stroke: var(--muted); stroke-width: 2; }
.meter-label { fill: var(--muted); font-size: 10px; text-anchor: middle; font-variant-numeric: tabular-nums; }
.meter-end { fill: var(--muted); font-size: 16px; text-anchor: middle; }
.needle line { stroke: var(--state); stroke-width: 4; stroke-linecap: round; transition: stroke .2s; }
.needle circle { fill: var(--panel); stroke: var(--state); stroke-width: 3; transition: stroke .2s; }
.needle.idle { opacity: .35; }

.readout { text-align: center; margin-top: 4px; }
.note-row { display: flex; justify-content: center; align-items: baseline; gap: 2px; min-height: 5.4rem; }
.note {
  font-size: clamp(4.2rem, 20vw, 5.6rem); font-weight: 900; line-height: 1; letter-spacing: -.04em;
  color: var(--state); transition: color .2s, text-shadow .2s;
}
.octave { font-size: 1.6rem; font-weight: 800; color: var(--muted); }
.direction { margin: 6px 0 0; font-size: 1.15rem; font-weight: 800; color: var(--state); min-height: 1.5em; }
.detail { margin: 4px 0 0; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

.card[data-state="in-tune"] { --state: var(--green); }
.card[data-state="in-tune"] .note { text-shadow: 0 0 30px rgba(108,255,155,.45); }
.card[data-state="close"] { --state: var(--yellow); }
.card[data-state="off"] { --state: var(--red); }

.strings { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 18px; }
.strings:empty { display: none; }
.string {
  position: relative; background: #08171b; border: 1px solid #1c343b; border-radius: 12px;
  color: var(--text); font: inherit; font-weight: 850; font-size: 1.05rem; padding: 10px 0 8px; cursor: pointer;
}
.string small { display: block; color: var(--muted); font-size: .65rem; font-weight: 700; margin-top: 2px; }
.string:hover { border-color: #3e6671; }
.string.target { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.string.locked { background: rgba(56,233,255,.12); }
.string.tuned::after {
  content: "✓"; position: absolute; top: -7px; right: -5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); color: #001013; font-size: .7rem; line-height: 18px;
}

.actions { display: flex; gap: 10px; margin-top: 16px; }
.button {
  flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 12px;
  padding: 13px 16px; cursor: pointer; font: inherit; font-weight: 800;
}
.button:hover { border-color: #3e6671; }
.button.primary { color: #001013; background: linear-gradient(135deg, var(--cyan), var(--green)); border-color: transparent; }
.button.primary.listening { color: var(--text); background: var(--panel); border-color: var(--line); }
.button:focus-visible, .string:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.status { margin: 12px 0 0; color: var(--muted); font-size: .85rem; text-align: center; min-height: 1.2em; }
.status.error { color: var(--red); }
.privacy { color: var(--muted); font-size: .82rem; text-align: center; margin: 16px 8px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
deedz-nav { min-height:50px; margin-bottom:22px; --dz-nav-bg:rgba(13,27,32,.88); --dz-nav-line:var(--line); --dz-nav-accent:var(--cyan); }
