/* Дашборд мощностей Reddit / Quora — стили.
   Токены взяты из дизайн-системы «Ясно»; тёмная тема выведена из тех же ролей. */

/* Layout: тёплый canvas, панели с волосяной рамкой на 12-колоночной сетке, все цифры — моноширинным шрифтом */
:root {
  --canvas: #f3f2ee;
  --surface: #fdfdfb;
  --sunken: #ebe9e3;
  --thumb: #fdfdfb;
  --pop: #fdfdfb;
  --line: #e3e1da;
  --line-strong: #cfccc3;
  --line-control: #8a877e;
  --ink: #14161a;
  --ink-2: #464a52;
  --ink-3: #62656c;
  --on-ink: #fdfdfb;
  --on-fill: #fdfdfb;
  --accent: #3355e8;
  --accent-strong: #2640c0;
  --accent-soft: #e6ebfd;
  --signal-soft: #f1fbd0;
  --positive: #0e7a4d;
  --positive-soft: #e2f3ea;
  --negative: #c2362b;
  --negative-soft: #fbe7e3;
  --warning: #8f5d00;
  --warning-fill: #f2b53a;
  --warning-soft: #fdf1d8;
  --s1: #3355e8;
  --s2: #f0643a;
  --s3: #10a08a;
  --s4: #b25ad0;
  --s5: #e5a211;
  --s6: #e14f7a;
  --s7: #5f8a2a;
  --s8: #1f7fb8;
  --reddit: #f0643a;
  --quora: #3355e8;
  --load: #8a877e;
  --row-hover: rgba(20, 22, 26, .025);
  --col-hover: rgba(20, 22, 26, .06);
  --topbar-bg: rgba(243, 242, 238, .84);
  --shadow-panel: 0 1px 0 rgba(20, 22, 26, .04);
  --shadow-raised: 0 1px 2px rgba(20, 22, 26, .08), 0 0 0 1px rgba(20, 22, 26, .06);
  --shadow-pop: 0 16px 40px -12px rgba(20, 22, 26, .22), 0 0 0 1px rgba(20, 22, 26, .07);
  --shadow-lift: 0 12px 24px -14px rgba(20, 22, 26, .38);

  --on-warn: #14161a;
  --sans: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --plot-h: 340px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #121316;
    --surface: #1a1b1f;
    --sunken: #25262b;
    --thumb: #34363d;
    --pop: #23242a;
    --line: #2c2d33;
    --line-strong: #3b3d44;
    --line-control: #777981;
    --ink: #eceae4;
    --ink-2: #b6b7bc;
    --ink-3: #8f9198;
    --on-ink: #121316;
    --on-fill: #121316;
    --accent: #6f8bff;
    --accent-strong: #9aacff;
    --accent-soft: #222a4a;
    --signal-soft: #20260f;
    --positive: #45c98f;
    --positive-soft: #14301f;
    --negative: #ff7a6b;
    --negative-soft: #3a1c19;
    --warning: #f2b53a;
    --warning-fill: #f2b53a;
    --warning-soft: #33280f;
    --s1: #6f8bff;
    --s2: #ff7a50;
    --s3: #2cc0a6;
    --s4: #c77be3;
    --s5: #f0b43a;
    --s6: #f06d93;
    --s7: #86b04a;
    --s8: #4aa3d8;
    --reddit: #ff7a50;
    --quora: #6f8bff;
    --load: #6b6d75;
    --row-hover: rgba(255, 255, 255, .025);
    --col-hover: rgba(255, 255, 255, .07);
    --topbar-bg: rgba(18, 19, 22, .82);
    --shadow-panel: 0 1px 0 rgba(0, 0, 0, .3);
    --shadow-raised: 0 1px 2px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .07);
    --shadow-pop: 0 18px 44px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .09);
    --shadow-lift: 0 12px 24px -12px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --canvas: #121316;
  --surface: #1a1b1f;
  --sunken: #25262b;
  --thumb: #34363d;
  --pop: #23242a;
  --line: #2c2d33;
  --line-strong: #3b3d44;
  --line-control: #777981;
  --ink: #eceae4;
  --ink-2: #b6b7bc;
  --ink-3: #8f9198;
  --on-ink: #121316;
  --on-fill: #121316;
  --accent: #6f8bff;
  --accent-strong: #9aacff;
  --accent-soft: #222a4a;
  --signal-soft: #20260f;
  --positive: #45c98f;
  --positive-soft: #14301f;
  --negative: #ff7a6b;
  --negative-soft: #3a1c19;
  --warning: #f2b53a;
  --warning-fill: #f2b53a;
  --warning-soft: #33280f;
  --s1: #6f8bff;
  --s2: #ff7a50;
  --s3: #2cc0a6;
  --s4: #c77be3;
  --s5: #f0b43a;
  --s6: #f06d93;
  --s7: #86b04a;
  --s8: #4aa3d8;
  --reddit: #ff7a50;
  --quora: #6f8bff;
  --load: #6b6d75;
  --row-hover: rgba(255, 255, 255, .025);
  --col-hover: rgba(255, 255, 255, .07);
  --topbar-bg: rgba(18, 19, 22, .82);
  --shadow-panel: 0 1px 0 rgba(0, 0, 0, .3);
  --shadow-raised: 0 1px 2px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .07);
  --shadow-pop: 0 18px 44px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .09);
  --shadow-lift: 0 12px 24px -12px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ─── База ─────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { display: block; flex: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.t-title-l { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
.t-title-m { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -.005em; text-wrap: balance; }
.t-body-s { margin: 0; font-size: 13px; line-height: 18px; }
.t-display-l { font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-display-m { font-size: 28px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }
.c-ink { color: var(--ink); }
.c-ink2 { color: var(--ink-2); }
.c-ink3 { color: var(--ink-3); }
.c-pos { color: var(--positive); }
.c-neg { color: var(--negative); }
.c-warn { color: var(--warning); }
.num-r { text-align: right; }
.lbl-short { display: none; }

/* ─── Шапка приложения ─────────────────────────────────── */

.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar-in {
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: var(--gutter);
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px 20px;
}
.brand { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: -.01em; }
.brand-sub { color: var(--ink-3); font-weight: 500; }
.tb-spacer { flex: 1 1 auto; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.badge-demo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: help;
}
.badge-demo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warning-fill); }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .15s var(--ease);
}
.icon-btn:hover { color: var(--ink); background: var(--sunken); }
.icon-btn:active { transform: scale(.93); }
.icon-btn .ico { width: 18px; height: 18px; }

