/* CRM 360 — стиль экосистемы Norbiss (DESIGN.md, эталоны docs/design/REFERENCE_*.png).
   Цвета — только переменными ниже; в правилах элементов цвет не пишется (проверка crm/tests/web-style.test.mjs). */

@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-cyrillic-ext.woff2?v=1') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-cyrillic.woff2?v=1') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-latin-ext.woff2?v=1') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  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;
}
@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-latin.woff2?v=1') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  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: 'Noto Sans Georgian';
  src: url('fonts/noto-sans-georgian-500.woff2?v=1') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F;
}
@font-face {
  font-family: 'Noto Sans Georgian';
  src: url('fonts/noto-sans-georgian-700.woff2?v=1') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F;
}
@font-face {
  font-family: 'Noto Sans Georgian';
  src: url('fonts/noto-sans-georgian-800.woff2?v=1') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('fonts/noto-sans-arabic-500.woff2?v=1') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('fonts/noto-sans-arabic-700.woff2?v=1') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('fonts/noto-sans-arabic-800.woff2?v=1') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Noto Sans Armenian';
  src: url('fonts/noto-sans-armenian-500.woff2?v=1') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0530-058F, U+FB13-FB17;
}
@font-face {
  font-family: 'Noto Sans Armenian';
  src: url('fonts/noto-sans-armenian-700.woff2?v=1') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0530-058F, U+FB13-FB17;
}
@font-face {
  font-family: 'Noto Sans Armenian';
  src: url('fonts/noto-sans-armenian-800.woff2?v=1') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0530-058F, U+FB13-FB17;
}

