/* ═════════════════════════════════════════════════════════════
   NEON FREQUENCY 2087 · poster-art cyberpunk theme
   Palette: cosmic midnight, hot magenta, sunset red, teal, cream
   ═════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0a0510;
  --bg-2:      #110718;
  --ink:       #f4ebd0;
  --ink-dim:   #a08e75;
  --magenta:   #ff1f6d;
  --magenta-2: #b71354;
  --red:       #ff3d5a;
  --teal:      #00c9b2;
  --teal-dim:  #007a6c;
  --rule:      rgba(244,235,208,0.18);
  --rule-soft: rgba(244,235,208,0.08);
  --shadow-1:  0 0 24px rgba(255,31,109,0.18);
  --shadow-2:  0 0 48px rgba(255,61,90,0.15);
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
html { background: var(--bg); }

body {
  color: var(--ink);
  font-family: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 8%,  rgba(255,31,109,0.18), transparent 55%),
    radial-gradient(circle at 82% 92%, rgba(0,201,178,0.12), transparent 60%),
    linear-gradient(180deg, #0a0510 0%, #07030c 100%);
}

/* ───── grain + scanlines overlays ───── */
.grain, .scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
}
.grain {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.18 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  opacity: .55;
  mix-blend-mode: overlay;
}
.scan {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.02) 0,
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  animation: scan 6s linear infinite;
}
@keyframes scan { from { background-position-y: 0; } to { background-position-y: 64px; } }

/* ───── frame: full viewport, no body scroll ───── */
.frame {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 24px;
  height: 100dvh;
  display: grid;
  /* header / strip / hero(flex shrinks) / footer / log */
  grid-template-rows: auto auto minmax(0, 1fr) auto minmax(120px, 25%);
  gap: 14px;
}
@media (max-width: 1180px) {
  .frame { max-width: 100%; }
}
@media (max-height: 760px) {
  .frame { gap: 10px; padding: 14px 18px; }
}

/* ───── header ───── */
.hdr {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.brand {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 3.4vw, 30px);
  letter-spacing: .04em;
  color: var(--magenta);
  text-shadow: 0 0 16px rgba(255,31,109,0.45);
}
.brand-sub {
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: .35em;
  text-transform: uppercase;
  margin-top: 4px;
}
.hdr-r { text-align: right; }
.jp {
  font-family: 'Noto Sans JP', 'Hiragino Sans', system-ui, sans-serif;
  font-size: 22px;
  color: var(--red);
  letter-spacing: .12em;
}
.coords {
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: .25em;
  margin-top: 4px;
}

