/* Tinos (the free Times New Roman) and Cousine, served from this site (the CSP allows only 'self').
   SIL Open Font License; license files are in assets/fonts. */
@font-face { font-family: "Tinos"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/tinos-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Tinos"; font-style: italic; font-weight: 400; font-display: swap; src: url("../assets/fonts/tinos-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Tinos"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/tinos-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cousine"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/cousine-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cousine"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/cousine-latin-700-normal.woff2") format("woff2"); }

/* Jarvis Notes web. Colors mirror JarvisTheme.Role in the iOS app; see THIRD_PARTY_NOTICES.md for adapted styles. */

:root {
  color-scheme: light dark;
  --wash: #ffffff;
  --wash-opacity: 0.72;
  --canvas-top: #e4f3fa;
  --canvas-bottom: #cfe8f3;
  --surface: #ffffff;
  --control: #eef7fc;
  --text: #0b2230;
  --text-2: #3d5866;
  --divider: #c3d9e4;
  --primary: #096a9b;
  --success: #1b6e37;
  --review: #875400;
  --destructive: #b3261e;
  --inset-highlight: rgba(255, 255, 255, 0.9);
  --shadow-card: 0 1px 2px rgba(11, 34, 48, 0.08), 0 8px 24px rgba(11, 34, 48, 0.08);
  --focus: #0041b8;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --radius-card: 20px;
  --font: Tinos, "Times New Roman", Times, serif;
  --mono: Cousine, "Courier New", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wash: #061823;
    --wash-opacity: 0.6;
    --canvas-top: #0a2433;
    --canvas-bottom: #061823;
    --surface: #0f2a38;
    --control: #153646;
    --text: #eaf6fb;
    --text-2: #a6c3d0;
    --divider: #274b5c;
    --primary: #45bfea;
    --success: #5ccf8a;
    --review: #f0b347;
    --destructive: #ff7468;
    --inset-highlight: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --focus: #8fdcff;
  }
}

@media (prefers-color-scheme: dark) {
  .wallpaper { background-image: url("../assets/aero-water-dark.svg"); }
}

@media (prefers-contrast: more) {
  :root { --wash-opacity: 0.9; --text-2: #223b48; --divider: #5c7987; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --text-2: #cfe3ec; --divider: #7fa3b3; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --wash-opacity: 0.9; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
  background: linear-gradient(var(--canvas-top), var(--canvas-bottom)) fixed;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
.sprite { display: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-lg); top: -100px; z-index: 50;
  padding: var(--space-sm) var(--space-lg);
  background: var(--surface); color: var(--primary); border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--space-lg); }

/* Wallpaper: the wash keeps text on the wallpaper as legible as on the plain gradient. */
.wallpaper {
  position: fixed; inset: 0; z-index: -1;
  background: url("../assets/aero-water.svg") center / cover no-repeat;
}
.wallpaper::before, .wallpaper::after { content: ""; position: absolute; inset: 0; }
.wallpaper::before { background: var(--wash); opacity: var(--wash-opacity); }
.wallpaper::after {
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--wash) 85%, transparent) 0%,
    color-mix(in srgb, var(--wash) 85%, transparent) 18%,
    transparent 32%);
}

/* Layout */

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: max(var(--space-md), env(safe-area-inset-top)) max(var(--space-lg), env(safe-area-inset-right)) 0 max(var(--space-lg), env(safe-area-inset-left));
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: var(--space-xs) 0 var(--space-sm); }
.brand { display: flex; align-items: center; gap: var(--space-sm); font-weight: 700; font-size: 1.125rem; letter-spacing: 0.01em; }
.brand-name { padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--divider); }
.topbar-actions { display: flex; gap: var(--space-sm); }

/* Tabs: Notes is the app; How it works and Privacy are plain pages.
   Phone: the tabs get their own row under the brand. Wider: they sit between the brand and the buttons. */
.topbar { flex-wrap: wrap; }
.tabs { order: 3; width: 100%; }
.tabs ul { display: flex; gap: var(--space-xs); margin: 0; padding: 0; list-style: none; }
.tabs a {
  display: block; padding: 6px 14px; border-radius: 999px;
  color: var(--text-2); text-decoration: none; font-size: 1rem;
  border: 1px solid transparent;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface); border-color: var(--divider); font-weight: 700; }
@media (min-width: 720px) {
  .tabs { order: 0; width: auto; margin-right: auto; margin-left: var(--space-lg); }
}

