/* ==========================================================================
   Anima — дизайн-система платформы частной психологической практики
   Тёмная тема по умолчанию, светлая — тумблером.
   Шрифт Onest лежит локально: чётко и без обращения к сети.
   ========================================================================== */

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-latin.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: Onest;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- токены ---------- */
:root {
  /* поверхности */
  --bg: #07080d;
  --bg-2: #0b0d14;
  --panel-a: rgba(255, 255, 255, 0.052);
  --panel-b: rgba(255, 255, 255, 0.018);
  --panel: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  --panel-flat: rgba(255, 255, 255, 0.04);
  --panel-2: rgba(255, 255, 255, 0.058);
  --panel-solid: #101420;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.18);
  --edge: inset 0 1px 0 rgba(255, 255, 255, 0.07);

  /* текст */
  --text: #f2f4f9;
  --text-2: #a9b1c3;
  --text-3: #6f778b;

  /* акценты */
  --accent: #4cc9f0;
  --accent-2: #7b6cf6;
  --accent-soft: rgba(76, 201, 240, 0.14);
  --accent-ink: #05070c;

  --good: #34d97f;
  --warn: #ffb224;
  --bad: #ff5f74;
  --info: #58a6ff;
  --good-soft: rgba(52, 217, 127, 0.15);
  --warn-soft: rgba(255, 178, 36, 0.15);
  --bad-soft: rgba(255, 95, 116, 0.15);

  /* типографика: плотный скейл, как в референсе */
  --t-caption: 11.5px;
  --t-s: 13px;
  --t-m: 15px;
  --t-l: 17px;
  --t-h5: 20px;
  --t-h4: 24px;
  --t-h3: 28px;
  --t-h2: 33px;
  --t-h1: 42px;
  --t-display: clamp(38px, 5vw, 60px);
  --lh-tight: 1.08;
  --lh-snug: 1.25;
  --lh-body: 1.5;
  --lh-read: 1.62;
  --tr-tight: -0.025em;
  --tr-caps: 0.12em;

  /* геометрия */
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-round: 999px;

  --shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.65);
  --shadow-soft: 0 10px 28px -12px rgba(0, 0, 0, 0.5);
  --sidebar: 250px;
  --topbar: 66px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grid-line: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

/* акценты модулей — тёмная тема.
   Оттенки намеренно приглушённые: продукт про людей в трудном состоянии,
   неоновая витрина здесь читается как чужая. */
