/* ==========================================================================
   Niloogram — "Midnight" theme (dark skin for the hosted edition).
   The openCode terminal system, flipped to a deep blue-black canvas with a
   cool cyan accent + faint glow on selection. Standalone like the other theme
   sheets (Vite serves each as its own <link>); the block below is openCode's
   layout verbatim, then a dark palette + cool overrides that win by source
   order. Keep structural edits in sync with styles-opencode.css.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500;700&display=swap");

:root {
  /* surfaces — warm cream ladder */
  --canvas: #fdfcfc;
  --surface-soft: #f8f7f7;
  --surface-card: #f1eeee;
  --surface-dark: #201d1d;
  --surface-dark-elevated: #302c2c;

  /* ink — near-black, the brand's only "color" on light surfaces */
  --ink: #201d1d;
  --ink-deep: #0f0000;
  --charcoal: #302c2c;
  --body: #424245;
  --mute: #646262;
  --stone: #6e6e73;
  --ash: #9a9898;

  /* hairlines — translucent warm tint matches the cream canvas's undertone */
  --line: rgba(15, 0, 0, 0.12);
  --line-strong: #646262;
  --hairline: 1px solid var(--line);
  --hairline-strong: 1px solid var(--line-strong);

  /* semantic ramp (Apple HIG) — accent/focus only on marketing chrome */
  --accent: #007aff;
  --accent-hover: #0056b3;
  --rec: #ff3b30;
  --warning: #ff9f0a;
  --success: #30d158;

  /* geometry — 4px on interactive, 0 on containers */
  --radius: 0px;
  --radius-sm: 4px;

  /* type stacks — Berkeley Mono is paid; fall back through IBM Plex Mono
     (loaded above), JetBrains Mono, then the long monospace ladder. */
  --font-mono: "Berkeley Mono", "JetBrains Mono", "IBM Plex Mono", ui-monospace,
    SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  --font-ui: var(--font-mono);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  /* flat cream canvas — no gradients, no surface alternation */
  background-color: var(--canvas);
  min-height: 100vh;
}

.app {
  max-width: 620px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
  position: relative;
}

/* ------------------------------------------------------------- backdrop -- */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* a single faint hairline rule drifting down the canvas — quiet, not animated
   confetti. The OpenCode system is flat-on-cream with no decorative imagery. */
.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  top: -1px;
  background: var(--line);
  animation: sweep 18s linear infinite;
  opacity: 0.7;
}
@keyframes sweep {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(calc(100vh + 2px)); opacity: 0; }
}

.app > *:not(.bg-decor) {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------- header -- */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 6px 2px 18px;
  border-bottom: var(--hairline);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ash);
  transition: background 0.3s var(--ease);
}
.rec-dot.live {
  background: var(--rec);
}

.wordmark {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  margin: 0;
  color: var(--ink);
}

nav {
  display: flex;
  gap: 0;
  background: transparent;
  border: var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0;
}

nav button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: 500 0.84rem/1 var(--font-ui);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  padding: 9px 16px;
  border-radius: 0;
  cursor: pointer;
}
/* sharp tab separators instead of a pill track */
nav button + button { border-left: var(--hairline); }
nav button.active { color: var(--ink); background: var(--surface-soft); }
.nav-pill {
  position: absolute;
  inset: 0;
  border-radius: 0;
  /* a 2px ink underline marks the active tab — the system's flat selection
     signal, no halo */
  background: transparent;
  border-bottom: 2px solid var(--ink);
}
.nav-label { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- panels - */
main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.dictate .controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
}

