@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #14203a;
  --ink-2: #3d4a66;
  --muted: #66718a;
  --line: #dce1eb;
  --surface: #f2f4f8;
  --paper: #ffffff;
  --blue: #1f4fd8;
  --blue-dark: #173da8;
  --marigold: #f5b700;
  --good: #166b41;
  --warn: #8a5600;
  --bad: #b3261e;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 12px; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.muted { color: var(--muted); }
.hint { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 4px; }
.optional { color: var(--muted); font-weight: 400; font-size: 13px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.strong { font-weight: 650; }
.mark { width: 22px; height: 22px; flex: none; }

/* Status is shown as coloured words */
.st { font-weight: 650; }
.st-good { color: var(--good); }
.st-warn { color: var(--warn); }
.st-bad { color: var(--bad); }
.st-muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; line-height: 1.2;
  padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid #b9c1d3; background: var(--paper); color: var(--ink);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-danger { color: var(--bad); border-color: #e3b8b4; }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }
.btn-lg { padding: 12px 20px; font-size: 16px; }
.linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select {
  display: block; width: 100%; margin-top: 5px;
  font: inherit; color: var(--ink); background: var(--paper);
  padding: 8px 10px; border: 1px solid #b9c1d3; border-radius: var(--radius);
}
textarea { display: block; width: 100%; margin-top: 5px; font: inherit; color: var(--ink); background: var(--paper); padding: 8px 10px; border: 1px solid #b9c1d3; border-radius: var(--radius); resize: vertical; }
.pre { white-space: pre-wrap; }
[hidden] { display: none !important; }

/* Picker tiles for code type and styles */
.choice-block { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.choice-block legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 8px; }
.tiles { display: grid; gap: 8px; }
.tiles-type { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.tiles-style { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid #b9c1d3; border-radius: var(--radius); background: var(--paper); cursor: pointer; font-weight: 400; }
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile:hover { border-color: var(--ink-2); }
.tile:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #f3f6fe; }
.tile:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.tile-name { font-weight: 600; font-size: 14px; }
.tile-note { font-size: 13px; color: var(--muted); }
.tile-note.st-good { color: var(--good); }
.tile svg { width: 52px; height: 52px; margin-bottom: 6px; }
.type-hint { margin: 12px 0 0; }

input:disabled { background: var(--surface); color: var(--muted); }
input[type=file] { display: block; margin-top: 6px; font: inherit; font-size: 14px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.triple { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { font-weight: 400; }
.choice { border: 0; padding: 0; margin-left: 0; margin-right: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.choice legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.choice label { font-weight: 400; }
.choice-col { flex-direction: column; gap: 6px; }
.color { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-weight: 400; }
.color input { width: 46px; height: 36px; padding: 2px; border: 1px solid #b9c1d3; border-radius: var(--radius); background: var(--paper); }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form input[type=text], .inline-form select { width: auto; min-width: 200px; margin-top: 0; }
.form-actions { display: flex; gap: 10px; }

.notice { padding: 10px 14px; border-radius: var(--radius); border-left: 4px solid; background: var(--paper); margin: 0 0 16px; }
.notice-ok { border-color: var(--good); }
.notice-error { border-color: var(--bad); }

/* App shell */
body.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; color: inherit; }
.side .brand { padding: 0 8px 18px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #c8d0e2; text-decoration: none; padding: 7px 10px; border-radius: var(--radius); font-weight: 500; }
.side nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.side nav a.on { color: #fff; background: rgba(255, 255, 255, 0.12); box-shadow: inset 3px 0 0 var(--marigold); }
.side-group { margin: 18px 10px 4px; font-size: 13px; color: #8f9bb6; }
.side-foot { margin-top: auto; padding: 18px 10px 0; font-size: 14px; }
.side-foot p { margin: 0 0 4px; }
.side-foot .linklike { color: #c8d0e2; }
.side-version { color: #8f9bb6; font-size: 13px; margin-top: 10px !important; }
.main { padding: 26px 30px 48px; min-width: 0; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .version { margin: 0 auto 2px 0; color: var(--muted); }
.page-head h1 + .btn, .page-head > .btn { margin-left: auto; }
.page-head .version + .btn { margin-left: 0; }
.crumb { margin: 0 0 4px; font-size: 14px; color: var(--muted); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.panel > h2, .panel > h3 { margin-bottom: 12px; }
.panel.flush { padding: 0; overflow-x: auto; }
.pad { padding: 16px 20px 0; }
.panel.empty { padding: 36px 28px; max-width: 560px; }
.panel.empty h2 { font-size: 20px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.cols > .panel { margin-bottom: 0; }
.cols { margin-bottom: 18px; }
.of { color: var(--muted); font-weight: 400; font-size: 14px; letter-spacing: 0; }
.plain { margin: 0; padding-left: 18px; }
.plain li + li { margin-top: 4px; }

/* Headline figures: one strip with dividers */
.figures { display: flex; flex-wrap: wrap; margin: 0 0 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.figures > div { flex: 1 1 180px; padding: 14px 20px; border-left: 1px solid var(--line); margin-left: -1px; }
.figures dt { color: var(--ink-2); font-size: 14px; }
.figures dd { margin: 2px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table .thumb { width: 60px; padding-right: 0; }
.table .thumb img { display: block; border: 1px solid var(--line); border-radius: 3px; }
.table .clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline-flex; margin-left: 6px; vertical-align: middle; }
.table .actions .btn { padding: 5px 10px; font-size: 14px; }
.table .actions input[type=text] { min-width: 150px; padding: 5px 8px; }
.panel:not(.flush) > .table th:first-child, .panel:not(.flush) > .table td:first-child { padding-left: 0; }
.panel:not(.flush) > .table th:last-child, .panel:not(.flush) > .table td:last-child { padding-right: 0; }

.filter { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter input, .filter select { width: auto; min-width: 280px; margin-top: 0; }

/* Charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: #e7eaf1; stroke-width: 1; }
.chart .grid.axis { stroke: #b9c1d3; }
.chart .tick { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart .bar { fill: var(--blue); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(20, 32, 58, 0.06); }
.chart-empty { position: absolute; inset: 0 0 26px 0; display: flex; align-items: center; justify-content: center; margin: 0; color: var(--muted); pointer-events: none; }
.tip { position: fixed; z-index: 20; background: var(--ink); color: #fff; font-size: 13px; padding: 5px 9px; border-radius: 4px; pointer-events: none; white-space: nowrap; }

.brow { display: grid; grid-template-columns: minmax(90px, 46%) 1fr 48px 38px; align-items: center; gap: 10px; padding: 5px 0; }
.brow-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow-track { height: 10px; }
.brow-fill { display: block; height: 100%; background: var(--blue); border-radius: 0 3px 3px 0; }
.brow-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.brow-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

/* Code detail and builder */
.detail { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.qr { display: block; width: 100%; max-width: 258px; height: auto; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 3px; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.downloads .btn-primary { flex: 1 1 100%; }
.downloads .btn { flex: 1; }
.meta { margin: 0; }
.meta dt { font-size: 13px; color: var(--muted); margin-top: 10px; }
.meta dd { margin: 0; }
.meta-wide { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin-bottom: 14px; }
.meta-wide dt { margin: 0; font-size: 14px; }
.range { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.range-label { color: var(--ink-2); margin-right: 6px; }
.range a { padding: 5px 10px; border-radius: var(--radius); text-decoration: none; color: var(--ink-2); font-weight: 500; }
.range a:hover { background: #e4e8f0; }
.range a.on { background: var(--ink); color: #fff; }
.range .range-export { margin-left: auto; color: var(--blue); text-decoration: underline; }

.builder { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.builder-preview { position: sticky; top: 20px; }
.builder-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.builder-preview .hint { margin-top: 10px; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; max-width: 860px; margin-bottom: 14px; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; }
.plan h3 { font-size: 20px; }
.plan-tag { color: var(--ink-2); margin: 4px 0 14px; min-height: 2.9em; }
.plan-price { color: var(--ink-2); margin-bottom: 14px; }
.plan-price strong { font-size: 34px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.plan-wanted { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.features { list-style: none; margin: 0 0 20px; padding: 0; flex: 1; }
.features li { padding: 5px 0 5px 24px; position: relative; }
.features li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 11px; height: 6px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); }
.features li.no { color: #8791a8; }
.features li.no::before { border: 0; width: 10px; height: 2px; top: 16px; background: #b3bacb; transform: none; }

/* Public site */
body.public { background: var(--paper); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; max-width: 1180px; margin: 0 auto; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.topbar nav a:not(.btn):hover { text-decoration: underline; }
.narrow { max-width: 440px; margin: 0 auto; padding: 40px 24px 80px; }
.narrow h1 { margin-bottom: 14px; }
.narrow .stack .btn { width: 100%; padding: 10px; }
.below { margin-top: 16px; }
.inactive { text-align: center; padding-top: 18vh; }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 48px 32px 72px; }
.hero h1 { font-size: clamp(40px, 5.6vw, 68px); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: 22px; text-wrap: balance; }
.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 34em; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.hero-demo { justify-self: center; width: 100%; max-width: 400px; }
/* The sample code sits on a printer's proof with crop marks */
.proof { position: relative; background: #fff; border: 1px solid var(--line); margin: 22px; padding: 30px 30px 18px; text-align: center; box-shadow: 10px 10px 0 var(--marigold); }
.proof img { display: block; width: 100%; height: auto; }
.proof-line { margin: 12px 0 0; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.crop { position: absolute; width: 16px; height: 16px; border: 0 solid var(--ink); }
.crop-tl { top: -22px; left: -22px; border-right-width: 1px; border-bottom-width: 1px; }
.crop-tr { top: -22px; right: -22px; border-left-width: 1px; border-bottom-width: 1px; }
.crop-bl { bottom: -22px; left: -22px; border-right-width: 1px; border-top-width: 1px; }
.crop-br { bottom: -22px; right: -22px; border-left-width: 1px; border-top-width: 1px; }
.demo-form { margin: 30px 22px 0; }
.demo-row { display: flex; gap: 8px; margin-top: 5px; }
.demo-row input { margin-top: 0; }

.band { max-width: 1180px; margin: 0 auto; padding: 56px 32px; border-top: 1px solid var(--line); }
.band h2 { font-size: 30px; letter-spacing: -0.025em; margin-bottom: 22px; }
.band-intro { color: var(--ink-2); font-size: 17px; margin-top: -10px; margin-bottom: 26px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: block; font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--blue); margin-bottom: 12px; }
.steps h3 { font-size: 19px; margin-bottom: 6px; }
.steps p { color: var(--ink-2); font-size: 16px; }
.band-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; }
.band-split p { color: var(--ink-2); font-size: 17px; max-width: 26em; }
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { font-weight: 700; font-size: 17px; }
.facts dd { margin: 0; color: var(--ink-2); font-size: 16px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 26px 32px 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  body.app { display: block; }
  .side { position: static; height: auto; padding: 14px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side-group { flex-basis: 100%; margin: 8px 10px 0; }
  .side-foot { display: flex; gap: 16px; align-items: center; padding-top: 12px; }
  .side-version { margin-top: 0 !important; }
  .main { padding: 18px 16px 40px; }
  .detail, .builder, .hero, .band-split { grid-template-columns: 1fr; }
  .builder-preview { position: static; max-width: 330px; }
  .hero { gap: 36px; padding: 28px 20px 48px; }
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .band { padding: 40px 20px; }
  .topbar { padding: 14px 20px; }
  .topbar nav { gap: 14px; }
  .topbar nav a[href^="/#"] { display: none; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .pair, .triple { grid-template-columns: 1fr; }
}