/* ─── Каркас страницы ──────────────────────────────────── */

.app { max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); padding-block: 28px 64px; }
.view { display: flex; flex-direction: column; gap: 24px; }
.view.is-leaving { animation: viewOut .15s ease-in forwards; pointer-events: none; }
.reveal { animation: rise .6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes viewOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes growW { from { width: 0; } }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; }
.ph-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 780px; }
.ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .2s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { color: var(--on-ink); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-control); }
.btn-ghost:hover { color: var(--ink); background: var(--sunken); }
.btn-sm { height: 28px; padding: 0 12px; }
.btn:active { transform: translateY(1px) scale(.985); box-shadow: none; }
.btn .arr { display: inline-block; transition: transform .25s var(--ease); }
.btn-primary:hover .arr { transform: translateX(3px); }
.btn-ghost:hover .arr { transform: translateX(-3px); }

.panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 16px; }
.panel-head > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.panel-tools { display: flex; flex-wrap: wrap; gap: 8px; }

/* Сегментированный переключатель с «бегунком» */
.seg {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  max-width: 100%;
  padding: 2px;
  gap: 2px;
  border-radius: 8px;
  background: var(--sunken);
}
.seg-thumb {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 6px;
  background: var(--thumb);
  box-shadow: var(--shadow-raised);
  opacity: 0;
  pointer-events: none;
}
.seg.has-thumb .seg-thumb { opacity: 1; }
.seg.thumb-anim .seg-thumb {
  transition: transform .38s cubic-bezier(.3, .8, .25, 1), width .38s cubic-bezier(.3, .8, .25, 1), height .38s cubic-bezier(.3, .8, .25, 1), opacity .2s ease;
}
.seg button {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s ease;
}
.seg button:hover, .seg button[aria-pressed="true"] { color: var(--ink); }
.seg:not(.has-thumb) button[aria-pressed="true"] { background: var(--thumb); box-shadow: var(--shadow-raised); }
.seg-lg button { height: 36px; }
.seg-fill { display: flex; width: 100%; }
.seg-fill button { flex: 1 1 auto; padding: 0 10px; }