[data-app="crm"] { --accent: #5ed3ae; --accent-2: #5a9dfa; --accent-soft: rgba(94, 211, 174, 0.14); }
[data-app="ses"] { --accent: #a68cff; --accent-2: #6fc9f5; --accent-soft: rgba(166, 140, 255, 0.15); }
[data-app="echo"] { --accent: #f0a875; --accent-2: #e37fa4; --accent-soft: rgba(240, 168, 117, 0.15); }
[data-app="hub"] { --accent: #7fd6c0; --accent-2: #9080f2; --accent-soft: rgba(127, 214, 192, 0.14); }

/* ---------- светлая тема: палитра референса ---------- */
[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-2: #ffffff;
  --panel-a: #ffffff;
  --panel-b: #ffffff;
  --panel: #ffffff;
  --panel-flat: #ffffff;
  --panel-2: #f1f3f5;
  --panel-solid: #ffffff;
  --line: #e9ecef;
  --line-strong: #ced4da;
  --edge: none;

  --text: #212529;
  --text-2: #495057;
  --text-3: #868e96;

  --good: #42ad3f;
  --warn: #e7a516;
  --bad: #e24343;
  --info: #2e92db;
  --good-soft: #edf7ec;
  --warn-soft: #fcf2dc;
  --bad-soft: #fbe3e3;
  --accent-ink: #ffffff;

  --shadow: 0 22px 50px -20px rgba(20, 28, 50, 0.22);
  --shadow-soft: 0 6px 20px -8px rgba(20, 28, 50, 0.14);
  --grid-line: #edf0f3;
  color-scheme: light;
}

/* На белом неоновые акценты выцветают. Значения подобраны так, чтобы белый текст
   на кнопке давал контраст не ниже 4:1 — иначе подписи на акценте не читаются. */
[data-theme="light"][data-app="crm"] {
  --accent: #0f8c6e; --accent-2: #2465d8; --accent-soft: #e4f6f0;
}
[data-theme="light"][data-app="ses"] {
  --accent: #6244d6; --accent-2: #1b7fa8; --accent-soft: #eeeaff;
}
[data-theme="light"][data-app="echo"] {
  --accent: #b06122; --accent-2: #c0396c; --accent-soft: #fbeee2;
}
[data-theme="light"][data-app="hub"] {
  --accent: #0d8a77; --accent-2: #5b41d6; --accent-soft: #e2f6f1;
}

/* ---------- база ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* Onest переменный: на тёмном фоне светлый текст оптически худеет,
     поэтому вес чуть выше четырёхсотого — так буквы остаются плотными */
  font: 430 var(--t-m) / var(--lh-body) Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* на светлом фоне всё наоборот: обычный вес и системное сглаживание */
[data-theme="light"] body {
  font-weight: 400;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

/* едва заметное зерно — убирает «пластиковость» больших заливок */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] body::after { opacity: 0.018; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: var(--tr-tight); line-height: var(--lh-snug); }
h1 { font-size: var(--t-h3); line-height: var(--lh-tight); }
h2 { font-size: var(--t-h5); }
h3 { font-size: var(--t-m); letter-spacing: -0.01em; }
p { margin: 0 0 10px; color: var(--text-2); line-height: var(--lh-read); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
.num, table.tbl td, .value, .metric .value {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "ss01" 1;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Иконки. Без собственного размера inline-svg растягивается по контейнеру —
   отсюда и брались гигантские мозг, щит и молния. Точечные правила
   (.btn svg, .badge svg и прочие) специфичнее и продолжают работать. */
.ic {
  width: 16px; height: 16px; flex: none;
  vertical-align: -0.15em; stroke-width: 1.7;
}

/* аврора на фоне */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora::before, .aurora::after {
  content: "";
  position: absolute; width: 62vw; height: 62vw; border-radius: 50%;
  filter: blur(100px); opacity: 0.45;
  animation: drift 28s var(--ease) infinite alternate;
}
.aurora::before {
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 62%);
  top: -24vw; left: -15vw;
}
.aurora::after {
  background: radial-gradient(circle at 60% 40%, var(--accent-2), transparent 62%);
  bottom: -28vw; right: -16vw; animation-delay: -13s;
}
[data-theme="light"] .aurora::before, [data-theme="light"] .aurora::after { opacity: 0.16; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 4vw, 0) scale(1.14); }
}

/* ---------- каркас ---------- */
.shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  padding: 18px 12px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent 42%);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
[data-theme="light"] .sidebar { background: #fff; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: var(--accent-ink);
  font-weight: 700; font-size: 14px; letter-spacing: -0.02em;
  box-shadow: 0 8px 20px -8px var(--accent);
}
.brand-name { font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; font-size: var(--t-m); }
.brand-sub { font-size: var(--t-caption); color: var(--text-3); margin-top: 1px; }

.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: var(--tr-caps);
  color: var(--text-3); padding: 16px 10px 7px; font-weight: 500;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-2); cursor: pointer; font-size: 14px;
  transition: background 0.16s, color 0.16s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--text); font-weight: 500; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .ic { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-item.active .ic { opacity: 1; color: var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar); flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 26px; border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
}
.topbar .spacer { flex: 1; }
.page-title { font-size: var(--t-l); font-weight: 600; letter-spacing: -0.02em; }
.page { padding: 24px 26px 40px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); font-size: var(--t-s); margin-top: 4px; }

/* ---------- сетка ---------- */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.mt-auto { margin-top: auto; }