:root {
  /* фирменные */
  --navy: #002D7A;
  --blue: #0043C3;
  --cobalt: #0059FF;
  --sky: #D6E6FF;
  --yellow: #FFB800;
  --coral: #FF651E;
  --cream: #FFF2D9;
  --white: #FFFFFF;
  /* светлая тема */
  --bg: #FBF7EF;
  --surface: #FFFFFF;
  --field: #FFFFFF;
  --tint: #F6F0E4;
  --line: #E8E1D3;
  --line-strong: #CFC4AF;
  --ink: #0B2150;
  --muted: #4A5A80;
  --in: #0B6E46;
  --out: #C42335;
  --err: #C42335;
  --err-bg: #FDEDEE;
  --warn-bg: #FFE8DA;
  --up-bg: #DDF3E8;
  --up-ink: #0B6E46;
  --late-bg: #FFE3E0;
  --late-ink: #A0162A;
  --skel: #EFE7D8;
  --link: #0043C3;
  --on-navy: #FFFFFF;
  --on-navy-2: #C9D7F6;
  --nav-icon: #7FA8FF;
  --nav-pill: rgba(255, 255, 255, 0.14);
  --hero: #002D7A;
  --hero-line: transparent;
  --seg-bg: #002D7A;
  --check-on: #E6EEFF;
  --focus: #0059FF;
  --backdrop: rgba(0, 21, 64, 0.45);
  --shadow: 0 1px 2px rgba(0, 45, 122, 0.06), 0 6px 16px rgba(0, 45, 122, 0.08);
  --shadow-new: 0 2px 4px rgba(0, 21, 64, 0.2), 0 8px 18px rgba(0, 21, 64, 0.28);
  --card-line: transparent;
  --ic-a: #0059FF;
  --ic-b: #FFB800;
  --ic-c: #FF651E;
  --ic-d: #002D7A;
  --ic-w: #FFFFFF;
  /* знаки входа: цвета Google — его фирменные, кнопка Apple — чёрная (светлая тема) или белая (тёмная), как требует Apple */
  --g-blue: #4285F4;
  --g-green: #34A853;
  --g-yellow: #FBBC05;
  --g-red: #EA4335;
  --apple-bg: #000000;
  --apple-ink: #FFFFFF;
  /* мозаика бренда (из nbx.css Norbiss) */
  --mz-hero:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 160'%3E%3Cg transform='translate%280 0%29'%3E%3Crect width='80' height='80' fill='%23FF651E'/%3E%3Cpath d='M0 80A80 80 0 0 1 80 0V80z' fill='%23FFB800'/%3E%3C/g%3E%3Cg transform='translate%2880 0%29'%3E%3Crect width='80' height='80' fill='%230059FF'/%3E%3Ccircle cx='40' cy='40' r='26' fill='%23FFB800'/%3E%3Ccircle cx='40' cy='40' r='11' fill='%23FF651E'/%3E%3C/g%3E%3Cg transform='translate%28160 0%29'%3E%3Crect width='80' height='80' fill='%23FFF2D9'/%3E%3Cpath d='M40 8 72 40 40 72 8 40z' fill='%230043C3'/%3E%3C/g%3E%3Cg transform='translate%280 80%29'%3E%3Crect width='80' height='80' fill='%230043C3'/%3E%3Cpath d='M0 80a40 40 0 0 1 80 0z' fill='%23FFB800'/%3E%3C/g%3E%3Cg transform='translate%2880 80%29'%3E%3Crect width='80' height='80' fill='%23FFB800'/%3E%3Cpath d='M0 0h80A80 80 0 0 1 0 80z' fill='%230059FF'/%3E%3C/g%3E%3Cg transform='translate%28160 80%29'%3E%3Crect width='80' height='80' fill='%23002D7A'/%3E%3Cpath d='M80 0v80H0A80 80 0 0 1 80 0z' fill='%23FF651E'/%3E%3Ccircle cx='62' cy='62' r='9' fill='%23FFF2D9'/%3E%3C/g%3E%3C/svg%3E");
  --mz-hero-sq:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'%3E%3Cg transform='translate%280 0%29'%3E%3Crect width='80' height='80' fill='%230059FF'/%3E%3Ccircle cx='40' cy='40' r='26' fill='%23FFB800'/%3E%3Ccircle cx='40' cy='40' r='11' fill='%23FF651E'/%3E%3C/g%3E%3Cg transform='translate%2880 0%29'%3E%3Crect width='80' height='80' fill='%23FFF2D9'/%3E%3Cpath d='M40 8 72 40 40 72 8 40z' fill='%230043C3'/%3E%3C/g%3E%3Cg transform='translate%280 80%29'%3E%3Crect width='80' height='80' fill='%23FFB800'/%3E%3Cpath d='M0 0h80A80 80 0 0 1 0 80z' fill='%230059FF'/%3E%3C/g%3E%3Cg transform='translate%2880 80%29'%3E%3Crect width='80' height='80' fill='%23FF651E'/%3E%3Cpath d='M0 80A80 80 0 0 1 80 0V80z' fill='%23FFB800'/%3E%3C/g%3E%3C/svg%3E");
  --mz-side:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 248 62'%3E%3Cg transform='translate%280 0%29'%3E%3Crect width='62' height='62' fill='%230059FF'/%3E%3Ccircle cx='31' cy='31' r='18' fill='%23FFB800'/%3E%3C/g%3E%3Cg transform='translate%2862 0%29'%3E%3Crect width='62' height='62' fill='%23FF651E'/%3E%3Cpath d='M0 62A62 62 0 0 1 62 0V62z' fill='%23FF9C6B'/%3E%3C/g%3E%3Cg transform='translate%28124 0%29'%3E%3Crect width='62' height='62' fill='%23FFB800'/%3E%3Cpath d='M31 6 56 31 31 56 6 31z' fill='%230043C3'/%3E%3C/g%3E%3Cg transform='translate%28186 0%29'%3E%3Crect width='62' height='62' fill='%230043C3'/%3E%3Cpath d='M0 62a31 31 0 0 1 62 0z' fill='%23FFF2D9'/%3E%3C/g%3E%3C/svg%3E");
  --mz-corner:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 48'%3E%3Cg transform='translate%280 0%29'%3E%3Crect width='48' height='48' fill='%23FFB800'/%3E%3Cpath d='M48 0v48H0A48 48 0 0 1 48 0z' fill='%23FF651E'/%3E%3C/g%3E%3Cg transform='translate%2848 0%29'%3E%3Crect width='48' height='48' fill='%230059FF'/%3E%3Ccircle cx='24' cy='24' r='14' fill='%23FFF2D9'/%3E%3C/g%3E%3C/svg%3E");
  /* шкала */
  --font: 'Manrope', 'Noto Sans Armenian', 'Noto Sans Georgian', 'Noto Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-field: 12px; --r-row: 16px; --r-card: 24px; --r-pill: 999px;
  --tap: 52px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #001540;
    --surface: #0B285B;
    --field: #031C4D;
    --tint: #0E3068;
    --line: #1C3A72;
    --line-strong: #2E5196;
    --ink: #EEF2FF;
    --muted: #AAB6D6;
    --in: #4FD394;
    --out: #FF8C8C;
    --err: #FF9A8F;
    --err-bg: rgba(255, 101, 30, 0.14);
    --warn-bg: rgba(255, 101, 30, 0.18);
    --up-bg: rgba(79, 211, 148, 0.18);
    --up-ink: #8BE8B8;
    --late-bg: rgba(255, 140, 140, 0.2);
    --late-ink: #FFC2C2;
    --skel: #14386F;
    --link: #9DBDFF;
    --hero: #002D7A;
    --hero-line: #1C3A72;
    --seg-bg: #031C4D;
    --check-on: #13377A;
    --focus: #9DBDFF;
    --backdrop: rgba(0, 8, 30, 0.62);
    --shadow: none;
    --card-line: #1C3A72;
    --ic-a: #4C8DFF;
    --ic-d: #C9D7F6;
    --ic-w: #0B285B;
    --apple-bg: #FFFFFF;
    --apple-ink: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #001540;
  --surface: #0B285B;
  --field: #031C4D;
  --tint: #0E3068;
  --line: #1C3A72;
  --line-strong: #2E5196;
  --ink: #EEF2FF;
  --muted: #AAB6D6;
  --in: #4FD394;
  --out: #FF8C8C;
  --err: #FF9A8F;
  --err-bg: rgba(255, 101, 30, 0.14);
  --warn-bg: rgba(255, 101, 30, 0.18);
  --up-bg: rgba(79, 211, 148, 0.18);
  --up-ink: #8BE8B8;
  --late-bg: rgba(255, 140, 140, 0.2);
  --late-ink: #FFC2C2;
  --skel: #14386F;
  --link: #9DBDFF;
  --hero: #002D7A;
  --hero-line: #1C3A72;
  --seg-bg: #031C4D;
  --check-on: #13377A;
  --focus: #9DBDFF;
  --backdrop: rgba(0, 8, 30, 0.62);
  --shadow: none;
  --card-line: #1C3A72;
  --ic-a: #4C8DFF;
  --ic-d: #C9D7F6;
  --ic-w: #0B285B;
  --apple-bg: #FFFFFF;
  --apple-ink: #000000;
  color-scheme: dark;
}

