/* Пулт Ф1 — tokens from docs/design/session-center/10_ux_console.md §9.3. No web fonts, no external files. */
:root {
  --bg: #FFFFFF; --surface: #F6F7F9; --card: #FFFFFF; --border: #E3E6EA; --text: #15181C; --text-2: #5B636D;
  --accent: #2557D6;
  --you: #C2410C; --you-bg: #FFF1EA;
  --work: #15803D; --work-bg: #EAF7EE;
  --other: #475569; --other-bg: #EEF1F5;
  --stall: #8A5A00; --stall-bg: #FFF5D6;
  --calm: #5B636D; --done: #5B636D;
  --old: #626A76; --old-bg: #F3F4F6;
}
/* Light is the default whatever the system theme (owner, 21.10); dark only when he picks it („Тема“). */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111315; --surface: #181B1F; --card: #1E2227; --border: #2C3137; --text: #E8EAED; --text-2: #A2AAB4;
  --accent: #7FA2FF;
  --you: #FF9A66; --you-bg: #3A1F12;
  --work: #6BD49A; --work-bg: #12291C;
  --other: #A9B6C8; --other-bg: #20262E;
  --stall: #F2C14E; --stall-bg: #2E2510;
  --calm: #A2AAB4; --done: #8A939E;
  --old: #8A939E; --old-bg: #1E2227;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { line-height: 1.3; font-weight: 600; margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; color: var(--text-2); }
.muted { color: var(--text-2); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px;
       border-bottom: 1px solid var(--border); background: var(--surface); }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; flex: 1; }
.logout { font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
        font-size: 13px; border: 1px solid var(--border); }
.banner { margin: 0; padding: 8px 16px; background: var(--stall-bg); color: var(--stall); font-size: 13px; }
.banner[hidden] { display: none; }

/* layout: phone one column, desktop inbox | tree */
.cols { display: grid; gap: 24px; padding: 16px; max-width: 1440px; margin: 0 auto; }
@media (min-width: 900px) { .cols { grid-template-columns: minmax(300px, 420px) 1fr; } }
.count { color: var(--text-2); font-weight: 400; }

/* inbox cards */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--card); }
.card.grp-you { border-left: 4px solid var(--you); }
.line1 { display: flex; gap: 6px; align-items: baseline; color: var(--you); }
.line1 .age { margin-left: auto; color: var(--text-2); }
.line3 { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.empty { color: var(--text-2); }

/* tree */
.nodes, .kids { list-style: none; margin: 0; padding: 0; }
.kids { margin-left: 14px; padding-left: 10px; border-left: 1px solid var(--border); }
.row summary { display: grid; grid-template-columns: 20px 1fr auto; grid-template-areas: "g who age" "g state listen";
               column-gap: 8px; align-items: baseline; padding: 8px 6px; min-height: 48px; cursor: pointer;
               list-style: none; border-radius: 6px; }
.row summary::-webkit-details-marker { display: none; }
.row summary:hover { background: var(--surface); }
.glyph { grid-area: g; text-align: center; }
.who { grid-area: who; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state { grid-area: state; font-size: 13px; }
.age { grid-area: age; font-size: 13px; color: var(--text-2); white-space: nowrap; }
@media (min-width: 1280px) {
  .row summary { grid-template-columns: 20px minmax(0, 1fr) 220px 70px auto; grid-template-areas: "g who state age listen";
                 min-height: 40px; }
  .age { text-align: right; }
}
.more { padding: 0 6px 10px 34px; font-size: 13px; }
.more p { margin: 2px 0; }
.tag { font-size: 12px; color: var(--text-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.done-count { font-size: 13px; margin: 4px 0 0 6px; }

/* state colours: always glyph + word + colour */
.g-you, .grp-you > summary .state, .pill.grp-you { color: var(--you); }
.pill.grp-you { background: var(--you-bg); border-color: transparent; }
.g-work, .grp-work > summary .state, .pill.grp-work { color: var(--work); }
.pill.grp-work { background: var(--work-bg); border-color: transparent; }
.g-other, .grp-other > summary .state, .pill.grp-other { color: var(--other); }
.pill.grp-other { background: var(--other-bg); border-color: transparent; }
.g-stall, .grp-stall > summary .state, .pill.grp-stall { color: var(--stall); }
.pill.grp-stall { background: var(--stall-bg); border-color: transparent; }
.g-calm, .grp-calm > summary .state { color: var(--calm); }
.g-old, .grp-old > summary .state, .pill.grp-old { color: var(--old); }
.pill.grp-old { background: var(--old-bg); }
.grp-old > summary .who { color: var(--text-2); }
.g-done, .grp-done > summary .state { color: var(--done); }
.grp-you > summary { background: var(--you-bg); }

.foot { padding: 8px 16px 24px; font-size: 12px; text-align: center; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 12px; padding: 24px; }
.login-card label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.login-card input { font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid var(--border);
                    border-radius: 6px; background: var(--bg); color: var(--text); min-height: 48px; }
.login-card button { font: inherit; font-weight: 600; min-height: 48px; border: 0; border-radius: 6px;
                     background: var(--accent); color: var(--bg); cursor: pointer; }
.error { color: var(--you); margin: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* „Тема“ switch in the header */
.theme { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.theme button { font: inherit; font-size: 13px; min-height: 32px; padding: 4px 12px; border: 0; cursor: pointer;
                background: transparent; color: var(--text-2); }
.theme button[aria-pressed="true"] { background: var(--accent); color: var(--bg); font-weight: 600; }
@media (max-width: 899px) { .theme button { min-height: 40px; } }
/* phone header: title · theme · logout on one line, the count pills on the next */
@media (max-width: 899px) {
  .summary { order: 3; flex-basis: 100%; }
  .theme { margin-left: auto; }
}

/* car mode v0: „Слушай“ + the player bar (speechSynthesis, bg-BG; no paid voice) */
.listen { grid-area: listen; justify-self: end; align-self: center; font: inherit; font-size: 14px; font-weight: 600; min-height: 40px;
          padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card);
          color: var(--accent); cursor: pointer; }
.listen[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: transparent; }
.line1 .listen { margin-left: 8px; }
.no-speech .listen { display: none; }
.player { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
          padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--surface);
          border-top: 1px solid var(--border); font-size: 13px; }
.player[hidden] { display: none; }
.player .now { flex: 1 1 100%; color: var(--text); }
.player .voice { flex: 1; }
.speed { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.speed button { font: inherit; min-height: 44px; min-width: 52px; border: 0; background: transparent; color: var(--text-2);
                cursor: pointer; }
.speed button[aria-pressed="true"] { background: var(--accent); color: var(--bg); font-weight: 600; }
.stop { font: inherit; font-weight: 600; min-height: 48px; min-width: 96px; border: 0; border-radius: 6px;
        background: var(--you); color: var(--bg); cursor: pointer; }
.stop:disabled { background: var(--border); color: var(--text-2); cursor: default; }
body.with-player { padding-bottom: 132px; }
@media (min-width: 900px) { .player .now { flex: 1 1 auto; } body.with-player { padding-bottom: 76px; } }