/* ---------- панели ---------- */
/* backdrop-filter намеренно не на карточках: на экране ответов их шестьдесят,
   и размытие фона под каждой заметно роняет плавность прокрутки */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--edge);
  transition: border-color 0.2s, transform 0.22s var(--ease), box-shadow 0.22s;
}
[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(20, 28, 50, 0.04); }
.card.solid { background: var(--panel-solid); }
.card.hover:hover {
  border-color: var(--line-strong); transform: translateY(-2px);
  box-shadow: var(--shadow-soft), var(--edge);
}
.card.glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 65%, transparent), transparent 48%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-title { font-size: var(--t-s); font-weight: 600; letter-spacing: -0.01em; }
.card-sub { font-size: var(--t-caption); color: var(--text-3); line-height: 1.4; }
.card-head .spacer { flex: 1; }

/* ---------- метрики ---------- */
.metric .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: var(--tr-caps);
  color: var(--text-3); margin-bottom: 10px; font-weight: 500;
}
.metric .value {
  font-size: var(--t-h1); font-weight: 600; letter-spacing: -0.035em;
  line-height: var(--lh-tight);
}
.metric .value .unit {
  font-size: var(--t-l); color: var(--text-2); font-weight: 500; margin-left: 5px;
  letter-spacing: -0.02em;
}
.metric .foot {
  margin-top: 10px; font-size: var(--t-caption); color: var(--text-3);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}

.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: var(--t-caption); }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--text-3); }

/* ---------- бейджи, кнопки ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-round); font-size: var(--t-caption); font-weight: 500;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line);
  white-space: nowrap; line-height: 1.35;
}
.badge svg { width: 13px; height: 13px; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge .pip { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--r-sm); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: var(--t-s); font-weight: 500; letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); border-color: transparent; font-weight: 600;
  box-shadow: 0 10px 24px -10px var(--accent);
}
.btn.primary:hover { box-shadow: 0 14px 30px -10px var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn.sm svg { width: 13px; height: 13px; }
.btn.lg { padding: 12px 22px; font-size: var(--t-m); border-radius: var(--r); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn .spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-sm); cursor: pointer; border: 1px solid var(--line);
  background: var(--panel-flat); transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }

.seg {
  display: inline-flex; padding: 3px; gap: 3px;
  background: var(--panel-2); border-radius: var(--r-sm); border: 1px solid var(--line);
}
.seg button {
  border: 0; background: transparent; padding: 6px 13px; border-radius: var(--r-xs);
  cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.seg button.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--t-caption); color: var(--text-3); }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 12px; outline: none; width: 100%; font-size: var(--t-s);
  transition: border-color 0.15s, background 0.15s;
}
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 3px;
  background: var(--panel-2); outline: none; border: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer; box-shadow: 0 2px 10px -2px var(--accent); border: 0;
}
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch .track {
  width: 40px; height: 23px; border-radius: var(--r-round); background: var(--panel-2);
  border: 1px solid var(--line); position: relative; transition: background 0.2s, border-color 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--text-3);
  transition: transform 0.24s var(--ease), background 0.2s;
}
.switch.on .track { background: var(--accent-soft); border-color: var(--accent); }
.switch.on .track::after { transform: translateX(17px); background: var(--accent); }

/* Признак жизни, пока рассуждающая модель думает. Снизу по центру,
   поверх всего: на разборе сессии экран длинный, и индикатор рядом
   с кнопкой был бы за пределами видимой области. */
.thinking-note {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--r-round);
  background: color-mix(in srgb, var(--panel-solid) 94%, transparent);
  border: 1px solid var(--line-strong); backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px -12px rgba(0, 0, 0, 0.6);
  font-size: var(--t-s); color: var(--text-2); max-width: min(560px, calc(100vw - 32px));
}
.thinking-note .t {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* вертелка объявлена для кнопок; здесь она нужна сама по себе */
.thinking-note .spin {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent); animation: spin 0.7s linear infinite;
}

/* Кнопка отзыва: на каждом экране, но не поверх работы — в нижнем углу,
   узкая, не перехватывает клики по содержимому. */