/* How it works and Privacy pages */
.page { max-width: 760px; padding-bottom: var(--space-xl); }
.page h1 { margin-bottom: var(--space-md); }
.page .card { padding: var(--space-xl); }
.page .card + .card { margin-top: var(--space-lg); }
.page h2 { margin-bottom: var(--space-sm); }
.page p, .page li { color: var(--text-2); line-height: 1.55; }
.page p + p { margin-top: var(--space-sm); }
.page strong { color: var(--text); }
.page ol, .page ul { margin: 0; padding-left: 1.25em; display: grid; gap: var(--space-sm); }
.page a { color: var(--primary); font-weight: 700; }
.page .lede { font-size: 1.1875rem; color: var(--text-2); margin: 0 0 var(--space-lg); }

/* Glossy Aero orb: the one purely decorative flourish. */
.brand-orb {
  width: 30px; height: 30px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95) 0 18%, rgba(255, 255, 255, 0) 42%),
    radial-gradient(circle at 50% 110%, #7fe3ff 0 25%, rgba(127, 227, 255, 0) 60%),
    radial-gradient(circle at 50% 40%, #1f8fd6, #0041b8 75%);
  box-shadow: inset 0 -2px 4px rgba(0, 17, 49, 0.5), 0 2px 6px rgba(0, 65, 184, 0.45);
}

.icon-button {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--divider);
  background: var(--surface); color: var(--primary);
  box-shadow: var(--shadow-card);
}
.icon-button svg { width: 22px; height: 22px; }

.layout { display: grid; gap: var(--space-xl); align-items: start; }

.list-pane { min-width: 0; display: flex; flex-direction: column; gap: var(--space-md); padding-bottom: var(--space-lg); }

h1 { margin: var(--space-xs) 0 0; font-size: 2.125rem; line-height: 1.15; font-weight: 750; letter-spacing: -0.01em; }
h1:focus { outline: none; }
h2 { margin: 0; font-size: 1.375rem; line-height: 1.25; }
h3 { margin: var(--space-xl) 0 var(--space-sm); font-size: 1.0625rem; }

.secondary { color: var(--text-2); }

/* Search */
.search {
  display: flex; align-items: center; gap: var(--space-sm);
  min-height: 44px; padding: 0 var(--space-md);
  border-radius: 14px; background: var(--surface); border: 1px solid var(--divider);
}
.search svg { color: var(--text-2); }
.search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; font-size: 1.0625rem; }
.search input::placeholder { color: var(--text-2); opacity: 1; }
.search input:focus-visible { outline: none; }
.search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Pills and cards */
.pill {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  width: fit-content; max-width: 100%;
  padding: var(--space-xs) var(--space-md);
  border-radius: 999px; background: var(--surface); border: 1px solid var(--divider);
}
.notes-count { margin: var(--space-sm) 0 0; font-weight: 600; color: var(--text-2); }

