/* =====================================================================
   Midpack — Product Longread
   Editorial system built on the IG Studio design tokens.
   ===================================================================== */

:root {
  /* Surface — warm neutral paper */
  --bg: #f7f7f5;
  --paper: #fdfdfc;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --surface-3: #f1f1ee;
  --desk: #f7f7f7;

  /* Ink */
  --ink-0: #0d0d10;
  --ink-1: #16161a;
  --ink-2: #3d3d44;
  --ink-3: #6b6b73;
  --ink-4: #9a9aa1;
  --ink-5: #c8c8cc;

  /* Border */
  --border: #e6e6e1;
  --border-strong: #d4d4cf;
  --hair: #ddddd6;

  /* Accent — indigo */
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --accent-ring: #c7caff;
  --accent-ink: #312e81;

  /* Linked — purple */
  --linked: #7c3aed;
  --linked-soft: rgba(124, 58, 237, 0.06);
  --linked-ring: rgba(124, 58, 237, 0.28);
  --linked-ink: #5b3bb0;
  --linked-border: rgba(124, 58, 237, 0.20);

  /* Status */
  --ok: #2f7a4a;
  --ok-soft: #e6f0e9;
  --ok-ring: #b8d8c2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --warn-ring: #fcd34d;
  --coral: #b53527;
  --coral-soft: #fdf0f4;

  /* Azure — external links */
  --teal: #1f74c4;
  --teal-soft: #eff6fc;
  --teal-ring: #aacef0;
  --teal-ink: #1a5694;
  --teal-border: #cfe4f7;

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow-sm: 0 1px 2px rgba(20, 20, 28, 0.05);
  --shadow-md: 0 4px 16px -4px rgba(20, 20, 28, 0.10), 0 2px 4px rgba(20, 20, 28, 0.05);
  --shadow-lg: 0 24px 60px -22px rgba(20, 20, 28, 0.30), 0 8px 20px -10px rgba(20, 20, 28, 0.12);

  --page-w: 820px;
  --pad-x: 76px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.62;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ Sheet / page column ============ */
.doc {
  max-width: var(--page-w);
  margin: 0 auto;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
}

section.sheet {
  padding: 64px var(--pad-x);
  scroll-margin-top: 18px;
  position: relative;
  border-bottom: 1px solid var(--hair);
}
section.sheet:last-child { border-bottom: none; }
.sheet.tight { padding-top: 44px; padding-bottom: 44px; }
.sheet.dark { background: #15151a; color: #e9e9ec; border-bottom-color: #2a2a30; }

/* full-bleed within the column */
.bleed { margin-left: calc(var(--pad-x) * -1); margin-right: calc(var(--pad-x) * -1); }

/* ============ Type ============ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0;
}
.eyebrow .num { color: var(--accent); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink-0); letter-spacing: -0.02em; }
h1 { font-size: 62px; line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: 33px; line-height: 1.1; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.012em; }
h4 { font-size: 14.5px; line-height: 1.35; letter-spacing: -0.005em; }

p { margin: 0 0 14px 0; color: var(--ink-2); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 18px; line-height: 1.6; color: var(--ink-1); letter-spacing: -0.006em; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; line-height: 1.55; }
strong, b { font-weight: 600; color: var(--ink-1); }
em { font-style: italic; }
.mono { font-family: var(--font-mono); }
.term { font-weight: 600; color: var(--ink-1); box-shadow: inset 0 -0.5em 0 rgba(79,70,229,0.10); }

/* section header block */
.sec-head { margin-bottom: 26px; }
.sec-head .kicker {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px;
}
.sec-head .kicker .sn {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.sec-head .kicker .rule { flex: 1; height: 1px; background: var(--border); }
.sec-head h2 { max-width: 16em; }
.sec-head .dek { margin-top: 14px; max-width: 38em; font-size: 16px; color: var(--ink-2); }

/* columns */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid { display: grid; gap: 16px; }

/* figure + caption */
figure { margin: 0; }
.fig {
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.fig img { display: block; width: 100%; height: auto; }
.cap {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-4);
  margin-top: 10px;
  letter-spacing: 0.01em;
}
.cap b { color: var(--ink-2); font-weight: 600; }
.cap .tag {
  color: var(--accent); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px;
  margin-right: 8px;
}

/* browser frame for full screenshots */
.window {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}
.window .bar {
  height: 34px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 7px;
  padding: 0 13px;
}
.window .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-5); }
.window .bar .addr {
  margin-left: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  height: 20px; line-height: 20px; padding: 0 10px; flex: 1; max-width: 320px;
}
.window img { display: block; width: 100%; height: auto; }

/* callout / aside */
.callout {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  padding: 18px 20px;
}
.callout.accent { border-color: var(--accent-ring); background: var(--accent-soft); }
.callout.warn { border-color: var(--warn-ring); background: var(--warn-soft); }
.callout .lbl {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 7px;
}
.callout.accent .lbl { color: var(--accent-ink); }
.callout.warn .lbl { color: var(--warn); }

/* inline code */
code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--ink-1); }
.callout ul.ticks { margin: 10px 0 0; gap: 8px; }
.callout ul.ticks li { font-size: 13.5px; color: var(--ink-3); }