.fb-btn {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--r-round);
  background: color-mix(in srgb, var(--panel-solid) 94%, transparent);
  border: 1px solid var(--line-strong); color: var(--text-2);
  font-size: var(--t-s); cursor: pointer; backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.55);
  transition: color 0.16s, border-color 0.16s, transform 0.16s var(--ease);
}
.fb-btn:hover {
  color: var(--accent); border-color: var(--accent); transform: translateY(-1px);
}
.fb-btn svg { width: 15px; height: 15px; }

@media (max-width: 760px) {
  /* на телефоне подпись лишняя: место дороже */
  .fb-btn { right: 12px; bottom: 12px; padding: 10px; }
  .fb-btn span { display: none; }
}

/* ---------- таблицы ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
table.tbl th {
  text-align: left; font-weight: 500; color: var(--text-3); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: var(--tr-caps); padding: 0 12px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background 0.14s; }
table.tbl tbody tr:hover { background: var(--panel-2); }
table.tbl td.r, table.tbl th.r { text-align: right; }
.scroll-x { overflow-x: auto; }

/* ---------- прогресс ---------- */
.bar { height: 7px; border-radius: var(--r-round); background: var(--panel-2); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: var(--r-round);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.9s var(--ease);
}
.bar.good > i { background: var(--good); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

/* ---------- скелетоны ---------- */
.skel { border-radius: var(--r); background: var(--panel-2); position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.4s infinite;
}
[data-theme="light"] .skel::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- анимации появления ---------- */
.rise { animation: rise 0.5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade { animation: fade 0.35s var(--ease) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.pop { animation: pop 0.4s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise 0.5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.07s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.17s; }
.stagger > *:nth-child(5) { animation-delay: 0.22s; }
.stagger > *:nth-child(6) { animation-delay: 0.27s; }
.stagger > *:nth-child(7) { animation-delay: 0.32s; }
.stagger > *:nth-child(8) { animation-delay: 0.37s; }
.stagger > *:nth-child(9) { animation-delay: 0.42s; }
.stagger > *:nth-child(10) { animation-delay: 0.47s; }

.pulse-ring { animation: pulsering 2.4s ease-out infinite; transform-origin: center; }
@keyframes pulsering {
  0% { opacity: 0.55; transform: scale(0.55); }
  70% { opacity: 0; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.05); }
}
.blink { animation: blink 1.5s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- PIN-вход ---------- */
.gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); }
.gate .box { width: 320px; text-align: center; animation: rise 0.6s var(--ease) both; }
.gate .logo {
  width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 19px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: var(--accent-ink); font-weight: 700; font-size: 22px;
  box-shadow: 0 16px 40px -14px var(--accent);
}
.gate h2 { margin-bottom: 7px; font-size: var(--t-h4); }
.gate .hint { color: var(--text-3); font-size: var(--t-s); margin-bottom: 26px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 28px; }
.pin-dots i {
  width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  transition: background 0.2s, transform 0.2s var(--ease), border-color 0.2s;
}
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.2); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-pad button {
  height: 58px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--panel-flat); font-size: 21px; font-weight: 500; cursor: pointer;
  transition: background 0.14s, transform 0.12s, border-color 0.14s;
}
.pin-pad button:hover { background: var(--panel-2); border-color: var(--line-strong); }
.pin-pad button:active { transform: scale(0.94); }
.pin-pad button.ghost { background: transparent; border-color: transparent; font-size: 14px; color: var(--text-3); }
.shake { animation: shake 0.42s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* ---------- тосты ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: var(--r);
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); animation: rise 0.35s var(--ease) both; font-size: var(--t-s);
  display: flex; gap: 10px; align-items: flex-start;
}
.toast.out { animation: fadeout 0.3s var(--ease) both; }
@keyframes fadeout { to { opacity: 0; transform: translateY(8px); } }
.toast .tl { width: 3px; align-self: stretch; border-radius: 3px; background: var(--accent); flex: none; }
.toast.good .tl { background: var(--good); }
.toast.bad .tl { background: var(--bad); }

