/* Vekvik: drawing paper, pencil ink, one green for "go" and a wood tone for what's in stock. */
:root {
  --paper: #f6f3ee;
  --panel: #fffdf9;
  --sunk: #ece7df;
  --ink: #1c1b18;
  --muted: #5e5a52;
  --line: #d9d2c6;
  --line-strong: #a39b8d;
  --go: #1f5d4a;
  --go-hover: #174a3b;
  --go-wash: #e1ede8;
  --on-go: #ffffff;
  --wood: #b07a3f;
  --wood-wash: #f3e7d8;
  --warn: #8a5300;
  --warn-wash: #fbecc8;
  --bad: #a3271c;
  --bad-wash: #f8e0dc;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(28, 27, 24, 0.04), 0 8px 24px -12px rgba(28, 27, 24, 0.18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171614;
    --panel: #201f1c;
    --sunk: #2a2824;
    --ink: #efebe4;
    --muted: #b1aa9e;
    --line: #3a3732;
    --line-strong: #5c574f;
    --go: #5fbf9b;
    --go-hover: #78cfae;
    --go-wash: #1d3229;
    --on-go: #0d1a15;
    --wood: #d9a56b;
    --wood-wash: #33291d;
    --warn: #f0b44c;
    --warn-wash: #33290f;
    --bad: #ff8a7e;
    --bad-wash: #3a1d19;
    color-scheme: dark;
  }
  .drawing img { background: #fafaf8; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--go); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 18px 20px; }
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 20px; letter-spacing: -0.02em; text-decoration: none; }
.mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.top nav { display: flex; gap: 20px; font-size: 15px; color: var(--muted); }
.top nav a { text-decoration: none; }
.top nav a:hover { color: var(--ink); }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 800; margin-top: 28px; }
h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 750; }
h3 { font-size: 18px; font-weight: 700; }
.lede { max-width: 720px; font-size: 19px; color: var(--muted); margin: 18px 0 28px; }

