:root {
  color-scheme: dark;
  --bg: #050508;
  --bg-raised: #0a0a0f;
  --bg-soft: #0b111b;
  --surface: rgba(8, 15, 25, 0.88);
  --surface-strong: rgba(10, 20, 34, 0.97);
  --surface-soft: rgba(157, 196, 255, 0.055);
  --ink: #e8f4ff;
  --ink-soft: #b5cde2;
  --ink-muted: #82a2bd;
  --line: rgba(0, 212, 255, 0.11);
  --line-strong: rgba(0, 212, 255, 0.32);
  --accent: #00d4ff;
  --accent-blue: #4d9fff;
  --accent-pale: #9dc4ff;
  --accent-ink: #00141c;
  --accent-soft: rgba(0, 212, 255, 0.12);
  --status: #00ffaa;
  --status-soft: rgba(0, 255, 170, 0.12);
  --warning: #ffbd68;
  --warning-soft: rgba(255, 189, 104, 0.12);
  --danger: #ff7b92;
  --danger-soft: rgba(255, 123, 146, 0.12);
  --shadow-xl: 0 44px 120px rgba(0, 0, 0, 0.56), 0 1px 0 rgba(157, 196, 255, 0.07) inset;
  --shadow-md: 0 22px 62px rgba(0, 0, 0, 0.34), 0 1px 0 rgba(157, 196, 255, 0.05) inset;
  --brand-gradient: linear-gradient(135deg, #00d4ff, #4d9fff);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --page: 1480px;
  --ease: cubic-bezier(0.2, 0.78, 0.24, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f8ff;
  --bg-raised: #eaf4ff;
  --bg-soft: #ddeeff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.97);
  --surface-soft: rgba(5, 52, 82, 0.045);
  --ink: #071421;
  --ink-soft: #274966;
  --ink-muted: #42617e;
  --line: rgba(0, 105, 150, 0.14);
  --line-strong: rgba(0, 113, 166, 0.34);
  --accent: #007fa3;
  --accent-blue: #226bd4;
  --accent-pale: #174c8c;
  --accent-ink: #f6fdff;
  --accent-soft: rgba(0, 127, 163, 0.11);
  --status: #007d59;
  --status-soft: rgba(0, 125, 89, 0.1);
  --warning: #985400;
  --warning-soft: rgba(152, 84, 0, 0.1);
  --danger: #b3264a;
  --danger-soft: rgba(179, 38, 74, 0.09);
  --shadow-xl: 0 38px 100px rgba(20, 76, 112, 0.17), 0 1px 0 white inset;
  --shadow-md: 0 18px 48px rgba(20, 76, 112, 0.11), 0 1px 0 white inset;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1000px 680px at 4% -8%, rgba(0, 212, 255, 0.13), transparent 66%),
    radial-gradient(840px 620px at 100% 8%, rgba(77, 159, 255, 0.11), transparent 70%),
    linear-gradient(155deg, var(--bg-raised), var(--bg) 48%, color-mix(in srgb, var(--bg) 90%, #001525));
  color: var(--ink);
  font: 16px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.58;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  z-index: -1;
  height: 36vh;
  pointer-events: none;
  background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 94%, #00101c));
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.ui-icon {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 78%, white);
  outline-offset: 3px;
}

.surface {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(157, 196, 255, 0.055), transparent 34%),
    var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(25px) saturate(1.12);
  -webkit-backdrop-filter: blur(25px) saturate(1.12);
}

.demo-banner {
  position: relative;
  z-index: 90;
  padding: 9px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 34%, transparent);
  background: color-mix(in srgb, var(--warning) 13%, var(--bg-raised));
  color: color-mix(in srgb, var(--warning) 84%, var(--ink));
  text-align: center;
  font-size: 13px;
  font-weight: 680;
}

/* Верхняя панель и навигация */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(28px) saturate(1.24);
  -webkit-backdrop-filter: blur(28px) saturate(1.24);
}