.section-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }
.section-pill { position: relative; min-height: 44px; color: var(--primary); font-weight: 650; font-size: 1.0625rem; }
.section-pill select {
  appearance: none; border: 0; background: transparent; color: inherit; font-weight: inherit;
  padding: var(--space-xs) 26px var(--space-xs) var(--space-xs); min-height: 36px; max-width: 18ch;
}
.section-pill select:focus-visible { outline: none; }
.section-pill:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.section-pill .chevron { position: absolute; right: var(--space-md); width: 14px; height: 14px; pointer-events: none; }
.pill-button { min-height: 44px; color: var(--primary); font-weight: 600; font-size: 0.9375rem; }
.pill-button svg { width: 16px; height: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.filters { padding: 0 var(--space-lg); }
.filter-row { display: flex; align-items: center; gap: var(--space-md); min-height: 52px; flex-wrap: wrap; }
.filter-row + .filter-row { border-top: 1px solid var(--divider); }
.filter-row svg { color: var(--primary); width: 22px; height: 22px; }
.filter-label { flex: 1; font-size: 1.0625rem; }
.filter-row select {
  appearance: none; border: 0; background: transparent; color: var(--primary); font-size: 1.0625rem;
  min-height: 44px; padding: 0 22px 0 var(--space-sm); text-align: right; text-align-last: right;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 9px center, right 4px center; background-size: 5px 5px; background-repeat: no-repeat;
}
.filter-row select:focus-visible { outline: none; }
.filter-row:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

/* Notes list */
.note-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.note-list li + li { border-top: 1px solid var(--divider); }
.note-row {
  display: flex; align-items: center; gap: var(--space-md);
  width: 100%; padding: var(--space-md) var(--space-lg);
  border: 0; background: transparent; text-align: left;
}
.note-row:hover { background: var(--control); }
.note-row[aria-current="true"] { background: var(--control); box-shadow: inset 4px 0 0 var(--primary); }
.note-row:focus-visible { outline-offset: -3px; }
.note-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.note-title { font-weight: 650; font-size: 1.0625rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-meta { font-size: 0.875rem; color: var(--text-2); }
.note-preview { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-row > svg { color: var(--text-2); width: 16px; height: 16px; }
.demo-badge {
  display: inline-block; margin-left: var(--space-xs); padding: 0 6px; border-radius: 6px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; vertical-align: 2px;
  color: var(--text-2); border: 1px solid var(--divider);
}

.status { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: 0.9375rem; }
.status.processing { color: var(--text-2); }
.status.failed { color: var(--destructive); }
.status.failed svg { --warning-glyph: var(--surface); }
.spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid var(--divider); border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { padding: var(--space-xl) var(--space-lg); text-align: center; display: grid; justify-items: center; gap: var(--space-sm); }
.empty-state h2 { font-size: 1.375rem; }
.empty-state p { margin: 0; max-width: 34ch; color: var(--text-2); }
.empty-state svg { width: 44px; height: 44px; color: var(--text-2); }
.empty-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: center; margin-top: var(--space-sm); }

.load-error { padding: var(--space-lg); display: grid; gap: var(--space-sm); }
.load-error p { margin: 0; }
.load-error-title { display: flex; align-items: center; gap: var(--space-sm); font-weight: 700; color: var(--destructive); }
.load-error-title svg { --warning-glyph: var(--surface); }

.banner {
  margin: 0 0 var(--space-md); padding: var(--space-sm) var(--space-lg); border-radius: 14px;
  background: var(--surface); border: 1px solid var(--divider); color: var(--text); font-weight: 550;
}
.demo-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg); border-radius: 14px;
  background: var(--surface); border: 1px dashed var(--divider); font-size: 0.9375rem;
}

.demo-cta { border-style: solid; }

/* Buttons */
.secondary-button, .danger-button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  min-height: 44px; padding: var(--space-sm) var(--space-lg);
  border-radius: 999px; border: 1px solid var(--divider);
  background: var(--control); color: var(--primary); font-weight: 600;
}
.danger-button { color: var(--destructive); }
.secondary-button svg, .danger-button svg { width: 18px; height: 18px; }
.secondary-button:disabled { opacity: 0.45; }
.link-button {
  min-height: 44px; padding: 0 var(--space-md); border: 0; background: transparent;
  color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}

/* Aqua capsule, adapted from SwiftUI-AquaButton. The fill is opaque so white text keeps
   at least 4.5:1 against every stop (about 8.7, 6.2, and 4.8 to 1, top to bottom). */
.aqua-button {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  min-height: 50px; padding: 14px var(--space-xl);
  border: 0; border-radius: 999px;
  color: #fff; font-weight: 650; font-size: 1.0625rem; line-height: 1.2;
  text-shadow: 0 1px 0.5px rgba(0, 17, 49, 0.55);
  background: linear-gradient(#0041b8, #1f5fb8, #1a7aa3);
  box-shadow:
    inset 0 1px 4px 1px rgba(0, 17, 49, 0.55),
    0 6px 16px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 78, 187, 0.5);
  transition: transform 0.1s ease-in-out;
}
.aqua-button::before, .aqua-button::after { content: ""; position: absolute; z-index: -1; border-radius: 999px; pointer-events: none; }
.aqua-button::before {
  top: 3px; left: 14px; right: 14px; height: 10px;
  background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.25));
  filter: blur(2px);
}
.aqua-button::after {
  bottom: 5px; left: 12px; right: 12px; height: 8px;
  background: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.4));
  filter: blur(3px);
}
.aqua-button svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 0.5px rgba(0, 17, 49, 0.55)); }
.aqua-button:active:not(:disabled) {
  transform: scale(0.98);
  background: linear-gradient(rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.16)), linear-gradient(#0041b8, #1f5fb8, #1a7aa3);
}
.aqua-button:active:not(:disabled)::before { opacity: 0.5; }
.aqua-button:disabled { opacity: 0.45; }
.aqua-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.aqua-small { min-height: 44px; padding: 10px var(--space-xl); font-size: 1rem; }
@media (prefers-contrast: more) {
  .aqua-button { box-shadow: inset 0 0 0 1.5px rgba(0, 17, 49, 0.9), 0 6px 16px rgba(0, 0, 0, 0.3); }
  .aqua-button::before { background: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.25)); }
}