.ask { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
textarea { width: 100%; resize: vertical; min-height: 92px; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px; font: 19px/1.45 var(--font); color: var(--ink); background: var(--panel); }
textarea::placeholder { color: var(--muted); opacity: 0.75; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.examples button { border: 1px solid var(--line); background: var(--sunk); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 14px var(--font); cursor: pointer; }
.examples button:hover { border-color: var(--line-strong); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field > span { font-weight: 650; }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.field small { color: var(--muted); font-size: 13px; }
.field input[type="file"], .field select { font: 14px var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px; min-height: 40px; }
.go { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.primary { background: var(--go); color: var(--on-go); border: 0; border-radius: var(--radius); padding: 13px 22px; font: 650 17px var(--font); cursor: pointer; min-height: 48px; }
.primary:hover { background: var(--go-hover); }
.primary[disabled] { opacity: 0.6; cursor: progress; }
.status { color: var(--muted); font-size: 15px; }
.status.err { color: var(--bad); }

.result { margin: 44px 0 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card > h3 { margin-bottom: 12px; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.pill.go { background: var(--go-wash); color: var(--go); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.bad { background: var(--bad-wash); color: var(--bad); }
.pill.wood { background: var(--wood-wash); color: var(--wood); }
.sub { color: var(--muted); margin: 6px 0 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi b { display: block; overflow-wrap: anywhere; font-size: clamp(24px, 3vw, 34px); font-weight: 780; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 14px; }
.kpi .pill { margin-top: 6px; }

.why { font-size: 17px; margin: 0 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 650; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); padding: 8px 10px 8px 0; }
td { border-bottom: 1px solid var(--line); padding: 10px 10px 10px 0; vertical-align: top; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.plans tr.on td { background: var(--go-wash); }
.plans tr.on td:first-child { box-shadow: inset 3px 0 0 var(--go); }
.plans button { font: 14px var(--font); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.plans button:hover { border-color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.reasons { margin: 4px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.reasons li::before { content: "· "; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 4px; }
details[open] summary { margin-bottom: 4px; }

.warnings { border-color: var(--warn); background: var(--warn-wash); }
.warnings ul { margin: 0; padding-left: 20px; }
.blocked { color: var(--bad); }

.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { font: 14px var(--font); border: 1px solid var(--line); background: var(--sunk); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.drawing { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 640px; background: #fafaf8; }
.drawing img { display: block; width: 100%; height: auto; }
.drawing.tall img { width: auto; max-width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips span { background: var(--sunk); border-radius: 8px; padding: 4px 10px; font-size: 14px; }
.chips span i { font-style: normal; color: var(--muted); margin-right: 4px; }
.list { margin: 0; padding-left: 20px; }
.list li { margin: 3px 0; }

.bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); margin: 6px 0 10px; }
.bar > div { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; min-width: 2px; border-right: 1px solid var(--panel); }
.bar .m { background: var(--wood-wash); }
.bar .p { background: var(--go-wash); }
.bar .f { background: var(--warn-wash); }
.bar .i { background: var(--sunk); }
.bar .s { background: var(--bad-wash); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.files a { display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; text-decoration: none; font-size: 14px; }
.files a:hover { border-color: var(--line-strong); }
.files a span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.secondary { font: 650 15px var(--font); border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: var(--radius); padding: 10px 16px; cursor: pointer; }

.how, .pipeline { margin: 64px 0; }
.how p, .pipeline > p { max-width: 760px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 0; list-style: none; counter-reset: s; margin-top: 22px; }
.cols li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-size: 15px; color: var(--muted); }
.cols li::before { content: counter(s); display: block; font-weight: 800; font-size: 28px; color: var(--go); margin-bottom: 6px; }
.cols li b { color: var(--ink); display: block; margin-bottom: 4px; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 20px; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 14px; color: var(--muted); }
.steps li b { color: var(--ink); display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 4px; }
.steps li.extra { border-style: dashed; }

.foot { max-width: 1180px; margin: 40px auto 0; padding: 24px 20px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .cols { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  main, .top, .foot { padding-left: 16px; padding-right: 16px; }
  .top nav { gap: 12px; font-size: 14px; }
  .top nav a:nth-child(3) { display: none; }
  .cols { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  textarea { font-size: 17px; }
}
.gap { margin-top: 20px; margin-bottom: 8px; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--sunk); padding: 1px 5px; border-radius: 4px; }
/* Grid children may shrink below their tables' width; the tables scroll inside them. */
.result > *, .split > *, .kpis > * { min-width: 0; }
.plans td:last-child { width: 1%; }

/* Examples: the cards (home page and /examples/) and each example's walk-through. */
.examples-home { margin: 56px 0 0; }
.examples-home .head { justify-content: space-between; }
.examples-home > p { color: var(--muted); max-width: 760px; }
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.ex-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.ex-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.ex-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.ex-card img { display: block; width: 100%; height: auto; aspect-ratio: 10 / 7; object-fit: contain; background: #fafaf8; border-bottom: 1px solid var(--line); }
.ex-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.ex-card-body b { font-size: 17px; letter-spacing: -0.01em; }
.ex-card-body q { color: var(--muted); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ex-card-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ex-card-stats span { background: var(--sunk); border-radius: 6px; padding: 2px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ex-intro { margin: 28px 0 8px; }
.ex-intro h1 { font-size: clamp(36px, 5vw, 60px); }
.ex-shows { color: var(--muted); padding-left: 20px; max-width: 900px; margin: 28px 0 0; }
.ex-shows li { margin: 8px 0; }
.ex-shows a { color: var(--ink); font-weight: 600; }



/* An example: the job in summary, then its details in tabs. */
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); }
.said { margin: 14px 0 0; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--go); border-radius: 10px; }
.said p { margin: 0; font-size: 18px; line-height: 1.4; }
.said footer { margin-top: 6px; font-size: 13px; color: var(--muted); }
.shows { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.note { border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; font-size: 15px; background: var(--sunk); }
.note.warn { background: var(--warn-wash); border: 1px solid var(--warn); }
.note ul { margin: 6px 0 0; padding-left: 20px; }
.sched { display: block; width: 100%; height: auto; margin: 8px 0 10px; border-radius: 8px; overflow: hidden; }
.files a.all { border-color: var(--go); background: var(--go-wash); font-weight: 650; }

.xp-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.xp-switch { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.xp-switch a { text-decoration: none; }
.xp-sum { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; margin: 14px 0 18px; }
.xp-pic { margin: 0; }
.xp-pic img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: #ece8e1; }
.xp-pic figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.xp-info h1 { font-size: clamp(28px, 3.4vw, 44px); }
.xp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.xp-kpis > div { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.xp-kpis dt { font-size: 12.5px; color: var(--muted); }
.xp-kpis dd { margin: 0; font-size: 23px; font-weight: 780; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.xp-kpis span { font-size: 12px; color: var(--muted); }
.xp-kpis .ok-t { color: var(--go); font-weight: 600; }
.xp-kpis .bad-t { color: var(--bad); font-weight: 600; }
.xp-rec { margin: 12px 0 0; font-size: 15px; }
.xp-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 14px 0 0; }
.btn { background: var(--go); color: var(--on-go); text-decoration: none; padding: 10px 16px; border-radius: 10px; font-weight: 650; }
.btn:hover { background: var(--go-hover); }

.xp-tabs { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; background: var(--paper); border-bottom: 1px solid var(--line); margin: 0 -20px; padding: 0 20px; }
.xp-tablist { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.xp-tablist::-webkit-scrollbar { display: none; }
.xp-tablist a { padding: 12px; white-space: nowrap; text-decoration: none; color: var(--muted); font-size: 15px; border-bottom: 2px solid transparent; }
.xp-tablist a:hover { color: var(--ink); }
.xp-tablist a[aria-current] { color: var(--ink); font-weight: 650; border-bottom-color: var(--go); }
.xp-mini { display: none; white-space: nowrap; font-size: 14px; color: var(--muted); }
.xp-mini b { color: var(--ink); margin-right: 6px; display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.xp-tabs.stuck .xp-mini { display: block; }
.xp-panel { padding: 20px 0 8px; scroll-margin-top: 56px; }
.js .xp-panel:not(.on) { display: none; }
.sr-h { font-size: 24px; margin: 8px 0 14px; }
.js .sr-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.xp-lead { color: var(--muted); margin: 0 0 12px; max-width: 900px; }
.xp-panel h3 { margin-bottom: 10px; }

.xp-steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.xp-steps a { display: flex; flex-direction: column; gap: 2px; height: 100%; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13.5px; color: var(--muted); }
.xp-steps a:hover { border-color: var(--go); }
.xp-steps .num { width: 24px; height: 24px; border-radius: 50%; background: var(--go); color: var(--on-go); display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.xp-steps b { color: var(--ink); font-size: 15px; }
.xp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.xp-cols.wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

.xp-design { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; font: 14px var(--font); color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.drawing-inline { max-height: 74vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fafaf8; }
.drawing-inline svg.fig { display: block; width: 100%; height: auto; }
.drawing-inline svg text, .drawing-inline svg line, .drawing-inline svg path, .drawing-inline svg circle { pointer-events: none; }
.js .drawing-inline .unit { cursor: pointer; }
.js .drawing-inline .unit:hover { fill: #dceee5; }
.drawing-inline .unit.sel { fill: #b9dccb; stroke: #1f5d4a; stroke-width: 2; stroke-dasharray: none; }
.drawing-inline .unit:focus { outline: none; stroke: #1f5d4a; stroke-width: 2; }
.xp-unit { position: sticky; top: 58px; max-height: calc(100vh - 76px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.xp-unit select, .filter select, .board-bar select { width: 100%; min-width: 0; font: 14px var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 8px; }
.unit-body h3 { margin: 14px 0 2px; font-size: 18px; }
.unit-body h4 { margin: 14px 0 6px; font-size: 14px; }
.unit-body table td { padding: 6px 8px 6px 0; }

.filter { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.filter label { white-space: nowrap; }
.filter-chips button { border: 1px solid var(--line); background: var(--sunk); color: var(--ink); border-radius: 999px; padding: 4px 12px; font: 13px var(--font); cursor: pointer; }
.filter-chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.scroll.tall { max-height: 62vh; overflow: auto; }
table.sticky thead th { position: sticky; top: 0; background: var(--paper); z-index: 1; }
.used a { margin-right: 1px; }
.used .muted { margin-right: 8px; }

.board-bar { display: flex; gap: 6px; margin-bottom: 8px; }
.board-bar button { flex: none; width: 38px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); border-radius: 8px; font-size: 18px; cursor: pointer; }
.board-svg svg, .board-svg img { display: block; width: 100%; height: auto; max-height: 64vh; background: #fafaf8; border: 1px solid var(--line); border-radius: 10px; }
svg.board .sheet { fill: #fff; stroke: #1d1d1f; stroke-width: 3; }
svg.board .pl rect { fill: #e9e4da; stroke: #1d1d1f; stroke-width: 2; }
svg.board .pl.hl rect { fill: #b9dccb; stroke: #1f5d4a; stroke-width: 3; }
svg.board .pl.dim { opacity: 0.4; }
svg.board text { fill: #1d1d1f; font-family: system-ui, sans-serif; }
svg.board .dim-t { fill: #6e6e73; }
svg.board .ha { fill: #1f5d4a; }
svg.board .hb { fill: none; stroke: #b4532a; stroke-width: 2.5; }
svg.board .he { stroke: #7a4fb0; stroke-width: 7; stroke-linecap: round; }
svg.board .edged { stroke: #b07a3f; stroke-width: 8; }

@media (max-width: 1000px) {
  .xp-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .xp-sum, .xp-design, .xp-cols, .xp-cols.wide-left { grid-template-columns: minmax(0, 1fr); }
  .xp-unit { position: static; max-height: none; }
  .xp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .xp-tabs { margin: 0 -16px; padding: 0 16px; }
  .xp-tabs.stuck .xp-mini { display: none; }
  .xp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .said p { font-size: 17px; }
}
#cut-table td:first-child, #cut-table td:nth-child(3), #hw-table td:first-child { white-space: nowrap; }
