[hidden] { display: none !important; }

/* Шрифты — со своего сервера (FR-30, ADR-038): страница не обращается ни к
   одному стороннему хосту. Вариативные woff2 (SIL OFL, fonts/OFL.txt): один
   файл на подмножество символов закрывает все начертания. */
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("fonts/golos-text-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("fonts/golos-text-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+20BD;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/unbounded-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --panel: #17211e;
  --panel-raised: #22302b;
  --panel-line: #34443e;
  --ivory: #ece5d0;
  --ivory-ink: #2b2a24;
  --ink: #e6ebe7;
  --ink-soft: #9fb0a8;
  --truth: #3ddc84;
  --truth-deep: #1f7a4a;
  --lie: #ff5a4e;
  --lie-deep: #9a2e27;
  --brass: #c9a45c;
  --neutral: #8e9a95;
  --warn: #ffb547;
  /* Отказ Кодекса Брехометра: не предупреждение (--warn), а «проверять не
     буду», поэтому читается в красном, отдельно от --lie у лжи. */
  --codex: #ff7a6b;

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(12px, 3vw, 28px);
  --page: 1120px;
  --radius-item: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(rgb(52 68 62 / 0.22) 1px, transparent 1px) -1px -1px / 100% 96px,
    linear-gradient(90deg, rgb(52 68 62 / 0.22) 1px, transparent 1px) -1px -1px / 96px 100%,
    var(--panel);
  color: var(--ink);
  font: 400 16px/1.45 var(--font-body);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  /* Колонка на всю высоту окна: основная часть забирает свободное место, и
     подвал стоит внизу экрана, даже когда на странице ещё ничего нет. */
  display: flex;
  flex-direction: column;
}

button { font: inherit; color: inherit; }

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

/* ── Header: name of the instrument on the left, its readings on the right ── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--panel-line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }

.brand-name {
  margin: 0; /* an <h1> for search engines (FR-41), set like the rest of the bar */
  font: 800 clamp(20px, 3.4vw, 26px) / 1 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ivory);
}

.brand-beta {
  /* Outside .brand-name: its uppercase would turn β into Β, a Latin-looking B. */
  font: 700 clamp(18px, 3vw, 22px) / 1 var(--font-display);
  color: var(--brass);
  text-decoration: none;
  margin-left: -6px;
}
.brand-beta:hover, .brand-beta:focus-visible { color: var(--ivory); }

.brand-model {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.readouts {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Вход и кабинет (FR-5) ── */

.account-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--ivory);
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
}

.account-btn svg { width: 18px; height: 18px; flex: none; }

.account-btn-name {
  max-width: 22vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-btn[data-signed-in]:hover,
.account-btn[aria-expanded="true"] { color: var(--brass); }

/* Меню учётной записи (FR-37): под кнопкой, по правому краю */
.account-menu-wrap { position: relative; display: flex; }

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel-raised);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-item);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.45);
  text-transform: none;
  letter-spacing: normal;
}

.account-menu-sep { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--panel-line); }

.account-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: 500 14px/1.2 var(--font-body);
  text-align: left;
  cursor: pointer;
}

.account-menu button svg { width: 17px; height: 17px; flex: none; color: var(--ink-soft); }
.account-menu button:hover,
.account-menu button:focus-visible { background: var(--panel); outline: none; }
.account-menu button:hover svg,
.account-menu button:focus-visible svg { color: var(--brass); }

.balance-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--brass);
  cursor: pointer;
  font: 600 14px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.balance-btn svg { width: 16px; height: 16px; flex: none; }
.balance-btn:hover { color: var(--ivory); }

.login-explain {
  margin: -8px 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius-item);
  background: color-mix(in srgb, var(--brass) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brass) 40%, transparent);
  font-size: 14px;
  color: var(--ink);
}

.login-consents {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.login-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}

.login-check input { margin-top: 3px; accent-color: var(--brass); flex: none; }
.login-check a { color: var(--brass); }

.login-providers {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.login-provider {
  padding: 12px 14px;
  border-radius: var(--radius-item);
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--ink);
  font: 500 15px/1.3 var(--font-body);
  cursor: pointer;
  text-align: center;
}

.login-provider:hover:not(:disabled) { border-color: var(--brass); color: var(--brass); }
.login-provider:disabled { opacity: 0.45; cursor: not-allowed; }

/* Режим «проба» листа входа (FR-43): главное действие — начать анализ, вход ниже. */
.login-trial { margin: 0 0 18px; }

