/* «Сводка» — кабинет владельца сети винных магазинов (ARCHITECTURE.md §6.4).
   Идея: тёмно-синий лист сверху с главной цифрой раздела и «пульсом дня», ниже — спокойные списки.
   Цвета: ночь и янтарь — фирменные (иконка), рост — «лоза», падение — «бордо», вторичный текст — «пробка».
   Один шрифт — Onest (OFL, лежит в /static/fonts), цифры моноширинные, чтобы суммы стояли столбиком. */

@font-face { font-family: "Onest"; font-weight: 400; font-display: swap;
  src: url("fonts/onest-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap;
  src: url("fonts/onest-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191-2193, U+2212, U+2215, U+25B2, U+25BC, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap;
  src: url("fonts/onest-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap;
  src: url("fonts/onest-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191-2193, U+2212, U+2215, U+25B2, U+25BC, U+FEFF, U+FFFD; }

:root {
  --night: #0E1A3A;          /* фирменный тёмно-синий: лист сверху */
  --night-raised: #1B2B58;   /* поля и переключатели на листе */
  --on-night: #EEF1F8;
  --on-night-dim: #9EA9C8;
  --amber: #FF8C1A;          /* единственный акцент: пульс, выбранное */
  --amber-ink: #2B1600;
  --amber-soft: #B45A00;     /* янтарный текст на светлом */
  --paper: #F4F5F9;
  --surface: #FFFFFF;
  --ink: #141B33;
  --cork: #7C7468;           /* вторичный текст — тёплый «пробковый» серый */
  --rule: #E0E2EA;
  --vine: #3E8E5A;           /* рост */
  --bordeaux: #A8243D;       /* падение, минус */
  --vine-night: #7FCF9A;
  --bordeaux-night: #FF97AA;
  --nav-h: 58px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --night: #15244D; --night-raised: #22356A;
    --paper: #0A1129; --surface: #111A36; --ink: #E8ECF6; --cork: #A79E91; --rule: #222D50;
    --vine: #6CC08A; --bordeaux: #F07A8E; --amber-soft: #FFAE5C;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.45 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
a { color: inherit; }
p { margin: 0; }
h1 { font-size: 25px; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 17px; line-height: 1.3; margin: 0 0 4px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.product-suggestions { list-style: none; margin: 6px 0 12px; padding: 4px; max-height: 300px; overflow: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 12px; }
.product-suggestions li { padding: 10px 12px; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; }
.product-suggestions li:hover, .product-suggestions [aria-selected="true"] { background: var(--paper); outline: 2px solid var(--amber); outline-offset: -2px; }
@media (max-width: 767px) { .product-suggestions { max-height: 144px; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- лист сверху ---------- */
.sheet {
  background: var(--night); color: var(--on-night);
  border-radius: 0 0 28px 28px;
  padding: env(safe-area-inset-top) 0 22px;
}
.sheet > *, main { max-width: 720px; margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)); }
.top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; }
.top-actions { display: flex; margin-right: -10px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--on-night-dim); }
.icon-btn:hover { color: var(--on-night); }

.fresh { font-size: 13px; color: var(--on-night-dim); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fresh::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--vine-night); flex: none; }
.fresh-warn::before { background: var(--amber); }
.fresh-warn { color: #FFC48A; }
.fresh-alert::before { background: var(--bordeaux-night); }
.fresh-alert { color: var(--bordeaux-night); font-weight: 700; }

/* выбор магазина и периода */
.pickers { margin-top: 2px; }
.store-pick select, .store-one {
  width: 100%; min-height: 46px; font: inherit; font-size: 17px; font-weight: 700;
  color: var(--on-night); background: var(--night-raised); border: 0; border-radius: 14px; padding: 0 44px 0 14px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%239EA9C8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.store-one { display: flex; align-items: center; background-image: none; }
.chips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 12px auto 0; padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chips a {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border-radius: 20px; border: 1px solid rgba(255, 255, 255, .14); color: var(--on-night-dim);
  text-decoration: none; font-size: 15px; white-space: nowrap;
}
.chips a[aria-current] { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.dates label { font-size: 13px; color: var(--on-night-dim); margin: 0; }
.dates input { width: 100%; margin-top: 4px; background: var(--night-raised); color: var(--on-night); border: 0; color-scheme: dark; }
.dates button { grid-column: 1 / -1; background: var(--on-night); color: var(--night); border: 0; font-weight: 700; }
.period { font-size: 13px; color: var(--on-night-dim); margin-top: 8px; }
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 4px; background: var(--night-raised);
  border-radius: 14px; padding: 4px; margin-top: 4px; margin-bottom: 10px; }
/* вкладки — той же ширины и по центру, что и остальные блоки листа (на широком экране не растягиваются влево) */
.sheet > .tabs { width: calc(min(720px, 100%) - 2 * max(var(--gutter), env(safe-area-inset-left))); margin-inline: auto;
  padding-inline: 4px; }
/* вкладок может быть много (Товары) — равные ячейки сеткой; длинное название переносится внутри своей ячейки */
.tabs a { padding: 6px 8px; line-height: 1.15; text-align: center; min-height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; text-decoration: none; color: var(--on-night-dim); font-size: 14px; }
.tabs a[aria-current] { padding-inline: 4px; }
.tabs a[aria-current] { background: var(--on-night); color: var(--night); font-weight: 700; }

/* главная цифра раздела */
.hero { margin-top: 20px; }
.hero-label { font-size: 15px; color: var(--on-night-dim); }
.hero-num { font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 6px; }
.hero-name { font-size: 28px; font-weight: 700; margin: 2px 0 4px; }
.hero-sub, .hero-cmp { font-size: 15px; color: var(--on-night-dim); margin-top: 2px; }
.cmp { font-weight: 700; }
.cmp.up { color: var(--vine); }
.cmp.down { color: var(--bordeaux); }
.sheet .cmp.up { color: var(--vine-night); }
.sheet .cmp.down { color: var(--bordeaux-night); }
.sheet .cmp:not(.up):not(.down) { color: var(--on-night); }

/* пульс дня */
.pulse { margin: 16px 0 0; }
.pulse svg { display: block; width: 100%; height: auto; overflow: visible; }
.pulse-base { stroke: rgba(255, 255, 255, .14); stroke-width: 1; }
.pulse-yday { fill: none; stroke: var(--on-night-dim); stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .8; }
.pulse-now { stroke: rgba(255, 255, 255, .22); stroke-width: 1; stroke-dasharray: 2 3; }
.pulse-today { fill: none; stroke: var(--amber); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.pulse-today.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s cubic-bezier(.3, .7, .2, 1) .15s forwards; }
.pulse-dot { fill: #fff; stroke: var(--amber); stroke-width: 2; }
.pulse-hour { fill: var(--on-night-dim); font-size: 9px; text-anchor: middle; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.pulse-legend { display: flex; gap: 16px; font-size: 13px; color: var(--on-night-dim); margin-top: 6px; }
.pulse-legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-today::before { content: ""; width: 16px; height: 3px; border-radius: 2px; background: var(--amber); }
.key-yday::before { content: ""; width: 16px; height: 0; border-top: 2px dashed var(--on-night-dim); }
.versus { margin: 14px 0 0; }
.versus div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.versus dt { color: var(--on-night-dim); font-size: 15px; }
.versus dd { margin: 0; font-weight: 700; text-align: right; }
.versus .versus-full dt, .versus .versus-full dd { font-size: 14px; font-weight: 400; color: var(--on-night-dim); }
.chart { position: relative; height: 170px; margin-top: 16px; }

/* ---------- списки под листом ---------- */
main { padding-top: 6px; }
.block { margin-top: 26px; }
.block > h2 + .note { margin-bottom: 4px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--rule); }
.line {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  min-height: 54px; padding: 10px 0; text-decoration: none; color: inherit;
}
.line-main { min-width: 0; overflow-wrap: anywhere; }
.line-num { margin-left: auto; text-align: right; white-space: nowrap; font-weight: 700; }
.line-note { display: block; font-size: 13px; font-weight: 400; color: var(--cork); margin-top: 1px; }
.weekday { color: var(--cork); font-size: 14px; }
.bar { display: block; width: 100%; height: 2px; margin-top: -2px; }
.bar rect { fill: var(--amber); opacity: .6; }
.neg { color: var(--bordeaux); }
.note { font-size: 13px; color: var(--cork); margin-top: 8px; }
.empty { padding: 18px 0; color: var(--cork); border-bottom: 0 !important; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.6; padding: 0 8px; border-radius: 10px;
  background: rgba(255, 140, 26, .16); color: var(--amber-soft); vertical-align: 2px; }
.sheet .badge { color: #FFB872; background: rgba(255, 140, 26, .2); }

/* данные неполные / раздел недоступен (ARCHITECTURE.md §11.3) */
.data-note { margin: 16px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px;
  background: rgba(255, 140, 26, .12); color: var(--amber-soft); }
.data-note a { font-weight: 700; }
.view-as { margin: 16px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: var(--bordeaux); color: #fff; }
.levels { list-style: none; padding: 0; margin: 8px 0 0; }
.levels li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.state { display: inline-block; font-size: 12px; font-weight: 700; padding: 0 8px; border-radius: 10px; line-height: 1.7; }
.state-ok { background: rgba(62, 142, 90, .15); color: var(--vine); }
.state-partial { background: rgba(255, 140, 26, .16); color: var(--amber-soft); }
.state-none { background: rgba(124, 116, 104, .16); color: var(--cork); }
.todo { margin-top: 6px; font-size: 14px; }
.store-states { font-size: 13px; color: var(--cork); margin-top: 4px; }

/* раскрытие строки: внутреннее — с янтарной чертой слева */
details.drill > summary, details.fold > summary { list-style: none; cursor: pointer; }
details.drill > summary::-webkit-details-marker, details.fold > summary::-webkit-details-marker { display: none; }
details.drill > summary::after, details.fold > summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid var(--cork); border-bottom: 2px solid var(--cork);
  transform: rotate(-45deg); transition: transform .15s;
}
details[open] > summary::after { transform: rotate(45deg); }
details.drill[open] > summary .line-main { font-weight: 700; }
.drill-body { margin: 0 0 14px 2px; padding-left: 14px; border-left: 2px solid var(--amber); }
.list-sub > li { border-bottom-style: dashed; }
.list-sub .line { min-height: 44px; padding: 8px 0; }
.list-sub .line-num { font-weight: 400; }
details.fold { border-bottom: 1px solid var(--rule); }
details.fold > summary { display: flex; align-items: center; gap: 8px; min-height: 52px; }
details.fold > summary h2 { margin: 0; }
details.fold > summary .count { color: var(--cork); margin-right: auto; }
.block-aside { border: 1px dashed var(--rule); border-radius: 18px; padding: 14px 14px 4px; }
.block-aside .list > li:last-child { border-bottom: 0; }

/* Mobile home: clearly recognizable disclosure; informational unknowns are neutral. */
.home-compare > h2 { margin-bottom:12px; }
.home-compare .home-inline-insights { padding-top:0; }
.home-compare .home-inline-insights > .hero { margin-top:4px; }
.home-compare .home-inline-insights .versus { margin-top:12px; }
details.home-accordion { border:1px solid var(--rule); border-radius:14px; background:var(--surface); margin:0 0 10px; }
details.home-accordion > summary { display:flex; align-items:center; min-height:56px; padding:12px 16px;
  gap:12px; list-style:none; cursor:pointer; font-weight:700; color:var(--ink); }
details.home-accordion > summary::-webkit-details-marker { display:none; }
details.home-accordion > summary::after { content:""; flex:none; width:9px; height:9px;
  margin:0 4px 4px 0; border-right:2px solid var(--cork);
  border-bottom:2px solid var(--cork); transform:rotate(45deg); transition:transform .18s; }
details.home-accordion[open] > summary::after { transform:rotate(225deg); margin-top:7px; margin-bottom:0; }
details.home-accordion > summary:focus-visible { outline:2px solid var(--amber); outline-offset:2px; border-radius:14px; }
.home-accordion-hint { margin-left:auto; color:var(--cork); font-size:13px; font-weight:400; }
.home-accordion-open, details.home-accordion[open] .home-accordion-closed { display:none; }
details.home-accordion[open] .home-accordion-open { display:inline; }
details.home-accordion[open] .home-accordion-hint { opacity:.8; }
details.home-accordion .drill-body { padding-right:14px; margin:8px 12px 16px; }
/* Unknown schedules/coverage are diagnostics, not orange incidents. */
.home-diagnostics-neutral .data-note {
  color:var(--ink); background:transparent; border:0;
  border-left:2px solid var(--rule); border-radius:0;
  padding:4px 10px; margin:6px 0; font-weight:400;
}
.home-quality-technical > summary { color:var(--ink); font-size:14px; }
.home-quality-technical > .home-diagnostics-neutral { padding:4px 6px 12px 8px; }
.home-real-alert { padding:12px 14px; border-left:3px solid var(--amber);
  background:rgba(255,140,26,.10); border-radius:10px; }
.home-real-alert p { margin:0; }
.home-inline-insights > .hero:empty { display:none; }

/* ---------- формы ---------- */
label { display: block; font-size: 14px; color: var(--cork); margin: 12px 0; }
input:not([type=hidden]):not([type=date]):not([type=checkbox]):not([type=radio]), .dates input {
  display: block; width: 100%; min-height: 46px; margin-top: 4px; padding: 0 14px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 12px;
}
.dates input { padding: 0 10px; }
.search { margin-top: 8px; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 12px; cursor: pointer; text-decoration: none; margin: 6px 0;
}
.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }
.quiet { background: none; border: 0; color: var(--cork); text-decoration: underline; padding: 0; min-height: 44px; }
.wide, .more { width: 100%; }
.stack button { margin-top: 4px; }
.error { color: var(--bordeaux); margin: 8px 0; }
.ok { color: var(--vine); margin: 8px 0; }

/* вход и «нет связи» — вся страница тёмная */
body.night { background: var(--night); color: var(--on-night); padding-bottom: 0; }
.door { max-width: 380px; min-height: 100vh; margin: 0 auto; padding: 14vh 24px 32px; display: flex; flex-direction: column; }
.door-mark { width: 84px; height: 42px; margin-bottom: 18px; }
.door h1 { font-size: 31px; margin-bottom: 6px; }
.door-sub { color: var(--on-night-dim); margin-bottom: 18px; }
.door label { color: var(--on-night-dim); }
#email-proof [hidden] { display: none !important; }
.door input:not([type=hidden]) { background: var(--night-raised); border-color: transparent; color: var(--on-night); }
.door button, .door .btn { width: 100%; margin-top: 10px; }
.door .error { color: var(--bordeaux-night); }
.door-note { font-size: 13px; color: var(--on-night-dim); margin-top: auto; padding-top: 32px; }
.door a:not(.btn) { color: var(--on-night); }
.door-hint { font-size: 14px; color: var(--on-night-dim); margin: 10px 0; }
.door .btn.door-vk { background: #0077FF; border-color: #0077FF; color: #fff; font-weight: 700; }
.door .btn.door-yandex { background: #fff; border-color: #fff; color: #000; font-weight: 700; }
.door-wide { max-width: 480px; padding-top: 8vh; }
.door .check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; color: var(--on-night); }
.door .check input { margin-top: 1px; }
.door .quiet { width: auto; color: var(--on-night-dim); }
.share-row { display: flex; gap: 8px; }
.share-row button, .share-row .btn { flex: 1; }
.qr { display: block; width: 200px; height: 200px; margin: 8px auto; background: #fff; padding: 8px; border-radius: 12px; }
.steps { padding-left: 22px; }
.steps > li { margin: 14px 0; }
.steps .btn { display: flex; width: 100%; margin: 10px 0 6px; }
.steps [data-connect-code][hidden], .steps [data-connect-wait][hidden] { display: none; }
.steps [data-connect-wait]:disabled { opacity: .55; cursor: wait; }

/* ---------- нижняя навигация ---------- */
nav.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  background: var(--surface); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom);
}
nav.bottom a {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: var(--nav-h); font-size: 13px; color: var(--cork); text-decoration: none;
}
nav.bottom a[aria-current] { color: var(--ink); font-weight: 700; }
nav.bottom a[aria-current]::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; margin-left: -13px;
  border-radius: 0 0 3px 3px; background: var(--amber);
}

.ios-hint {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px); z-index: 11;
  background: var(--night); color: var(--on-night); border-radius: 16px; padding: 14px 16px; font-size: 15px;
}
.ios-hint .link { background: none; border: 0; color: var(--amber); padding: 0; min-height: 36px; margin: 6px 0 0; font-weight: 700; }

.htmx-request .drill-body { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  .pulse-today.draw { animation: none; stroke-dashoffset: 0; }
  details > summary::after { transition: none; }
}
.spaced { margin-top: 18px; }

/* показатели ядра (Я2–Я13) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; margin: 8px 0 0; }
.kpis div { padding: 10px 0; border-top: 2px solid var(--rule); }
.kpis dt { font-size: 13px; color: var(--cork); }
.kpis dd { margin: 2px 0 0; font-size: clamp(16px, 4.8vw, 20px); font-weight: 700; overflow-wrap: anywhere; }
.kpis dd.cmp, .kpis dd.line-note { font-size: 13px; }
.heat { width: 100%; border-collapse: separate; border-spacing: 2px; margin-top: 8px; table-layout: fixed; }
.heat th { font-size: 11px; font-weight: 400; color: var(--cork); text-align: center; }
.heat th:first-child { width: 22px; }
.heat td { height: 18px; border-radius: 3px; background: var(--rule); }
.heat td.l1 { background: rgba(255, 140, 26, .18); }
.heat td.l2 { background: rgba(255, 140, 26, .36); }
.heat td.l3 { background: rgba(255, 140, 26, .55); }
.heat td.l4 { background: rgba(255, 140, 26, .78); }
.heat td.l5 { background: var(--amber); }
.late { color: var(--bordeaux); }

/* переключатель сети (если у пользователя их несколько) */
.client-pick { margin: 0 0 10px; }
.client-pick select { width: 100%; min-height: 40px; font: inherit; font-size: 15px; color: var(--on-night);
  background: transparent; border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 0 12px; }

/* «Настройки» владельца */
.check { display: flex; gap: 12px; align-items: center; font-weight: 400; color: var(--ink); font-size: 16px; min-height: 48px; margin: 0; }
.access { border: 1px solid var(--rule); border-radius: 12px; padding: 8px 12px 10px; margin: 0; }
.access legend { font-weight: 700; padding: 0 4px; }
.secret-once code { display: inline-block; font-size: 22px; padding: 10px 14px; background: var(--surface);
  border: 2px solid var(--amber); border-radius: 12px; user-select: all; }

/* Глубокая аналитика (Г1–Г6) */
.block h3 { margin: 18px 0 6px; font-size: 15px; color: var(--cork); font-weight: 600; }
.alert-line .line-main { border-left: 3px solid var(--bordeaux); padding-left: 10px; }

/* «Показ разделов»: по два раздела в ряд на телефоне, по четыре на широком экране */
.sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin-bottom: 10px; }
.sections legend { grid-column: 1 / -1; }
.sections label { margin: 8px 0; }
.sections select { display: block; width: 100%; min-height: 44px; margin-top: 4px; padding: 0 8px; font: inherit;
  font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.sections .note { display: block; margin-top: 4px; }
.auto-ok { color: var(--vine); }
.auto-partial { color: var(--cork); }
.auto-none { color: var(--bordeaux); }
@media (min-width: 720px) { .sections { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* демо-кабинет */
.view-as.demo-note { background: rgba(255, 140, 26, .14); color: var(--ink); border: 1px solid var(--amber);
  font-weight: 500; }
.demo-note a { color: inherit; font-weight: 700; text-decoration-color: var(--amber); text-underline-offset: 3px; }
.demo-note p { margin: 0; }
  font-weight: 600; text-decoration: none; }

/* ---------- прибыль: ячейки и «калькулятор» ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--cork); }
.tile-num { font-size: clamp(19px, 5.6vw, 26px); font-weight: 700; line-height: 1.15; margin-top: 2px; overflow-wrap: anywhere; }
.tile-note { font-size: 13px; color: var(--cork); margin-top: 2px; }
.tile-main { border: 2px solid var(--vine); }
.tile-main.neg { border-color: var(--bordeaux); }
.tile-main.neg .tile-num { color: var(--bordeaux); }
.calc { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 4px 14px; margin: 10px 0 0; }
.calc div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; }
.calc div + div { border-top: 1px solid var(--rule); }
.calc dt { color: var(--ink); min-width: 0; }
.calc dd { margin: 0; font-weight: 700; white-space: nowrap; }
.calc .op { display: inline-block; width: 20px; color: var(--cork); font-weight: 700; }
.calc .calc-sum { border-top: 2px solid var(--ink) !important; }
.calc .calc-sum dt { font-weight: 700; }
.calc .calc-total dd { font-size: 19px; }
.calc .calc-total.neg dd { color: var(--bordeaux); }
.calc .calc-aside dt, .calc .calc-aside dd { color: var(--cork); font-weight: 400; font-size: 14px; }

/* три вида статьи: кнопки-переключатели (radio или отдельные кнопки отправки) */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: 8px 0 4px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; }
.seg label, .seg button { display: flex; align-items: center; justify-content: center; text-align: center; margin: 0;
  min-height: 42px; padding: 4px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1.15; cursor: pointer; }
.seg.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:checked), .seg button[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); font-weight: 700; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--amber); outline-offset: 1px; }
.kind-pick { margin: 4px 0 10px; }
.kind-pick p { font-size: 13px; color: var(--cork); }

/* ---------- «Настройки»: ячейки ---------- */
/* галочки и переключатели — обычного размера (общий стиль полей их больше не растягивает) */
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; margin: 0; flex: none; accent-color: var(--amber); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 4px 16px; margin-top: 10px; }
.card > h2 { margin: 12px 0 2px; }
.card > .note:first-child, .card > h2 + .note { margin-top: 2px; margin-bottom: 6px; }
.card .row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; margin: 0;
  color: var(--ink); font-size: 16px; border-top: 1px solid var(--rule); }