/* ─── KPI ──────────────────────────────────────────────── */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-val { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.kpi-unit { font-size: 15px; line-height: 22px; color: var(--ink-2); }
.kpis-sm .kpi { gap: 8px; padding: 20px 24px; }
.kpis-sm .kpi-unit { font-size: 13px; line-height: 18px; }
.kpi-link {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s ease, border-color .22s ease;
}
.kpi-link:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.kpi-link:active { transform: translateY(0); }
.kpi-hint { display: inline-block; margin-top: auto; font-size: 13px; line-height: 18px; color: var(--ink-3); transition: color .2s ease, transform .25s var(--ease); }
.kpi-link:hover .kpi-hint, .kpi-link:focus-visible .kpi-hint { color: var(--accent-strong); transform: translateY(2px); }

.meter { height: 8px; overflow: hidden; border-radius: 999px; background: var(--sunken); }
.meter > span { display: block; width: var(--w, 0%); height: 100%; border-radius: inherit; background: var(--accent); animation: growW 1.1s var(--ease) .3s backwards; }
.meter.is-hot > span { background: var(--warning-fill); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
}
.chip::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-warn { background: var(--warning-soft); color: var(--warning); }
.chip-warn::before { background: var(--warning-fill); }
.chip-neg { background: var(--negative-soft); color: var(--negative); }
.chip-pos { background: var(--positive-soft); color: var(--positive); }
.chip-info { background: var(--accent-soft); color: var(--accent-strong); }
.chip-btn {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s ease;
}
.chip-btn:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px currentColor; }
.chip-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px currentColor; }
.chip-clear { align-self: flex-start; margin-top: 4px; }
.chip-clear::before { display: none; }
.link-btn {
  align-self: flex-start;
  margin-top: auto;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .2s ease, transform .25s var(--ease);
}
.link-btn:hover { color: var(--accent-strong); transform: translateY(2px); }

/* ─── Сетка второго ряда ───────────────────────────────── */

.row-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }

/* ─── Недельный график ─────────────────────────────────── */