.topbar-inner {
  width: min(var(--page), calc(100% - 44px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-wordmark {
  white-space: nowrap;
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.045em;
}

.brand-wordmark strong {
  color: var(--accent);
  font-weight: 880;
}

.brand-product b,
.brand-product small { display: block; }

.brand-product b {
  font-size: 13px;
  line-height: 1.15;
}

.brand-product small {
  margin-top: 3px;
  color: var(--ink-muted);
  font: 600 12px/1.2 "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.view-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.view-nav-button {
  min-height: 40px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 720;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.view-nav-button:hover { color: var(--ink); }

.view-nav-button.is-active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-strong));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent) inset, 0 8px 22px rgba(0, 0, 0, 0.16);
  color: var(--accent-pale);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.quiet-button,
.factory-state,
.primary-button,
.secondary-button,
.danger-button,
.text-action {
  border: 0;
  cursor: pointer;
  transition: transform 180ms var(--ease), border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.icon-button {
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.icon-button:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong));
}

.icon-button.is-spinning .ui-icon { animation: spin 700ms linear infinite; }

.quiet-button {
  min-height: 44px;
  padding: 0 11px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 650;
}

.quiet-button:hover { color: var(--ink); }

.factory-state {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
  text-align: left;
}

.factory-state:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong));
}

.status-light {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-muted);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ink-muted) 13%, transparent);
}

.factory-state[data-state="running"] .status-light {
  background: var(--status);
  box-shadow: 0 0 0 5px var(--status-soft), 0 0 20px color-mix(in srgb, var(--status) 48%, transparent);
  animation: breathe 2.8s ease-in-out infinite;
}

.factory-state[data-state="stopped"] .status-light {
  background: var(--danger);
  box-shadow: 0 0 0 5px var(--danger-soft);
}

.state-copy strong,
.state-copy small { display: block; }
.state-copy strong { font-size: 13px; line-height: 1.2; }
.state-copy small { margin-top: 2px; color: var(--ink-muted); font-size: 12px; line-height: 1.2; }

/* Каркас разделов */
.dashboard-shell {
  width: min(var(--page), calc(100% - 44px));
  margin: 0 auto;
  padding: 58px 0 52px;
}

.view-panel { animation: view-in 420ms var(--ease) both; }

.intro,
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  align-items: end;
  gap: 56px;
  margin-bottom: 32px;
}

.page-heading { align-items: center; }
.page-heading > .secondary-button { justify-self: end; }

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--ink-muted);
  font: 800 12px/1.25 "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.13em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 22px currentColor;
}

.intro h1,
.page-heading h1 {
  margin: 16px 0 0;
  font-size: clamp(45px, 5vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.064em;
  font-weight: 770;
}

.page-heading h1 { font-size: clamp(42px, 4.4vw, 68px); }

.intro h1 span {
  color: var(--ink-muted);
  font-weight: 560;
}

.intro-note { padding-bottom: 5px; }

.intro-note p,
.page-heading p:not(.eyebrow) {
  max-width: 670px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

.intro-note p { margin: 0 0 17px; }

.text-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  color: var(--accent-pale);
  font-size: 15px;
  font-weight: 720;
}

.text-action .ui-icon { width: 18px; height: 18px; transition: transform 180ms var(--ease); }
.text-action:hover .ui-icon { transform: translateX(4px); }
.text-action--small { min-height: 36px; color: var(--ink-muted); font-size: 13px; }
.text-action--small:hover { color: var(--accent-pale); }

.primary-button,
.secondary-button,
.danger-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 760;
}

.primary-button {
  background: var(--brand-gradient);
  box-shadow: 0 12px 30px rgba(0, 174, 255, 0.2);
  color: #00131b;
}

.primary-button:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(0, 174, 255, 0.28); }
.primary-button:disabled { opacity: 0.54; cursor: wait; transform: none; }

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.secondary-button:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong)); }

.danger-button { background: var(--danger); color: #18020a; }
.danger-button:hover { transform: translateY(-2px); }

/* Главная диорама */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.12fr) minmax(330px, 0.88fr);
  gap: 18px;
  align-items: stretch;
}

.factory-panel,
.today-card,
.latest-card,
.release-board,
.watch-card,
.topic-card,
.research-log,
.metrics-board,
.calendar-shell { border-radius: var(--radius-xl); }

.factory-panel { min-width: 0; overflow: hidden; }

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 0;
}

.section-heading--map { padding: 25px 28px 0; }
.section-heading h2 { margin: 6px 0 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.03em; }