.login-trial-btn {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-item);
  border: 0;
  background: var(--brass);
  color: var(--ivory-ink);
  font: 600 15px/1.3 var(--font-display);
  cursor: pointer;
}

.login-trial-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.login-trial-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.login-trial-or { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); text-align: center; }

.login-email, .login-code { margin-top: 4px; }

.login-email-row { display: flex; gap: 8px; }

.login-email-input, .login-code-input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: var(--radius-item);
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.login-code-input { letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

.login-email-input:disabled { opacity: 0.5; }
.login-email-input:focus-visible, .login-code-input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }

.login-email-btn {
  padding: 0 16px;
  border-radius: var(--radius-item);
  border: 0;
  background: var(--brass);
  color: var(--ivory-ink);
  font: 600 14px/1 var(--font-display);
  cursor: pointer;
  white-space: nowrap;
}

.login-email-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.login-resend {
  margin-top: 10px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--brass);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-resend:disabled { color: var(--ink-soft); cursor: default; text-decoration: none; }

.login-note { margin: 10px 0 0; font-size: 13px; color: var(--warn); }

.topup-beta { margin: 10px 0 0; font-size: 13px; color: var(--brass); }
.topup-terms { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); }
.topup-terms a { color: var(--brass); }

/* ── Подвал: документы (FR-30), на каждой странице ── */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  flex: none;
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: 18px var(--gutter) max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--panel-line);
  font-size: 13px;
  color: var(--ink-soft);
}

.site-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--ink); text-decoration: underline; }

.account-profile { margin: 0 0 18px; }

.account-settings { margin: 0 0 18px; }
.limit-label { display: block; margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); }
.limit-hint { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); text-wrap: pretty; }
.limit-reset {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brass);
  font-size: 13px;
  cursor: pointer;
}
.limit-reset:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-note[data-ok] { color: var(--ink-soft); }
.account-name { margin: 0; font: 600 18px/1.3 var(--font-display); }
.account-meta { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }

.account-subtitle {
  margin: 0 0 10px;
  font: 600 11px/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.account-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Колонка не шире списка: длинное название обрезается многоточием, а не
     раздвигает строку в горизонтальную прокрутку. */
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.account-history:empty::before {
  content: attr(data-empty);
  color: var(--ink-soft);
  font-size: 14px;
  opacity: 0.7;
}

.account-row-error { color: var(--ink-soft); font-size: 14px; list-style: none; }

.account-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.account-row-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 2px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-item);
  padding: 10px 12px;
  cursor: pointer;
  color: var(--ink);
}

.account-row-main:hover { border-color: var(--brass); }

.account-row-kind {
  grid-column: 1;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.account-row-title {
  grid-column: 2;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row-date {
  grid-column: 3;
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.account-row-score {
  grid-column: 2;
  font-size: 12px;
  color: var(--chip);
}

.account-row-cost {
  grid-column: 3;
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.account-row-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 6px;
}

.account-row-delete {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-item);
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
}

.account-row-delete svg { width: 17px; height: 17px; }

/* Продолжить приостановленную по балансу проверку (FR-34). */
.account-row-resume {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--brass);
  border-radius: var(--radius-item);
  background: transparent;
  color: var(--brass);
  font: 600 13px/1 var(--font-display);
  cursor: pointer;
}
.account-row-resume:hover { background: color-mix(in srgb, var(--brass) 18%, transparent); }
.account-row-delete:hover { border-color: var(--lie); color: var(--lie); }

.account-row-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.account-row-confirm button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
}

.account-row-confirm button:first-of-type:hover { border-color: var(--lie); color: var(--lie); }

.account-finance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.account-finance-balance {
  font: 600 16px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--brass);
}

.account-plan { margin: 6px 0 0; font-size: 14px; color: var(--ink); }

.account-topup-btn {
  padding: 6px 14px;
  border-radius: var(--radius-item);
  border: 0;
  background: var(--brass);
  color: var(--ivory-ink);
  font: 600 12px/1 var(--font-display);
  cursor: pointer;
  white-space: nowrap;
}

.account-row-finance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-item);
  padding: 10px 12px;
  list-style: none;
}