.chart-panel { display: flex; flex-direction: column; gap: 16px; overflow-x: clip; }
.wchart { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: var(--plot-h) auto; }
.wc-y { position: relative; }
.wc-y span {
  position: absolute;
  right: 8px;
  transform: translateY(50%);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wc-y span:first-child { transform: none; }
.wc-plot { position: relative; min-width: 0; }
.wc-grid i { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.wc-cols { position: absolute; inset: 0; display: flex; }
.wc-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
  border: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
  cursor: pointer;
  transition: opacity .18s ease, background-color .2s ease;
}
.wc-col.is-cur { background: var(--signal-soft); }
.wc-col:focus-visible { outline-offset: -2px; }
.wc-cols.has-hover .wc-col:not(.is-hover) { opacity: .35; }
.wc-stack { display: flex; flex-direction: column; justify-content: flex-end; width: min(36px, 62%); height: 100%; }
.wc-free {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 0;
  margin-bottom: 2px;
  padding-top: 4px;
  overflow: hidden;
  border: 1px dashed var(--line-control);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  opacity: 0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 12px;
  color: var(--ink-2);
  transition: height .75s var(--ease), opacity .3s ease;
}
.wc-free.is-on { opacity: 1; }
.wc-seg {
  flex: none;
  display: block;
  width: 100%;
  height: 0;
  background: var(--c);
  background-clip: padding-box;
  border-top: 2px solid transparent;
  transition: height .75s var(--ease), opacity .2s ease;
}
.wc-seg.is-top { border-top-width: 0; border-radius: 4px 4px 0 0; }
.wc-seg.is-dim { opacity: .22; }
.wc-intro .wc-seg, .wc-intro .wc-free { transition-delay: var(--d, 0ms); }
.wc-cap { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--ink); pointer-events: none; transition: bottom .7s var(--ease); }
.wc-cap span {
  position: absolute;
  right: 0;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  color: var(--ink);
  white-space: nowrap;
}
.wc-tip {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 236px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: var(--pop);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease, visibility 0s linear .16s, transform .24s var(--ease);
}
.wc-tip.is-on { opacity: 1; visibility: visible; transition: opacity .16s ease, visibility 0s, transform .24s var(--ease); }
.wc-tip.is-jump { transition: none; }
.tip-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 18px; }
.tip-row .sw { margin-top: 4px; }
.tip-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; color: var(--ink-2); }
.tip-sub { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.tip-sum, .tip-free { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.tip-sum { padding-top: 6px; border-top: 1px solid var(--line); }
.tip-sum .mono, .tip-free .mono, .tip-row .mono { color: var(--ink); }
.tip-empty { font-size: 13px; line-height: 18px; color: var(--ink-3); }

.wc-x { grid-column: 2; display: flex; padding-top: 8px; border-top: 1px solid var(--line-strong); }
.wc-x > span {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  color: var(--ink-3);
  white-space: nowrap;
}
.wc-x > span { color: var(--ink-2); }
.wc-x > span.is-cur { color: var(--ink); font-weight: 500; }
.wc-x > span.is-skip .x-d, .wc-x > span.is-skip .x-m { visibility: hidden; }
.x-m { color: var(--ink-3); font-weight: 400; }
.x-s { min-height: 14px; color: var(--ink-3); font-weight: 400; }

.sw { flex: none; width: 10px; height: 10px; border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: auto; padding-top: 8px; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.lg-title { font-size: 13px; line-height: 18px; color: var(--ink-3); }
.lg-btn { padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; transition: opacity .2s ease, background-color .15s ease; }
.lg-btn:hover, .lg-btn[aria-pressed="true"] { background: var(--sunken); color: var(--ink); }
.lg-btn.is-dim { opacity: .45; }
.sw-free { border: 1px dashed var(--line-control); }
.sw-cap { width: 14px; height: 0; border-top: 1.5px dashed var(--ink); border-radius: 0; }

/* ─── «Можно взять» ────────────────────────────────────── */

.take { display: flex; flex-direction: column; gap: 4px; }
.take-sub { margin-bottom: 8px; }
.take-item { border-top: 1px solid var(--line); padding: 4px 0; }
.take-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 10px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color .18s ease;
}
.take-row:hover:not(:disabled) { background: var(--sunken); }
.take-row:disabled { cursor: default; }
.take-l, .take-r { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.take-r { align-items: flex-end; text-align: right; }
.take-name { font-size: 16px; line-height: 22px; font-weight: 600; }
.take-conc { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--accent-strong); }
.take-row .t-display-m { transition: transform .25s var(--ease); }
.take-row:hover:not(:disabled) .t-display-m { transform: translateX(-3px); }

.fw { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.fw-r {
  display: grid;
  grid-template-columns: 64px 52px 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 18px;
}
.fw-r.fw-h { padding: 0 0 8px; border-top: 0; }
.fw-w { display: flex; flex-direction: column; line-height: 16px; white-space: nowrap; }
.fw-d { font-size: 12px; color: var(--ink-3); }
.fw-r.is-cur .fw-w > span:first-child { font-weight: 600; }
.fw-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fchip {
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .15s var(--ease);
}
.fchip:hover:not(:disabled) { background: var(--accent); color: var(--on-fill); transform: translateY(-1px); }
.fchip:disabled { background: var(--sunken); color: var(--ink-3); text-decoration: line-through; cursor: default; }

/* ─── Таблица проектов ─────────────────────────────────── */

.projects { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 80px; }
.projects.is-flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 25% { box-shadow: 0 0 0 6px var(--accent-soft); } }
.ptable {
  display: flex;
  flex-direction: column;
  --cols: minmax(0, 1.5fr) 112px 128px 60px 100px 76px 84px 52px minmax(0, 1.7fr) 108px;
}
.ptr { display: grid; grid-template-columns: var(--cols); column-gap: 14px; align-items: center; padding: 12px 16px; }
.ptr-head { padding: 10px 16px; border-radius: 8px; background: var(--sunken); }
.ptr-head .c {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.c { min-width: 0; font-size: 13px; line-height: 18px; }
.c.mono { font-size: 12px; }
.prow { border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .15s ease; }
.prow:hover { background: var(--row-hover); }
.p-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.p-toggle .ico { width: 14px; height: 14px; color: var(--ink-3); transition: transform .35s var(--ease); }
.prow.is-open .p-toggle .ico { transform: rotate(90deg); }
.p-titles { display: flex; flex-direction: column; min-width: 0; }
.p-name, .p-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name { font-size: 15px; line-height: 20px; font-weight: 500; }
.p-sub { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.st { display: inline-flex; align-items: center; gap: 8px; }
.st-dot { position: relative; flex: none; width: 8px; height: 8px; border: 1.5px solid currentColor; border-radius: 50%; }
.st-active { color: var(--ink); }
.st-active .st-dot { border-color: var(--accent); background: var(--accent); }
.st-active .st-dot::after { content: ""; position: absolute; inset: -5px; border: 1.5px solid var(--accent); border-radius: 50%; animation: pulse 2.4s ease-out infinite; }
.st-behind { color: var(--warning); }
.st-behind .st-dot { border-color: var(--warning-fill); background: var(--warning-fill); }
.st-done { color: var(--ink); }
.st-done .st-dot { border-color: var(--positive); background: var(--positive); }
.st-planned { color: var(--ink-2); }
.st-planned .st-dot { border-color: var(--ink-3); background: transparent; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
.c-end { display: flex; flex-direction: column; }
.fc { font-size: 12px; line-height: 16px; }
.c-done { display: flex; flex-direction: column; gap: 6px; }
.done-top { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 8px; }
.dev { white-space: nowrap; }
.pbar { position: relative; display: block; height: 6px; border-radius: 999px; background: var(--sunken); }
.pbar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: inherit; background: var(--accent); transition: width .9s var(--ease); }
.pbar-plan { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--ink); transition: left .9s var(--ease); }
.alive-bad {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--negative-soft);
  color: var(--negative);
  font-weight: 500;
  white-space: nowrap;
}
.p-empty { padding: 28px 16px; text-align: center; font-size: 13px; line-height: 18px; color: var(--ink-3); border-bottom: 1px solid var(--line); }

/* Раскрытая карточка проекта */
.pdetail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.pdetail.is-open { grid-template-rows: 1fr; border-bottom: 1px solid var(--line); }
.pdetail-in { min-height: 0; overflow: hidden; }
.pd {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  padding: 16px 0 20px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .3s ease, transform .5s var(--ease);
}
.pdetail.is-open .pd { opacity: 1; transform: none; }
.pcard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}
.pcard-h { display: flex; align-items: center; gap: 8px; }
.pcard-t { margin-right: auto; font-size: 15px; line-height: 20px; font-weight: 600; }
.pl-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.pm { display: flex; flex-direction: column; gap: 6px; }
.pm-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.pm-top .mono { color: var(--ink); }
.bar { position: relative; display: block; height: 6px; border-radius: 999px; background: var(--sunken); }
.bar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: var(--w, 0%); border-radius: inherit; background: var(--accent); }
.bar-time .bar-fill { background: var(--load); }
.pdetail.is-open .bar-fill { animation: growW .9s var(--ease) .15s backwards; }
.bar-plan { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.pstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pstats div { min-width: 0; }
.pstats dt {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pstats dd { margin: 2px 0 0; font-family: var(--mono); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.tcard-f { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* ─── Планировщик ──────────────────────────────────────── */

.pl-ctrl { display: flex; flex-direction: column; gap: 20px; }
.pl-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.35fr); gap: 32px; align-items: start; }
.pl-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.custom { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.custom.is-on { grid-template-rows: 1fr; }
.custom-in { min-height: 0; overflow: hidden; }
.custom:not(.is-on) .custom-in { visibility: hidden; transition: visibility 0s linear .4s; }
.custom-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 3px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld > span {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.fld input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-control);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fld input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.stepper { display: flex; align-items: center; gap: 6px; }
.btn-step {
  flex: none;
  min-width: 44px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line-control);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color .15s ease, transform .12s var(--ease), opacity .2s ease;
}
.btn-step:hover:not(:disabled) { background: var(--sunken); }
.btn-step:active:not(:disabled) { transform: scale(.94); }
.btn-step:disabled { opacity: .4; cursor: default; }
.step-date { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 6px; min-width: 0; text-align: center; }
.swap-box { display: inline-block; }
.swap-up { animation: swapUp .32s var(--ease); }
.swap-down { animation: swapDown .32s var(--ease); }
.swap-fade { animation: swapFade .3s ease; }
@keyframes swapUp { from { opacity: 0; transform: translateY(45%); } }
@keyframes swapDown { from { opacity: 0; transform: translateY(-45%); } }
@keyframes swapFade { from { opacity: .25; } }

.verdict {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--positive-soft);
  transition: background-color .35s ease;
}
.verdict.is-bad { background: var(--negative-soft); }
.v-head { display: flex; align-items: center; gap: 8px; }
.v-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--positive);
  color: var(--on-fill);
  transition: background-color .35s ease;
}
.v-icon svg { width: 14px; height: 14px; }
.verdict.is-bad .v-icon { background: var(--negative); }
.v-icon.is-pop { animation: pop .45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.3); } }
.v-title { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--positive); transition: color .35s ease; }
.verdict.is-bad .v-title { color: var(--negative); }
.v-lines { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 18px; color: var(--ink); }
.verdict .btn { align-self: flex-start; }