/* ─── основа ─── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  caret-color: var(--cobalt);
}
::selection { background: var(--sky); color: var(--navy); }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
h1:focus { outline: none; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 800; letter-spacing: -0.01em; }
a { color: var(--link); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; }
.tnum, .hero-num, .row-num b, .flow b { font-variant-numeric: tabular-nums; }

/* ─── значки ─── */
.i { width: 24px; height: 24px; flex: none; display: block; }
.i .a { fill: var(--ic-a); }
.i .b { fill: var(--ic-b); }
.i .c { fill: var(--ic-c); }
.i .d { fill: var(--ic-d); }
.i .w { fill: var(--ic-w); }
.i .s, .i .sa, .i .sb, .i .sd, .i .sw { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i .s { stroke: currentColor; }
.i .sa { stroke: var(--ic-a); stroke-linecap: butt; }
.i .sb { stroke: var(--ic-b); stroke-width: 2.2; }
.i .sd { stroke: var(--ic-d); }
.i .sw { stroke: var(--ic-w); stroke-width: 2.2; }
.i-sm { width: 18px; height: 18px; }
.i-lg { width: 40px; height: 40px; }
.i-xl { width: 64px; height: 64px; }
.mark { width: 32px; height: 32px; flex: none; }
.mark .m-a { fill: var(--cobalt); }
.mark .m-b { fill: var(--yellow); }
.mark-xl { width: 72px; height: 72px; }

/* ─── кнопки ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s5);
  border: 1.5px solid transparent; border-radius: var(--r-pill);
  font-size: 16px; font-weight: 700; line-height: 1.2; text-decoration: none; text-align: center;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--cobalt); color: var(--white); }
.btn-primary:hover { background: var(--blue); }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { background: var(--tint); }
.btn-block { width: 100%; }
.btn .i-end { margin-inline-end: calc(var(--s2) * -1); }
[dir="rtl"] .i-end, [dir="rtl"] .row-go, [dir="rtl"] .i-dir { transform: scaleX(-1); }
.btn[disabled] { cursor: progress; opacity: 0.72; }
.btn.is-busy .i-end { display: none; }
.btn.is-busy::after {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-round {
  width: var(--tap); height: var(--tap); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink);
  transition: background-color 160ms var(--ease);
}
.btn-round:hover { background: var(--tint); }
.btn-round.btn-sm { width: 44px; height: 44px; }
.btn-lang { font-size: 15px; font-weight: 800; letter-spacing: 0.01em; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s3);
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--link); font-size: 15px; font-weight: 700;
}
.btn-ghost:hover { background: var(--tint); }
.prefs { display: flex; gap: var(--s2); }

/* ─── поля ─── */
.form { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s5); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { font-size: 14px; font-weight: 700; color: var(--ink); padding: 0; margin-bottom: 6px; }
.field > label { margin-bottom: 0; }
.control { position: relative; }
.control input, .control select {
  width: 100%; height: var(--tap); padding: 0 var(--s4);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-field);
  background: var(--field); color: var(--ink); font-size: 16px; font-weight: 600;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.control input::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
.control input:focus, .control select:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--check-on); }
.control.has-eye input { padding-inline-end: 56px; }
.eye {
  position: absolute; top: 4px; inset-inline-end: 4px; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
}
.eye:hover { color: var(--ink); }
.control.select select { appearance: none; -webkit-appearance: none; padding-inline-end: 48px; cursor: pointer; }
.control.select select:disabled { cursor: default; opacity: 1; background: var(--tint); }
.control.select::after {
  content: ""; position: absolute; inset-inline-end: 20px; top: 50%; width: 9px; height: 9px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
}
.msg { display: flex; align-items: flex-start; gap: 6px; min-height: 18px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.msg:empty { display: none; }
.field.bad .control input { border-color: var(--coral); }
.field.bad .msg { color: var(--err); font-weight: 600; }
.field.bad .msg .i { margin-top: -1px; }
.form-error { display: none; align-items: flex-start; gap: var(--s2); padding: var(--s3); border-radius: var(--r-field); background: var(--err-bg); color: var(--err); font-size: 14px; font-weight: 600; }
.form-error.on { display: flex; }

/* сегменты (как «День / Неделя / Месяц» Norbiss) */
.seg { display: flex; gap: var(--s1); padding: 6px; border-radius: var(--r-pill); background: var(--seg-bg); }
.seg-item { flex: 1; position: relative; min-width: 0; }
.seg-item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-item span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s3);
  border-radius: var(--r-pill); color: var(--on-navy); font-size: 15px; font-weight: 700; text-align: center; line-height: 1.15;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.seg-item input:checked + span { background: var(--yellow); color: var(--navy); }