/* mode chips — hairline-bordered rectangles, 4px radius, no fill */
.mode-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin-bottom: 18px;
  border: var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.chip {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: 500 0.84rem/1 var(--font-ui);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  padding: 9px 15px;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.chip + .chip { border-left: var(--hairline); }
.chip:hover { color: var(--ink); }
.chip.active { color: var(--ink); background: var(--surface-soft); }
.chip-glow {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background: var(--surface-soft);
  /* 2px ink underline marks the selected format */
  border-bottom: 2px solid var(--ink);
}
.chip-label { position: relative; z-index: 1; }

/* language picker — a single inline sticker row, hairline-bordered */
.lang-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 18px;
  padding: 6px 10px 6px 14px;
  background: var(--surface-soft);
  border: var(--hairline);
  border-radius: var(--radius-sm);
  font: 500 0.78rem/1 var(--font-ui);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--mute);
}
.lang-label { flex-shrink: 0; }
.lang-row select {
  appearance: none;
  border: var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  color-scheme: light;
  font: 500 0.84rem/1 var(--font-ui);
  letter-spacing: 0.01em;
  padding: 6px 28px 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s var(--ease);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646262' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.lang-row select:hover { border-color: var(--line-strong); }
.lang-row select:focus { border-color: var(--ink); }
.lang-row select:disabled { opacity: 0.5; cursor: default; }
.lang-row select option {
  color: var(--ink);
  background: var(--canvas);
}

/* the stage: visualizer ring + mic */
.stage {
  position: relative;
  width: 300px;
  height: 300px;
  display: grid;
  place-items: center;
}

.visualizer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* the mic: a flat ink-bordered rectangle (no faux-3D, no gradient). The
   OpenCode system has no drop shadows — depth comes from typography, not
   CSS effects. */
.mic {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink);
  background: var(--surface-soft);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.mic svg { width: 44px; height: 44px; }
.mic:hover { background: var(--surface-card); }
.mic.recording {
  color: #fff;
  background: var(--rec);
  border-color: var(--rec);
  animation: mic-pulse 1.4s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.mic:disabled { cursor: default; opacity: 0.85; }

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* readouts */
.timer {
  font: 700 1.5rem/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--ash);
  min-height: 1.5rem;
  margin: 6px 0 0;
  transition: color 0.3s var(--ease);
}
.timer.rec { color: var(--rec); }

.hint {
  color: var(--mute);
  font-size: 0.84rem;
  margin: 2px 0 0;
  text-align: center;
}

.error {
  color: var(--rec);
  font-size: 0.84rem;
  text-align: center;
  margin: 4px 0 0;
}

/* --------------------------------------------------------------- result -- */
/* sharp rectangle (radius 0), hairline border, no shadow. */
.result {
  background: var(--canvas);
  border: var(--hairline);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
}

.result h2 {
  margin: 0 0 10px;
  padding-bottom: 9px;
  border-bottom: var(--hairline);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--ink);
}

.result .clean {
  margin: 0 0 10px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.92rem;
  color: var(--body);
}

.result details {
  margin: 0 0 10px;
  border-top: var(--hairline);
  padding-top: 8px;
}
.result summary {
  cursor: pointer;
  color: var(--mute);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.result .raw {
  color: var(--mute);
  white-space: pre-wrap;
  font-size: 0.84rem;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 8px;
  margin: 4px 0 8px;
}

button {
  font-family: var(--font-ui);
}

/* secondary buttons: cream fill, ink text, hairline border, 4px radius */
.actions button,
.settings button,
.account-row button {
  border: var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.84rem;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.actions button:hover,
.settings button:hover { border-color: var(--line-strong); background: var(--surface-soft); }

/* primary CTA: ink fill, cream text — the brand's only solid fill */
button.primary {
  background: var(--ink);
  color: var(--canvas);
  border: 1px solid var(--ink);
}
button.primary:hover { background: var(--ink-deep); border-color: var(--ink-deep); }

button.danger {
  color: var(--rec);
  border-color: rgba(255, 59, 48, 0.4);
}
button.danger:hover { border-color: var(--rec); background: var(--surface-soft); }

.meta {
  color: var(--mute);
  font: 400 0.74rem/1.5 var(--font-mono);
  margin: 0;
  word-break: break-all;
}

/* -------------------------------------------------------------- history -- */
.history { gap: 14px; }
.history audio {
  width: 100%;
  height: 38px;
  margin: 4px 0 8px;
}

/* ------------------------------------------------------------- settings -- */
.settings { gap: 14px; padding-bottom: 24px; }

.settings h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 18px 0 0;
  border-top: var(--hairline);
  padding-top: 18px;
}

.settings label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--mute);
}
.settings label.row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 400;
}