.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.quick-l { margin-right: 4px; }
.qchip {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .15s var(--ease);
}
.qchip:hover { transform: translateY(-1px); }
.qchip[aria-pressed="true"] { background: var(--accent); color: var(--on-fill); }
.qchip:disabled { background: var(--sunken); color: var(--ink-3); cursor: default; transform: none; }

/* Добавление проекта из планировщика */
.pl-add { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.pl-add-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.pl-add-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.pl-add .btn { height: 36px; }
@media (max-width: 760px) {
  .pl-add-row { grid-template-columns: minmax(0, 1fr); }
}

/* Таймлайн */
.tl-panel { display: flex; flex-direction: column; gap: 16px; }
.readout { max-width: 560px; text-align: right; transition: color .2s ease; }
.tl-scroll { margin: 0 -4px; padding: 0 4px 4px; overflow-x: auto; overscroll-behavior-x: contain; }
.tl { position: relative; --lw: 204px; }
.tl-ov { position: absolute; top: 0; bottom: 0; left: var(--lw); right: 0; pointer-events: none; }
.tl-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  background: var(--signal-soft);
  transition: left .45s var(--ease), width .45s var(--ease);
}
.tl-wl { position: absolute; top: 58px; bottom: 0; border-left: 1px solid var(--line); }
.tl-today { position: absolute; z-index: 3; top: 0; bottom: 0; border-left: 1.5px solid var(--ink); }
.tl-today span {
  position: absolute;
  top: 2px;
  left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 14px;
  white-space: nowrap;
}
.tl-today.is-flip span { left: auto; right: 4px; }
.tl-row { position: relative; z-index: 1; display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); align-items: center; }
.tl-head { height: 60px; }
.tl-cand { height: 40px; }
.tl-proj { height: 32px; border-top: 1px solid var(--line); }
.tl-track { position: relative; height: 100%; min-width: 0; }
.tl-lab { display: flex; align-items: center; gap: 10px; min-width: 0; padding-right: 12px; }
.tl-lab-2 { display: flex; flex-direction: column; min-width: 0; }
.tl-name { font-size: 13px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-strong { font-size: 13px; line-height: 16px; font-weight: 600; }
.tl-meta { font-size: 12px; line-height: 16px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-wk {
  position: absolute;
  top: 22px;
  display: flex;
  flex-direction: column;
  padding-left: 6px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  color: var(--ink-3);
  white-space: nowrap;
}
.tl-wk b { font-weight: 500; color: var(--ink-2); }
.tl-pick { cursor: pointer; }
.tl-cbar {
  position: absolute;
  top: 8px;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-fill);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: left .45s var(--ease), width .45s var(--ease), box-shadow .2s ease, background-color .3s ease;
}
.tl-cbar:hover { box-shadow: var(--shadow-lift); }
.tl-cbar:active, .tl.is-dragging .tl-cbar { cursor: grabbing; box-shadow: var(--shadow-lift); }
.tl-cbar.is-bad { background: var(--negative); }
.tl-cbar.is-beyond { justify-content: flex-end; border-radius: 4px 0 0 4px; }
.tl-cbar span { overflow: hidden; text-overflow: ellipsis; }
.tl.is-dragging .tl-cbar, .tl.is-dragging .tl-band { transition-duration: .1s; }
.tl-pbar { position: absolute; top: 9px; height: 14px; border-radius: 4px; }
.tl-intro .tl-pbar, .tl-intro .tl-cbar { animation: wipe .8s var(--ease) .15s backwards; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0 round 4px); } to { clip-path: inset(0 0 0 0 round 4px); } }