.freshness,
.calendar-summary {
  color: var(--ink-muted);
  font: 600 12px/1.4 "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.freshness { white-space: nowrap; }

.factory-stage {
  --parallax-x: 0px;
  --parallax-y: 0px;
  position: relative;
  min-height: 520px;
  margin: 2px 12px 0;
  perspective: 1100px;
  transform-style: preserve-3d;
  isolation: isolate;
}

.factory-floor {
  position: absolute;
  inset: 76px 5% 22px;
  z-index: -2;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 50%;
  background:
    linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 52% 44%, rgba(0, 212, 255, 0.11), rgba(0, 0, 0, 0.01) 58%, transparent 72%);
  background-size: 38px 38px, 38px 38px, auto;
  transform: rotateX(62deg) translate3d(var(--parallax-x), calc(var(--parallax-y) + 55px), -55px) scale(1.08);
  box-shadow: 0 56px 80px rgba(0, 0, 0, 0.26);
  transition: transform 320ms var(--ease);
}

.factory-lines {
  position: absolute;
  inset: 20px 1% 0;
  z-index: -1;
  width: 98%;
  height: calc(100% - 20px);
  overflow: visible;
  transform: translate3d(var(--parallax-x), var(--parallax-y), 0);
  transition: transform 280ms var(--ease);
}

.factory-track {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 58%, transparent);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.factory-track--shadow {
  stroke: rgba(0, 0, 0, 0.68);
  stroke-width: 12;
  transform: translateY(8px);
}

.factory-flow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 2 28;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.9));
  vector-effect: non-scaling-stroke;
  animation: flow 3.6s linear infinite;
}

.factory-node {
  --node-shift-x: 0px;
  --node-shift-y: 0px;
  position: absolute;
  width: 124px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px 15px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(157, 196, 255, 0.1), transparent 38%),
    color-mix(in srgb, var(--surface-strong) 94%, transparent);
  box-shadow: 0 24px 34px rgba(0, 0, 0, 0.34), 0 1px 0 rgba(157, 196, 255, 0.11) inset, 0 -8px 25px rgba(0, 212, 255, 0.035) inset;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transform: translate3d(var(--node-shift-x), var(--node-shift-y), 34px) rotateX(2deg) rotateY(-3deg);
  transform-style: preserve-3d;
  transition: transform 230ms var(--ease), border-color 200ms ease, box-shadow 200ms ease;
}

.factory-node::after {
  content: "";
  position: absolute;
  inset: 12px -8px -10px 10px;
  z-index: -1;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent-blue) 8%, #000);
  transform: translateZ(-18px);
  filter: brightness(0.64);
}

.factory-node:hover {
  z-index: 5;
  transform: translate3d(var(--node-shift-x), calc(var(--node-shift-y) - 8px), 58px) rotateX(0) rotateY(0) scale(1.035);
  border-color: var(--line-strong);
  box-shadow: 0 30px 46px rgba(0, 0, 0, 0.43), 0 0 38px rgba(0, 212, 255, 0.11), 0 1px 0 rgba(157, 196, 255, 0.14) inset;
}

.factory-node[data-state="live"] .node-signal { background: var(--status); box-shadow: 0 0 13px var(--status); }
.factory-node[data-state="stopped"] { border-color: color-mix(in srgb, var(--danger) 36%, var(--line)); }
.factory-node[data-state="stopped"] .node-signal { background: var(--danger); box-shadow: 0 0 13px var(--danger); }

.node-index {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--ink-muted);
  font: 650 12px/1 "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

.node-signal { width: 8px; height: 8px; margin: 2px 0 14px; border-radius: 50%; background: var(--ink-muted); }
.node-kicker { color: var(--ink-muted); font: 760 12px/1.2 "JetBrains Mono", ui-monospace, monospace; letter-spacing: 0.07em; }
.factory-node > strong { margin-top: 5px; font-size: 16px; line-height: 1.1; letter-spacing: -0.025em; }
.node-value { margin-top: 12px; font-size: 28px; line-height: 1; font-weight: 790; letter-spacing: -0.05em; }
.node-status { margin-top: 6px; color: var(--ink-muted); font-size: 12px; line-height: 1.25; }

.node-sources { left: 2.8%; top: 58%; }
.node-research { left: 20.4%; top: 29%; }
.node-plan { left: 37.3%; top: 58%; }
.node-queue { left: 54.3%; top: 26%; }
.node-publish { left: 70.8%; top: 55%; }
.node-metrics { right: 1.5%; top: 20%; }