.seg-item input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg-3 .seg-item span { font-size: 14px; padding: 0 var(--s2); }

.readout { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: 14px var(--s4); border-radius: var(--r-row); background: var(--tint); font-size: 15px; color: var(--muted); }
.readout b { color: var(--ink); font-weight: 700; }
.note { font-size: 14px; color: var(--muted); }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.check {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 var(--s3);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-field); background: var(--field); font-weight: 700; font-size: 15px; cursor: pointer;
}
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.check .box { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line-strong); border-radius: 7px; color: transparent; }
.check .box .i { width: 16px; height: 16px; }
.check:has(input:checked) { border-color: var(--cobalt); background: var(--check-on); }
.check input:checked + .box { background: var(--cobalt); border-color: var(--cobalt); color: var(--white); }
.check:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.field.bad .check { border-color: var(--coral); }

/* вход через Google и Apple */
.oauth { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s4); }
.btn-oauth { width: 100%; min-height: 48px; padding: 0 var(--s3); gap: var(--s2); font-size: 15px; }
.btn-google { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-google:hover { background: var(--tint); }
.btn-apple { background: var(--apple-bg); color: var(--apple-ink); }
.btn-apple:hover { opacity: 0.9; }
.i-brand { width: 22px; height: 22px; }
.i .g1 { fill: var(--g-blue); }
.i .g2 { fill: var(--g-green); }
.i .g3 { fill: var(--g-yellow); }
.i .g4 { fill: var(--g-red); }
.i .f { fill: currentColor; }
.btn-oauth.is-busy .i-brand { display: none; }
.or { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s6); color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-mail { margin-top: var(--s4); }

/* выбор языка */
.pick-row {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: var(--tap); padding: 0 var(--s4);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-field); background: var(--field); text-align: start;
}
.pick-row:hover { background: var(--tint); }
.pick-label { flex: 1; font-size: 14px; font-weight: 700; color: var(--muted); }
.pick-value { font-weight: 700; }
.pick-row .i { color: var(--muted); width: 20px; height: 20px; }
.lang-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.lang-row {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-field); background: var(--field); font-weight: 700; cursor: pointer;
}
.lang-row input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.lang-row .lang-ok { width: 18px; height: 18px; color: var(--cobalt); visibility: hidden; }
.lang-row:has(input:checked) { border-color: var(--cobalt); background: var(--check-on); }
.lang-row:has(input:checked) .lang-ok { visibility: visible; }
.lang-row:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ─── вход и создание компании ─── */
.auth { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-art { height: 72px; flex: none; background: var(--mz-hero) left top / auto 72px repeat-x; }
.auth-art .art-copy, .auth-art .art-mosaic { display: none; }
.auth-main { width: 100%; max-width: 448px; margin: 0 auto; padding: var(--s4) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s6); }
.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.lead { margin-top: var(--s2); color: var(--muted); font-size: 16px; line-height: 1.45; }
.link-switch { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: var(--s4); font-weight: 700; text-decoration: none; }
.link-switch:hover { text-decoration: underline; }
.notice { display: flex; gap: var(--s3); align-items: flex-start; margin: var(--s5) 0 var(--s4); padding: var(--s4); border-radius: var(--r-row); background: var(--tint); line-height: 1.45; }
.demo-badge {
  display: inline-flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); padding: 6px 12px;
  border-radius: 14px; background: var(--tint); color: var(--muted); font-size: 13px; line-height: 1.3;
}
.demo-badge b { color: var(--ink); }
.demo-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); flex: none; align-self: flex-start; margin-top: 5px; }