.card :is(h2, .note, input[type=hidden]) + :is(.row, .art) { border-top: 0; }
.card .row .row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.card .row .row-note { display: block; font-size: 13px; color: var(--cork); }
/* строка-ссылка: стрелка справа, видно, что она нажимается */
a.row { text-decoration: none; }
a.row::after { content: "›"; flex: none; font-size: 26px; line-height: 1; color: var(--amber-soft); margin-left: auto; }
a.row .row-main { font-weight: 600; }
.card-actions { padding: 10px 0 14px; border-top: 1px solid var(--rule); }
.card-actions button { width: 100%; margin: 0; }
.card .field { margin: 10px 0; color: var(--cork); }
.art { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 12px 0 8px; min-width: 0; }
.art-name { font-weight: 600; color: var(--ink); padding: 0; }
.card details.fold { border-bottom: 0; border-top: 1px solid var(--rule); }
.card details.fold > summary h2 { font-size: 16px; color: var(--amber-soft); }
.art-note { font-size: 13px; color: var(--cork); }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--amber-soft); font-weight: 600; text-decoration: none; }

/* ---------- меню: всплывающие ячейки под значком ---------- */
.top-actions { position: relative; }
.menu-pop > summary { list-style: none; cursor: pointer; }
.menu-pop > summary::-webkit-details-marker { display: none; }
.menu-pop[open] > summary { color: var(--on-night); }
.menu-panel { position: absolute; right: 6px; top: 46px; z-index: 30; width: min(320px, calc(100vw - 24px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 18px; padding: 6px;
  box-shadow: 0 12px 32px rgba(8, 14, 34, .35); }
.menu-who { padding: 10px 12px 8px; font-weight: 700; }
.menu-who span { display: block; font-size: 13px; font-weight: 400; color: var(--cork); }
.menu-row { display: block; position: relative; padding: 11px 36px 11px 12px; border-radius: 12px; text-decoration: none;
  font-weight: 600; background: var(--paper); margin-top: 6px; }
.menu-row span { display: block; font-size: 13px; font-weight: 400; color: var(--cork); }
.menu-row::after { content: "›"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 24px;
  color: var(--amber-soft); }
.menu-row:hover { background: var(--rule); }
.menu-exit { width: 100%; margin: 10px 0 2px; color: var(--bordeaux); font-weight: 700; border-color: var(--bordeaux);
  background: transparent; }

/* выбор магазинов ячейками: можно отметить любые */
.store-multi > summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 46px;
  padding: 0 44px 0 14px; border-radius: 14px; background: var(--night-raised); color: var(--on-night);
  font-size: 17px; font-weight: 700; position: relative; }
.store-multi > summary::-webkit-details-marker { display: none; }
.store-multi > summary::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px;
  margin-top: -6px; border-right: 2px solid var(--on-night-dim); border-bottom: 2px solid var(--on-night-dim);
  transform: rotate(45deg); }