.map-legend {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.map-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-muted); }
.legend-mark--live { background: var(--status); box-shadow: 0 0 9px color-mix(in srgb, var(--status) 70%, transparent); }
.map-hint { margin-left: auto; }

/* Сегодня, лента и ключевые числа */
.today-column { display: grid; grid-template-rows: auto 1fr; gap: 18px; min-width: 0; }
.today-card, .latest-card { min-width: 0; overflow: hidden; }
.today-timeline { padding: 20px 26px 25px; }

.timeline-item {
  display: grid;
  grid-template-columns: 48px 14px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 55px;
}

.timeline-time { padding-top: 1px; color: var(--ink-muted); font: 650 12px/1.4 "JetBrains Mono", ui-monospace, monospace; }
.timeline-dot { position: relative; width: 9px; height: 9px; margin-top: 5px; border: 2px solid var(--ink-muted); border-radius: 50%; }
.timeline-dot::after { content: ""; position: absolute; top: 10px; left: 2px; width: 1px; height: 41px; background: var(--line); }
.timeline-item:last-child .timeline-dot::after { display: none; }
.timeline-item[data-state="done"] .timeline-dot { border-color: var(--status); background: var(--status); box-shadow: 0 0 12px var(--status-soft); }
.timeline-item[data-state="next"] .timeline-dot { border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }
.timeline-copy strong, .timeline-copy small { display: block; }
.timeline-copy strong { font-size: 14px; line-height: 1.35; }
.timeline-copy small { margin-top: 3px; color: var(--ink-muted); font-size: 12px; line-height: 1.35; }

.latest-feed { padding: 14px 14px 18px; }
.feed-row {
  width: 100%;
  min-height: 65px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, transform 180ms var(--ease);
}

.feed-row:first-child { border-top: 0; }
.feed-row:hover { background: var(--accent-soft); transform: translateX(3px); }
.feed-number { color: var(--accent); font: 650 12px/1 "JetBrains Mono", ui-monospace, monospace; }
.feed-title, .feed-meta { display: block; }
.feed-title { overflow: hidden; font-size: 14px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { margin-top: 4px; color: var(--ink-muted); font-size: 12px; }
.feed-arrow { color: var(--ink-muted); font-size: 22px; }

.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  overflow: hidden;
}

.kpi-card { min-width: 0; padding: 18px 22px; border-left: 1px solid var(--line); }
.kpi-card:first-child { border-left: 0; }
.kpi-card span, .kpi-card small, .kpi-card strong { display: block; }
.kpi-card span { color: var(--ink-muted); font-size: 12px; font-weight: 680; }
.kpi-card strong { margin: 6px 0 3px; font-size: 27px; line-height: 1; letter-spacing: -0.045em; }
.kpi-card small { color: var(--ink-muted); font-size: 12px; }

.overview-lower { margin-bottom: 18px; }
.release-board { overflow: hidden; }
.slot-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; padding: 20px 24px 24px; }

.slot-card {
  min-width: 0;
  min-height: 146px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 190ms var(--ease), border-color 180ms ease, background 180ms ease;
}

.slot-card:hover { transform: translateY(-4px); border-color: var(--line-strong); background: var(--accent-soft); }
.slot-card[data-status="done"] { opacity: 0.75; }
.slot-top { width: 100%; display: flex; justify-content: space-between; gap: 8px; color: var(--ink-muted); font: 620 12px/1.2 "JetBrains Mono", ui-monospace, monospace; }
.slot-card strong { margin: 13px 0 12px; font-size: 14px; line-height: 1.35; }
.slot-status { margin-top: auto; color: var(--accent-pale); font-size: 12px; line-height: 1.3; }