/* ---------- модалка / шторка ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(4, 6, 12, 0.6);
  backdrop-filter: blur(5px); animation: fade 0.2s both;
  display: grid; place-items: center; padding: 24px;
}
.modal {
  width: min(720px, 100%); max-height: 86vh; overflow: auto;
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow);
  animation: pop 0.28s var(--ease) both;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%);
  background: var(--panel-solid); border-left: 1px solid var(--line-strong);
  z-index: 160; padding: 24px; overflow: auto; box-shadow: var(--shadow);
  animation: slidein 0.32s var(--ease) both;
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- прочее ---------- */
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.muted { color: var(--text-3); }
.small { font-size: var(--t-s); }
.tiny { font-size: var(--t-caption); }
.b { font-weight: 600; }
.center { text-align: center; }
.quote {
  border-left: 2px solid var(--line-strong); padding: 2px 0 2px 12px;
  color: var(--text-2); font-size: var(--t-s); font-style: italic; line-height: 1.55;
}
.kbd {
  display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11.5px;
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--r-round); background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12.5px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip svg { width: 13px; height: 13px; }

.evidence {
  background: var(--panel-2); border-radius: var(--r-sm); padding: 10px 12px;
  font-size: var(--t-s); color: var(--text-2); line-height: 1.5;
}

.stream-text { white-space: pre-wrap; line-height: var(--lh-read); font-size: var(--t-s); }
.stream-text .caret {
  display: inline-block; width: 7px; height: 15px; margin-left: 2px;
  background: var(--accent); vertical-align: text-bottom; animation: blink 1s step-end infinite;
}

.empty { padding: 40px; text-align: center; color: var(--text-3); font-size: var(--t-s); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--panel-2); border-radius: var(--r-round);
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: content-box; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: span 2; }
}
@media (max-width: 860px) {
  :root { --sidebar: 66px; --t-h1: 34px; }
  .sidebar { padding: 16px 10px; }
  .brand-text, .nav-item span, .nav-label, .sidebar-foot .btn span { display: none; }
  .nav-item { justify-content: center; }
  .nav-item.active::before { left: -10px; }
  /* часть сеток задаётся инлайном под конкретный экран —
     на узком экране всё равно схлопываем в колонку */
  .grid { grid-template-columns: 1fr !important; }
  .span2, .span3 { grid-column: span 1; }
  .row, .card-head { flex-wrap: wrap; }
  .row > * { min-width: 0; }
  .card-head .spacer { flex-basis: 100%; height: 0; }
  svg { max-width: 100%; }
  .topbar-extra { overflow: hidden; flex-wrap: nowrap; }
  .topbar-extra .badge { display: none; }
  .topbar-extra .badge:first-child, .topbar-extra select { display: inline-flex; }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .page-head { gap: 10px; }
  .card { padding: 16px; }
}


/* ==========================================================================
   Компоненты платформы: люди, разговор, время
   ========================================================================== */

/* ---------- аватар клиента ---------- */
.ava {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  letter-spacing: -0.02em; position: relative;
  background: hsl(var(--hue, 200) 46% 26%); color: hsl(var(--hue, 200) 70% 88%);
  border: 1px solid hsl(var(--hue, 200) 40% 40% / 0.5);
}
[data-theme="light"] .ava {
  background: hsl(var(--hue, 200) 62% 93%); color: hsl(var(--hue, 200) 48% 30%);
  border-color: hsl(var(--hue, 200) 45% 82%);
}
.ava.lg { width: 62px; height: 62px; font-size: 21px; border-radius: 20px; }
.ava.sm { width: 28px; height: 28px; font-size: 11px; }
.ava .dot {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
  border-radius: 50%; border: 2px solid var(--bg);
}
.ava .dot.good { background: var(--good); }
.ava .dot.warn { background: var(--warn); }
.ava .dot.bad { background: var(--bad); }

.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person .nm { font-weight: 500; letter-spacing: -0.01em; }
.person .sub { font-size: var(--t-caption); color: var(--text-3); margin-top: 1px; }

/* ---------- статус-точка ---------- */
/* Строка со статусной точкой. Текст переносится: рядом с точкой часто
   стоит целое правило, а не короткая подпись. */