@media (min-width: 900px) {
  .auth { flex-direction: row; }
  .auth-art {
    position: sticky; top: 0; height: 100dvh; flex: 0 0 44%; max-width: 620px;
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--s6);
    padding: var(--s6); background: var(--navy); color: var(--on-navy);
  }
  .auth-art .art-mosaic { display: block; flex: 1; max-height: 420px; border-radius: 28px; background: var(--mz-hero-sq) center / cover no-repeat; }
  .auth-art .art-copy { display: flex; flex-direction: column; gap: var(--s3); }
  .art-name { font-size: 36px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; margin-top: var(--s2); }
  .art-tag { font-size: 18px; line-height: 1.45; color: var(--on-navy-2); max-width: 30ch; }
  .auth-main { align-self: center; padding: var(--s6); max-width: 480px; }
  .auth-top .logo { visibility: hidden; }
}

/* ─── оболочка ─── */
.shell { min-height: 100dvh; }
.side { display: none; }
.page { padding: 0 var(--s4) calc(112px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: var(--s2); padding-top: calc(var(--s3) + env(safe-area-inset-top)); }
.company-pill {
  display: flex; align-items: center; gap: 10px; min-width: 0; height: var(--tap); padding-inline: 6px 18px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
}
.letter { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--yellow); color: var(--navy); font-size: 18px; font-weight: 800; }
.cname { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding-top: var(--s5); }
.h-row { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.h-row .mark { width: 36px; height: 36px; }
.sub { margin-top: 2px; color: var(--muted); font-size: 15px; }
.sub::first-letter { text-transform: uppercase; }
.grid { display: flex; flex-direction: column; gap: var(--s4); }
.col { display: contents; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; }
.only-wide { display: none; }

.hero { border-radius: var(--r-card); background: var(--hero); color: var(--on-navy); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--hero-line); }
.hero-body { padding: 20px 20px var(--s4); display: flex; flex-direction: column; align-items: flex-start; }
.hero h2 { font-size: 16px; font-weight: 700; color: var(--on-navy-2); }
.hero-num { margin-top: 6px; font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }
.hero-delta { display: flex; align-items: center; gap: var(--s2); margin-top: 10px; font-size: 14px; color: var(--on-navy-2); }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 800; }
.chip-up { background: var(--up-bg); color: var(--up-ink); }
.hero .chip-up { background: var(--sky); color: var(--navy); }
.hero-line { margin-top: 6px; font-size: 15px; color: var(--on-navy-2); }
.hero-delta + .hero-line { margin-top: var(--s4); }
.hero-text { margin-top: var(--s2); font-size: 15px; line-height: 1.45; color: var(--on-navy-2); max-width: 46ch; }
.hero .btn-yellow { margin-top: var(--s4); }
.hero-mosaic { height: 56px; background: var(--mz-hero) left bottom / auto 56px repeat-x; }