.account-row-finance-amount {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-row-finance-in { color: var(--truth); }
.account-row-finance-out { color: var(--ink); }

/* «Финансы», строка списания (FR-35): кнопка раскрывает детализацию под собой */
.account-row-finance-item { list-style: none; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.account-row-finance-toggle {
  width: 100%;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.account-row-finance-toggle:hover,
.account-row-finance-toggle[aria-expanded="true"] { border-color: var(--brass); }

.account-row-finance-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row-finance-sum {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.account-row-finance-returned {
  font-size: 11px;
  color: var(--truth);
  white-space: nowrap;
}

.finance-detail {
  margin: 0;
  padding: 6px 12px 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  font-size: 13px;
}

.finance-detail li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.finance-detail-label { color: var(--ink-soft); }
.finance-detail-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-detail-note { color: var(--ink-soft); }

.topup-form { margin-top: 4px; }

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--panel-line);
}

.account-action {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-action:hover { color: var(--ink); }
.account-action-danger { color: var(--lie); opacity: 0.85; }
.account-action-danger:hover { opacity: 1; }

/* ── Deck: what to listen to — microphone or link — right under the header ── */

.deck-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px var(--gutter) 0;
}

.deck {
  width: min(var(--page), 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  background: var(--panel-raised);
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  overflow: hidden;
}

.modes {
  display: flex;
  flex-direction: column;
  flex: none;
  border-right: 1px solid var(--panel-line);
}

.modes button {
  flex: 1;
  border: 0;
  padding: 11px 20px;
  background: none;
  color: var(--ink-soft);
  font: 600 14px/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}

.modes button + button { border-top: 1px solid var(--panel-line); }
.modes button:hover:not([aria-selected="true"]):not(:disabled) { color: var(--ink); }
.modes button[aria-selected="true"] { background: var(--ivory); color: var(--ivory-ink); }
.modes button:disabled { cursor: not-allowed; opacity: 0.5; }

.deck-body {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

/* Voice activity: the bars move with what the microphone actually hears. */

.mic-live {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.bars {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
}

.bars i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: var(--ink-soft);
  opacity: 0.45;
  transform-origin: bottom;
  transition: height 90ms linear, background-color 200ms, opacity 200ms;
}

[data-phase="listening"] .bars i,
[data-phase="finishing"] .bars i { background: var(--brass); opacity: 1; }
[data-phase="listening"] .bars i.speech { background: var(--truth); }

.mic-hint {
  font-size: 15px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls { flex: none; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--ivory);
  color: var(--ivory-ink);
  cursor: pointer;
  box-shadow: 0 2px 0 #b9b19a;
}

.icon-btn svg { width: 22px; height: 22px; display: block; }

.icon-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #b9b19a; }
.icon-btn:disabled { opacity: 0.6; cursor: progress; }

.icon-btn[aria-pressed="true"] {
  background: var(--brass);
  box-shadow: inset 0 0 0 2px var(--ivory), 0 2px 0 #b9b19a;
}

.link-form {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Depth of a link analysis (FR-23): a two-way switch next to the address. */
.depth {
  flex: none;
  display: flex;
  border: 1px solid var(--panel-line);
}

.depth button {
  border: 0;
  padding: 9px 12px;
  background: none;
  color: var(--ink-soft);
  font: 600 12px/1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.depth button + button { border-left: 1px solid var(--panel-line); }
.depth button:hover:not([aria-checked="true"]) { color: var(--ink); }
.depth button[aria-checked="true"] { background: var(--ivory); color: var(--ivory-ink); }

.link-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-item);
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.link-input::placeholder { color: var(--ink-soft); }
.link-input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.link-input.invalid { border-color: var(--lie); }
.link-input:disabled { opacity: 0.6; }

.progress {
  width: min(var(--page), 100%);
  height: 3px;
  border-radius: 2px;
  background: var(--panel-line);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--brass);
  transform-origin: left;
  transform: scaleX(0.05);
  transition: transform 400ms ease-out;
}

/* ── Stage ── */

.stage {
  flex: 1 0 auto;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 24px;
  padding: 20px var(--gutter) 56px;
}

/* ── Panel: the needle, the counters, the verdict and the warnings ── */

.panel {
  position: relative;
  width: min(var(--page), 100%);
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 22px;
  background: var(--panel-raised);
  border: 1px solid var(--panel-line);
  border-radius: 12px;
}

/* Стоимость проверки — в углу панели, с наценкой (FR-30): шапка говорит о
   пользователе и сервисе, панель — о проверке. */
.session-cost {
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gauge { width: 100%; }
.gauge svg { width: 100%; height: auto; display: block; }

[data-phase="analyzing"] .gauge { animation: analyzing 1.8s ease-in-out infinite; }

@keyframes analyzing { 50% { filter: drop-shadow(0 0 14px rgb(201 164 92 / 0.35)); } }

.readout { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.counters { display: flex; align-items: stretch; gap: 28px; flex-wrap: wrap; container-type: inline-size; }

.counter-rule { width: 1px; background: var(--panel-line); }

.counter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.zone-lie, .counter#lieCounter { --lamp: var(--lie); --lamp-deep: var(--lie-deep); }
.zone-truth, .counter#truthCounter { --lamp: var(--truth); --lamp-deep: var(--truth-deep); }

.counter-grey { --lamp: var(--neutral); --lamp-deep: var(--neutral); }

.counter-value {
  font: 800 clamp(36px, 7vw, 72px) / 0.9 var(--font-display); /* fallback without cqi */
  font: 800 clamp(36px, min(7vw, 11cqi), 72px) / 0.9 var(--font-display);
  color: var(--lamp);
  text-shadow: 0 0 18px color-mix(in srgb, var(--lamp) 45%, transparent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.counter-grey .counter-value { text-shadow: none; }

/* Four counters (quick link depth) in the same panel width: smaller digits. */
.counters:has(#needsSearchCounter:not([hidden])) { gap: 16px; }
.counters:has(#needsSearchCounter:not([hidden])) .counter-value { font-size: clamp(32px, min(7vw, 8cqi), 56px); }

.counter-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.counter:hover .counter-label { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.counter.flash .counter-value { animation: lamp-flash 900ms ease-out; }

@keyframes lamp-flash {
  0% { text-shadow: 0 0 46px var(--lamp), 0 0 12px white; color: color-mix(in srgb, var(--lamp) 55%, white); }
  100% { }
}

.ticker {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}

.ticker q { color: var(--ink); quotes: "«" "»"; }

.source-card { margin: 0; font-size: 14px; color: var(--ink-soft); text-wrap: pretty; }
.source-card a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.watch-link { color: var(--brass); white-space: nowrap; }

/* ── Warnings about the material: under the verdict, inside the panel ── */

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

.flag {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-item);
  border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  animation: flag-in 420ms cubic-bezier(.2,.8,.2,1);
}

.flag[data-level="explicit"] {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  border-color: var(--warn);
}

.flag-title {
  flex: none;
  font: 600 14px/1.25 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn);
}

.flag-subject { font-size: 14px; color: var(--ink-soft); min-width: 0; text-wrap: pretty; }

.flag:hover { border-color: var(--warn); }
.flag:hover .flag-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

@keyframes flag-in { from { transform: translateY(-6px); opacity: 0; } }

/* ── The server stopped the session: by the session limit or the balance
   (FR-32). It stays until the next session, unlike a warning in the ticker ── */

.stop-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-item);
  border: 1px solid var(--brass);
  background: color-mix(in srgb, var(--brass) 10%, transparent);
  animation: flag-in 420ms cubic-bezier(.2,.8,.2,1);
}

/* Empty, the live region stays in the accessibility tree (a hidden one is
   not read out when it appears) but takes no room in the panel's column. */
.stop-notice[data-empty] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  animation: none;
}

.stop-notice-text { margin: 0; flex: 1; min-width: 0; font-size: 14px; color: var(--ink); text-wrap: pretty; }

.stop-notice-btn {
  flex: none;
  padding: 7px 12px;
  border-radius: var(--radius-item);
  border: 1px solid var(--brass);
  background: transparent;
  color: var(--brass);
  font: 600 13px/1.2 var(--font-display);
  cursor: pointer;
}

.stop-notice-btn:hover { background: color-mix(in srgb, var(--brass) 18%, transparent); }

/* A session paused for the balance (FR-34): top up, go on, or end it. */
.stop-notice-actions { flex: none; display: flex; flex-wrap: wrap; gap: 8px; }
.stop-notice-primary { background: var(--brass); color: var(--ivory-ink); }
.stop-notice-primary:hover { background: color-mix(in srgb, var(--brass) 85%, var(--ivory)); }
.stop-notice-btn:disabled { opacity: .5; cursor: default; }

/* ── Lists: the two halves side by side ── */

.lists {
  width: min(var(--page), 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 20px;
  align-items: start;
}

/* While the recording is analyzed, the lists are about to change: dim them. */
[data-phase="analyzing"]:not([data-link]) .zone { opacity: 0.45; transition: opacity 300ms; }

.zone { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.zone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--lamp);
}

.zone-head h2 {
  margin: 0;
  font: 800 clamp(18px, 2.6vw, 24px) / 1 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lamp);
}

.zone-tally { font-size: 12px; letter-spacing: 0.1em; color: var(--ink-soft); white-space: nowrap; }

.claims {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.claims:empty::before {
  content: attr(data-empty);
  color: var(--ink-soft);
  font-size: 14px;
  opacity: 0.7;
}

.claim {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  background: var(--panel-raised);
  border: 1px solid var(--panel-line);
  border-left: 3px solid var(--lamp);
  border-radius: var(--radius-item);
  padding: 12px 15px;
  cursor: pointer;
}

.claim:hover { border-color: color-mix(in srgb, var(--lamp) 45%, var(--panel-line)); border-left-color: var(--lamp); }

/* Logic findings get a striped lamp: still red, but visibly not a false fact. */
.claim[data-kind="contradiction"],
.claim[data-kind="fallacy"] {
  border-left-color: transparent;
  border-left-style: solid;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--lamp) 0 5px,
    color-mix(in srgb, var(--lamp) 25%, var(--panel-raised)) 5px 8px
  );
  background-size: 3px 100%;
  background-repeat: no-repeat;
  background-position: left;
  background-origin: border-box;
}

.claim-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
}

.claim-meta {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.claim-meta:empty { display: none; }

.claim.is-new { animation: claim-in 420ms cubic-bezier(.2,.8,.2,1); }

@keyframes claim-in {
  from { transform: translateY(-8px); opacity: 0; background-color: color-mix(in srgb, var(--lamp) 22%, var(--panel-raised)); }
}

.show-all {
  align-self: flex-start;
  margin-top: 4px;
  background: none;
  border: 0;
  padding: 0 0 2px;
  color: var(--lamp);
  cursor: pointer;
  font: 600 14px/1.2 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--lamp);
}

/* ── Sheets ── */

.sheet {
  width: min(720px, 100vw - 24px);
  max-height: min(86dvh, 820px);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  padding: 26px 26px 28px;
  background: var(--panel-raised);
  color: var(--ink);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.55);
}

.sheet::backdrop { background: rgb(8 12 11 / 0.66); backdrop-filter: blur(2px); }

.sheet[open] { animation: sheet-in 220ms cubic-bezier(.2,.8,.2,1); }

@keyframes sheet-in { from { transform: translateY(16px); opacity: 0; } }

.sheet-close { position: absolute; top: 12px; right: 12px; margin: 0; }

.sheet-close button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 15px;
}

.sheet-title {
  font: 600 20px/1.25 var(--font-display);
  margin: 0 44px 18px 0;
}

.verdict-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 14px/1 var(--font-display);
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip) 16%, transparent);
  color: var(--chip);
  margin: 0 44px 16px 0;
}