/* Процедурная динамика */
.metrics-board { position: relative; overflow: hidden; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, #061a2b), var(--surface) 58%); }
.metrics-board::before { content: ""; position: absolute; inset: -20% 38% 24% -15%; pointer-events: none; background: radial-gradient(circle, rgba(0, 212, 255, 0.15), transparent 66%); }
.metrics-board::after { content: ""; position: absolute; inset: 32% -16% -38% 42%; pointer-events: none; background: radial-gradient(circle, rgba(77, 159, 255, 0.11), transparent 68%); }
.metrics-heading { position: relative; z-index: 3; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 30px 32px 0; }
.metrics-heading h2 { margin: 7px 0 0; font-size: clamp(30px, 3vw, 48px); line-height: 1; letter-spacing: -0.05em; }
.metrics-heading p:not(.section-kicker) { max-width: 590px; margin: 13px 0 0; color: var(--ink-soft); font-size: 15px; }
.metrics-glance { position: relative; z-index: 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 24px 32px 0; }

.metric-glance-card {
  min-width: 0;
  padding: 16px 18px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 42px rgba(0, 0, 0, 0.12);
  transition: transform 180ms var(--ease), border-color 180ms ease, background 180ms ease;
}

.metric-glance-card:hover { transform: translateY(-3px); background: color-mix(in srgb, var(--surface-strong) 91%, transparent); }

.metric-glance-card span, .metric-glance-card small, .metric-glance-card strong { display: block; }
.metric-glance-card span { color: var(--ink-muted); font-size: 13px; }
.metric-glance-card strong { margin-top: 6px; font-size: 27px; line-height: 1; letter-spacing: -0.045em; }
.metric-glance-card small { margin-top: 6px; color: var(--accent-pale); font-size: 13px; }
.metric-glance-card[data-series="audience"] { border-color: rgba(0, 212, 255, 0.34); box-shadow: inset 3px 0 rgba(0, 212, 255, 0.58), 0 18px 42px rgba(0, 0, 0, 0.12); }
.metric-glance-card[data-series="attention"] { border-color: rgba(77, 159, 255, 0.34); box-shadow: inset 3px 0 rgba(77, 159, 255, 0.58), 0 18px 42px rgba(0, 0, 0, 0.12); }
.metric-glance-card[data-series="site"] { border-color: rgba(157, 196, 255, 0.36); box-shadow: inset 3px 0 rgba(157, 196, 255, 0.62), 0 18px 42px rgba(0, 0, 0, 0.12); }

.metrics-visual { position: relative; min-height: 540px; margin-top: -8px; }
.metrics-scene { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, transparent 10%, rgba(3, 11, 20, 0.13) 74%, rgba(3, 11, 20, 0.28)); }
.metrics-scene canvas { width: 100%; height: 100%; display: block; filter: saturate(1.08) contrast(1.025); }
.metrics-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 160px 28px 80px; color: var(--ink-muted); text-align: center; }
.metrics-axis { position: absolute; right: 34px; bottom: 24px; left: 34px; z-index: 3; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; color: var(--ink-muted); font: 600 13px/1 "JetBrains Mono", ui-monospace, monospace; }
.metrics-axis i { height: 1px; background: linear-gradient(90deg, var(--line), var(--accent), var(--line)); }

/* Календарь */
.calendar-shell { overflow: hidden; }
.calendar-heading { align-items: center; padding-bottom: 23px; }
.calendar-week { padding: 0 22px 25px; }
.calendar-week-block { padding-top: 23px; border-top: 1px solid var(--line); }
.calendar-week-block + .calendar-week-block { margin-top: 25px; }
.calendar-week-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.calendar-week-head h3 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.calendar-week-head p { max-width: 660px; margin: 5px 0 0; color: var(--ink-muted); font-size: 13px; }
.week-badge { flex: none; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--accent-pale); font: 650 12px/1.2 "JetBrains Mono", ui-monospace, monospace; }
.calendar-scroll { overflow-x: auto; padding: 2px 1px 10px; scrollbar-color: var(--line-strong) transparent; }
.calendar-grid { min-width: 1180px; display: grid; grid-template-columns: repeat(7, minmax(156px, 1fr)); gap: 9px; }

