/* Post office counter (Swiss/La Poste signage: postal yellow band, black heavy type),
   with square black tags borrowed from label tape for step headings and column chips. */

@font-face { font-family: 'PDLabel'; src: url('/fonts/LiberationSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: 'PDLabel'; src: url('/fonts/LiberationSans-Bold.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Inter Tight'; src: url('/fonts/inter-tight-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('/fonts/inter-tight-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('/fonts/inter-tight-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #5b5b5b;
  --line: #d9d9d9;
  --accent: #ffcc00;
  --accent-ink: #111111;
  --action: #111111;
  --action-ink: #ffffff;
  --bad: #b3261e;
  --desk: #ecebe7;
  --r: 4px;
  --font: 'Inter Tight', system-ui, sans-serif;
  --h-weight: 800;
  --h-track: -0.02em;
  --tag-r: 2px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: inherit; text-underline-offset: 3px; }
h1, h2 { font-weight: var(--h-weight); letter-spacing: var(--h-track); line-height: 1.1; }
small { color: var(--muted); font-size: 0.82rem; display: block; margin-top: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* header */
.top { display: flex; align-items: center; gap: 16px; padding: 6px clamp(16px, 4vw, 40px); background: var(--accent); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; text-decoration: none; letter-spacing: -0.01em; }
.brand .mark { width: 22px; height: 22px; }
.tools-nav { margin-left: auto; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 0.92rem; padding: 4px 8px; border-radius: var(--r); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ' ▾'; }
.menu ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; list-style: none; margin: 0; padding: 8px; min-width: 250px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.menu li a { display: block; padding: 8px 10px; text-decoration: none; border-radius: var(--r); }
.menu li a:hover, .menu li a[aria-current] { background: var(--desk); }
.cal-link { font-size: 0.85rem; font-weight: 600; background: var(--ink); color: #fff; padding: 4px 10px; border-radius: var(--tag-r); text-decoration: none; }
.cal-link:hover { text-decoration: underline; }
@media (max-width: 640px) { .cal-link { display: none; } }

/* intro */
.intro { max-width: 1280px; margin: 0 auto; padding: clamp(18px, 3vw, 32px) clamp(16px, 4vw, 40px) 16px; }
.intro h1 { font-size: clamp(1.9rem, 4.2vw, 3.1rem); margin: 0 0 10px; max-width: 20ch; }
.lede { margin: 0; max-width: 62ch; color: var(--muted); font-size: 1.05rem; }

/* front page: tool strip and promises */
.tool-strip ul { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (min-width: 1180px) { .tool-strip ul { grid-template-columns: repeat(9, 1fr); } }
.tool-strip a { display: grid; gap: 2px; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; background: var(--panel); }
.tool-strip a:hover { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.tool-strip a[aria-current] { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }
.tool-strip strong { font-size: 0.95rem; line-height: 1.2; }
.tool-strip span:last-child { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.tile-tag { justify-self: start; background: var(--ink); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; padding: 1px 6px; border-radius: var(--tag-r); margin-bottom: 4px; }
.tile-cal a { background: var(--accent); border-color: var(--accent); }
.tile-cal span:last-child { color: var(--ink); }
.promises { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.85rem; font-weight: 600; }
.promises li::before { content: '✓ '; font-weight: 800; }
@media (max-width: 640px) {
  .tool-strip ul { display: flex; overflow-x: auto; scroll-snap-type: x proximity; margin-right: calc(-1 * clamp(16px, 4vw, 40px)); padding-right: 16px; }
  .tool-strip li { flex: 0 0 auto; scroll-snap-align: start; }
  .tool-strip a { padding: 7px 10px; }
  .tool-strip .tile-tag, .tool-strip span:last-child { display: none; }
  .tool-strip strong { white-space: nowrap; font-size: 0.88rem; }
  .promises { font-size: 0.8rem; }
  .promises li:nth-child(n+4) { display: none; }
}

/* bench */
.bench { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 40px; display: grid; grid-template-columns: minmax(320px, 430px) 1fr; gap: clamp(16px, 3vw, 36px); align-items: start; }
@media (max-width: 900px) { .bench { grid-template-columns: 1fr; } }
.controls { display: grid; gap: 12px; min-width: 0; }
.step { margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px 16px 16px; min-width: 0; display: grid; gap: 10px; }
/* Step heading = a black tag with the step number on a yellow block, like a counter ticket. */
.step legend { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 0 12px 0 0; margin-left: -2px; border-radius: var(--tag-r); font-weight: 700; font-size: 0.95rem; line-height: 30px; }
.step .n { display: grid; place-items: center; width: 30px; height: 30px; background: var(--accent); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--tag-r) 0 0 var(--tag-r); font-weight: 800; font-size: 0.9rem; }
label { display: block; font-weight: 600; font-size: 0.92rem; }
label small { font-weight: 400; }
label > input, label > select { margin-top: 4px; }
input[type='text'], input[type='number'], input[type='url'], select, textarea { width: 100%; font: inherit; font-weight: 400; font-size: 16px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 10px; }
textarea { resize: vertical; line-height: 1.4; font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; font-size: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.check.tight { align-self: end; padding-bottom: 10px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cols3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.cols4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 420px) { .cols3, .cols4 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.btn { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--ink); background: var(--panel); color: var(--ink); border-radius: var(--r); padding: 9px 14px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--action); color: var(--action-ink); border-color: var(--action); }
.btn.big { width: 100%; padding: 14px; font-size: 1.08rem; }
.btn.ghost { border-color: var(--line); }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: inherit; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { font: inherit; font-size: 0.9rem; font-weight: 600; background: none; border: 0; padding: 8px 10px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--accent); box-shadow: inset 0 -3px 0 var(--ink); }
.drop { display: grid; gap: 4px; place-items: center; text-align: center; border: 2px dashed var(--line); border-radius: var(--r); padding: 22px 12px; cursor: pointer; font-weight: 400; }
.drop.over { border-color: var(--ink); background: var(--desk); }
.drop input { position: absolute; opacity: 0; width: 1px; }
.list-status { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; font-size: 0.9rem; color: var(--muted); }
.warnings, .problems { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.88rem; color: var(--muted); }
.warnings li::before, .problems li::before { content: '· '; }
.bad { color: var(--bad) !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 0.82rem; font-weight: 600; border: 0; background: var(--ink); color: #fff; border-radius: var(--tag-r); padding: 4px 10px; cursor: pointer; letter-spacing: 0.02em; }
.chip:hover { background: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.paper-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; width: max-content; }
.paper-toggle button { font: inherit; font-size: 0.9rem; font-weight: 600; border: 0; background: var(--panel); padding: 7px 14px; cursor: pointer; color: var(--muted); }
.paper-toggle button[aria-checked='true'] { background: var(--ink); color: var(--bg); }
.tpl-note { margin: 0; font-size: 0.85rem; color: var(--muted); }
.more summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; }
.more[open] summary { margin-bottom: 8px; }
.cal-status { margin: 0; font-size: 0.88rem; }
.print-tip { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* preview */
.preview { position: sticky; top: 12px; min-width: 0; background: var(--desk); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; }
#summary { background: var(--ink); color: #fff; padding: 3px 10px; border-radius: var(--tag-r); font-size: 0.88rem; }
.pager { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.pager .btn { padding: 2px 12px; font-size: 1.2rem; line-height: 1.2; background: var(--panel); }
.sheet-wrap { position: relative; display: grid; place-items: center; }
.sheet-wrap svg { width: 100%; height: auto; max-height: calc(100vh - 150px); background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.1); cursor: pointer; }
@media (max-width: 900px) { .preview { position: static; } .sheet-wrap svg { max-height: none; } }
.empty-hint { position: absolute; inset: auto 10% 45% 10%; margin: 0; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; font-weight: 600; }

/* front page: panels under the workbench */
.panels { max-width: 1280px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .panels { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; }
.panel h2 { font-size: 1.1rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.tag { background: var(--accent); color: var(--ink); border: 2px solid var(--ink); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 0 6px; border-radius: var(--tag-r); line-height: 20px; }
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sheet-list a { display: flex; align-items: center; gap: 10px; padding: 5px 0; text-decoration: none; font-size: 0.9rem; border-bottom: 1px dashed var(--line); }
.sheet-list a:hover { text-decoration: underline; }
.sheet-list .tile-tag { margin: 0; min-width: 52px; text-align: center; }
.more-link { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 0.9rem; }
.sources { margin: 0; display: grid; gap: 2px; font-size: 0.9rem; }
.sources dt { font-weight: 700; margin-top: 8px; }
.sources dt:first-child { margin-top: 0; }
.sources dd { margin: 0; color: var(--muted); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 0.9rem; }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; background: var(--accent); border: 2px solid var(--ink); border-radius: var(--tag-r); }
.optout-banner { background: var(--ink); color: #fff; text-align: center; font-size: 0.85rem; padding: 6px 16px; }

/* content pages */
.howto, .reading { max-width: 860px; margin: 0 auto; padding: 10px clamp(16px, 4vw, 40px) 50px; }
.howto h2 { font-size: 1.4rem; margin: 28px 0 10px; }
.howto dt { font-weight: 700; margin-top: 14px; }
.howto dd { margin: 4px 0 0; color: var(--muted); }
.reading h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.tpl-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tpl-table th, .tpl-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cal { max-width: 860px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 50px; }
.cal-steps { padding-left: 1.2em; display: grid; gap: 22px; }
.cal-steps h2 { font-size: 1.15rem; margin: 0 0 8px; }
.cal-steps select { max-width: 520px; margin-top: 8px; }
.cal-steps .row { margin-top: 10px; }
.cal-result { font-weight: 700; }
.nudge { display: flex; flex-wrap: wrap; gap: 8px; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 14px clamp(16px, 4vw, 40px) 16px; font-size: 0.85rem; }
.foot-row { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.foot-row p { margin: 0; color: var(--muted); }
.foot-row strong { color: var(--ink); }
.foot-row ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.fine { max-width: 1280px; margin: 8px auto 0; color: var(--muted); font-size: 0.75rem; }