.verdict-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: 0 0 8px var(--chip);
}

.detail-kind {
  margin: -8px 0 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

.detail-related {
  padding: 10px 12px;
  border-radius: var(--radius-item);
  background: var(--panel);
}

.detail-related p { font-size: 15px; }

.reasoning-conclusion {
  margin-top: 4px !important;
  padding-left: 14px;
  border-left: 2px solid var(--lie);
}

.related-open {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brass);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-claim {
  font: 500 19px/1.4 var(--font-body);
  margin: 0 0 12px;
}

.detail-quote {
  margin: 0 0 18px;
  padding-left: 14px;
  border-left: 2px solid var(--panel-line);
  color: var(--ink-soft);
  font-size: 15px;
}

.detail-quote::before { content: "Как прозвучало: "; color: var(--neutral); }

.detail-section { margin: 0 0 14px; }

.detail-section h3 {
  margin: 0 0 4px;
  font: 600 11px/1.3 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.detail-section p { margin: 0; font-size: 16px; }

.evidence { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.evidence li {
  padding: 8px 12px;
  border-radius: var(--radius-item);
  background: var(--panel);
  border-left: 2px solid var(--warn);
}

.evidence-quote { font-size: 15px !important; }
.evidence-meta { margin-top: 2px !important; font-size: 13px !important; color: var(--ink-soft); }

.sources { margin: 0; padding-left: 18px; font-size: 14px; }
.sources a { color: var(--brass); word-break: break-word; }

.detail-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-line);
  font-size: 13px;
  color: var(--ink-soft);
}

.full-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.full-list details {
  background: var(--panel);
  border-radius: var(--radius-item);
  border-left: 4px solid var(--chip);
}

.full-list summary {
  cursor: pointer;
  padding: 12px 14px;
  list-style: none;
  font-size: 15px;
}

/* Пропущено по Кодексу: тот же приём, что у предупреждений о материале
   (заливка и подпись в цвет), но в красных тонах — это не «верить
   безоговорочно нельзя», а отказ проверять. */
.full-list details[data-label="excluded"] {
  background: color-mix(in srgb, var(--codex) 10%, var(--panel));
  border-left-color: var(--codex);
}

.full-list details[data-label="excluded"] summary::before {
  content: "Не проверяется";
  display: block;
  margin-bottom: 4px;
  font: 600 11px/1.25 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--codex);
}