/* Recorder deck: recessed well with a status LED, adapted from skeuomorphic-audio-recorder's InsetShadow. */
.record-deck {
  position: sticky; bottom: max(var(--space-md), env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; gap: var(--space-md);
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md);
  border-radius: 22px; border: 1px solid var(--divider);
  background: var(--control);
  box-shadow: inset 0 2.5px 2.5px rgba(0, 0, 0, 0.35), inset 0 -1.5px 1.5px var(--inset-highlight), var(--shadow-card);
}
.record-deck .aqua-button { flex: 1; }
.record-deck[hidden] { display: none; }

.led {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #9aa9b2, #5e6e78 70%);
  border: 1px solid rgba(0, 0, 0, 0.35);
}
.led.on {
  background: radial-gradient(circle at 35% 30%, #ff8a80, #d32f2f 70%);
  box-shadow: 0 0 3px rgba(255, 0, 0, 0.7), 0 0 6px rgba(255, 0, 0, 0.5);
}

/* Detail pane */
.detail-pane { min-width: 0; display: none; }
.pane {
  display: grid; gap: var(--space-lg);
  padding: 0 0 var(--space-xl);
}
.pane-header {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-card);
  border: 1px solid var(--divider);
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 55%),
    var(--surface);
  box-shadow: var(--shadow-card);
}
@media (prefers-color-scheme: dark) {
  .pane-header { background: linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 55%), var(--surface); }
}
.pane-header h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.back-button { display: none; }
.pane-section { padding: var(--space-lg); }
.pane-section h3 { margin: 0 0 var(--space-sm); font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.pane-section p { margin: 0; }
.pane-section ul { margin: 0; padding-left: 1.25em; display: grid; gap: var(--space-xs); }
.meta-line { color: var(--text-2); margin: 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-sm) 0 0; padding: 0; list-style: none; }
.tag-list li { padding: 2px 10px; border-radius: 999px; background: var(--control); border: 1px solid var(--divider); font-size: 0.875rem; font-weight: 600; }

.action-list { list-style: none; padding: 0 !important; }
.action-list label { display: flex; align-items: flex-start; gap: var(--space-md); min-height: 44px; padding: var(--space-xs) 0; cursor: pointer; }
.action-list input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.action-list .done { text-decoration: line-through; color: var(--text-2); }

.transcript { white-space: pre-wrap; }
details > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 650; color: var(--primary); }
details[open] > summary { margin-bottom: var(--space-sm); }

.pane-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.footnote { font-size: 0.875rem; color: var(--text-2); margin: 0; }
.note-audio { width: 100%; }

.status-card { padding: var(--space-lg); display: grid; gap: var(--space-sm); }
.status-card p { margin: 0; }

/* New voice log form */
.form-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { display: grid; gap: var(--space-xs); font-weight: 600; font-size: 0.9375rem; }
.field input, .field select, .field textarea {
  min-height: 44px; padding: var(--space-sm) var(--space-md);
  border-radius: 12px; border: 1px solid var(--divider); background: var(--control); font-weight: 400; font-size: 1rem;
}
.field textarea { min-height: 120px; resize: vertical; }
.field-hint { font-weight: 400; color: var(--text-2); font-size: 0.875rem; }
.field-error { color: var(--destructive); margin: 0; }