.card { padding: var(--s4); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--card-line); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 32px; margin-bottom: var(--s1); }
.count { min-width: 26px; height: 26px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-pill); background: var(--yellow); color: var(--navy); font-size: 13px; font-weight: 800; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: var(--s3); min-height: 68px; padding: 10px var(--s1); color: var(--ink); text-decoration: none; border-radius: var(--r-row); }
a.row { margin: 0 calc(var(--s2) * -1); padding: 10px var(--s2); transition: background-color 140ms var(--ease); }
a.row:hover { background: var(--tint); }
.row-ic { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--tint); }
.row-ic .i { width: 26px; height: 26px; }
.row-ic.tone-warn { background: var(--warn-bg); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-text b { font-size: 15px; font-weight: 700; line-height: 1.3; }
.row-text > span { font-size: 14px; color: var(--muted); line-height: 1.35; }
.row-num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.row-num b { font-size: 16px; font-weight: 800; white-space: nowrap; }
.row-num span { font-size: 13px; font-weight: 700; }
.up { color: var(--in); }
.down { color: var(--out); }
.flat { color: var(--muted); }
.row-go { color: var(--muted); width: 20px; height: 20px; }
.empty { padding: var(--s2) 0 var(--s1); color: var(--muted); font-size: 15px; line-height: 1.45; }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s2); }
.flow-cell { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r-row); background: var(--tint); min-width: 0; }
.flow-cell .i { width: 30px; height: 30px; }
.flow-cell span { font-size: 14px; color: var(--muted); }
.flow-cell b { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.flow .in { color: var(--in); }
.flow .out { color: var(--out); }
.soon { display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: 40px var(--s5); text-align: center; }
.soon p { color: var(--muted); max-width: 40ch; line-height: 1.45; }
.tag { flex: none; padding: 4px 10px; border-radius: var(--r-pill); background: var(--tint); color: var(--muted); font-size: 12px; font-weight: 700; }
.row.is-off .row-text b { color: var(--muted); }

/* ─── «Долги» ─── */
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.min0 { min-width: 0; }
.btn-new { background: var(--yellow); border-color: transparent; color: var(--navy); }
.btn-new:hover { background: var(--yellow); }
.btn-new .i .s { stroke-width: 2.6; }
.chip-late { background: var(--late-bg); color: var(--late-ink); }
.count-late { background: var(--late-bg); color: var(--late-ink); }
.letter-sm { width: 44px; height: 44px; font-size: 17px; }
.hero-act { margin-top: var(--s4); min-height: 48px; padding: 0 20px; }
.back-link { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 6px; min-height: 44px; margin: calc(var(--s3) * -1) 0 var(--s2); font-weight: 700; text-decoration: none; }
.back-link .i { width: 20px; height: 20px; }
.h-name { overflow-wrap: anywhere; }
.notice-warn { margin: 0; align-items: center; background: var(--warn-bg); font-size: 14px; font-weight: 600; }
@media (max-width: 359px) {
  .seg-3 .seg-item span { font-size: 13px; padding: 0 4px; letter-spacing: -0.01em; }
  :lang(fr) .bottom .nav-item, :lang(hy) .bottom .nav-item, :lang(ka) .bottom .nav-item { letter-spacing: -0.03em; }
}
.d-sort { margin: var(--s2) 0 var(--s2); }
.d-row { min-height: 72px; }
.d-row .row-text > span { font-weight: 600; }
.d-row .row-text > span.down + span.down { font-size: 13px; }
.d-num { text-align: end; }
.d-num span { font-weight: 700; font-size: 12px; }
.d-head, .d-wide { display: none; }
.d-total { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; padding: var(--s3) var(--s1) 0; border-top: 2px solid var(--line-strong); font-weight: 800; }
.d-total > b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-total > span:empty { display: none; }
.d-total b.down, .d-total b.up { display: none; }
.mv-row { min-height: 60px; }
.mv-note { margin-top: var(--s3); }
.empty-block { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s3) 0 var(--s2); }
.empty-block h3 { margin: var(--s2) 0 0; font-size: 18px; font-weight: 800; }
.empty-block p { color: var(--muted); line-height: 1.45; max-width: 52ch; }
.load-err { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); padding: var(--s3); border-radius: var(--r-field); background: var(--err-bg); color: var(--err); font-weight: 600; }
.load-err span { flex: 1; min-width: 12ch; }
.skel .row-ic, .skel b, .skel .row-text > span { background: var(--skel); border-radius: 8px; }
.skel b { width: 58%; height: 15px; }
.skel .row-text > span { width: 34%; height: 12px; }
.skel-line { width: 62%; border-radius: 12px; background: var(--nav-pill); }
.seg-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); border-radius: var(--r-row); }
.seg-wrap .seg-item span { border-radius: 12px; font-size: 14px; padding: 6px var(--s2); }
.readout b.clip { min-width: 0; max-width: 60%; }
@media (min-width: 960px) {
  .d-grid { display: grid; grid-template-columns: 44px minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) 20px; align-items: center; column-gap: var(--s4); }
  .d-head { display: grid; padding: var(--s3) var(--s1) var(--s2); color: var(--muted); font-size: 13px; font-weight: 700; }
  .d-head span:nth-child(n+3) { text-align: end; }
  .d-wide { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .d-wide b { font-size: 15px; }
  .d-sub { font-size: 13px; color: var(--muted); font-weight: 700; }
  .d-row .row-text > span.down { display: none; }
  .d-total { display: grid; padding-inline: var(--s1); }
  .d-total > span:empty { display: block; }
  .d-total b.down, .d-total b.up { display: inline; }
  .d-total > b, .d-total .d-wide { text-align: end; }
  .d-sort { max-width: 420px; }
}