.status-dot {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: var(--t-caption); color: var(--text-2); line-height: 1.5;
}
.status-dot i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-3);
  flex: none; margin-top: 5px;
}
.status-dot.good i { background: var(--good); }
.status-dot.warn i { background: var(--warn); }
.status-dot.bad i { background: var(--bad); }
.status-dot.accent i { background: var(--accent); }
.status-dot.info i { background: var(--info); }

/* ---------- разговор ---------- */
.talk { display: flex; flex-direction: column; gap: 12px; }
.turn { display: flex; gap: 11px; align-items: flex-start; scroll-margin-top: 90px; }
.turn .who {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600; background: var(--panel-2); color: var(--text-3);
  border: 1px solid var(--line);
}
.turn.psy .who { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.turn .bubble {
  border-radius: 4px 14px 14px 14px; padding: 10px 13px; background: var(--panel-2);
  border: 1px solid var(--line); font-size: var(--t-s); line-height: 1.55; max-width: 62ch;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.turn.psy .bubble { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.turn .at { font-size: 10.5px; color: var(--text-3); margin-top: 5px; font-variant-numeric: tabular-nums; }
.turn.hit .bubble { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.turn.dim { opacity: 0.4; }

/* чат: пользователь справа, собеседник слева */
.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg .body {
  padding: 11px 14px; border-radius: 16px; font-size: var(--t-s); line-height: 1.58;
  border: 1px solid var(--line); background: var(--panel-2); max-width: 60ch;
  white-space: pre-wrap; word-break: break-word;
}
.msg.me { flex-direction: row-reverse; }
.msg.me .body {
  background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  border-bottom-right-radius: 5px;
}
.msg.them .body { border-bottom-left-radius: 5px; }
.msg .stamp { font-size: 10.5px; color: var(--text-3); margin-top: 6px; }

/* ---------- форма волны ---------- */
.wave { display: flex; align-items: center; gap: 2px; height: 40px; }
.wave i {
  flex: 1; min-width: 2px; border-radius: 2px; background: var(--line-strong);
  transition: background 0.25s, transform 0.25s var(--ease);
}
.wave.on i { background: color-mix(in srgb, var(--accent) 70%, transparent); }
.wave.live i { animation: bounce 1.1s var(--ease) infinite alternate; }
@keyframes bounce { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }
.wave i:nth-child(3n) { animation-delay: -0.35s; }
.wave i:nth-child(3n + 1) { animation-delay: -0.7s; }

.rec-btn {
  width: 92px; height: 92px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 44px -14px var(--accent);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.rec-btn:hover { transform: scale(1.04); }
.rec-btn:active { transform: scale(0.97); }
.rec-btn svg { width: 34px; height: 34px; }
.rec-btn.on { background: var(--bad); box-shadow: 0 0 0 0 var(--bad-soft); animation: recpulse 1.6s infinite; }
@keyframes recpulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 45%, transparent); }
  100% { box-shadow: 0 0 0 26px transparent; }
}

/* ---------- лента времени ---------- */
.tl { position: relative; padding-left: 26px; display: flex; flex-direction: column; gap: 16px; }
.tl::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent-2) 60%, transparent), transparent);
  opacity: 0.5; border-radius: 2px;
}
.tl-item { position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 7px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.tl-item.muted::before { border-color: var(--line-strong); }
.tl-date { font-size: var(--t-caption); color: var(--text-3); margin-bottom: 4px; }

/* ---------- типы утверждений в заметке ---------- */
.claim {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 13px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2);
  border-left: 3px solid var(--text-3); font-size: var(--t-s); line-height: 1.55;
  transition: border-color 0.18s, background 0.18s, opacity 0.2s;
}
.claim.fact { border-left-color: var(--good); }
.claim.interpretation { border-left-color: var(--info); }
.claim.hypothesis { border-left-color: var(--warn); }
.claim.recommendation { border-left-color: var(--accent); }
.claim.dropped { opacity: 0.38; text-decoration: line-through; }
.claim.kept { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.claim .tools { margin-left: auto; display: flex; gap: 5px; flex: none; opacity: 0; transition: opacity 0.15s; }
.claim:hover .tools, .claim:focus-within .tools { opacity: 1; }
.claim .refs { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.ref-pin {
  font-size: 10.5px; padding: 2px 7px; border-radius: var(--r-round); cursor: pointer;
  background: var(--panel-flat); border: 1px solid var(--line); color: var(--text-3);
  font-variant-numeric: tabular-nums; transition: color 0.15s, border-color 0.15s;
}
.ref-pin:hover { color: var(--accent); border-color: var(--accent); }

.kind-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--t-caption); color: var(--text-3); }
.kind-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kind-legend i { width: 10px; height: 3px; border-radius: 2px; }