/* ───── strip ───── */
.strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.4fr;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(255,31,109,0.05), rgba(0,0,0,0.3));
}
.strip-cell {
  padding: 10px 14px;
  border-right: 1px solid var(--rule);
  display: grid;
  gap: 4px;
}
.strip-cell:last-child { border-right: none; }
.strip-k {
  font-size: 9px;
  letter-spacing: .35em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.strip-v {
  font-size: 13px;
  color: var(--ink);
  letter-spacing: .12em;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-dim);
  display: inline-block;
}
.dot.off    { background: var(--ink-dim); box-shadow: none; }
.dot.live   { background: #00ff88; box-shadow: 0 0 10px #00ff88; animation: blink 1.4s ease-in-out infinite; }
.dot.busy   { background: #ffaa00; box-shadow: 0 0 10px #ffaa00; animation: blink 0.8s ease-in-out infinite; }
.dot.error  { background: #ff3b3b; box-shadow: 0 0 10px #ff3b3b; }
.dot.connecting { background: var(--teal); box-shadow: 0 0 10px var(--teal); animation: blink 0.6s ease-in-out infinite; }
.dot.reconnecting { background: #ffaa00; box-shadow: 0 0 10px #ffaa00; animation: blink 0.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ───── equalizer ───── */
.strip-cell-eq { padding-bottom: 8px; }
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.eq span {
  flex: 1;
  background: linear-gradient(180deg, var(--magenta), var(--magenta-2));
  height: 4px;
  transform-origin: bottom;
  transition: height .15s ease-out;
}
.eq.active span { animation: eq 1s ease-in-out infinite; }
.eq.active span:nth-child(1) { animation-delay: 0.0s; }
.eq.active span:nth-child(2) { animation-delay: 0.18s; }
.eq.active span:nth-child(3) { animation-delay: 0.06s; }
.eq.active span:nth-child(4) { animation-delay: 0.32s; }
.eq.active span:nth-child(5) { animation-delay: 0.12s; }
.eq.active span:nth-child(6) { animation-delay: 0.42s; }
.eq.active span:nth-child(7) { animation-delay: 0.22s; }
.eq.active span:nth-child(8) { animation-delay: 0.05s; }
@keyframes eq {
  0%, 100% { height: 4px; }
  50%      { height: 100%; }
}

/* ───── hero ───── */
.hero {
  position: relative;
  border: 1px solid var(--rule);
  overflow: hidden;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr;
  background: var(--bg-2);
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
}
.hero-bg svg { width: 100%; height: 100%; display: block; filter: contrast(1.05) saturate(1.1); }
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,5,16,0) 35%, rgba(10,5,16,.92) 100%);
}
.hero-fg {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 22px 26px;
  display: grid;
  gap: 14px;
}
@media (max-height: 760px) {
  .hero-fg { padding: 14px 18px; gap: 10px; }
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: .35em;
  color: var(--ink);
  text-transform: uppercase;
}
.kicker-jp {
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  color: var(--teal);
  letter-spacing: .15em;
}
.kicker-divider {
  flex: 1; max-width: 60px;
  height: 1px;
  background: var(--rule);
}
.kicker-en { color: var(--ink-dim); }

.title {
  margin: 0;
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 7vw, 76px);
  line-height: 0.85;
  letter-spacing: -.02em;
  color: var(--ink);
  text-shadow: 0 8px 40px rgba(255,31,109,0.45);
  display: grid;
}
@media (max-height: 900px) {
  .title { font-size: clamp(32px, 5.5vw, 60px); }
}
@media (max-height: 760px) {
  .title { font-size: clamp(28px, 4.5vw, 48px); }
}
.title span:first-child { color: var(--magenta); }
.title span:last-child  { color: var(--ink); margin-left: -2px; }

.now-line {
  display: flex;
  gap: 14px;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}
.now-k {
  font-size: 10px;
  letter-spacing: .35em;
  color: var(--ink-dim);
}
.now-v {
  flex: 1;
  color: var(--ink);
  letter-spacing: .04em;
  min-width: 220px;
}

/* ───── primary CTA ───── */
.primary { display: flex; }
.cta {
  position: relative;
  background: var(--magenta);
  color: #1a0410;
  border: none;
  padding: 18px 28px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .25em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-grid;
  grid-template-columns: auto auto auto;
  gap: 14px;
  align-items: center;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
  box-shadow: 0 8px 0 0 var(--magenta-2), 0 24px 40px rgba(255,31,109,0.25);
}
.cta-pre, .cta-post {
  font-size: 10px;
  letter-spacing: .4em;
  color: #1a0410;
  opacity: .6;
}
.cta-main {
  font-size: 18px;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 0 0 var(--magenta-2), 0 28px 56px rgba(255,31,109,0.35); }
.cta:active { transform: translateY(4px); box-shadow: 0 4px 0 0 var(--magenta-2), 0 12px 24px rgba(255,31,109,0.25); }
.cta:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.cta-corner {
  position: absolute;
  width: 10px; height: 10px;
  border: 2px solid #1a0410;
}
.cta-corner-tl { top: -1px; left: -1px;  border-right: none; border-bottom: none; }
.cta-corner-tr { top: -1px; right: -1px; border-left: none;  border-bottom: none; }
.cta-corner-bl { bottom: -1px; left: -1px;  border-right: none; border-top: none; }
.cta-corner-br { bottom: -1px; right: -1px; border-left: none;  border-top: none; }