.calendar-day {
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.calendar-day[data-today="true"] { border-color: var(--accent); box-shadow: 0 0 30px rgba(0, 212, 255, 0.09) inset; }
.calendar-day[data-past="true"] { opacity: 0.62; }
.calendar-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.calendar-day-head strong { font-size: 14px; }
.calendar-day-head span { color: var(--ink-muted); font: 620 12px/1 "JetBrains Mono", ui-monospace, monospace; }
.calendar-day-slots { display: grid; gap: 8px; }

.calendar-slot {
  width: 100%;
  min-height: 84px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 170ms var(--ease), border-color 170ms ease, background 170ms ease;
}

.calendar-slot:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--accent-soft); }
.calendar-slot[data-status="done"] { border-color: color-mix(in srgb, var(--status) 26%, transparent); }
.calendar-slot[data-status="ready"] { border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.calendar-slot time { color: var(--accent-pale); font: 640 12px/1.3 "JetBrains Mono", ui-monospace, monospace; }
.calendar-slot strong { display: block; font-size: 13px; line-height: 1.35; }
.calendar-slot small { display: block; margin-top: 4px; color: var(--ink-muted); font-size: 12px; line-height: 1.25; }
.calendar-empty { min-height: 72px; display: grid; place-items: center; color: var(--ink-muted); font-size: 12px; text-align: center; }

/* Разведка */
.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.watch-card, .topic-card { min-width: 0; overflow: hidden; }
.panel-explainer { margin: 15px 26px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.compact-form { padding: 22px 26px 12px; }
.compact-form > label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 680; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.form-row input, .confirm-reason textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  color: var(--ink);
  padding: 0 14px;
  outline: 0;
}

.form-row input::placeholder, .confirm-reason textarea::placeholder { color: color-mix(in srgb, var(--ink-muted) 78%, transparent); }
.form-row input:focus, .confirm-reason textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-message { min-height: 20px; margin: 8px 0 0; color: var(--status); font-size: 12px; }
.form-message--error { color: var(--danger); }

.watch-list { padding: 2px 18px 22px; }
.watch-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
}

.watch-row:first-child { border-top: 0; }
.watch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status); box-shadow: 0 0 10px var(--status-soft); }
.watch-row[data-active="false"] .watch-dot { background: var(--ink-muted); box-shadow: none; }
.watch-name, .watch-meta { display: block; }
.watch-name { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.watch-meta { margin-top: 3px; color: var(--ink-muted); font-size: 12px; }
.watch-remove, .topic-remove { min-height: 36px; padding: 0 9px; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12px; }
.watch-remove:hover, .topic-remove:hover { color: var(--danger); }

.topic-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; min-height: 176px; padding: 12px 26px 26px; }
.topic-chip { min-height: 45px; display: inline-flex; align-items: center; gap: 6px; padding: 0 7px 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--accent-soft); color: var(--accent-pale); font-size: 13px; font-weight: 680; }
.topic-remove { min-width: 34px; border-radius: 999px; font-size: 18px; line-height: 1; }