/* ---------- шаги конвейера ---------- */
.steps { display: flex; flex-direction: column; gap: 3px; }
.step {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px;
  border-radius: var(--r-sm); border: 1px solid transparent; transition: all 0.25s var(--ease);
}
.step .mark {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); font-size: 11px; color: var(--text-3);
  transition: all 0.25s var(--ease);
}
.step .mark svg { width: 13px; height: 13px; }
.step.run { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.step.run .mark { border-color: var(--accent); color: var(--accent); }
.step.done .mark { background: var(--good); border-color: var(--good); color: #05140c; }
.step.wait { opacity: 0.45; }
.step .ttl { font-size: var(--t-s); font-weight: 500; }
.step .hint { font-size: var(--t-caption); color: var(--text-3); margin-top: 2px; line-height: 1.45; }
.step .res {
  font-size: var(--t-caption); color: var(--text-2); margin-top: 7px; line-height: 1.5;
  animation: fade 0.4s var(--ease) both;
}

/* ---------- предупреждение / безопасность ---------- */
.notice {
  display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px;
  border-radius: var(--r); font-size: var(--t-s); line-height: 1.55;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2);
}
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.notice b { color: inherit; }

/* синтетический голос помечается всегда и одинаково */
.synthetic-mark {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
  border-radius: var(--r-round); font-size: var(--t-caption); font-weight: 500;
  background: repeating-linear-gradient(135deg,
    var(--warn-soft) 0 8px, transparent 8px 16px);
  border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn);
}

/* ---------- шкала 0-10 ---------- */
.scale { display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.scale i {
  flex: 1; border-radius: 2px; background: var(--panel-2);
  transition: background 0.3s, height 0.3s var(--ease);
}
.scale i.on { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.scale.bad i.on { background: var(--bad); }
.scale.warn i.on { background: var(--warn); }
.scale.good i.on { background: var(--good); }

/* ---------- сетка календаря ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.cal-day {
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px;
  background: var(--panel); min-height: 190px; display: flex; flex-direction: column; gap: 7px;
  transition: border-color 0.2s, background 0.2s;
}
.cal-day.today { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--panel-flat)); }
.cal-day.off { opacity: 0.5; }
.cal-day > .h { display: flex; align-items: baseline; gap: 6px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.cal-day > .h .d { font-size: var(--t-l); font-weight: 600; letter-spacing: -0.03em; }
.cal-day > .h .w { font-size: var(--t-caption); color: var(--text-3); }
.appt {
  border-radius: var(--r-xs); padding: 8px 9px; font-size: 12px; line-height: 1.4;
  background: var(--panel-2); border: 1px solid var(--line); cursor: pointer;
  border-left: 3px solid var(--accent); transition: transform 0.15s var(--ease), border-color 0.15s;
}
.appt:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.appt .t { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 11px; }
.appt.done { opacity: 0.55; border-left-color: var(--good); }
.appt.cancelled { opacity: 0.4; border-left-color: var(--bad); text-decoration: line-through; }
.appt.moved { border-left-color: var(--warn); }
.appt.today { border-left-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }

/* ---------- канбан ---------- */
.board { display: grid; gap: 14px; align-items: start; }
.board-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.board-col > .h {
  display: flex; align-items: center; gap: 8px; padding: 0 4px 2px;
  font-size: 12px; color: var(--text-3);
}
.board-col > .h .n { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- список с выбором ---------- */
.pick {
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 13px; cursor: pointer;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2);
  transition: border-color 0.16s, background 0.16s, transform 0.16s var(--ease);
}
.pick:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick .box {
  width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong);
  flex: none; display: grid; place-items: center; margin-top: 1px; transition: all 0.16s;
}
.pick.on .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pick .box svg { width: 12px; height: 12px; opacity: 0; }
.pick.on .box svg { opacity: 1; }

/* ---------- обратный отсчёт ---------- */
.count-ring { position: relative; display: grid; place-items: center; }
.count-ring .n {
  position: absolute; font-size: var(--t-h4); font-weight: 600; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.locked { position: relative; overflow: hidden; }
.locked .veil {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 8px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(7px);
  border-radius: inherit; text-align: center; padding: 16px;
}

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; cursor: pointer; padding: 10px 14px;
  font-size: var(--t-s); color: var(--text-3); position: relative; white-space: nowrap;
  transition: color 0.15s;
}
.tabs button:hover { color: var(--text-2); }
.tabs button.active { color: var(--text); font-weight: 500; }
.tabs button.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--accent);
}