.full-list summary::-webkit-details-marker { display: none; }
.full-list details[open] summary { color: var(--ink-soft); }
.full-list .detail-body { padding: 0 14px 14px; }
.full-list .verdict-chip { margin-bottom: 10px; }

.empty-note { color: var(--ink-soft); }

/* ── Narrow screens: the panel stacks, the halves stay side by side ── */

@media (max-width: 900px) {
  .panel { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .gauge { max-width: 420px; justify-self: center; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { padding: 10px var(--gutter); gap: 8px; }
  .readouts { gap: 12px; font-size: 11px; width: 100%; justify-content: space-between; }
  .deck { border-radius: 10px; }
  .modes { flex-direction: row; width: 100%; border-right: 0; border-bottom: 1px solid var(--panel-line); }
  .modes button { text-align: center; padding: 10px 12px; font-size: 13px; }
  .modes button + button { border-top: 0; border-left: 1px solid var(--panel-line); }
  .deck-body { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .mic-hint { white-space: normal; font-size: 14px; }
  .icon-btn { width: 42px; height: 42px; }
  .icon-btn svg { width: 20px; height: 20px; }
  .link-form { gap: 8px; flex-wrap: wrap; }
  .link-form .link-input { flex-basis: 100%; }
  .depth { flex: 1; }
  .depth button { flex: 1; }
  .link-input { padding: 10px 12px; font-size: 14px; }
  .lists { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .panel { padding: 16px 14px; }
  .site-footer-links { flex-direction: column; gap: 10px; }
  .session-cost { position: static; }
  .ticker { font-size: 15px; }
  .counters { gap: 18px; }
  .claim { padding: 9px 10px; }
  .claim-text { font-size: 13px; }
  .claim-meta { display: none; }
  .zone-tally { display: none; }
  .show-all { font-size: 13px; }
  .flag { flex-direction: column; gap: 4px; padding: 9px 11px; }
  .flag-subject { font-size: 13px; }
  .stop-notice { flex-direction: column; align-items: stretch; gap: 8px; }
  .stop-notice-btn { align-self: flex-start; min-height: 44px; }
  .stop-notice-actions { flex: initial; }
  .limit-reset { min-height: 44px; }
  .account-menu button { min-height: 44px; }
  .account-btn[data-signed-in] .account-btn-name { display: none; }
  .account-row-main { grid-template-columns: auto 1fr; }
  .account-row-date, .account-row-cost { grid-column: 2; }
  .account-row-kind { display: none; }
  /* Строка списания: название — первой строкой, дата и сумма — второй */
  .account-row-finance-toggle { flex-wrap: wrap; row-gap: 2px; }
  .account-row-finance-title { flex-basis: 100%; }
  .account-row-finance-toggle .account-row-date { flex: 1; }
  .account-row-finance-returned { white-space: normal; text-align: right; }
  .sheet {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    padding: 22px 16px max(22px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .link-form { flex-wrap: wrap; justify-content: center; }
  .link-input { flex: 1 1 100%; }
}

@media (max-width: 600px) {
  /* Two by two: ложь, правда / не засчитано, нужен поиск. */
  .counters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .counters:has(#needsSearchCounter:not([hidden])) { gap: 14px 18px; }
  .counter-rule { display: none; }
  #truthCounter { order: 1; }
  #neutralCounter { order: 2; }
  #needsSearchCounter { order: 3; }
  .counters .counter-value,
  .counters:has(#needsSearchCounter:not([hidden])) .counter-value { font-size: 40px; }
}

/* ── Debug panel (?debug=1) ── */

.debug-panel {
  position: fixed;
  bottom: 8px;
  left: 8px;
  z-index: 20;
  max-width: min(460px, calc(100vw - 16px));
  padding: 8px 10px;
  border-radius: 8px;
  background: rgb(8 12 11 / 0.82);
  color: var(--ink-soft);
  font: 12px/1.45 ui-monospace, "SF Mono", Menlo, monospace;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