.research-log { margin-top: 18px; overflow: hidden; }
.research-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 22px 26px 26px; }
.research-day { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.research-day-head { display: flex; justify-content: space-between; gap: 12px; }
.research-day-head strong { font-size: 15px; }
.research-day-head span { color: var(--accent-pale); font: 650 12px/1.4 "JetBrains Mono", ui-monospace, monospace; }
.research-day ul { margin: 13px 0 0; padding-left: 18px; color: var(--ink-soft); }
.research-day li { margin-top: 7px; font-size: 13px; line-height: 1.4; }

/* Drawer, модалки, состояния */
.drawer-layer { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: 1fr minmax(360px, 520px); }
.drawer-backdrop { grid-column: 1 / -1; grid-row: 1; border: 0; background: rgba(0, 5, 12, 0.7); cursor: pointer; backdrop-filter: blur(8px); }
.node-drawer { grid-column: 2; grid-row: 1; width: 100%; max-height: 100vh; overflow-y: auto; border: 0; border-left: 1px solid var(--line-strong); background: var(--surface-strong); box-shadow: -34px 0 90px rgba(0, 0, 0, 0.42); color: var(--ink); animation: drawer-in 300ms var(--ease) both; }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 28px 28px 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-strong) 92%, transparent); backdrop-filter: blur(18px); }
.drawer-header h2 { margin: 6px 0 0; font-size: 31px; letter-spacing: -0.045em; }
.drawer-summary { margin: 0; padding: 22px 28px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.drawer-content { padding: 0 28px 36px; }
.drawer-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.drawer-stat { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.drawer-stat span, .drawer-stat strong, .drawer-stat small { display: block; }
.drawer-stat span { color: var(--ink-muted); font-size: 12px; }
.drawer-stat strong { margin: 6px 0 3px; font-size: 25px; line-height: 1; }
.drawer-stat small { color: var(--ink-muted); font-size: 12px; }
.drawer-section { margin-top: 26px; }
.drawer-section h3 { margin: 0 0 11px; font-size: 16px; }
.drawer-list { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.drawer-list-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--line); }
.drawer-list-row:first-child { border-top: 0; }
.drawer-list-row strong, .drawer-list-row small { display: block; }
.drawer-list-row strong { font-size: 13px; line-height: 1.35; }
.drawer-list-row small { margin-top: 4px; color: var(--ink-muted); font-size: 12px; line-height: 1.35; }
.material-button, .drawer-link { flex: none; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border: 0; background: transparent; color: var(--accent-pale); cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: none; }
.drawer-link .ui-icon { width: 14px; height: 14px; }
.material-copy { margin: 0; color: var(--ink-soft); font: inherit; line-height: 1.65; white-space: pre-wrap; }
.drawer-danger { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }

.confirm-dialog { width: min(500px, calc(100% - 30px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 23px; background: var(--surface-strong); box-shadow: var(--shadow-xl); color: var(--ink); }
.confirm-dialog::backdrop { background: rgba(0, 5, 12, 0.76); backdrop-filter: blur(8px); }
.confirm-card { padding: 29px; }
.confirm-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 15px; background: var(--danger-soft); color: var(--danger); }
.confirm-card h2 { margin: 8px 0 0; font-size: 27px; letter-spacing: -0.04em; }
.confirm-card > p:not(.section-kicker) { margin: 13px 0 0; color: var(--ink-soft); line-height: 1.6; }
.confirm-reason { display: block; margin-top: 19px; color: var(--ink-soft); font-size: 13px; font-weight: 680; }
.confirm-reason textarea { min-height: 92px; margin-top: 7px; padding: 12px 14px; resize: vertical; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 130; max-width: min(420px, calc(100% - 48px)); padding: 13px 17px; border: 1px solid color-mix(in srgb, var(--status) 28%, var(--line)); border-radius: 14px; background: var(--surface-strong); box-shadow: var(--shadow-md); color: var(--ink); font-size: 14px; }
.toast[data-kind="error"] { border-color: color-mix(in srgb, var(--danger) 36%, var(--line)); }
.empty-state, .error-state { min-height: 82px; display: grid; place-items: center; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--ink-muted); font-size: 13px; text-align: center; }
.error-state { color: var(--danger); }
.skeleton-line, .skeleton-card { border-radius: 11px; background: linear-gradient(90deg, var(--surface-soft), color-mix(in srgb, var(--accent) 8%, var(--surface-soft)), var(--surface-soft)); background-size: 200% 100%; animation: skeleton 1.4s linear infinite; }
.skeleton-line { height: 45px; margin-top: 8px; }
.skeleton-card { height: 74px; margin: 10px 0; }

.dashboard-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 2px 0; color: var(--ink-muted); font-size: 12px; }

/* Вход */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; overflow: hidden; }
.auth-mesh { position: fixed; inset: -10%; pointer-events: none; background: radial-gradient(circle at 50% 42%, rgba(0, 212, 255, 0.17), transparent 29%), linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px); background-size: auto, 54px 54px, 54px 54px; transform: perspective(700px) rotateX(62deg) translateY(24%); }
.auth-card { position: relative; width: min(470px, 100%); padding: 44px; border-radius: 28px; text-align: center; }
.brand--center { justify-content: center; margin-bottom: 36px; }
.brand--center > span:last-child { text-align: left; }
.brand--center b, .brand--center small { display: block; }
.brand--center b { font-size: 13px; }
.brand--center small { color: var(--ink-muted); font-size: 12px; }
.auth-card h1 { margin: 13px 0 0; font-size: clamp(42px, 8vw, 62px); line-height: 0.98; letter-spacing: -0.06em; }
.auth-copy { margin: 18px 0 24px; color: var(--ink-soft); }