/* ---------- документ библиотеки ---------- */
.doc {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2);
  transition: border-color 0.16s, transform 0.16s var(--ease);
}
.doc:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.doc .ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.doc .ico svg { width: 17px; height: 17px; }

/* ---------- мелочи ---------- */
.tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--r-round);
  font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2);
  white-space: nowrap;
}
.hr-label {
  display: flex; align-items: center; gap: 12px; font-size: var(--t-caption);
  color: var(--text-3); text-transform: uppercase; letter-spacing: var(--tr-caps);
}
.hr-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sticky-side { position: sticky; top: calc(var(--topbar) + 18px); }
.scroll-y { overflow-y: auto; }
.link { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }

@media (max-width: 1180px) {
  .cal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cal { grid-template-columns: 1fr; }
  .turn .bubble, .msg .body { max-width: 100%; }
}

/* ==========================================================================
   Вход в сервис и своя учётка
   ========================================================================== */

.login-box {
  width: min(380px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 14px;
  position: relative; z-index: 1;
  animation: rise 0.5s var(--ease) both;
  padding: 28px 26px 24px;
  border-radius: var(--r-xl);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  text-align: left;
}
.login-box .logo {
  width: 52px; height: 52px; border-radius: 16px; margin: 0 0 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: var(--accent-ink);
  font-weight: 700; font-size: 20px;
  box-shadow: 0 14px 34px -14px var(--accent);
}
.login-box h2 { font-size: var(--t-h4); letter-spacing: -0.03em; }
.login-box .hint { color: var(--text-3); font-size: var(--t-s); margin-bottom: 6px; }
.login-box .field label { font-size: var(--t-caption); color: var(--text-2); }
/* поля входа крупнее обычных: на телефоне мелкий инпут неудобен,
   а шрифт меньше 16px заставляет Safari зумить страницу */
.login-box input {
  font-size: 16px; padding: 12px 13px; border-radius: var(--r-sm);
}
.login-box .pass-row { display: flex; gap: 8px; align-items: stretch; }
.login-box .pass-row input { flex: 1; min-width: 0; }
.login-box .pass-row .icon-btn { width: 44px; height: auto; flex: none; }
.login-box .btn.lg { justify-content: center; }
.login-foot {
  text-align: center; font-size: var(--t-caption); color: var(--text-3);
  margin-top: 2px;
}
.login-foot:hover { color: var(--accent); }
.login-err {
  font-size: var(--t-s); line-height: 1.45; padding: 10px 12px;
  border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad);
}

/* своя учётка в подвале боковой панели */
.who-box {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--r-sm); cursor: pointer; min-width: 0;
  transition: background 0.16s;
}
.who-box:hover { background: var(--panel-2); }
.who-text { min-width: 0; }
.who-name {
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.who-role { font-size: 10.5px; color: var(--text-3); }

@media (max-width: 860px) {
  .who-text { display: none; }
  .who-box { justify-content: center; }
}