/* Recorder panel: one physical device, the same in light and dark mode. */
.recorder {
  --plate-top: #d3d9df; --plate-bottom: #a9b1ba; --bezel: #16181b; --well: #d3d8de;
  --key-top: #f4f6f8; --key-bottom: #c2c9d0; --key-title: #1e2328;
  --lcd: #0b1410; --lcd-text: #d8f5e1; --lcd-off: #26352e;
  padding: var(--space-md);
  border-radius: 24px;
  background: linear-gradient(var(--plate-top), var(--plate-bottom));
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.recorder-bezel { display: grid; gap: var(--space-sm); padding: var(--space-sm); border-radius: 16px; background: var(--bezel); }
.grille {
  height: 50px; border-radius: 10px;
  background-color: var(--well);
  background-image: radial-gradient(circle, var(--bezel) 2.4px, transparent 2.9px);
  background-size: 11px 11px; background-position: center;
  box-shadow: inset 0 2.5px 2.5px rgba(0, 0, 0, 0.35), inset 0 -1.5px 1.5px rgba(255, 255, 255, 0.7);
}
.lcd {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg); border-radius: 10px; background: var(--lcd);
  box-shadow: inset 0 2.5px 2.5px rgba(0, 0, 0, 0.6), inset 0 -1px 1px rgba(255, 255, 255, 0.08);
}
.lcd-text { flex: 1; min-width: 0; display: grid; }
.lcd-status, .lcd-clock { font-family: var(--mono); color: var(--lcd-text); text-shadow: 0 0 4px rgba(216, 245, 225, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcd-status { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.lcd-clock { font-size: 0.9375rem; opacity: 0.85; }
.meter { display: flex; flex-direction: column-reverse; gap: 3px; flex: none; }
.meter span { width: 26px; height: 4px; border-radius: 1.5px; background: var(--lcd-off); }
.meter span.lit { background: var(--lcd-text); }
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: var(--space-sm); }
.key {
  display: grid; justify-items: center; gap: var(--space-sm);
  min-height: 44px; padding: var(--space-md) var(--space-sm);
  border: 0; border-radius: 10px; background: var(--well);
  box-shadow: inset 0 2.5px 2.5px rgba(0, 0, 0, 0.35), inset 0 -1.5px 1.5px rgba(255, 255, 255, 0.7);
  color: var(--key-title); font-weight: 650; font-size: 0.8125rem;
}
.key-face {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(var(--key-top), var(--key-bottom));
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  color: var(--tint, var(--key-title));
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}
.key-face svg { width: 24px; height: 24px; }
.key:active:not(:disabled) .key-face { transform: scale(0.96); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.key:disabled { opacity: 0.45; }
.key:focus-visible { outline: 3px solid #8fdcff; outline-offset: 2px; }
.key-record { --tint: #d32f2f; }
.key-resume { --tint: #0b5fa5; }

.recorder-info { display: grid; gap: var(--space-md); }
.recorder-help { margin: 0; color: var(--text-2); }
.recorder-help strong { color: var(--text); }

/* Dialogs */
dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--divider); border-radius: 22px;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
dialog::backdrop { background: rgba(6, 24, 35, 0.45); }
.dialog-body { padding: var(--space-xl); }
.dialog-body h2 { margin-bottom: var(--space-md); }
.dialog-body ul { padding-left: 1.25em; display: grid; gap: var(--space-xs); }
.dialog-body a { color: var(--primary); font-weight: 600; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); justify-content: flex-start; }
.dialog-close { justify-content: flex-end; margin-top: var(--space-xl); }

.site-footer { padding: var(--space-md) 0 var(--space-xl); text-align: center; }
.site-footer p { display: inline-block; margin: 0; padding: var(--space-xs) var(--space-md); border-radius: 14px; background: var(--surface); border: 1px solid var(--divider); color: var(--text-2); font-size: 0.875rem; }

/* Phone: one column like the iPhone app; the detail pane slides over the list. */
@media (max-width: 959px) {
  body.detail-open { overflow: hidden; }
  body.detail-open .detail-pane {
    display: block; position: fixed; inset: 0; z-index: 20; overflow-y: auto;
    padding: max(var(--space-md), env(safe-area-inset-top)) max(var(--space-lg), env(safe-area-inset-right)) max(var(--space-lg), env(safe-area-inset-bottom)) max(var(--space-lg), env(safe-area-inset-left));
    background: linear-gradient(var(--canvas-top), var(--canvas-bottom));
  }
  .back-button { display: inline-flex; }
  body.searching .record-deck { display: none; }
}

/* Desktop: list on the left, the recorder or the open note on the right. */
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); }
  .detail-pane { display: block; position: sticky; top: var(--space-lg); max-height: calc(100vh - 2 * var(--space-lg)); overflow-y: auto; padding: 2px; }
  h1 { font-size: 2.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .spinner { animation: none; border-top-color: var(--divider); border-right-color: var(--primary); }
  .aqua-button:active:not(:disabled), .key:active:not(:disabled) .key-face { transform: none; }
}

@media (forced-colors: active) {
  .wallpaper { display: none; }
  .aqua-button, .key, .key-face, .record-deck, .card, .pill, .lcd { border: 1px solid ButtonText; forced-color-adjust: auto; }
  .aqua-button::before, .aqua-button::after { display: none; }
  .led.on { background: Highlight; }
}

.site-footer a { color: var(--primary); font-weight: 700; }
@media (max-width: 719px) { .tabs ul { margin-left: -6px; } }