.tl-daily { align-items: stretch; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.tl-dlab { position: relative; flex-direction: column; align-items: flex-start; gap: 0; height: 200px; }
.tl-tick {
  position: absolute;
  right: 10px;
  transform: translateY(50%);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.tl-days { height: 200px; cursor: pointer; }
.tl-grid i { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.tl-hl {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(100% / 84);
  border-radius: 3px;
  background: var(--col-hover);
  opacity: 0;
  transition: left .12s ease, opacity .15s ease;
}
.tl-hl.is-on { opacity: 1; }
.tl-dcols { position: absolute; inset: 0; display: flex; }
.dcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.dc-c, .dc-l { flex: none; display: block; width: 70%; height: 0; transition: height .5s var(--ease), background-color .25s ease; }
.dc-c { border-radius: 2px 2px 0 0; background: var(--accent); }
.dc-c.is-over { background: var(--negative); }
.dc-l { border-radius: 2px 2px 0 0; background: var(--load); }
.dc-l.is-under { border-top: 1px solid transparent; border-radius: 0; background-clip: padding-box; }
.tl-intro .dc-c, .tl-intro .dc-l { transition-delay: var(--d, 0ms); }
.tl-cap { position: absolute; z-index: 2; left: 0; right: 0; border-top: 1.5px dashed var(--ink); pointer-events: none; transition: bottom .5s var(--ease); }
.tl-cap span {
  position: absolute;
  right: 0;
  bottom: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
}
.tl-base { height: 1px; margin-left: var(--lw); background: var(--line-strong); }
.tl-legend { padding-left: 204px; margin-top: 0; padding-top: 0; }
.sw-band { width: 14px; height: 10px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--signal-soft); }
.hint { margin: 0; padding-left: 204px; }

/* Предупреждение «залезает в резерв» */
.verdict.is-warn { background: var(--warning-soft); }
.verdict.is-warn .v-icon { background: var(--warning-fill); color: var(--on-warn); }
.verdict.is-warn .v-title { color: var(--warning); }
.wc-safe { border-top: 1.5px dotted var(--warning); }
.wc-safe span { right: auto; left: 0; color: var(--warning); }
.sw-cap.sw-safe { border-top: 1.5px dotted var(--warning); }

/* Пользователь и выход */
.who { font-size: 13px; line-height: 18px; color: var(--ink-3); white-space: nowrap; }

/* Вход */
.login { min-height: 100vh; display: grid; place-items: center; padding-inline: var(--gutter); padding-block: 40px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 32px; }
.login-card .btn { margin-top: 4px; height: 40px; }
.is-shake { animation: shake .4s var(--ease); }
@keyframes shake { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }

/* Управление */
.fld select, .fld input:not([type]), .fld input[type="text"], .fld input[type="date"], .fld input[type="password"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-control);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fld select:focus, .fld input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fld input:disabled { opacity: .45; }
.adm-form { display: flex; flex-direction: column; gap: 16px; }
.adm-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.adm-fields-main { grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); }
.adm-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adm-plats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.adm-plat { min-width: 0; margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); transition: opacity .2s ease; }
.adm-plat.is-off .adm-fields { opacity: .5; }
.adm-plat legend { padding: 0 6px; }
.adm-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; cursor: pointer; }
.adm-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.adm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-editor { border-color: var(--accent); }
.adm-editor.is-in { animation: rise .45s var(--ease); }
.adm-list { display: flex; flex-direction: column; }
.adm-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 130px 130px minmax(0, .8fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.adm-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.btn.is-confirm { background: var(--negative); border-color: var(--negative); color: var(--on-fill); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }

/* Живые аккаунты */
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.acc-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.acc-card input { font-size: 20px; height: 44px; }
.acc-log { display: flex; flex-direction: column; }
.acc-row {
  display: grid;
  grid-template-columns: 120px 80px 130px 130px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .2s ease, transform .3s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { background: var(--negative); color: var(--on-fill); }

@media (max-width: 1099px) {
  .adm-fields-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-fields-main .fld-wide { grid-column: 1 / -1; }
  .adm-plats, .adm-grid { grid-template-columns: minmax(0, 1fr); }
  .adm-row { grid-template-columns: minmax(0, 1fr) auto; }
  .adm-row > .mono, .adm-row > .t-body-s { grid-column: 1; }
  .adm-row > .adm-actions { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
}

@media (max-width: 760px) {
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
  .acc-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 4px; }
  .acc-row > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .adm-fields, .adm-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-row { grid-template-columns: minmax(0, 1fr); }
  .adm-row > .adm-actions { grid-column: 1; grid-row: auto; }
  .who, .tb-right .badge-demo { display: none; }
}

.boot-error { max-width: 640px; margin: 64px auto; padding-inline: var(--gutter); display: flex; flex-direction: column; gap: 8px; }
.noscript { max-width: 640px; margin: 64px auto; padding-inline: 16px; font-family: var(--sans); }

/* ─── Адаптив ──────────────────────────────────────────── */

@media (min-width: 1100px) and (max-width: 1319px) {
  .ptable { --cols: minmax(0, 1.4fr) 112px 120px 60px 100px 72px minmax(0, 1.6fr) 104px; }
  .ptable .c-quota, .ptable .c-acc { display: none; }
}

@media (max-width: 1319px) {
  .pl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .verdict { grid-column: 1 / -1; }
}

@media (max-width: 1279px) {
  .span-8, .span-4 { grid-column: 1 / -1; }
  .take-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 40px; align-items: start; }
  .take-body .fw { margin-top: 0; padding-top: 4px; border-top: 0; }
}

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Компактная шапка: у админа четыре раздела, пользователь и «Выйти» */
  .brand { display: none; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
}

@media (max-width: 1099px) {
  .seg-fill { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .who { display: none; }
}

@media (max-width: 1099px) {
  .tl { min-width: 900px; --lw: 180px; }
  .tl-legend, .hint { padding-left: 0; }

  .ptr-head { display: none; }
  .prow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "name name name status"
      "done done done done"
      "pkg start end units"
      "quota acc alive alive";
    row-gap: 14px;
    padding: 16px 4px;
  }
  .prow .c-name { grid-area: name; }
  .prow .c-status { grid-area: status; justify-self: end; }
  .prow .c-done { grid-area: done; }
  .prow .c-pkg { grid-area: pkg; }
  .prow .c-start { grid-area: start; }
  .prow .c-end { grid-area: end; }
  .prow .c-units { grid-area: units; }
  .prow .c-quota { grid-area: quota; }
  .prow .c-acc { grid-area: acc; }
  .prow .c-alive { grid-area: alive; }
  .prow .num-r { text-align: left; }
  .prow .c[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-family: var(--mono);
    font-size: 10px;
    line-height: 14px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
}

@media (max-width: 760px) {
  :root { --plot-h: 260px; }
  .tl { min-width: 880px; --lw: 128px; }
  .app { padding-block: 20px 48px; }
  .view, .kpis, .row-12 { gap: 16px; }
  .panel { padding: 20px; border-radius: 18px; }
  .t-display-l { font-size: 32px; line-height: 36px; }
  .brand { display: none; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
  .topbar-in { min-height: 56px; }
  .take-body { grid-template-columns: minmax(0, 1fr); }
  .take-body .fw { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
  .pl-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .readout { text-align: left; }
  .wchart { grid-template-columns: 36px minmax(0, 1fr); }
  .wc-tip { width: 210px; }
}

@media (max-width: 600px) {
  .prow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "name name"
      "status status"
      "done done"
      "pkg units"
      "start end"
      "quota acc"
      "alive alive";
  }
  .prow .c-status { justify-self: start; }
}

@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .ph-actions, .ph-actions .btn, .page-head > .btn { width: 100%; }
  .topbar-in, .tb-right { gap: 8px; }
  .seg-nav button { padding: 0 10px; }
  .badge-demo { padding: 0 8px; }
  .seg-fill { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fw-r { grid-template-columns: 52px 44px 36px minmax(0, 1fr); gap: 8px; }
  .custom-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stepper { gap: 4px; }
  .btn-step { min-width: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

/* Создание проекта у полосы таймлайна */
.tl-create { position: absolute; top: 4px; left: 0; max-width: 100%; height: 32px; padding: 0 12px; border: 1px dashed var(--accent); border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-family: inherit; font-weight: 500; font-size: 12px; white-space: nowrap; cursor: pointer; transition: background .18s, box-shadow .18s; }
.tl-create:hover, .tl-create:focus-visible { background: var(--surface); box-shadow: var(--shadow-lift); }
.tl-inline-editor { position: sticky; left: 4px; z-index: 5; box-sizing: border-box; margin: 10px 0 18px; border: 1px solid var(--accent); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lift); }
.inline-project-form { padding: 20px; min-width: 0; }
.draft-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.draft-title h2 { margin: 4px 0 0; }
.draft-close { font-size: 25px; line-height: 1; }
.draft-identity, .draft-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.inline-project-form .pl-grid { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 20px; }
.inline-project-form .verdict { grid-column: 1 / -1; padding: 12px 16px; }
.inline-project-form .custom-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0; }
.inline-project-form .seg-fill { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.inline-project-form .seg-fill .seg-thumb { display: none; }
.inline-project-form .seg-fill button { padding: 0 8px; }
.inline-project-form .seg-fill button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow-sm); }
.draft-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; }
.draft-footer > [role="alert"] { flex-basis: 100%; margin: 0; }
.draft-footer .adm-actions { margin-left: auto; }
.view:not(.has-draft) .tl-legend .lg:nth-child(2), .view:not(.has-draft) .tl-legend .lg:nth-child(3), .view:not(.has-draft) .tl-legend .lg:last-child { display: none; }
@media (max-width: 760px) {
  .inline-project-form { padding: 14px; }
  .inline-project-form .pl-grid, .draft-identity { grid-template-columns: minmax(0,1fr); }
  .draft-footer { align-items: stretch; flex-direction: column; }
  .draft-footer .adm-actions { margin-left: 0; display: grid; grid-template-columns: auto minmax(0,1fr); }
  .draft-dates { gap: 8px; }
  .draft-dates input { min-width: 0; width: 100%; }
}
@media (max-width: 400px) {
  .topbar-in { gap: 6px; }
  .tb-spacer { display: none; }
  .seg-nav button { padding-inline: 8px; }
}
.draft-mobile-trigger { display: none; }
@media (max-width: 760px) {
  .draft-mobile-trigger { display: inline-flex; }
  .tl-panel > .panel-head { flex-wrap: wrap; }
}
.platform-phase { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 12px; }
.acc-card { display: flex; flex-direction: column; gap: 12px; }
.acc-card p { margin: 0; }
.acc-warm-log { display: block; margin-top: 4px; font-size: 11px; }