.cta.recording {
  background: var(--red);
  animation: recording 1.2s ease-in-out infinite;
}
@keyframes recording {
  0%, 100% { box-shadow: 0 8px 0 0 #a3192a, 0 24px 40px rgba(255,61,90,0.4); }
  50%      { box-shadow: 0 8px 0 0 #a3192a, 0 24px 60px rgba(255,61,90,0.7); }
}

/* G4: STOP variant — neutral, doesn't compete as primary CTA */
.cta.cta--stop {
  background: #2a1a25;
  color: var(--ink);
  box-shadow: 0 6px 0 0 #14080f, 0 16px 24px rgba(0,0,0,0.4);
}
.cta.cta--stop .cta-pre,
.cta.cta--stop .cta-post { color: var(--ink-dim); }
.cta.cta--stop .cta-corner { border-color: var(--ink-dim); }
.cta.cta--stop:hover {
  box-shadow: 0 8px 0 0 #14080f, 0 20px 32px rgba(0,0,0,0.5);
  background: #34202d;
}

/* G1: pre-permission hint and LISTEN ONLY secondary action */
.primary { gap: 12px; align-items: center; flex-wrap: wrap; }
.btn-listen-only {
  border-color: var(--teal);
  color: var(--teal);
}
.btn-listen-only:hover { border-color: var(--ink); }
.btn-listen-only:disabled { opacity: .35; cursor: not-allowed; }

.pre-perm-hint {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: .03em;
  line-height: 1.55;
  border-left: 2px solid var(--teal-dim);
  padding: 6px 10px;
  margin-top: -4px;
  background: rgba(0,201,178,0.04);
}
.pre-perm-hint b { color: var(--ink); font-weight: 600; }
.pre-perm-hint[hidden] { display: none; }

/* ───── controls row ───── */
.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  /* talk-group (mode + TALK) | CALL DJ | PREV | NEXT */
  .controls { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ─── talk-group: mode toggle + TALK side by side ─────────────────── */
.talk-group {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
}
@media (pointer: coarse), (max-width: 640px) {
  .talk-group { grid-template-columns: 64px 1fr; }
}

.btn-mode {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  padding: 0;
  font: inherit;
  transition: border-color .18s, color .18s, background .18s, transform .12s;
  position: relative;
}
.btn-mode:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(0, 201, 178, 0.06);
}
.btn-mode:active:not(:disabled) { transform: translateY(1px); }
.btn-mode:disabled { opacity: .35; cursor: not-allowed; }
.btn-mode .mode-icon { width: 24px; height: 24px; }
.btn-mode .mode-label {
  font-size: 8px;
  letter-spacing: .25em;
  font-weight: 600;
  text-transform: uppercase;
  color: inherit;
  opacity: .85;
}
.btn-mode[data-mode="ptt"] {
  color: var(--ink);
  border-color: rgba(244, 235, 208, 0.4);
}
.btn-mode[data-mode="vad"] {
  color: var(--teal);
  border-color: var(--teal);
  background: rgba(0, 201, 178, 0.08);
  box-shadow: 0 0 12px rgba(0, 201, 178, 0.25), inset 0 0 12px rgba(0, 201, 178, 0.08);
}
.btn-mode[data-mode="vad"] .mode-label { color: var(--teal); opacity: 1; }
.btn-mode[data-mode="ptt"] .mode-icon-vad,
.btn-mode[data-mode="vad"] .mode-icon-ptt { display: none; }

/* TALK кнопка — компактная: TALK слева (с inline hint мелким текстом),
   SPACE-kbd справа. Никакого «трехэтажного» стека. */
.btn-ptt {
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
  position: relative;
  overflow: hidden;
}
.btn-ptt .btn-text {
  display: inline-block;
  line-height: 1;
}
.btn-ptt .btn-hint {
  display: none; /* desktop: kbd справа уже всё говорит */
  font-size: 9px;
  letter-spacing: .25em;
  color: var(--ink-dim);
  text-transform: uppercase;
  font-weight: 400;
  transition: color .2s;
  line-height: 1;
  margin-left: 8px;
}
.btn-ptt .btn-kbds {
  display: inline-flex;
}
@media (pointer: coarse), (max-width: 640px) {
  /* На touch нет SPACE — показываем "tap & hold" hint. */
  .btn-ptt .btn-hint { display: inline-block; }
  /* btn-kbds сами скрыты глобально через :not(#micModeKbd) на coarse. */
}

/* VAD waveform внутри TALK кнопки — synthwave-стиль */
.vad-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
  z-index: 0;
}
.btn-ptt > .btn-text,
.btn-ptt > .btn-hint,
.btn-ptt > .btn-kbds { position: relative; z-index: 1; }

.btn-ptt.vad-on {
  background: rgba(0, 201, 178, 0.04);
  border-color: var(--teal);
  cursor: default;
  opacity: 1 !important; /* не залочка визуально хоть disabled=true */
}
.btn-ptt.vad-on .vad-wave { display: block; }
.btn-ptt.vad-on .btn-text {
  font-size: 12px;
  opacity: 0.75;
}
.btn-ptt.vad-on .btn-hint {
  color: var(--teal);
  font-weight: 600;
  letter-spacing: .4em;
}
.btn-ptt.vad-on .btn-hint::before {
  content: '◉  ';
  color: var(--teal);
  animation: vad-pulse 1.4s ease-in-out infinite;
}
@keyframes vad-pulse {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}

/* .btn-line is the legacy class — most controls are now .btn-row.
   Keep btn-line as a plain bordered button without the slide-up animation
   (which conflicted with the new TEXT [KBD] inline layout and produced an
   empty cream bar on hover). */
.btn-line {
  position: relative;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 14px 18px;
  font: inherit;
  font-size: 12px;
  letter-spacing: .25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}
.btn-line:hover:not(:disabled) {
  border-color: var(--ink);
  background: rgba(244, 235, 208, 0.06);
}
.btn-line:disabled { opacity: .35; cursor: not-allowed; }

.btn-ptt {
  position: relative;
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
  padding: 14px 24px;
  font: inherit;
  font-weight: 600;
  letter-spacing: .25em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  transition: background .14s, color .14s, box-shadow .14s, transform .08s;
}
.btn-ptt .btn-pre, .btn-ptt .btn-post {
  font-size: 9px;
  letter-spacing: .35em;
  opacity: .65;
}
.btn-ptt .btn-main { font-size: 16px; }
.btn-ptt:hover {
  background: rgba(0,201,178,0.08);
  box-shadow: 0 0 24px rgba(0,201,178,0.25);
}
.btn-ptt.active {
  background: var(--teal);
  color: #001f1c;
  box-shadow: 0 0 36px rgba(0,201,178,0.6);
  transform: scale(0.99);
}
.btn-ptt:disabled { opacity: .35; cursor: not-allowed; }

/* ───── log: fills remaining viewport, scrolls internally ───── */
.logwrap {
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(0,201,178,0.03), rgba(0,0,0,0.3));
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}
.logwrap-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: .35em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.logwrap-h-v { color: var(--teal); margin-left: auto; }
.copy-diag-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  font: inherit;
  letter-spacing: .35em;
  padding: 3px 8px;
  cursor: pointer;
  text-transform: uppercase;
  transition: color .15s, border-color .15s, background .15s;
}
.copy-diag-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.copy-diag-btn:active {
  background: var(--accent);
  color: var(--ink);
}