.store-multi[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.store-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
@media (min-width: 560px) { .store-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.store-cell { display: flex; align-items: center; gap: 8px; min-height: 46px; margin: 0; padding: 6px 10px;
  border-radius: 12px; background: var(--night-raised); color: var(--on-night); font-size: 15px; cursor: pointer;
  border: 1px solid transparent; }
.store-cell span { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.store-cell:has(input:checked) { border-color: var(--amber); background: rgba(255, 140, 26, .16); }
.store-all { display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18); color: var(--on-night); text-decoration: none; font-size: 15px; }
.store-cells button { margin: 0; min-height: 46px; }

/* «Уведомления на телефон»: время справа в строке */
/* iPhone растягивает поле времени на всю строку — ширина задана явно, при нехватке места поле уходит под подпись */
.card .row:has(input[type=time]) { flex-wrap: wrap; }
.card .row .row-main { flex: 1 1 12em; }
.card .row input[type=time] { -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 8em; min-width: 0;
  max-width: 8em; min-height: 40px; margin: 0 0 0 auto; padding: 0 8px; text-align: center; font-size: 16px; }
.card h3 { margin: 14px 0 0; }

/* ---------- экраны 1С:Бухгалтерии (web/books.py) ---------- */
.aging { display: block; width: 100%; height: 10px; margin: 12px 0 6px; border-radius: 999px; overflow: hidden; }
.aging-ok { fill: var(--vine-night); }
.aging-d30 { fill: #FFB872; }
.aging-d60 { fill: var(--amber); }
.aging-old { fill: var(--bordeaux-night); }
.aging-unknown { fill: var(--on-night-dim); }
.aging-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.aging-key::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.aging-key-ok::before { background: var(--vine-night); }
.aging-key-d30::before { background: #FFB872; }
.aging-key-d60::before { background: var(--amber); }
.aging-key-old::before { background: var(--bordeaux-night); }
.aging-key-unknown::before { background: var(--on-night-dim); }
.books-left { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(62, 142, 90, .1); color: var(--vine); }
.books-left.neg { background: rgba(168, 36, 61, .08); color: var(--bordeaux); }
.tiles a.tile { display: block; color: inherit; text-decoration: none; }
.tiles .tile-label, .tiles .tile-num, .tiles .tile-note { display: block; }
.tile-note.neg { color: var(--bordeaux); }
.line-num.neg { color: var(--bordeaux); }
.tiles-night .tile { background: var(--night-raised); border-color: transparent; color: var(--on-night); }
.tiles-night .tile-label { color: var(--on-night-dim); }
.tiles-night .tile-num.neg { color: var(--bordeaux-night); }
.badge-ok { color: var(--vine); background: rgba(62, 142, 90, .14); }
.badge-bad { color: var(--bordeaux); background: rgba(168, 36, 61, .12); }
.h2-note { font-size: 14px; font-weight: 400; color: var(--cork); }
.tabs + .tabs { margin-top: 6px; }
.flow-tick-start { text-anchor: start; }
.flow-tick-end { text-anchor: end; }
.hero-num.neg { color: var(--bordeaux-night); }
.access-grid { display: grid; gap: 12px; }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.access-actions button { margin: 0; font-size: 14px; }
nav.tabs:empty { display: none; }

/* Desktop cabinet: persistent navigation and a working area, preserving mobile below 1100px. */
@media (min-width: 1100px) {
  body:has(nav.bottom) { padding-bottom: 24px; --gutter: 28px; }
  body:has(nav.bottom) #page { max-width: 1600px; margin: 0 auto; padding: 0 32px 0 252px; }
  body:has(nav.bottom) .sheet { margin-top: 24px; border-radius: 20px; }
  body:has(nav.bottom) .sheet > *, body:has(nav.bottom) main { max-width: none; }
  body:has(nav.bottom) .sheet > .client-pick { margin-inline: auto; }
  body:has(nav.bottom) main { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; padding: 24px 0; }
  body:has(nav.bottom) main > * { grid-column: 1 / -1; min-width: 0; margin-block: 0; }
  body:has([data-product-search]) main > .block { grid-column: auto; }
  body:has(nav.bottom) main > .block { padding: 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; }
  body:has(nav.bottom) h1 { font-size: 32px; }
  body:has(nav.bottom) .hero-num { font-size: clamp(48px,5vw,72px); }
  body:has(nav.bottom) nav.bottom { left: max(20px,calc((100vw - 1600px)/2 + 20px)); top: 24px; right: auto; bottom: auto; max-height: calc(100dvh - 48px); overflow-y: auto;
    width: 208px; display: flex; flex-direction: column; gap: 6px; padding: 16px 10px; border: 1px solid var(--rule); border-radius: 16px; }
  body:has(nav.bottom) nav.bottom a { flex: 0 0 auto; justify-content: flex-start; padding: 12px 16px; min-height: 48px; font-size: 16px; border-radius: 8px; }
  body:has(nav.bottom) nav.bottom a[aria-current] { background: var(--paper); }
  body:has(nav.bottom) nav.bottom a[aria-current]::before { top: 10px; bottom: 10px; left: 0; width: 3px; height: auto; margin: 0; border-radius: 0 3px 3px 0; }
  body:has(nav.bottom) .access-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body:has(nav.bottom) .line-main { min-width: 0; overflow-wrap: anywhere; }
  body:has(nav.bottom) .line-num { flex-shrink: 0; }
  body:has(nav.bottom) [data-product-search] { max-width: 840px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  body:has(nav.bottom) [data-product-search] > label { grid-column: 1 / -1; }
  body:has(nav.bottom) [data-product-search] .search { grid-column: 1; grid-row: 2; margin: 0; }
  body:has(nav.bottom) [data-product-search] > button { grid-column: 2; grid-row: 2; margin: 0; }
  body:has(nav.bottom) [data-product-search] > ul, body:has(nav.bottom) [data-product-search] > p,
  body:has(nav.bottom) [data-product-search] > a { grid-column: 1 / -1; }
  [data-product-search] > p:empty { display: none; }
}
.progress { display: block; width: 100%; height: 8px; margin: 6px 0 4px; border-radius: 999px; overflow: hidden; }
.progress-bg { fill: var(--rule); }
.progress-done { fill: var(--vine); }
/* Document filters reuse the cabinet form controls, with a compact desktop grid. */
.journal-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:12px;align-items:end;--surface:var(--night-raised);--ink:var(--on-night);--rule:transparent}
.journal-filters label{display:grid;gap:5px;min-width:0;margin:0;color:var(--on-night-dim)}
.journal-filters input,.journal-filters select{width:100%;min-width:0;margin:0;min-height:44px}
.journal-filters select{font:inherit;color:var(--on-night);background:var(--night-raised);border:0;border-radius:12px;padding:8px}
@media(min-width:1100px){body:has(nav.bottom) main>.journal-document{grid-column:auto}}
@media(min-width:1100px){
  body.partner-workspace:not(:has(nav.bottom)) #page{max-width:1360px;margin:auto;padding:0 32px}
  body.partner-workspace:not(:has(nav.bottom)) .sheet{margin-top:24px;border-radius:20px}
  body.partner-workspace:not(:has(nav.bottom)) .sheet>*,body.partner-workspace:not(:has(nav.bottom)) main{max-width:none}
  body.partner-workspace:not(:has(nav.bottom)) main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;padding:24px 0;align-items:start}
  body.partner-workspace main>*{grid-column:1/-1}
  body.partner-workspace main>.card{min-width:0;margin:0;overflow-wrap:anywhere;grid-column:auto}
  body.partner-overview main>.card:first-of-type{grid-column:1/-1}
  body.partner-workspace .stack{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  body.partner-workspace .stack .field{min-width:0;margin:0}
  body.partner-workspace .stack>button,body.partner-workspace .stack>p,body.partner-workspace .stack>.check,body.partner-workspace .stack>label:has(input[type=checkbox]){grid-column:1/-1}
}
.partner-workspace .field select{display:block;width:100%;font:inherit;min-height:46px;padding:0 14px;background:var(--surface);color:var(--ink);border:1px solid var(--rule);border-radius:12px}
.partner-proof { white-space: pre-wrap; overflow-wrap: anywhere; }
.partner-workspace .field textarea { display:block; box-sizing:border-box; width:100%; min-height:110px; font:inherit; padding:12px; background:var(--surface); color:var(--ink); border:1px solid var(--rule); border-radius:12px; resize:vertical; }
.partner-workspace article { padding:12px 0; border-bottom:1px solid var(--rule); }
.partner-record { overflow-wrap:anywhere; min-width:0; }

.partner-workspace .secret-once code { white-space:normal; overflow-wrap:anywhere; word-break:break-word; }
.partner-workspace .share-row { flex-wrap:wrap; }
.partner-workspace .share-row button { flex:1 1 9em; }
@media (min-width:1100px) { .partner-workspace .stack>.field:has(textarea) { grid-column:1/-1; } }

.connection-code { font-size:clamp(2rem,6vw,3rem); font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:.12em; }
.connection-code-scope dd { margin-inline-start:0; overflow-wrap:anywhere; }

/* A bounded catalog list, with per-store details loaded on demand. */
.catalog-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(7rem,auto) minmax(9rem,auto) 1.25rem; gap:16px; align-items:center; padding:14px 0; min-width:0; }
.catalog-row > span { min-width:0; overflow-wrap:anywhere; }
.catalog-head { color:var(--muted); font-size:13px; padding:10px 0; }
.catalog-head > :nth-child(n+2), .catalog-quantity, .catalog-price { text-align:right; font-variant-numeric:tabular-nums; }
.catalog-name strong { font-weight:600; }
.catalog-product { border-bottom:1px solid var(--rule); }
.catalog-product > summary { list-style:none; cursor:pointer; min-height:64px; }
.catalog-product > summary::-webkit-details-marker { display:none; }
/* Exactly one indicator, independent of generic details.drill arrow rules. */
.catalog-product > summary::after {
  content:""; width:9px; height:9px; border-right:2px solid var(--cork);
  border-bottom:2px solid var(--cork); transform:rotate(-45deg);
  justify-self:center; margin-right:3px;
}
.catalog-product[open] > summary::after { transform:rotate(45deg); }
.catalog-product > .drill-body { padding:4px 0 16px; }
.catalog-product > summary:focus-visible { outline:2px solid var(--amber); outline-offset:3px; }
.catalog-results[aria-busy=true] { opacity:.75; }
[data-catalog-retry][hidden] { display:none; }
body:has([data-product-search]) main > .catalog-results { grid-column:1/-1; }
body:has(nav.bottom) [data-product-search] > .catalog-stock-filter { grid-column:1; grid-row:3; max-width:22rem; margin:0; }
.catalog-stock-filter select, .catalog-sort-filter select { display:block; width:100%; min-height:44px; color:inherit; background:var(--surface); border:1px solid var(--rule); border-radius:10px; padding:8px 12px; font:inherit; }
@media (max-width:700px) {
  .catalog-row { grid-template-columns:minmax(0,1fr) minmax(5rem,auto) 1rem; gap:8px 12px; }
  .catalog-head { display:none; }
  .catalog-price { grid-column:1/3; text-align:left; font-size:14px; }
  .catalog-product > summary::after { grid-column:3; grid-row:1/3; }
  .catalog-quantity { max-width:9rem; }
}

.settings-areas { flex-wrap: wrap; overflow: visible; }
/* The short cold-entry intro owns its backdrop; input skips, CSS fails open. */
html { background: #0E1A3A; }
.launch-screen { display: none; position: fixed; inset: 0; z-index: 100;
  place-items: center; background: #0E1A3A; color: #fff; pointer-events: auto; }
.svodka-launching .launch-screen { display: grid; animation: svodka-launch-safety 1800ms step-end forwards; }
.launch-lockup { display: flex; flex-direction: column; align-items: center; gap: 18px; pointer-events: none; }
.launch-lockup svg { width: 120px; height: 60px; }
.launch-lockup svg path { stroke-dasharray: 80; stroke-dashoffset: 80; animation: svodka-line 1000ms ease-out forwards; }
.launch-lockup span { font-size: clamp(28px, 5vw, 40px); font-weight: 700; animation: svodka-name 350ms ease-out both; }
.svodka-launch-ready .launch-screen { animation: svodka-launch-exit 1600ms ease-out forwards; }
@keyframes svodka-line { to { stroke-dashoffset: 0; } }
@keyframes svodka-name { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes svodka-launch-exit { 80% { opacity: 1; } to { opacity: 0; visibility: hidden; } }
@keyframes svodka-launch-safety { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .svodka-launching .launch-screen { display: none; animation: none; }
  .launch-lockup svg path, .launch-lockup span { animation: none; }
}
html[data-device-lock]:not([data-device-lock="ready"]) #page { visibility: hidden; }
.device-lock-cover { display:none; }
html[data-device-lock]:not([data-device-lock="ready"]) .device-lock-cover {
 position:fixed;inset:0;z-index:2147483647;display:flex;flex-direction:column;gap:24px;align-items:center;justify-content:center;background:#0E1A3A;color:#fff;
}
.device-lock-cover a { color:#fff;padding:16px; }
/* One focused sign-in surface, using the existing Svodka palette/type. */
.auth-entry-page main { margin:0; max-width:none; padding:0; }
.auth-entry { box-sizing:border-box; width:100%; max-width:420px; min-height:100svh; gap:12px; padding:max(64px,12svh) 28px max(28px,env(safe-area-inset-bottom)); }
.auth-entry h1 { margin:0 0 18px; }
.auth-entry .btn { min-height:54px; display:flex; align-items:center; justify-content:center; margin:0; }
.auth-entry .door-email { background:var(--amber); border-color:var(--amber); color:#0E1A3A; font-weight:700; }
.auth-brand { display:flex; align-items:center; gap:10px; font-size:24px; font-weight:700; text-decoration:none; margin-bottom:20px; }
.auth-back { margin-top:12px; font-size:14px; }
.auth-fallback { margin-top:auto; padding-top:24px; font-size:13px; color:var(--on-night-dim); }
.auth-fallback summary { cursor:pointer; }
.email-otp-code { font-size:28px; letter-spacing:.3em; text-align:center; }
.auth-entry .check { align-items:flex-start; line-height:1.5; }
.auth-entry .check input { width:20px; min-width:20px; height:20px; }
@media(min-width:768px) { .auth-entry { padding-top:16vh; } }
/* Device unlock: same Svodka night/amber identity, no customer data or account chooser. */
body.device-access-page { background:#0E1A3A; color:#fff; }
.device-access-page #page { min-height:100svh; background:#0E1A3A; }
.device-access-page main { width:100%; max-width:none; margin:0; padding:0; }
.device-access { box-sizing:border-box; min-height:100svh; width:min(100%,380px); margin:0 auto; padding:max(28px,env(safe-area-inset-top)) 24px max(22px,env(safe-area-inset-bottom)); display:flex; flex-direction:column; align-items:center; outline:none; }
.device-face-slot > button { width:100%; }
.device-brand { display:flex; align-items:center; gap:10px; font-size:23px; font-weight:700; margin:12px 0 clamp(28px,6svh,58px); }
.device-brand svg { width:42px; height:22px; }
.device-intro { text-align:center; width:100%; }
.device-intro h1 { font-size:27px; line-height:1.2; margin:0 0 12px; color:#fff; }
.device-intro p { min-height:38px; font-size:14px; line-height:1.5; margin:0; color:#b8c1d6; }
.device-dots { display:flex; gap:20px; margin:27px 0 0; height:14px; }
.device-dots span { width:12px; height:12px; border:1.5px solid #9ca9c5; border-radius:50%; transition:background .12s,border-color .12s; }
.device-dots .filled { background:#FF8C1A; border-color:#FF8C1A; }
.device-input-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.device-input-label:focus-within { position:static; width:100%; height:auto; clip-path:none; color:#b8c1d6; margin-top:12px; }
.device-input-label input { max-width:100%; box-sizing:border-box; }
.device-status { box-sizing:border-box; min-height:38px; font-size:13px; line-height:1.5; text-align:center; color:#ffd3a6; margin:12px 0; width:100%; }
.device-keypad { display:grid; width:100%; max-width:312px; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.device-keypad button { box-sizing:border-box; width:100%; height:76px; padding:0; display:grid; place-items:center; border:1px solid #a6b7d13d; border-radius:22px; background:#ffffff08; color:#fff; font-family:inherit; font-size:34px; line-height:1; touch-action:manipulation; -webkit-tap-highlight-color:transparent; transition:background .1s,border-color .1s,transform .1s; }
@media(hover:hover) { .device-keypad button:hover:not(:disabled) { background:#ffffff12; border-color:#a6b7d166; } }
.device-keypad button:active:not(:disabled) { background:#ffffff1c; border-color:#ff8c1a99; transform:scale(.97); }
.device-keypad button:focus-visible,.device-access button:focus-visible,.device-recovery summary:focus-visible { outline:2px solid #FF8C1A; outline-offset:3px; }
.device-keypad .device-face { color:#FF8C1A; }
.device-keypad [hidden] { display:none; }
.device-keypad button:disabled { opacity:.45; }
.device-recovery { margin:26px 0 0; text-align:center; font-size:13px; color:#b8c1d6; }
.device-recovery summary { display:inline; cursor:pointer; list-style:none; padding:8px; }
.device-recovery summary::-webkit-details-marker { display:none; }
.device-recovery p { font-size:13px; line-height:1.5; }
.device-recovery button,.device-skip { color:#c7d0e2; background:transparent; border:0; padding:14px 10px; font-family:inherit; }
.device-biometric-symbol { color:#FF8C1A; margin:40px 0 20px; }
.device-biometric-offer .primary { box-sizing:border-box; width:100%; }
.device-biometric-offer .device-footnote { margin:24px 0 0; text-align:center; color:#9ba8c2; font-size:12px; line-height:1.6; }
@media(max-height:680px) { .device-access { padding-top:20px; } .device-brand { margin:0 0 22px; } .device-keypad { gap:8px 12px; } .device-keypad button { height:60px; border-radius:18px; } .device-dots { margin-top:18px; } .device-status { min-height:26px; margin:8px 0; } .device-recovery { margin-top:16px; } }
@media(prefers-reduced-motion:reduce) { .device-dots span,.device-keypad button { transition:none; } .device-keypad button:active:not(:disabled) { transform:none; } }

/* Business home: compact, independently refreshed analysis. */
.business-comparison { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 12px; padding:12px 0; border-bottom:1px solid var(--rule); }
.business-comparison > span:first-child { flex:1; min-width:150px; }
.business-comparison .note { width:100%; }
.business-days > div { display:grid; grid-template-columns:3rem minmax(20px,1fr) auto; gap:12px; align-items:center; margin:10px 0; font-size:14px; }
.business-day-track { height:6px; background:var(--rule); border-radius:4px; overflow:hidden; }
.business-day-track i { display:block; height:100%; background:var(--amber); }
.business-top { list-style:none; padding:0; counter-reset:rank; }
.business-top li { counter-increment:rank; display:grid; grid-template-columns:24px minmax(0,1fr); gap:4px 8px; padding:12px 0; border-bottom:1px solid var(--rule); }
.business-top li::before { content:counter(rank); grid-row:1/3; color:var(--cork); }
.business-top li span { grid-column:2; color:var(--cork); font-size:14px; }
.business-top strong { overflow-wrap:anywhere; }
#business-analytics .pulse-hour { fill:var(--cork); }
#business-analytics .pulse { margin:16px 0; }
#business-analytics figcaption { color:var(--cork); font-size:13px; }
#business-analytics .card { margin-bottom:16px; }

#home-stores .line-main { min-width:0; overflow-wrap:anywhere; }
#home-stores .line-num { max-width:62%; }
#home-stores .line-num > .line-note { white-space:normal; line-height:1.4; }

/* Revenue, evidence, stores, products: one calm reading order. */
.hero-dynamic { display:flex; flex-wrap:wrap; align-items:baseline; gap:5px 10px; margin:2px 0 12px; color:var(--cork); font-size:12px; }
.hero-dynamic strong { font-size:20px; }
.hero-dynamic:empty,.home-payments:empty { display:none; }
#business-analytics { display:block; }
#business-analytics > .card,#business-analytics > .block { margin:0 0 20px; }
#business-analytics .pulse svg { max-height:180px; }
.business-secondary { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 10px; color:var(--cork); font-size:12px; }
.business-secondary .note { font-size:12px; }
#home-stores .line { min-height:46px; padding:10px 0; }
#home-stores .bar { display:none; }
#home-stores .line-note { font-size:12px; }
.business-top li { padding:9px 0 12px; }
.business-top .top-leader strong { color:var(--amber); }
.popularity { grid-column:2; height:3px; background:var(--rule); border-radius:3px; }
.popularity::before { content:""; display:block; width:var(--share); height:100%; background:var(--amber); border-radius:3px; opacity:.65; }
.business-days { display:flex; align-items:stretch; gap:5px; height:130px; overflow-x:auto; }
.business-days > div { display:flex; flex:1; min-width:16px; flex-direction:column; justify-content:flex-end; gap:6px; margin:0; font-size:10px; }
.business-days > div > span:first-child { order:2; writing-mode:vertical-rl; align-self:center; }
.business-days .business-day-track { height:85px; border-radius:3px; position:relative; background:transparent; }
.business-days .business-day-track i { width:100%!important; height:var(--height); position:absolute; bottom:0; border-radius:3px; }
.business-days strong { display:none; }

/* #180: explicit tablet/desktop composition, scoped to the home. */
.business-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.business-metrics:empty { display:none; }
.hero-calendar-comparison { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px; width:100%; font-size:12px; }
.business-metrics div { display:flex; flex-direction:column; gap:3px; }
.business-metrics span { color:var(--cork); font-size:12px; }
.business-metrics strong { font-size:22px; font-variant-numeric:tabular-nums; }
.business-metrics small { grid-column:1/-1; color:var(--cork); }
.store-payments { font-size:12px; color:var(--cork); margin:0 0 12px; }
.home-chart { margin:12px 0; min-width:0; }
.chart-surface { position:relative; touch-action:pan-y pinch-zoom; user-select:none; -webkit-user-select:none; outline-offset:4px; }
.chart-surface svg { width:100%; display:block; overflow:visible; }
.chart-line { fill:none; stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.chart-line.current { stroke:var(--amber); }
.chart-line.previous { stroke:var(--cork); stroke-dasharray:5 6; }
.chart-axis { fill:var(--cork); font-size:11px; font-variant-numeric:tabular-nums; }
.chart-grid { stroke:var(--rule); stroke-width:1; }
.chart-mark { fill:var(--amber); }
.chart-mark.previous { fill:var(--cork); }
.chart-guide { stroke:var(--cork); stroke-dasharray:3 3; }
.chart-dot { fill:var(--amber); stroke:var(--ink); stroke-width:2; }
.chart-dot.previous { fill:var(--cork); }
.chart-tooltip { display:block; min-height:32px; color:var(--ink); font-size:12px; font-variant-numeric:tabular-nums; pointer-events:none; }
.chart-tooltip[hidden] { display:block; visibility:hidden; }
.chart-compact { display:grid; gap:14px; padding:4px 0; }
.chart-day { display:grid; grid-template-columns:1fr auto; gap:6px 12px; align-items:baseline; }
.chart-day > span { font-size:13px; color:var(--cork); }
.chart-day > strong { font-size:22px; font-variant-numeric:tabular-nums; }
.chart-day > i { grid-column:1/-1; width:var(--share); height:5px; border-radius:3px; background:var(--amber); }
.chart-day:first-child:not(:last-child) > i { background:var(--rule); }
.business-metrics .metric-basis { font-size:10px; line-height:1.35; }
.home-chart figcaption { color:var(--cork); font-size:12px; display:flex; flex-wrap:wrap; gap:8px; }
.legend-current::before,.legend-previous::before { content:""; display:inline-block; width:15px; border-top:2px solid var(--amber); margin-right:5px; vertical-align:middle; }
.legend-previous::before { border-color:var(--cork); border-top-style:dashed; }
.chart-table { margin-top:10px; font-size:12px; }
.chart-table table { width:100%; font-variant-numeric:tabular-nums; }
.business-secondary { padding-top:10px; border-top:1px solid var(--rule); }
.nav-icon { flex:none; }
nav.bottom a { flex-direction:column; gap:4px; min-height:52px; }
nav.bottom a[aria-current] { color:var(--amber); }
@media(min-width:768px) {
  body:has(#business-analytics) main,body:has(#business-analytics) .sheet > * { max-width:none; }
  #business-analytics { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:20px; align-items:start; }
  #business-analytics > * { min-width:0; }
  #business-analytics > .business-insight { grid-column:1/-1; }
  #business-analytics > #home-stores { grid-column:2; grid-row:1; }
  #business-analytics > .business-products { grid-column:1; grid-row:2; }
  #business-analytics > .business-week { grid-column:2; grid-row:2; }
  #business-analytics > .business-insight { grid-row:3; }
  .business-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); max-width:680px; }
}
@media(min-width:1100px) {
  #home-summary { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); column-gap:24px; }
  #home-summary > :not(.business-metrics) { grid-column:1; }
  #home-summary > .business-metrics { grid-column:2; grid-row:1/5; align-self:center; }
  body:has(nav.bottom) nav.bottom a { flex-direction:row; gap:12px; }
  #business-analytics { grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
  #business-analytics > .business-products { grid-column:1; }
  #business-analytics > .business-week { grid-column:2; }
}

body:has(nav.bottom) [data-product-search] > .catalog-sort-filter { grid-column:2; grid-row:3; max-width:22rem; margin:0; }
@media (max-width:700px) { .catalog-sort-filter { display:block; margin-top:12px; } }

@media (min-width:768px) {
  .device-access-page main { min-height:100svh; display:grid; place-items:center; }
  .device-access { min-height:0; width:420px; max-width:100%; padding-block:24px; }
  .device-brand { margin:0 0 28px; }
  .device-access .device-keypad { margin-top:20px; }
  .device-recovery p { font-size:13px; max-width:320px; }
}

/* Small, honest loading state; no artificial delay and no full-screen cover. */
.home-loading { display:flex; align-items:center; justify-content:center; min-height:52px; }
.home-loading[hidden] { display:none; }
.home-loading i { width:22px; height:22px; border:2px solid #9EA9C840; border-top-color:#FF8C1A; border-radius:50%; animation:home-spin .8s linear infinite; }
@keyframes home-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .home-loading i { animation:none; border-color:#FF8C1A; } }
.coverage-status{margin:12px 0;border:1px solid #a6b7d144;border-radius:12px;padding:10px 14px;background:#ffffff04}
.coverage-status>summary{cursor:pointer;min-height:28px;line-height:1.6;color:var(--text,#e6ecf7)}
.coverage-status>summary:focus-visible{outline:2px solid #ff8c1a;outline-offset:4px}
@media(max-width:767px){.product-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:6px;padding-bottom:8px;scroll-snap-type:x proximity}.product-tabs>a{flex:0 0 auto;white-space:nowrap;scroll-snap-align:center;min-height:42px;display:flex;align-items:center}.product-tabs>a[aria-current=page]{outline-offset:-2px}}

/* Article subtype disclosure: preserve the existing field layout when visible. */
[data-operation-subtype][hidden] { display: none; }