/* нижняя панель телефона */
.bottom.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bottom {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
  padding: var(--s2) var(--s1) calc(var(--s2) + env(safe-area-inset-bottom));
  background: var(--navy);
  --ic-a: var(--nav-icon); --ic-w: var(--navy); --ic-d: var(--white);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 56px; padding: 0;
  min-width: 0; border: 0; background: transparent; color: var(--on-navy-2); font-size: 12px; font-weight: 700; text-decoration: none; text-align: center; line-height: 1.15;
}
.nav-item span { max-width: 100%; }
@media (max-width: 359px) {
  .bottom { padding-inline: 2px; }
  .bottom .nav-item { font-size: 11px; letter-spacing: -0.02em; }
}
:lang(hy) .bottom .nav-item, :lang(ka) .bottom .nav-item { font-size: 11px; letter-spacing: -0.01em; }
.nav-item .i { width: 56px; height: 32px; padding: 3px 14px; border-radius: var(--r-pill); }
.nav-item[aria-current="page"] { color: var(--yellow); }
.nav-item[aria-current="page"] .i { background: var(--nav-pill); }
.nav-new {
  justify-self: center; width: 64px; height: 64px; margin-top: -30px; margin-bottom: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  border: 0; border-radius: 50%; background: var(--yellow); color: var(--navy); box-shadow: var(--shadow-new);
  transition: transform 140ms var(--ease);
}
.nav-new:active { transform: scale(0.95); }
.nav-new .i { width: 30px; height: 30px; }
.nav-new .i .s { stroke-width: 2.6; }

/* компьютер: боковое меню */
.only-phone { display: inline-flex; }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .side {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--s1);
    padding: var(--s5) var(--s4); background: var(--navy); color: var(--on-navy);
    --ic-a: var(--nav-icon); --ic-w: var(--navy); --ic-d: var(--white);
  }
  .side-logo { display: flex; align-items: center; gap: 10px; padding: 0 var(--s2) var(--s5); font-size: 18px; font-weight: 800; }
  .side-list { display: flex; flex-direction: column; gap: var(--s1); }
  .side .nav-item {
    position: relative; flex-direction: row; gap: var(--s3); min-height: 48px; padding: 0 14px;
    border-radius: var(--r-row); color: var(--on-navy); font-size: 15px; text-align: start;
  }
  .side .nav-item .i { width: 24px; height: 24px; padding: 0; background: none; }
  .side .nav-item:hover { background: var(--nav-pill); }
  .side .nav-item[aria-current="page"] { background: var(--blue); color: var(--on-navy); }
  .side .nav-item[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -10px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); transform: translateY(-50%); }
  .side .nav-new { width: 100%; height: 48px; margin: var(--s4) 0 0; border-radius: var(--r-pill); font-size: 15px; font-weight: 800; box-shadow: none; }
  .side .nav-new .i { width: 22px; height: 22px; }
  .side .side-menu { margin-top: auto; }
  .side-mosaic { height: 62px; margin-top: var(--s4); border-radius: var(--r-row); background: var(--mz-side) left top / auto 62px repeat-x; }
  .bottom, .only-phone { display: none; }
  .page { padding: 0 var(--s6) var(--s6); width: 100%; }
  .top { padding-top: var(--s5); }
  .content { padding-top: var(--s6); }
  .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s5); align-items: start; }
  .col { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
  .only-wide { display: inline-flex; }
  .card { padding: 20px; }
  .hero-body { padding: var(--s5) var(--s5) 20px; }
  .hero-num { font-size: 48px; }
}

/* окна */
.sheet {
  margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92dvh; padding: 0;
  border: 0; border-radius: var(--r-card) var(--r-card) 0 0; background: var(--surface); color: var(--ink);
  overflow: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: var(--backdrop); }