.log {
  list-style: none;
  margin: 0;
  padding: 8px 14px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.log::-webkit-scrollbar { width: 6px; }
.log::-webkit-scrollbar-thumb { background: var(--rule); }
.log li {
  color: var(--ink-dim);
  border-left: 2px solid var(--rule-soft);
  padding-left: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  animation: in .35s ease-out;
}
@keyframes in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.log li.event { color: var(--teal); border-color: var(--teal-dim); }
.log li.dj    { color: var(--ink); border-color: var(--magenta); }
.log li.you   { color: var(--ink); border-color: var(--teal); }
.log li.error { color: #ff6b6b; border-color: #ff3b3b; }
/* Q4: source-URL link in log entries */
.log .log-link { color: var(--magenta); text-decoration: underline; text-decoration-style: dotted; }
.log .log-link:hover { color: var(--ink); }

/* ───── footer ───── */
.ft {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--rule);
  font-size: 11px;
}
/* Q2: footer compresses heavily on small screens */
@media (max-width: 640px) {
  .ft { grid-template-columns: 1fr 1fr; }
  .ft-cell:nth-child(n+5) { display: none; }
}

/* ─── mobile-fit: вырезаем декор + разрешаем естественный scroll ─── */
@media (max-width: 640px) {
  /* Header / footer / log / kicker / EQ / hero-bg — декор, прячем. */
  .hdr { display: none; }
  .ft { display: none; }
  .logwrap { display: none; }
  .kicker { display: none; }
  .strip-cell-eq { display: none; }
  .hero-bg { display: none; }
  .hero { background: linear-gradient(180deg, #1a0a1f 0%, #0e0420 100%); }
  /* Strip без EQ + меньше padding. */
  .strip { grid-template-columns: 1fr 1fr 1fr; }
  .strip-cell { padding: 6px 9px; }
  .strip-k { font-size: 8px; }
  .strip-v { font-size: 12px; }
  /* Hero уплотняем. */
  .hero-fg { padding: 10px 12px; gap: 6px; }
  .title { font-size: clamp(24px, 7vw, 36px); line-height: 0.85; }
  .title span:last-child { margin-left: 0; }
  .now-line { padding-top: 4px; gap: 8px; }
  .now-k { font-size: 8px; letter-spacing: .2em; }
  .now-v { font-size: 12px; }
  /* CTA + controls компактнее. */
  .cta { padding: 12px 18px; gap: 10px; }
  .cta-main { font-size: 16px; }
  .cta-pre, .cta-post { font-size: 9px; }
  .primary { gap: 8px; }
  .btn-listen-only { padding: 12px 16px; font-size: 11px; }
  .talk-group { grid-template-columns: 52px 1fr; gap: 6px; }
  .controls { gap: 6px; }
  .btn-row { padding: 10px 12px; min-height: 42px; font-size: 11px; }
  .vol-row { padding: 4px 0; }
  /* Естественный flow — лучше скролл чем зарезка. */
  html, body { height: auto; overflow: auto; }
  body { min-height: 100dvh; }
  .frame {
    height: auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }
  .hero { min-height: auto; }
}

/* Tablet (641-1024) — лог компактнее, footer виден. */
@media (min-width: 641px) and (max-width: 1024px) {
  .logwrap { max-height: 140px; }
  .log { font-size: 10px; }
}
.ft-cell {
  padding: 10px 12px;
  border-right: 1px solid var(--rule);
  display: grid;
  gap: 3px;
}
.ft-cell:last-child { border-right: none; }
.ft-k {
  font-size: 9px;
  letter-spacing: .35em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.ft-v {
  letter-spacing: .12em;
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════
   Q1 / J2 / I4 / I5 — accessibility, keyboard hint, volume row
   ═══════════════════════════════════════════════════════════════ */

/* Q1: volume slider row */
.vol-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  font-size: 11px;
  color: var(--ink-dim);
}
.vol-k { font-size: 9px; letter-spacing: .35em; text-transform: uppercase; }
.vol-v { font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; color: var(--ink); }
.vol-row input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  cursor: pointer;
}
.vol-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,201,178,0.45);
}
.vol-row input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg);
  cursor: pointer;
}