/* file-kind cards — section 06 top block: stacked shelf rows */
.fkinds { display: flex; flex-direction: column; gap: 12px; }
.fkind { display: grid; grid-template-columns: 232px 1fr; align-items: stretch; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.fkind .fk-head { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-right: 1px solid var(--border); background: var(--surface-2); }
.fkind .fk-ic { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--border); }
.fkind .fk-ic svg { width: 19px; height: 19px; }
.fkind .lbl { margin: 0; }
.fkind .fk-foot { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.fkind .fk-foot .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.fkind .fk-body { padding: 20px; }
.fkind .fk-body p.small { margin-top: 0; }
.fkind .fk-body ul.ticks { margin-bottom: 0; }
/* versioned-here cards */
.fkind.versioned .fk-ic { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-ring); }
.fkind.versioned .fk-foot { color: var(--ok); }
.fkind.versioned .fk-foot .dot { background: var(--ok); }
/* external-link card */
.fkind.external { background: #fffdf4; border-color: #ecdca0; }
.fkind.external .fk-head { background: #faf0ca; border-right-color: #ecdca0; }
.fkind.external .fk-ic { background: #fffdf4; color: #9a7b1c; border-color: #e6d292; }
.fkind.external .lbl { color: #6f560f; }
.fkind.external .fk-foot { color: #6f560f; }
.fkind.external .fk-foot .dot { background: #b89320; }

/* "hidden bill" ledger — НАСЛІДКИ */
.bill { border: 1px solid var(--warn-ring); border-radius: 12px; background: var(--warn-soft); overflow: hidden; }
.bill-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--warn-ring); }
.bill-head .lbl { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--warn); }
.bill-head .sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-3); }
.bill-row { display: grid; grid-template-columns: 18px 1fr; column-gap: 13px; align-items: start; padding: 14px 18px; }
.bill-row + .bill-row { border-top: 1px solid color-mix(in srgb, var(--warn-ring) 55%, transparent); }
.bill-row .x { width: 18px; height: 18px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.bill-row > div { display: flex; flex-direction: column; min-width: 0; }
.bill-row .x svg { width: 9px; height: 9px; }
.bill-row .top { display: grid; grid-template-columns: 1fr auto; align-items: start; column-gap: 14px; }
.bill-row h5 { margin: 0; font-size: 14.5px; font-weight: 650; line-height: 1.3; color: var(--ink-0); }
.bill-row p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.bill-row .ded { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--warn); white-space: nowrap; padding: 3px 7px; border-radius: 5px; background: color-mix(in srgb, var(--warn) 10%, transparent); }

/* inline UI tokens (match prototype vocabulary) */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
  vertical-align: middle;
}
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.chip.linked { background: var(--linked-soft); color: var(--linked-ink); box-shadow: inset 0 0 0 1px var(--linked-border); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-ring); }
.chip.v { padding: 0 6px; height: 18px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

ul.clean, ol.clean { margin: 0; padding: 0; list-style: none; }
ul.ticks { margin: 14px 0; padding: 0; list-style: none; display: grid; gap: 9px; }
ul.ticks li {
  position: relative; padding-left: 26px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5;
}
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 16px; height: 16px; border-radius: 5px;
  background: var(--ok-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.8 6l2.2 2.2 4.2-4.4' stroke='%232f7a4a' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
ul.crosses li::before {
  background: #f6e3e0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.3 3.3l5.4 5.4M8.7 3.3l-5.4 5.4' stroke='%23b53527' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ============ FAQ ============ */
.faq .qa { padding: 18px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr; gap: 7px; break-inside: avoid; }
.faq .qa:last-child { border-bottom: none; }
.faq .qa .q { font-size: 16px; font-weight: 600; color: var(--ink-0); letter-spacing: -0.012em; display: flex; gap: 10px; }
.faq .qa .q .mk { color: var(--accent); font-family: var(--font-mono); font-size: 13px; flex-shrink: 0; }
.faq .qa .a { font-size: 14px; color: var(--ink-2); line-height: 1.55; padding-left: 23px; }

/* ============ Closing ============ */
.closing { text-align: center; padding-top: 80px; padding-bottom: 80px; }
.closing .logo { width: 44px; height: 44px; border-radius: 11px; background: var(--ink-0); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 22px; margin-bottom: 20px; }
.closing .cl { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; max-width: 22em; margin: 0 auto 10px; }
.closing .cs { color: var(--ink-3); font-size: 14px; }

/* ============ Cover ============ */
.cover { padding-top: 70px; padding-bottom: 0; }
.cover .brandline { display: flex; align-items: center; gap: 12px; margin-bottom: 60px; }
.cover .logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink-0); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 17px; letter-spacing: -0.04em;
}
.cover .wordmark { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.cover .docmeta { margin-left: auto; text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); line-height: 1.7; }
.cover h1 { max-width: 14em; margin-bottom: 26px; }
.cover .essence { font-size: 20px; line-height: 1.5; color: var(--ink-2); max-width: 30em; letter-spacing: -0.01em; }
.cover .essence b { color: var(--ink-0); }

/* ============ Stage ribbon (signature) ============ */
.ribbon-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden; }
.ribbon-top {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.ribbon-top .thumb { width: 30px; height: 30px; border-radius: 6px; background: linear-gradient(135deg,#cdb6a3,#9a7d63); flex-shrink: 0; }
.ribbon-top .pname { font-weight: 600; font-size: 14px; }
.ribbon-top .pname span { color: var(--ink-3); font-weight: 400; }
.ribbon-top .spacer { flex: 1; }

.ribbon { display: flex; align-items: stretch; gap: 0; padding: 18px 16px 20px; overflow-x: auto; }
.stage {
  flex: 0 0 auto; min-width: 132px; position: relative;
  padding: 0 12px;
}
.stage + .stage { border-left: 1px dashed var(--border); }
.stage .pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 11px 0 8px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.stage .pip { width: 15px; height: 15px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; }
.stage .pip.done { background: var(--ok-soft); color: var(--ok); }
.stage .pip.active { background: var(--accent); color: #fff; }
.stage .pip.todo { background: transparent; border: 1px dashed var(--ink-5); }
.stage.is-active .pill { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); color: var(--ink-0); font-weight: 600; }
.stage .perf { margin-top: 9px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.stage .perf .av { width: 17px; height: 17px; border-radius: 50%; font-size: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.stage .files { margin-top: 11px; display: grid; gap: 5px; }
.fitem {
  display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 7px;
}
.fitem .fx { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); }
.fitem .vv { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); background: var(--surface-3); padding: 0 4px; border-radius: 3px; }
.fitem.linked { border-color: var(--linked-border); background: var(--linked-soft); }
.fitem svg { width: 12px; height: 12px; flex-shrink: 0; }

/* pinned comment bubble on a stage */
.pin {
  margin-top: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 9px; box-shadow: var(--shadow-sm); position: relative;
}
.pin::before {
  content: ""; position: absolute; top: -5px; left: 16px; width: 9px; height: 9px;
  background: #fff; border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.pin.flagged { border-color: var(--warn-ring); background: linear-gradient(180deg,#fff8e9,#fffdf6); }
.pin .ph { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.pin .ph .av { width: 16px; height: 16px; border-radius: 50%; font-size: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.pin .ph .nm { font-size: 11px; font-weight: 600; }
.pin .pb { font-size: 11.5px; line-height: 1.4; color: var(--ink-2); }
.av-marta { background: linear-gradient(135deg, #d1b8a3, #a18062); }
.av-olena { background: linear-gradient(135deg, #6a8eb5, #3d5d86); }
.av-founder { background: linear-gradient(135deg, #a37cd1, #6b4ba1); }
.av-tech { background: linear-gradient(135deg, #8fae8f, #5d7d5d); }

/* spinning loader for an "in progress" status — replaces the static dot */
.spin {
  width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; flex: none;
  border: 1.5px solid var(--accent-ring); border-top-color: var(--accent);
  animation: spin 1.5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* "someone is typing" indicator below the latest comment */
.typing { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.typing .av { width: 16px; height: 16px; border-radius: 50%; color: #fff; font-size: 8px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.typing .tlabel { font-size: 10.5px; color: var(--ink-4); font-style: italic; }
.tdots { display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); }
.tdots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); animation: tdot 1.25s ease-in-out infinite; }
.tdots i:nth-child(2) { animation-delay: 0.16s; }
.tdots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes tdot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-3px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .spin, .vspine .vpip.active::before { animation: none; }
  .tdots i { animation: none; opacity: 0.55; }
}

/* ============ Vertical signature timeline ============ */
.vrib { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.vrib-top { display: flex; align-items: center; gap: 11px; padding: 15px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.vrib-top .thumb { width: 34px; height: 34px; border-radius: 7px; background: linear-gradient(135deg,#cdb6a3,#9a7d63); flex-shrink: 0; }
.vrib-top .pn { font-weight: 600; font-size: 15px; }
.vrib-top .pn span { color: var(--ink-3); font-weight: 400; }
.vrib-top .spacer { flex: 1; }
.vrib-body { padding: 8px 20px 20px; }

.vstage { display: grid; grid-template-columns: 24px 1fr; gap: 14px; }
.vspine { display: flex; flex-direction: column; align-items: center; }
.vspine .vpip { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 10px; font-weight: 600; flex-shrink: 0; margin-top: 14px; z-index: 1; }
.vspine .vpip.done { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-ring); }
.vspine .vpip.active {
  background: var(--surface); color: #fff;
  box-shadow: 0 0 0 1px var(--accent-ring);
  border: 1px solid var(--accent-ring);
}
/* spinner sits inside the white disc, not as the pip's border */
.vspine .vpip.active::before {
  content: ""; width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid var(--accent-ring); border-top-color: var(--accent);
  animation: spin 1.5s linear infinite;
}
.vspine .vpip.todo { background: var(--surface); color: var(--ink-4); box-shadow: inset 0 0 0 1px var(--border-strong); }
.vspine .vline { flex: 1; width: 2px; background: var(--border); margin: 2px 0; }
.vstage.is-done .vspine .vline { background: var(--ok-ring); }
.vstage:has(.vpip.active) .vspine .vline { background: var(--accent-ring); }
.vstage:last-child .vspine .vline { display: none; }

.vcontent { padding: 12px 0 18px; min-width: 0; }
.vstage:last-child .vcontent { padding-bottom: 4px; }
.vhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vname { font-size: 14.5px; font-weight: 600; color: var(--ink-1); }
.vstage.is-todo .vname { color: var(--ink-3); font-weight: 500; }
.vstatus { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 5px; display: inline-flex; align-items: center; gap: 4px; }
.vstatus.done { background: var(--ok-soft); color: var(--ok); }
.vstatus.active { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.vstatus.todo { background: var(--surface-3); color: var(--ink-3); }
.vperf { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); }
.vperf .av { width: 17px; height: 17px; border-radius: 50%; font-size: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.vfiles { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.vfiles.col { flex-direction: column; }
.vstage.is-todo .vfiles { opacity: 0.55; }

/* ============ Compact horizontal stepper + transition bar ============ */
.stepper { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow: hidden; scroll-behavior: smooth; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px 11px 0 0; }
.spill { transition: background .2s ease, color .2s ease; }
.spill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 7px; border-radius: 7px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.spill .sp { width: 14px; height: 14px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 8px; }
.spill .sp.done { background: var(--ok-soft); color: var(--ok); }
.spill .sp.todo { background: transparent; box-shadow: inset 0 0 0 1px var(--ink-5); }
.spill.done { color: var(--ink-2); }
.spill.active { background: #fff; border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); color: var(--ink-0); font-weight: 600; height: 30px; }
.spill.active .lab { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; background: var(--accent-soft); padding: 2px 5px; border-radius: 4px; }
.spill.active .lab .spin { width: 9px; height: 9px; }
.step-arrow { color: var(--ink-5); font-size: 10px; }
.xfer { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 11px 11px; background: var(--surface); flex-wrap: nowrap; margin-top: -1px; }
.xfer .field { display: flex; flex-direction: column; gap: 2px; }
.xfer .field .fl { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-4); }
.xfer .field .fv { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-1); }
.xfer .field .fv .av { width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 8px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.xfer .vr { width: 1px; height: 26px; background: var(--border); }
.xfer .btns { margin-left: auto; display: flex; gap: 7px; }
.xbtn { height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); font-family: inherit; font-size: 12px; font-weight: 500; color: var(--ink-1); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; transition: transform .12s ease, filter .15s ease, opacity .15s ease; }
.xbtn:hover:not(:disabled) { filter: brightness(0.97); }
.xbtn:active:not(:disabled) { transform: translateY(1px); }
.xbtn:disabled { opacity: 0.4; cursor: default; }
.xbtn.primary { background: var(--ink-0); color: #fff; border-color: var(--ink-0); }
.xbtn.go { background: var(--ok); color: #fff; border-color: var(--ok); }
@media (max-width: 560px) {
  .wf-usedby { display: none; }
  .xfer { flex-wrap: wrap; }
  .xfer .btns { margin-left: 0; width: 100%; }
  .xfer .btns .xbtn { flex: 1; justify-content: center; }
}

/* ============ Workflow builder ============ */
.wf { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.wf-top { display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.wf-top .t { font-size: 13px; font-weight: 600; }
.wf-top .spacer { flex: 1; }
.wf-canvas { padding: 26px 22px; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 15px 15px; }

/* live pipeline: pulses cascade left→right, splitting at Тех-пак and merging at Зразок */
.wf-flow path {
  stroke: var(--accent); stroke-width: 1.8;
  stroke-dasharray: 5 150;
  animation: wf-flow 2.4s linear infinite;
}
.wf-flow path:nth-child(1) { animation-delay: 0s; }
.wf-flow path:nth-child(2), .wf-flow path:nth-child(3) { animation-delay: 0.3s; }
.wf-flow path:nth-child(4), .wf-flow path:nth-child(5) { animation-delay: 0.6s; }
.wf-flow path:nth-child(6) { animation-delay: 0.9s; }
@keyframes wf-flow { to { stroke-dashoffset: -155; } }

/* hover-highlight a stage */
.fc-node { cursor: default; transition: transform 0.16s ease; }
.fc-node rect { transition: stroke 0.16s ease, filter 0.16s ease; }
.fc-node:hover { transform: translateY(-2px); }
.fc-node:hover rect { stroke: var(--accent); filter: drop-shadow(0 3px 7px rgba(79, 70, 229, 0.22)); }

@media (prefers-reduced-motion: reduce) {
  .wf-flow path { animation: none; display: none; }
}

/* ============ Screenshot lightbox ============ */
.window img { cursor: zoom-in; transition: filter 0.15s ease; }
.window:hover img { filter: brightness(0.97); }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  background: rgba(13, 13, 16, 0.84);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: lb-fade 0.18s ease;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: 10px; box-shadow: var(--shadow-lg);
  cursor: zoom-out; animation: lb-zoom 0.2s cubic-bezier(.2,.7,.2,1);
}
.lightbox-close {
  position: fixed; top: 18px; right: 18px; z-index: 201;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; line-height: 1; color: #fff;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.15s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.24); }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-zoom { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox-img { animation: none; }
}
.wf-node { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.wf-box { width: 96px; height: 46px; border-radius: 9px; border: 1px solid var(--border-strong); background: #fff; box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: var(--ink-1); text-align: center; padding: 0 6px; position: relative; }
.wf-box.start { background: var(--ink-0); color: #fff; border-color: var(--ink-0); }
.wf-box.review { border-color: var(--accent-ring); background: var(--accent-soft); color: var(--accent-ink); }
.wf-box .grip { position: absolute; top: 5px; left: 6px; color: var(--ink-5); font-size: 9px; letter-spacing: -1px; }
.wf-perf { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); }

/* ============ Role cards ============ */
.role {
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
  padding: 16px 16px 15px; box-shadow: var(--shadow-sm);
}
.role .rh { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.role .av { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role .rname { font-size: 14px; font-weight: 600; }
.role .rrole { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-4); }
.role .job { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.role .hires { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--ink-3); }
.role .hires b { color: var(--ink-2); }

/* ============ Quote cards ============ */
.quote {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 22px 22px 18px; box-shadow: var(--shadow-sm); position: relative; break-inside: avoid;
}
.quote .qmark { font-size: 40px; line-height: 0.6; color: var(--accent-ring); font-family: Georgia, serif; }
.quote .qt { font-size: 15.5px; line-height: 1.55; color: var(--ink-1); margin: 6px 0 14px; letter-spacing: -0.005em; }
.quote .qf { display: flex; align-items: center; gap: 9px; }
.quote .qf .av { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.quote .qf .who { font-size: 12.5px; }
.quote .qf .who b { display: block; font-weight: 600; color: var(--ink-1); }
.quote .qf .who span { color: var(--ink-4); font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ============ Metric plates ============ */
.metric {
  position: relative;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, border-color .3s ease;
}
/* hairline accent that wipes in from the left on hover */
.metric::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-ring) 55%, transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.metric:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.metric:hover::after { transform: scaleX(1); }

/* mono category kicker — "01 · Прозорість" */
.metric .mlabel {
  display: flex; align-items: center; gap: 8px; margin-bottom: 18px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.15em; color: var(--ink-4);
}
.metric .mlabel .mi { color: var(--accent); font-size: 9.5px; padding-right: 8px; border-right: 1px solid var(--border); }

/* headline value */
.metric .mv { font-size: 38px; font-weight: 600; letter-spacing: -0.035em; color: var(--ink-0); line-height: 0.98; font-variant-numeric: tabular-nums; }
.metric .mv small { font-size: 15px; font-weight: 500; color: var(--ink-3); letter-spacing: -0.01em; }
.metric.accent .mv { color: var(--accent); }

/* directional plates: text-led headline + arrow badge */
.metric.dir .mv { font-size: 23px; letter-spacing: -0.02em; line-height: 1.15; }
.metric .ar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5em; height: 1.5em; margin-left: 0.15em; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.72em; font-weight: 700; vertical-align: middle;
}

/* supporting line */
.metric .mt { font-size: 13px; color: var(--ink-2); margin-top: 11px; line-height: 1.5; }

/* baseline shown as a quiet delta chip — no alarming red */
.metric .was {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.02em; color: var(--ink-4);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 4px;
}
.metric .was:has(del)::before { content: "↓"; color: var(--accent); font-weight: 700; }
.metric .was del { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-5); }

/* soft indigo wash marks the two primary target plates */
.metric.accent {
  background: radial-gradient(130% 110% at 0% 0%, var(--accent-soft), transparent 52%), var(--surface);
  border-color: var(--accent-ring);
}

@media (prefers-reduced-motion: reduce) {
  .metric, .metric::after { transition: none; }
  .metric:hover { transform: none; }
}

/* metrics: match the first-row horizontal gap to the gap between rows (16px) */
#s-metrics .cols-2 { gap: 16px; }

/* ============ Step ribbon (season / getting started) ============ */
.steps { display: grid; gap: 12px; }
.step {
  display: grid; grid-template-columns: 38px 1fr; gap: 16px; align-items: start;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.step:first-child { border-top: none; }
.step .sx {
  width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.step h4 { margin-bottom: 4px; }
.step p { font-size: 13.5px; color: var(--ink-3); margin: 0; }
.step .files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.fname { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 7px; }
.fname svg { width: 10px; height: 10px; color: var(--ink-4); flex-shrink: 0; }

/* ============ Comparison table ============ */
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp th, .cmp td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cmp thead th {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-4); border-bottom: 1px solid var(--border-strong);
}
.cmp tbody td:first-child { font-weight: 600; color: var(--ink-1); width: 28%; }
.cmp td .lim { color: var(--ink-3); }
.cmp tr:last-child td { border-bottom: none; }
.cmp .mp { color: var(--accent-ink); font-weight: 600; }

/* ============ Scope diagram ============ */
.scope { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.scope .col { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.scope .col .ch { padding: 12px 14px 11px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.scope .col .ch .lbl { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.scope .col.core .ch { background: var(--ok-soft); } .scope .col.core .ch .lbl { color: var(--ok); }
.scope .col.later .ch { background: var(--surface-3); } .scope .col.later .ch .lbl { color: var(--ink-3); }
.scope .col.no .ch { background: var(--coral-soft); } .scope .col.no .ch .lbl { color: var(--coral); }
.scope .col ul { margin: 0; padding: 10px 14px 14px; list-style: none; display: grid; gap: 8px; }
.scope .col li { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; padding-left: 15px; position: relative; }
.scope .col li::before { content: ""; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-5); }
.scope .col.core li::before { background: var(--ok); }
.scope .col.no li::before { background: var(--coral); border-radius: 1px; }

/* ============ Data spectrum ============ */
.spectrum { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 18px 20px 20px; }
.spectrum .track { position: relative; height: 6px; border-radius: 3px; margin: 10px 0 18px; background: linear-gradient(90deg, var(--accent-soft), var(--surface-3) 55%, var(--coral-soft)); }
.spectrum .ends { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-4); white-space: nowrap; }
.spectrum .nodes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.spectrum .node { text-align: left; }
.spectrum .node .nt { font-size: 13px; font-weight: 600; color: var(--ink-1); margin-bottom: 3px; }
.spectrum .node .nd { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.spectrum .node .badge { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 5px; border-radius: 3px; }
.spectrum .node.light .badge { background: var(--accent-soft); color: var(--accent-ink); }
.spectrum .node.heavy .badge { background: var(--coral-soft); color: var(--coral); }

/* ============ Component vs Template infographic ============ */
.cvt { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cvt .panel { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 18px; box-shadow: var(--shadow-sm); }
.cvt .panel.link-panel { border-color: var(--linked-border); background: radial-gradient(130% 90% at 100% 0%, rgba(124, 58, 237, 0.10), transparent 55%), #fff; }
.cvt .panel h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cvt .panel .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 16px; }
.diagram { display: flex; align-items: center; gap: 10px; }
.diagram .src {
  flex: 0 0 auto; width: 78px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2);
  padding: 9px; text-align: center; font-size: 10.5px; color: var(--ink-2);
}
.diagram .src.live { border-color: var(--linked-border); background: #fff; box-shadow: 0 0 0 3px var(--linked-soft); }
.diagram .src .ico { width: 22px; height: 22px; margin: 0 auto 5px; color: var(--linked); }
.diagram .arrows { flex: 1; display: grid; gap: 7px; }
.diagram .arrows .to {
  display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3);
}
.diagram .arrows .line { flex: 1; height: 1px; background: var(--border-strong); position: relative; }
.diagram .arrows.copy .line { border-top: 1px dashed var(--border-strong); background: none; }
.diagram .arrows .line::after { content: ""; position: absolute; right: 0; top: -3px; border: 3px solid transparent; border-left-color: var(--border-strong); }
.diagram .prod { width: 58px; padding: 7px 6px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); text-align: center; font-size: 10px; color: var(--ink-3); }
.diagram .prod.live { box-shadow: inset 0 0 0 1px var(--linked-border); }
.cvt .note { margin-top: 15px; font-size: 12px; color: var(--ink-3); line-height: 1.45; padding-top: 13px; border-top: 1px dashed var(--border); }
.cvt .note b { color: var(--ink-1); }

/* ============ Inheritance infographic ============ */
.inherit { border: none; border-radius: 14px; background: transparent; padding: 0; }
.inherit .flow { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; gap: 0; }
.inherit .sources { display: grid; gap: 12px; }
.src-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; background: #fff; }
.src-card .st { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-4); margin-bottom: 6px; }
.src-card .si { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-1); margin-bottom: 8px; }
.src-card .gives { display: flex; flex-wrap: wrap; gap: 5px; }
.merge-col { display: flex; align-items: center; justify-content: center; position: relative; align-self: stretch; }
.merge-col svg { width: 64px; height: 100%; overflow: visible; }
.merge-col .merge-down { display: none; }

/* Animated convergence: pulses of indigo flow from the three sources into the hub. */
.merge-flow .rail { stroke: var(--accent-ring); stroke-width: 2; fill: none; }
.merge-flow .flow {
  stroke: var(--accent); stroke-width: 2.4; fill: none; stroke-linecap: round;
  stroke-dasharray: 7 128;            /* one short pulse, long gap (total > path length) */
  animation: merge-flow 2.6s linear infinite;
}
.merge-flow .f1 { animation-delay: 0s; }
.merge-flow .f2 { animation-delay: -0.85s; }
.merge-flow .f3 { animation-delay: -1.7s; }
.merge-flow .hub { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: merge-hub 2.6s ease-in-out infinite; }
.merge-flow .hub-ring { fill: none; stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: merge-ring 2.6s ease-out infinite; }
@keyframes merge-flow { to { stroke-dashoffset: -135; } }
/* mobile down-arrow: a pulse travels down the stem into the new-product card */
.merge-down .md-rail { stroke: var(--accent-ring); stroke-width: 2; }
.merge-down .md-head { stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.merge-down .md-flow {
  stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 5 40; animation: md-flow 1.4s linear infinite;
}
@keyframes md-flow { to { stroke-dashoffset: -45; } }
@keyframes merge-hub { 0%, 100% { transform: scale(1); } 46% { transform: scale(1); } 60% { transform: scale(1.5); } 80% { transform: scale(1); } }
@keyframes merge-ring { 0%, 50% { transform: scale(1); opacity: 0; } 62% { opacity: 0.5; } 100% { transform: scale(3.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .merge-flow .flow, .merge-flow .hub, .merge-flow .hub-ring { animation: none; }
  .merge-flow .flow { display: none; }
  .merge-down .md-flow { animation: none; display: none; }
  .exp-arrow .ea-flow { animation: none; display: none; }
}
.prod-card { border: 1.5px solid var(--accent-ring); border-radius: 12px; background: #fff; box-shadow: var(--shadow-md); overflow: hidden; }
.prod-card .pc-h { background: var(--accent-soft); padding: 11px 14px; border-bottom: 1px solid var(--accent-ring); }
.prod-card .pc-h .t { font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.prod-card .pc-h .s { font-family: var(--font-mono); font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.prod-card .pc-b { padding: 11px 13px; display: grid; gap: 6px; }

/* ============ Source of truth / export ============ */
.sot { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 30px 26px; }
.sot .hub-row { display: grid; grid-template-columns: 1fr 90px 1fr; align-items: center; gap: 0; }
.hub {
  border: 1.5px solid var(--ink-1); border-radius: 14px; background: var(--surface); padding: 20px;
  box-shadow: var(--shadow-md); text-align: center;
}
.hub .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--ink-0); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; margin-bottom: 10px; }
.hub .ht { font-size: 15px; font-weight: 600; }
.hub .hs { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.hub .chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 12px; }
.exp-arrow { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-4); }
.exp-arrow .lbl { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.exp-arrow .ea-rail, .exp-arrow .ea-head { stroke: var(--ink-4); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.exp-arrow .ea-flow {
  stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round;
  stroke-dasharray: 5 48; animation: ea-flow 1.6s linear infinite;
}
@keyframes ea-flow { to { stroke-dashoffset: -53; } }
.stores { display: grid; gap: 9px; }
.store { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; background: var(--surface-2); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.store .ic { width: 20px; height: 20px; flex-shrink: 0; }

/* ============ Phone (review package) ============ */
.phone { width: 270px; margin: 0 auto; }
.phone .device {
  border-radius: 38px; background: #1b1b20; padding: 11px; box-shadow: var(--shadow-lg);
}
.phone .screen { border-radius: 28px; overflow: hidden; background: var(--bg); height: 540px; position: relative; display: flex; flex-direction: column; }
.phone .notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 92px; height: 22px; background: #1b1b20; border-radius: 12px; z-index: 5; }
.phone .pkg-top { padding: 34px 15px 12px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 9px; }
.phone .pkg-top .lg { width: 26px; height: 26px; border-radius: 7px; background: var(--ink-0); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.phone .pkg-top .brand-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.phone .pkg-top .mode { margin-left: auto; font-size: 9.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.07em; background: var(--bg); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }
.phone .pinbody { flex: 1; padding: 26px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.phone .pinbody .lock { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.phone .pinbody h4 { font-size: 16px; margin-bottom: 6px; }
.phone .pinbody p { font-size: 12.5px; color: var(--ink-3); margin-bottom: 22px; }
.phone .pins { display: flex; gap: 9px; margin-bottom: 22px; }
.phone .pins .b { width: 38px; height: 46px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--ink-1); }
.phone .pins .b.filled { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.phone .pins .b.empty { color: var(--ink-5); }
.phone .cta { width: 100%; height: 42px; border-radius: 10px; background: var(--ink-0); color: #fff; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.phone .pkg-foot { padding: 11px 18px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); text-align: center; border-top: 1px solid var(--border); background: var(--surface); }

/* before infographic — scattered tools */
.scatter { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 22px; position: relative; min-height: 240px; }
.scatter .ctr { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); text-align: center; }
.scatter .ctr .q { font-size: 14px; font-weight: 600; color: var(--ink-1); background: #fff; border: 1px solid var(--border-strong); border-radius: 9px; padding: 9px 13px; box-shadow: var(--shadow-md); }
.scatter .ctr .cost { font-family: var(--font-mono); font-size: 11px; color: var(--coral); margin-top: 8px; }
.tool-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 11px; font-size: 12px; font-weight: 500; color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.tool-chip .d { width: 7px; height: 7px; border-radius: 50%; }

/* before infographic — fragmentation: team + files across systems */
.frag { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 20px 20px 22px; }
.frag-team { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px dashed var(--border-strong); }
.frag-team .lbl { font-family: var(--font-mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); }
.frag-team .avs { display: flex; gap: 7px; flex-wrap: wrap; }
.tav { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px 3px 3px; font-size: 11px; color: var(--ink-2); }
.tav .av { width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.frag-silos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.silo { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); overflow: hidden; display: flex; flex-direction: column; }
.silo .sh { display: flex; align-items: center; gap: 6px; padding: 8px 9px; border-bottom: 1px solid var(--border); background: var(--surface); }
.silo .sh .d { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.silo .sh .nm { font-size: 10.5px; font-weight: 600; color: var(--ink-1); line-height: 1.2; }
.silo .sh .who { font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.04em; }
.silo .sf { padding: 8px; display: grid; gap: 5px; flex: 1; }
.mfile { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--ink-2); background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 4px 6px; }
.mfile svg { width: 11px; height: 11px; color: var(--ink-4); flex-shrink: 0; }
.mfile .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfile .vv { margin-left: auto; font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-4); background: var(--surface-3); padding: 0 4px; border-radius: 3px; flex-shrink: 0; }
.mfile.conflict { border-color: var(--warn-ring); background: var(--warn-soft); }
.mfile.conflict .vv { background: #fff; color: var(--warn); }
.frag-note { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 11.5px; color: var(--coral); }
.frag-note svg { width: 13px; height: 13px; flex-shrink: 0; }

/* before illustration — scattered, hand-composed fragmentation scene */
.frag-ill { position: relative; height: 420px; border: 1px solid var(--border); border-radius: 14px; background: radial-gradient(120% 90% at 50% 30%, #ffffff 0%, var(--surface-2) 100%); overflow: hidden; }
.frag-ill .threads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.frag-ill .tlabel { position: absolute; top: 14px; left: 18px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-4); }

.fperson { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 5px; z-index: 4; }
.fperson .av { width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; border: 2.5px solid #fff; box-shadow: var(--shadow-md); }
.fperson .pl { font-size: 10.5px; color: var(--ink-2); background: #fff; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); white-space: nowrap; box-shadow: var(--shadow-sm); }

.fcard { position: absolute; width: 158px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 11px; box-shadow: var(--shadow-md); padding: 10px 11px 11px; z-index: 3; }
.fcard .fh { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.fcard .fh .d { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.fcard .fh .nm { font-size: 12px; font-weight: 600; color: var(--ink-1); line-height: 1.1; white-space: nowrap; }
.fcard .fh .who { font-family: var(--font-mono); font-size: 8px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.05em; }
.fcard .fl { display: flex; flex-direction: column; gap: 5px; }
.fchip { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 7px; }
.fchip svg { width: 11px; height: 11px; color: var(--ink-4); flex-shrink: 0; }
.fchip .vv { margin-left: auto; font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-4); background: var(--surface-3); padding: 0 4px; border-radius: 3px; }
.fchip.warnf { border-color: var(--warn-ring); background: var(--warn-soft); }
.fchip.warnf .vv { background: #fff; color: var(--warn); }
.floose { position: absolute; z-index: 3; box-shadow: var(--shadow-md); background: #fff; }
.conflict-tag { position: absolute; z-index: 5; display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--warn-ring); color: var(--coral); border-radius: 8px; padding: 4px 9px; font-size: 10.5px; font-weight: 600; box-shadow: var(--shadow-md); }
.conflict-tag svg { width: 13px; height: 13px; }
.conflict-tag { white-space: nowrap; }

/* TOC */
.toc { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 2px 40px; margin-top: 8px; }
.toc a { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--ink-1); }
.toc a:hover .tt { color: var(--accent); }
.toc .tn { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); width: 22px; flex-shrink: 0; }
.toc .tt { font-size: 13.5px; font-weight: 500; }
.toc .tdots { flex: 1; }

/* footer / running */
.runfoot { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); letter-spacing: 0.04em; }

/* utility */
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; } .mt40 { margin-top: 40px; }
.mb0 { margin-bottom: 0; }
.center { text-align: center; }

/* ============ Left table-of-contents (screen only) ============ */
.sidenav {
  position: fixed; top: 0; left: 0;
  width: 250px; height: 100vh;
  padding: 32px 20px 26px 30px;
  display: flex; flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sidenav-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; margin-bottom: 22px; flex-shrink: 0; }
.sidenav-brand .m {
  width: 27px; height: 27px; border-radius: 7px; background: var(--ink-0); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; letter-spacing: -0.04em;
}
.sidenav-brand .wm { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-1); line-height: 1.1; }
.sidenav-brand .wm span {
  display: block; font-family: var(--font-mono); font-size: 9px; font-weight: 500;
  color: var(--ink-4); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 3px;
}
.sidenav-list { display: flex; flex-direction: column; gap: 1px; }
.sidenav-link {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 10px; border-radius: 7px;
  text-decoration: none; color: var(--ink-3);
  font-size: 12.5px; line-height: 1.32; letter-spacing: -0.005em;
  transition: background .14s ease, color .14s ease;
}
.sidenav-link .n { font-family: var(--font-mono); font-size: 10px; color: var(--ink-5); width: 15px; flex-shrink: 0; transition: color .14s ease; }
.sidenav-link:hover { background: var(--surface-3); color: var(--ink-1); }
.sidenav-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.sidenav-link.active .n { color: var(--accent); }
.sidenav-foot {
  margin-top: auto; padding: 16px 10px 0; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); line-height: 1.7;
  border-top: 1px solid var(--border); margin-top: 18px;
}

/* Toggle button + scrim for the drawer state */
.sidenav-toggle {
  /* Bottom-left so it never overlaps the cover header / page logo. */
  position: fixed; bottom: 20px; left: 16px; z-index: 60;
  display: none; align-items: center; gap: 8px;
  height: 40px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-1);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; cursor: pointer;
  box-shadow: var(--shadow-md);
}
.sidenav-toggle svg { display: block; }
.sidenav-scrim {
  position: fixed; inset: 0; z-index: 45; background: rgba(20,20,28,.34);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.sidenav-scrim.show { opacity: 1; pointer-events: auto; }

/* Wide screens: persistent rail in the left gutter */
@media (min-width: 1400px) {
  .sidenav-toggle { display: none !important; }
}
/* Narrower: hide rail off-canvas, reveal via toggle/drawer */
@media (max-width: 1399px) {
  .sidenav {
    transform: translateX(-100%); transition: transform .26s ease;
    background: var(--bg); border-right: 1px solid var(--border);
    width: 264px;
  }
  .sidenav.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidenav-toggle { display: flex; }
  /* Floating "Зміст" toggle sits bottom-left (bottom 20px + 40px tall = 60px);
     clear it so the footer content never hides behind the button. */
  .sheet.closing { padding-bottom: 100px; }
}

/* ============ Responsive: tablet & phone ============ */
/* Tablet / small laptop: trim the wide editorial gutter, relax dense grids. */
@media (max-width: 860px) {
  :root { --pad-x: 32px; }
  section.sheet { padding: 48px var(--pad-x); }
  .sheet.tight { padding-top: 32px; padding-bottom: 32px; }
  h1 { font-size: 44px; }
  .cover { padding-top: 48px; }
  .cover .brandline { margin-bottom: 40px; }
  .scope, .spectrum .nodes, .frag-silos, .cols-3 { grid-template-columns: 1fr 1fr; }
}
/* Phone: minimal gutter so content keeps the screen width; stack everything. */
@media (max-width: 560px) {
  :root { --pad-x: 16px; }
  section.sheet { padding: 34px var(--pad-x); }
  .sheet.tight { padding-top: 24px; padding-bottom: 24px; }
  h1 { font-size: 32px; line-height: 1.06; }
  h2 { font-size: 24px; }
  .lead { font-size: 16px; }
  .cover .brandline { flex-wrap: wrap; gap: 8px; }
  .cover .docmeta { font-size: 10px; }
  .cover .essence { font-size: 16px; }
  .cols-2, .cols-3, .scope, .spectrum .nodes, .frag-silos, .cvt,
  .fkind, .inherit .flow, .sot .hub-row { grid-template-columns: 1fr; }
  /* stacked vertically — point the export arrow down instead of right */
  .exp-arrow .exp-svg { transform: rotate(90deg); margin: 12px 0; }
  .exp-arrow .lbl { display: none; }
  /* product header: wrap instead of squeezing the name into a thin column */
  .vrib-top { flex-wrap: wrap; padding: 14px 16px; }
  .vrib-top .spacer { display: none; }
  .vrib-top .pn { flex: 1 1 auto; min-width: 0; }
  .toc { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: 1fr; gap: 2px; }
  /* Stacked flow: the horizontal converging curves read as noise vertically.
     Swap them for a single top-to-bottom arrow between sources and the product card. */
  .merge-col { align-self: center; padding: 2px 0; }
  .merge-col svg:not(.merge-down) { display: none; }
  .merge-col .merge-down { display: block; width: 22px; height: 38px; }
}
@media (max-width: 380px) {
  :root { --pad-x: 12px; }
  h1 { font-size: 29px; }
}

/* ============ Print ============ */
@page { size: A4 portrait; margin: 14mm 15mm; }
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  :root { --pad-x: 0px; }
  body { background: #fff; }
  .doc { box-shadow: none; max-width: none; }
  section.sheet { padding: 20px 0; border-bottom: none; }
  /* bleed offset collapses to page edge now that --pad-x is 0; also override inline padding */
  .bleed { margin-left: 0 !important; margin-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }
  .no-print { display: none !important; }
  .fig, .window, .ribbon-wrap, .quote, .role, .metric, .panel, .inherit, .sot, .spectrum, .scope .col, .phone, .callout, .scatter { break-inside: avoid; box-shadow: none; }
  .sec-head, h2, h3 { break-after: avoid; }
  .page-break { break-before: page; }
  .cover { break-after: page; }
}