.settings select,
.settings input[type="text"],
.settings input[type="password"],
.settings textarea {
  appearance: none;
  border: var(--hairline);
  background: var(--surface-soft);
  color: var(--ink);
  color-scheme: light;
  font: 400 0.92rem/1.4 var(--font-ui);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.settings select:focus,
.settings input:focus,
.settings textarea:focus {
  /* the canvas's flat focus signal — no halo, no glow */
  border-color: var(--ink);
  background: var(--canvas);
}

.settings select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646262' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.settings textarea { resize: vertical; }

.settings input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

.save-flash { color: var(--accent); }

/* custom prompts */
.prompt-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-soft);
  border: var(--hairline);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.prompt-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.prompt-name { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.prompt-hint-text {
  color: var(--mute);
  font-size: 0.8rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prompt-row .danger {
  border: var(--hairline);
  background: transparent;
  padding: 2px 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* BYOK keys */
.key-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.key-name {
  width: 86px;
  flex-shrink: 0;
  font: 500 0.8rem/1 var(--font-mono);
  color: var(--mute);
}
.key-row input { flex: 1; min-width: 0; }

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* boot shimmer while /api/me resolves */
.boot {
  margin: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}

/* ------------------------------------------------------- history status ---- */
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: 500 0.66rem/1.7 var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.badge-failed { color: var(--rec); border-color: rgba(255, 59, 48, 0.4); }
.badge-partial { color: var(--warning); border-color: rgba(255, 159, 10, 0.4); }

/* Collapsible error disclosure on history cards. */
.error-detail { margin: 10px 0 0; }
.error-detail > summary {
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--mute);
  user-select: none;
  list-style: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.error-detail > summary::-webkit-details-marker { display: none; }
.error-detail[open] > summary { color: var(--rec); margin-bottom: 6px; }
.error-detail .error {
  font: 0.78rem/1.5 var(--font-mono);
  background: var(--surface-card);
  border: var(--hairline);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  margin: 0;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Redo-cleanup row on a history card. */
.redo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: var(--hairline);
}
.redo-row label { white-space: nowrap; }
.redo-row select {
  appearance: none;
  border: var(--hairline);
  background: var(--surface-soft);
  color: var(--ink);
  color-scheme: light;
  font: 400 0.86rem/1.4 var(--font-ui);
  padding: 7px 28px 7px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  flex: 1;
  min-width: 0;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646262' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.redo-row select:focus { border-color: var(--ink); }

/* Subtle secondary button (used by Apply in the redo row). */
button.ghost {
  background: transparent;
  border: var(--hairline);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
button.ghost:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-soft); }
button.ghost:disabled { opacity: 0.5; cursor: default; }

/* -------------------------------------------------------- progress bar ----- */
.progress { width: 100%; max-width: 320px; margin-top: 10px; }
.progress-bar {
  height: 4px;
  border-radius: 0;
  background: var(--surface-card);
  border: var(--hairline);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  position: absolute;
  inset: 0;
  width: 35%;
  border-radius: 0;
  background: var(--ink);
  background-size: 200% 100%;
  animation: progress-slide 1.1s ease-in-out infinite;
}
@keyframes progress-slide {
  0%   { left: -35%; }
  100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-fill { animation: progress-pulse 1.4s ease-in-out infinite; left: 0; width: 100%; opacity: 0.6; }
  @keyframes progress-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 0.8; } }
}

/* -------------------------------------------------------- upload button ------ */
.upload-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

/* -------------------------------------------------------- model picker ------ */
.model-picker { display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.model-picker .hint { margin: 2px 0 0; }

/* -------------------------------------------------------- theme picker ------ */
/* Segmented theme switcher in Settings. Mirrors the top-nav shape so the
   shared .nav-pill (layoutId="theme-pill") slides between options cleanly.
   Rendered as a hairline-bordered tab strip with a 2px ink underline. */
.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: transparent;
  border: var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
}
.theme-picker button {
  position: relative;
  flex: 1 1 auto;
  min-width: 84px;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: 500 0.8rem/1 var(--font-ui);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  padding: 9px 16px;
  border-radius: 0;
  cursor: pointer;
}
.theme-picker button + button { border-left: var(--hairline); }
.theme-picker button:hover { color: var(--ink); }
.theme-picker button.active { color: var(--ink); background: var(--surface-soft); }

/* --------------------------------------------------- prompt edit / actions -- */
.prompt-row-actions { display: flex; gap: 6px; align-items: center; }
.prompt-row-actions button {
  background: transparent;
  border: var(--hairline);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.prompt-edit { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.prompt-edit input,
.prompt-edit textarea {
  appearance: none;
  border: var(--hairline);
  background: var(--surface-soft);
  color: var(--ink);
  color-scheme: light;
  font: 400 0.9rem/1.4 var(--font-ui);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  outline: none;
  width: 100%;
}
.prompt-edit textarea { resize: vertical; min-height: 64px; }
.prompt-edit input:focus,
.prompt-edit textarea:focus { border-color: var(--ink); background: var(--canvas); }
.prompt-edit-actions { display: flex; gap: 8px; }
.prompt-edit-actions button.primary { padding: 7px 16px; }

/* -------------------------------------------------------- iphone / pwa ------ */
@media (display-mode: standalone) {
  .app {
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .stage { width: 260px; height: 260px; }
  .mode-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mode-row::-webkit-scrollbar { display: none; }
  .chip { padding: 8px 12px; font-size: 0.78rem; }
}

button { touch-action: manipulation; }

.result { overflow-wrap: anywhere; word-break: break-word; }
.redo-row select { max-width: 50vw; }

/* --------------------------------------------------------- reduced motion  */
@media (prefers-reduced-motion: reduce) {
  .scanline { animation: none; opacity: 0; }
  .mic.recording { animation: none; }
}


/* ===== Midnight dark overrides (win by source order) ===== */

:root {
  /* surfaces — deep blue-black ladder, each step a touch lighter */
  --canvas: #0b0e14;
  --surface-soft: #12161f;
  --surface-card: #1a1f2b;
  --surface-dark: #e6edf3;
  --surface-dark-elevated: #f1f4f8;

  /* ink — cool near-white, the text color on the dark canvas */
  --ink: #e6edf3;
  --ink-deep: #ffffff;
  --charcoal: #c9d1d9;
  --body: #b3bdc9;
  --mute: #8b96a5;
  --stone: #7d8794;
  --ash: #5a6472;

  /* hairlines — faint cool light on dark */
  --line: rgba(230, 237, 243, 0.11);
  --line-strong: #3a424f;
  --hairline: 1px solid var(--line);
  --hairline-strong: 1px solid var(--line-strong);

  /* semantic ramp — cyan accent is the "cool" signal (focus + selection) */
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --rec: #ff5c57;
  --warning: #ffb454;
  --success: #3fb950;
}

/* flat canvas + a single faint cyan glow bleeding from the top edge */
body {
  background-color: var(--canvas);
  background-image: radial-gradient(120% 80% at 50% -10%, rgba(56, 189, 248, 0.07), transparent 60%);
}

/* dark form controls: native chrome (scrollbars, calendar) match the theme */
.lang-row select,
.settings select,
.settings input[type="text"],
.settings input[type="password"],
.settings textarea,
.redo-row select,
.prompt-edit input,
.prompt-edit textarea {
  color-scheme: dark;
}

/* select chevrons: openCode's stroke is a mid-gray tuned for cream — swap to a
   cool light stroke so it reads on the dark surfaces */
.lang-row select,
.settings select,
.redo-row select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b96a5' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* selection signal: cyan underline + faint glow instead of the flat ink bar.
   Shared by the top nav, mode chips, and the theme picker (all use .nav-pill /
   .chip-glow via layoutId). */
.nav-pill,
.chip-glow {
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 1px 10px -2px rgba(56, 189, 248, 0.5);
}
nav button.active,
.chip.active,
.theme-picker button.active { color: var(--ink); }

/* focus rings pick up the cyan accent (openCode focuses to flat ink) */
.settings select:focus,
.settings input:focus,
.settings textarea:focus,
.lang-row select:focus,
.redo-row select:focus,
.prompt-edit input:focus,
.prompt-edit textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

/* the mic: keep the flat rectangle but add a cool halo so it doesn't sink into
   the dark canvas (openCode is shadow-free on cream; dark wants a little lift) */
.mic {
  border-color: var(--line-strong);
  box-shadow: 0 0 28px -8px rgba(56, 189, 248, 0.3);
}
.mic:hover {
  border-color: var(--accent);
  box-shadow: 0 0 34px -6px rgba(56, 189, 248, 0.45);
}
