/* Ranheat Voice library (RIS-212). Mobile-first, dark-scheme aware, no
   framework. One file, small enough to read whole. */

:root {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --ink: #26221c;
  --muted: #6f695f;
  --line: #e2ded6;
  --accent: #8a5a2b;        /* wood-brown, house-ish */
  --accent-ink: #ffffff;
  --user: #2f6f3e;
  --agent: #34557f;
  --auto: #6f695f;
  --danger: #a33a2f;
  --ok: #2f6f3e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191713;
    --panel: #221f1a;
    --ink: #ece7de;
    --muted: #a39b8d;
    --line: #37322a;
    --accent: #c98d4e;
    --accent-ink: #191713;
    --user: #7dc38d;
    --agent: #8fb3e0;
    --auto: #a39b8d;
    --danger: #e08074;
    --ok: #7dc38d;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 46rem; margin: 0 auto; padding: 0.75rem 0.9rem 3rem; }
a { color: var(--accent); }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.logout { display: flex; gap: 0.6rem; align-items: baseline; margin: 0; }
.who { color: var(--muted); font-size: 0.85rem; }
.linkish {
  background: none; border: none; color: var(--accent);
  font: inherit; font-size: 0.85rem; text-decoration: underline; padding: 0;
}

/* forms & controls */
input[type="search"], input[type="text"], input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 0.5rem;
  background: var(--panel); color: var(--ink);
  font: inherit;
}
button[type="submit"] {
  padding: 0.55rem 1rem;
  border: none; border-radius: 0.5rem;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600;
  min-height: 44px;                 /* thumb-sized */
}
.searchbar { display: flex; gap: 0.5rem; align-items: center; margin: 0.9rem 0; }
.searchbar .clear { font-size: 0.85rem; }
.inline-form { display: flex; gap: 0.5rem; margin: 0.4rem 0 0.7rem; }

/* notes list */
.note-list { list-style: none; margin: 0; padding: 0; }
.note-row {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 0.6rem;
  padding: 0.65rem 0.8rem; margin-bottom: 0.55rem;
}
.note-title { display: block; font-weight: 600; }
.note-meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem;
  color: var(--muted); font-size: 0.82rem; margin: 0.15rem 0 0;
}

/* badges & status */
.badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 0.35rem; padding: 0.08rem 0.35rem;
  vertical-align: 0.12em;
}
.badge-user  { background: color-mix(in srgb, var(--user) 18%, transparent);  color: var(--user); }
.badge-agent { background: color-mix(in srgb, var(--agent) 18%, transparent); color: var(--agent); }
.badge-auto, .badge-file
             { background: color-mix(in srgb, var(--auto) 18%, transparent);  color: var(--auto); }
.status { font-weight: 600; }
.status-ready { color: var(--ok); }
.status-failed { color: var(--danger); }
.status-transcribing, .status-uploaded, .status-uploading, .status-recorded
  { color: var(--muted); }

/* detail page */
.crumbs { margin: 0.8rem 0 0.2rem; font-size: 0.9rem; }
.note-heading { font-size: 1.25rem; margin: 0.2rem 0 0.1rem; }
audio { width: 100%; margin: 0.8rem 0 0.4rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 0.6rem;
  padding: 0.7rem 0.85rem; margin: 0.8rem 0;
}
.panel h2 { font-size: 0.95rem; margin: 0 0 0.3rem; }
.title-slots { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0.1rem 0.5rem;
               margin: 0.3rem 0 0; font-size: 0.85rem; }
.title-slots dt { color: var(--muted); text-transform: uppercase; font-size: 0.7rem;
                  padding-top: 0.2rem; }
.title-slots dd { margin: 0; }

/* transcript segments */
.segments { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.segments li { display: flex; gap: 0.6rem; padding: 0.25rem 0; }
button.seek {
  flex: none; border: none; border-radius: 0.35rem;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font: inherit; font-size: 0.8rem; font-variant-numeric: tabular-nums;
  padding: 0.05rem 0.45rem; height: fit-content; cursor: pointer;
}
.transcript-text { white-space: pre-wrap; }

/* chips, entities, versions */
.chips { margin: 0.2rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  border-radius: 1rem; padding: 0.15rem 0.7rem; font-size: 0.85rem;
  border: 1px solid var(--line);
}
.chip small { color: var(--muted); font-size: 0.68rem; margin-left: 0.25rem; }
.chip-user  { border-color: color-mix(in srgb, var(--user) 45%, transparent); }
.chip-agent { border-color: color-mix(in srgb, var(--agent) 45%, transparent); }
.entities { list-style: none; margin: 0.2rem 0; padding: 0; }
.entities li { padding: 0.15rem 0; }
.etype {
  font-size: 0.72rem; text-transform: uppercase; color: var(--muted);
  margin-right: 0.3rem;
}
.versions { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.versions th { text-align: left; color: var(--muted); font-weight: 600;
               border-bottom: 1px solid var(--line); padding: 0.25rem 0.4rem; }
.versions td { border-bottom: 1px solid var(--line); padding: 0.3rem 0.4rem; }

/* login */
.login-card { max-width: 22rem; margin: 3rem auto 0; }
.login-card form { display: grid; gap: 0.6rem; }
.login-card label { font-size: 0.85rem; color: var(--muted); }

/* misc */
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.error { color: var(--danger); font-weight: 600; }
.empty { color: var(--muted); margin: 2rem 0; text-align: center; }

/* a little more room on wider screens */
@media (min-width: 640px) {
  main { padding: 0.75rem 1.5rem 3rem; }
}