.sheet[open] { animation: sheet-in 260ms var(--ease); }
.sheet-in { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.sheet-head h2 { font-size: 22px; }
.sheet .form { margin-top: 0; }
.sheet .lead { margin-top: 0; }
.menu-company { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-row); background: var(--tint); min-width: 0; }
.menu-company div { display: flex; flex-direction: column; min-width: 0; }
.menu-company span:not(.letter) { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.version { text-align: center; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: var(--s3); }
.actions .btn { flex: 1; padding: 0 var(--s4); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .sheet { margin: auto; max-width: 460px; border-radius: var(--r-card); }
  .sheet-in { padding: var(--s5); }
}

/* «Клиенты»: поиск по списку, отметки, карточка (контакты, условия, точки), окно «Новый клиент» с предупреждением о похожих */
.h-row-act { flex-wrap: wrap; }
.h-row-act .min0 { flex: 1; }
.cl-add { min-height: 48px; padding: 0 20px; flex: 1 1 100%; }
.empty-block .cl-add { flex: none; margin-top: var(--s2); }
.cl-search { margin-bottom: var(--s2); }
.cl-search input { padding-inline-start: 44px; }
.cl-search .control::before {
  content: ""; position: absolute; inset-inline-start: 16px; top: 50%; width: 14px; height: 14px; margin-top: -9px;
  border: 2px solid var(--muted); border-radius: 50%; pointer-events: none;
}
.cl-search .control::after {
  content: ""; position: absolute; inset-inline-start: 29px; top: 50%; width: 7px; height: 2px; margin-top: 5px;
  background: var(--muted); border-radius: 1px; transform: rotate(45deg); pointer-events: none;
}
.cl-search input::-webkit-search-cancel-button { cursor: pointer; }
.cl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.h-row .cl-tags { margin: 6px 0 0; }
.kv { display: grid; gap: var(--s3); margin: 0 0 var(--s3); }
.kv div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv dt { font-size: 13px; font-weight: 700; color: var(--muted); }
.kv dd { margin: 0; min-height: 44px; display: flex; align-items: center; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.kv-grid { display: grid; gap: var(--s2); }
.cl-tel { color: var(--link); font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.row-text .cl-tel { align-self: flex-start; min-height: 44px; margin-block: -8px; }
.row-text b.wrap { overflow-wrap: anywhere; }
.cl-note { margin-top: var(--s3); line-height: 1.45; overflow-wrap: anywhere; }
.cl-note b { color: var(--ink); }
.cl-money { margin-top: var(--s4); justify-content: space-between; }
.cl-money .i-end { margin-inline-start: auto; }
.similar { padding: var(--s3); border-radius: var(--r-row); background: var(--warn-bg); }
.similar-t { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s1); }
.similar .row { min-height: 56px; }
.similar .rows li + li { border-top-color: var(--line-strong); }
@media (min-width: 640px) { .h-row-act .cl-add { flex: none; } .kv { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } .kv-grid { grid-template-columns: 1fr 1fr; } }

/* «Клиенты» 2: отбор, звонок из строки, долг с подписью, цвет кружка по состоянию, правка карточки, точек и контактов */
.pills { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer;
}
.pill input:checked + span { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.pill input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.cl-flt { margin-bottom: var(--s2); }
.cl-li { display: flex; align-items: center; gap: var(--s1); }
.cl-li > .row { flex: 1; min-width: 0; }
.cl-call { flex: none; color: var(--link); }
.cl-call .i { width: 20px; height: 20px; }
.cl-call-gap { width: 44px; flex: none; }
.row-text > .cl-debt { color: var(--muted); }
.cl-debt b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.cl-debt .down, .cl-debt b { white-space: nowrap; }
.letter-late { background: var(--late-bg); color: var(--late-ink); }
.letter-bad { background: var(--late-bg); color: var(--late-ink); box-shadow: inset 0 0 0 2px var(--late-ink); }
.cl-tel { gap: 6px; }
.cl-tel .i { width: 18px; height: 18px; }
.cl-map { text-decoration: none; }
.cl-money-num { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cl-money-line { margin: var(--s2) 0 var(--s3); }
.cl-money-card .readout { margin-bottom: var(--s1); }
.cl-add-part { margin-top: var(--s2); }
.cl-archive { margin-top: var(--s1); }
.check-wide { width: 100%; }
.checks-one { grid-template-columns: 1fr; }
.checks-week { grid-template-columns: repeat(4, 1fr); }
.check-day { justify-content: center; padding: 0 var(--s1); gap: 6px; }
.btn-danger { color: var(--err); }
.btn.btn-danger { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.hide-box { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.hide-sure { display: flex; flex-direction: column; gap: var(--s2); width: 100%; padding: var(--s3); border-radius: var(--r-row); background: var(--err-bg); }
.hide-sure p { margin: 0; font-weight: 600; line-height: 1.4; }
.hide-sure[hidden] { display: none; }
@media (min-width: 640px) { .checks-week { grid-template-columns: repeat(7, 1fr); } }

.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom)); max-width: min(420px, calc(100vw - 32px));
  padding: var(--s3) var(--s4); border-radius: var(--r-row); background: var(--navy); color: var(--on-navy); font-size: 15px; font-weight: 600;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: var(--s5); } }

.fatal { min-height: 100dvh; display: grid; place-items: center; padding: var(--s4); }
.fatal-box { display: flex; flex-direction: column; align-items: center; gap: var(--s4); text-align: center; max-width: 360px; }
.loading { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms; animation-iteration-count: 1; transition-duration: 1ms; }
  .btn.is-busy::after { animation: spin 1.6s linear infinite; }
}