/* unified button row — TEXT [KBD] layout, all controls same height */
.btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font: inherit;
  font-size: 13px;
  letter-spacing: .25em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  transition: border-color .15s, color .15s, background .15s;
  min-height: 52px;
}
.btn-row:hover:not(:disabled) { border-color: var(--ink); }
.btn-row:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-row .btn-text { font-weight: 500; }
.btn-row .btn-kbds {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-row kbd {
  display: inline-block;
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.55;
  line-height: 1.4;
}
.btn-row .btn-kbd-toggle {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity .15s, color .15s;
}
.btn-row .btn-kbd-toggle:hover { opacity: 1; }
.btn-row .btn-kbd-toggle[data-mode="vad"] {
  color: var(--teal);
  border-color: var(--teal);
  opacity: 0.9;
}
/* PTT (TALK) override — more prominent, teal accent */
.btn-row.btn-ptt {
  color: var(--teal);
  border-color: var(--teal);
}
.btn-row.btn-ptt:hover:not(:disabled) {
  background: rgba(0, 201, 178, 0.08);
}
.btn-row.btn-ptt.active {
  background: var(--teal);
  color: var(--bg);
}
.btn-row.btn-ptt.active kbd { opacity: 1; }
@media (pointer: coarse), (max-width: 640px) {
  .btn-row { letter-spacing: .15em; padding: 12px 14px; min-height: 46px; }
  /* Прячем все kbd-хинты КРОМЕ переключателя PTT/VAD — он на touch
     остаётся как tap-chip, без него не переключиться между режимами. */
  .btn-row kbd:not(#micModeKbd) { display: none; }
  /* Восстанавливаем видимость micModeKbd как chip — на touch это уже не
     hotkey-индикатор, а tap-target, поэтому показываем зелёным. */
  #micModeKbd {
    display: inline-block;
    pointer-events: auto;
    background: rgba(0, 201, 178, 0.12);
    border: 1px solid var(--teal);
    color: var(--teal);
    padding: 3px 10px;
    font-size: 10px;
    letter-spacing: .35em;
    border-radius: 2px;
    cursor: pointer;
  }
  /* На touch у chip нет смысла буквы " M" — это hotkey, который не работает.
     Скрываем хвост через атрибут data-touch (выставляем из JS). */
  #micModeKbd[data-touch="1"] { letter-spacing: .25em; }
}

/* I4: focus-visible — clear ring on every interactive element.
   Use focus-visible (not :focus) so mouse clicks don't show ring. */
.cta:focus-visible,
.btn-line:focus-visible,
.btn-ptt:focus-visible,
.btn-listen-only:focus-visible,
.vol-row input[type="range"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* I5: prefers-reduced-motion — strip all decorative animation */
@media (prefers-reduced-motion: reduce) {
  .scan,
  .grain,
  .dot,
  .dot.live,
  .dot.busy,
  .dot.connecting,
  .dot.reconnecting,
  .eq.active span,
  .log li,
  .cta.recording {
    animation: none !important;
  }
  .scan { display: none; }
  .grain { opacity: .25; }
  /* keep a subtle indicator on the live dot rather than nothing */
  .dot.live { box-shadow: 0 0 4px #00ff88; }
}

/* ═══════════════════════════════════════════════════════════════
   K1 — touch target hints (PTT visible affordance for tap-toggle)
   ═══════════════════════════════════════════════════════════════ */
@media (pointer: coarse) {
  .btn-ptt .btn-pre { content: 'TAP'; }
  .btn-ptt .btn-post { content: 'TOGGLE'; }
}
.btn-ptt[data-mobile="1"] .btn-pre::before { content: 'TAP '; }
.btn-ptt[data-mobile="1"] .btn-pre { font-size: 0; }
.btn-ptt[data-mobile="1"] .btn-pre::before {
  font-size: 9px; letter-spacing: .35em; opacity: .65;
}
.btn-ptt[data-mobile="1"] .btn-post { font-size: 0; }
.btn-ptt[data-mobile="1"] .btn-post::before {
  content: 'TOGGLE';
  font-size: 9px; letter-spacing: .35em; opacity: .65;
}

/* ─── easter egg: synthwave visualizer ───────────────────────────── */
.egg {
  position: fixed;
  inset: 0;
  background: #050010;
  z-index: 9999;
  overflow: hidden;
  cursor: none;
}
.egg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.egg-hud {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  font-size: 10px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
  text-shadow: 0 0 6px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.8);
  z-index: 2;
}
.egg-hud-l { pointer-events: none; }
.egg-hud-jp {
  font-family: serif;
  font-size: 22px;
  letter-spacing: .15em;
  margin-bottom: 4px;
  color: #FF2A6D;
}
.egg-hud-c {
  text-align: center;
  color: #00C9B2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.egg-hud-scene {
  font-size: 13px;
  letter-spacing: .4em;
}
.egg-hud-counter {
  font-size: 9px;
  letter-spacing: .35em;
  color: rgba(0, 201, 178, 0.55);
}
.egg-hud-r {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
.egg-hud-divider {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,.25);
  margin: 0 4px;
}
.egg-hud-exit { display: inline-flex; align-items: center; }
.egg-nav {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: rgba(255,255,255,.85);
  padding: 4px 10px;
  font: inherit;
  letter-spacing: .35em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
  pointer-events: auto;
}
.egg-nav:hover {
  border-color: #00C9B2;
  color: #00C9B2;
  transform: translateY(-1px);
}
.egg-nav:active { transform: translateY(0); background: rgba(0,201,178,.1); }
.egg-nav kbd {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 14px;
}
.egg-hud kbd {
  display: inline-block;
  border: 1px solid rgba(255,255,255,.6);
  padding: 2px 6px;
  margin-right: 4px;
  font-family: inherit;
}
.egg-scanlines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,.18) 0px,
    rgba(0,0,0,.18) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: multiply;
}
body.egg-on { overflow: hidden; }