@keyframes flow { to { stroke-dashoffset: -120; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.16); filter: brightness(1.2); } }
@keyframes skeleton { to { background-position: -200% 0; } }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1240px) {
  .topbar-inner { flex-wrap: wrap; padding: 12px 0; }
  .view-nav { order: 3; width: 100%; }
  .view-nav-button { flex: 1; }
  .hero-grid { grid-template-columns: 1fr; }
  .today-column { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .slot-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .research-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .dashboard-shell, .topbar-inner { width: min(100% - 28px, var(--page)); }
  .dashboard-shell { padding-top: 38px; }
  .brand-product, .quiet-button { display: none; }
  .intro, .page-heading { grid-template-columns: 1fr; gap: 18px; }
  .page-heading > .secondary-button { justify-self: start; }
  .kpi-ribbon { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-card:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .kpi-card:nth-child(5) { border-top: 1px solid var(--line); }
  .research-grid { grid-template-columns: 1fr; }
  .metrics-visual { min-height: 500px; margin-top: -4px; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .dashboard-shell, .topbar-inner { width: min(100% - 20px, var(--page)); }
  .topbar-inner { gap: 10px; }
  .brand-wordmark { font-size: 16px; }
  .topbar-actions { gap: 6px; }
  .factory-state { padding-right: 10px; }
  .state-copy { display: none; }
  .view-nav-button { min-height: 44px; padding: 0 10px; font-size: 13px; }
  .dashboard-shell { padding: 30px 0 38px; }
  .intro, .page-heading { margin-bottom: 24px; }
  .intro h1, .page-heading h1 { font-size: clamp(38px, 12vw, 55px); }
  .intro-note p, .page-heading p:not(.eyebrow) { font-size: 15px; }
  .section-heading, .section-heading--map { padding: 20px 19px 0; }
  .freshness { white-space: normal; text-align: right; }
  .factory-stage { min-height: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 14px; perspective: none; }
  .factory-floor, .factory-lines { display: none; }
  .factory-node { position: relative; inset: auto; width: 100%; min-height: 154px; transform: none; }
  .factory-node::after { display: none; }
  .factory-node:hover { transform: translateY(-3px); }
  .node-value { font-size: 31px; }
  .map-legend { flex-wrap: wrap; gap: 10px 16px; min-height: 70px; padding: 13px 19px; }
  .map-hint { width: 100%; margin-left: 0; }
  .today-column { grid-template-columns: 1fr; }
  .kpi-ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { border-top: 1px solid var(--line); }
  .kpi-card:nth-child(odd) { border-left: 0; }
  .kpi-card:first-child, .kpi-card:nth-child(2) { border-top: 0; }
  .slot-strip { display: flex; overflow-x: auto; padding: 18px; scroll-snap-type: x mandatory; }
  .slot-card { min-width: 210px; scroll-snap-align: start; }
  .metrics-heading { padding: 24px 20px 0; }
  .metrics-heading .text-action { display: none; }
  .metrics-glance { grid-template-columns: 1fr; padding: 20px 20px 0; }
  .metrics-visual { min-height: 500px; margin-top: 2px; }
  .metrics-axis { right: 20px; left: 20px; }
  .calendar-week { padding: 0 14px 18px; }
  .calendar-week-head { align-items: flex-start; }
  .calendar-week-head p { display: none; }
  .panel-explainer { margin-right: 19px; margin-left: 19px; }
  .compact-form { padding-right: 19px; padding-left: 19px; }
  .form-row { grid-template-columns: 1fr; }
  .form-row .primary-button { width: 100%; }
  .topic-list { padding-right: 19px; padding-left: 19px; }
  .research-days { grid-template-columns: 1fr; padding: 18px; }
  .drawer-layer { grid-template-columns: 1fr; }
  .node-drawer { grid-column: 1; }
  .drawer-header { padding: 22px 20px 17px; }
  .drawer-summary { padding: 18px 20px; }
  .drawer-content { padding: 0 20px 28px; }
  .confirm-card { padding: 23px; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions button { width: 100%; }
  .dashboard-footer { flex-direction: column; gap: 6px; }
}

@media (max-width: 420px) {
  .brand-wordmark { font-size: 14px; }
  .icon-button { width: 42px; }
  .factory-stage { grid-template-columns: 1fr; }
  .factory-node { min-height: 136px; }
  .kpi-ribbon { grid-template-columns: 1fr; }
  .kpi-card { border-left: 0; }
  .kpi-card:nth-child(2) { border-top: 1px solid var(--line); }
  .drawer-stat-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .factory-node, .factory-floor, .factory-lines { transform: none !important; }
}
