/* labmate.tools · Cryo Labels — same colour and type tokens as assets/styles.css */
:root {
  --paper: #F2EDDF;
  --frame: #FAF7EE;
  --ink: #1B2224;
  --teal: #17403D;
  --pass: #2E9E5B;
  --pass-dark: #1F7A45;
  --sample: #9CC7B6;
  --muted: #5B6466;
  --warn: #B4690E;
  --warn-dark: #7A4508;
  --warn-bg: #FCEFD9;
  --serif: 'IBM Plex Serif', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; }
a { color: var(--ink); }
a:hover { color: var(--teal); }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.sans { font-family: var(--sans); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.page { max-width: 1440px; margin: 0 auto; padding: 24px 56px 32px; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 3px solid var(--ink); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--teal); text-decoration: none; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 26px; display: flex; align-items: center; gap: 3px; }
.nav { display: flex; gap: 28px; font-size: 13px; letter-spacing: .08em; flex-wrap: wrap; }
.crumbs { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11px; letter-spacing: .08em; padding: 7px 0; border-bottom: 1px solid var(--ink); }
.crumbs a { text-decoration: none; }
.saved { color: var(--pass-dark); }

/* hero */
.hero { display: flex; gap: 28px; align-items: stretch; padding: 22px 0 20px; border-bottom: 1px dotted var(--ink); }
.fig { margin: 0; width: 210px; flex-shrink: 0; border: 1px solid var(--ink); background: var(--frame); display: flex; flex-direction: column; }
.fig svg { display: block; width: 100%; height: auto; padding: 10px 18px; flex-grow: 1; }
.fig figcaption { font-size: 10px; letter-spacing: .08em; padding: 5px 8px; border-top: 1px solid var(--ink); }
.hero-text { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.hero h1 { margin: 0; font-size: 52px; font-weight: 600; line-height: 1; }
.lede { margin: 0; font-size: 19px; font-style: italic; max-width: 640px; }
.flow { font-size: 12px; letter-spacing: .1em; margin-top: 6px; }
.facts { list-style: none; margin: 0; padding: 0 0 0 18px; width: 260px; flex-shrink: 0; align-self: center; border-left: 1px solid var(--ink); font-size: 11px; letter-spacing: .04em; line-height: 1.7; }

/* work area */
.work { display: grid; grid-template-columns: 500px minmax(0, 1fr); gap: 40px; padding-top: 24px; }
.steps { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.box { border: 1px solid var(--ink); background: var(--frame); }
.bar { margin: 0; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 400; letter-spacing: .12em; padding: 6px 12px; display: flex; justify-content: space-between; gap: 12px; }
.bar-note { color: var(--sample); }
.box-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; letter-spacing: .08em; min-width: 0; }
input, select, textarea { font-family: var(--mono); font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--ink); border-radius: 0; padding: 9px 10px; width: 100%; min-height: 40px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus, button:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.grid2, .grid3, .grid4 { display: grid; gap: 10px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span3 { grid-column: 1 / -1; }
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--teal); }

.tabs { display: flex; width: fit-content; border: 1px solid var(--ink); }
.tabs button { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; background: transparent; color: var(--ink); border: 0; padding: 10px 16px; cursor: pointer; min-height: 40px; }
.tabs button + button { border-left: 1px solid var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.filelink { text-decoration: underline; cursor: pointer; color: var(--ink); }
.filelink input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filelink:focus-within { outline: 2px solid var(--teal); }

.sheetinfo { border-top: 1px dotted var(--ink); padding-top: 8px; font-size: 11px; line-height: 1.6; }
.sheetinfo .ref { color: var(--muted); }
.sheetinfo .est { color: var(--warn-dark); }

.geom { border: 1px solid var(--ink); background: #fff; }
.geom summary { cursor: pointer; font-size: 11px; letter-spacing: .08em; padding: 9px 10px; list-style: none; display: flex; align-items: center; min-height: 40px; }
.geom summary::-webkit-details-marker { display: none; }
.geom summary::before { content: '+'; width: 1.2em; }
.geom[open] summary::before { content: '−'; }
.geom summary span { color: var(--muted); margin-left: auto; }
.geom-body { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 10px; border-top: 1px dotted var(--ink); }
.warn-inline { margin: 0; font-size: 12px; color: var(--warn-dark); }

.align { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: end; }
.align ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.offsets { display: flex; gap: 10px; }
.offsets .field { width: 92px; }
.span-all { grid-column: 1 / -1; }

/* output */
.output { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.output-grid { display: grid; grid-template-columns: minmax(0, 520px) minmax(240px, 1fr); gap: 22px; align-items: start; }
.preview-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sheet-frame { background: #fff; border: 1px solid var(--ink); line-height: 0; }
.sheet-frame svg { display: block; width: 100%; height: auto; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 12px; letter-spacing: .08em; }
.pager button { font-family: var(--mono); background: transparent; border: 1px solid var(--ink); color: var(--ink); min-width: 44px; min-height: 36px; cursor: pointer; }
.pager button:disabled { opacity: .3; cursor: default; }

.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; align-self: stretch; }
.grow { flex-grow: 1; }

.status { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.status.warn { border: 1.5px solid var(--warn); background: var(--warn-bg); }
.status.pass { border: 1px solid var(--pass-dark); background: var(--frame); flex-direction: row; align-items: center; gap: 10px; }
.status.empty { border: 1px dashed var(--ink); background: var(--frame); }
.status-title { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; font-weight: 600; }
.status.warn .status-title { color: var(--warn-dark); }
.status.pass .status-title { color: var(--pass-dark); }
.status p { margin: 0; font-size: 13px; line-height: 1.45; }
.status code { font-family: var(--mono); font-size: 12px; background: #fff; padding: 0 3px; }

.stats { margin: 0; font-size: 12px; border-top: 1px solid var(--ink); }
.stats div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dotted var(--ink); }
.stats dd { margin: 0; text-align: right; }

.note-box { border: 1px solid var(--ink); background: var(--frame); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.note-title { font-size: 11px; letter-spacing: .1em; }
.note-box p { margin: 0; font-size: 13px; }

.primary, .secondary { font-family: var(--mono); letter-spacing: .1em; display: flex; justify-content: space-between; align-items: center; width: 100%; cursor: pointer; border-radius: 0; text-align: left; }
.primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); font-size: 16px; font-weight: 600; padding: 20px; min-height: 60px; }
.primary:hover { background: var(--teal); border-color: var(--teal); }
.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); font-size: 13px; padding: 13px 20px; min-height: 44px; }
.secondary:hover { background: var(--frame); }
.primary:disabled, .secondary:disabled { opacity: .35; cursor: not-allowed; }
.error { margin: 0; color: var(--warn-dark); font-size: 13px; }

.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11px; letter-spacing: .08em; border-top: 3px solid var(--ink); padding-top: 10px; margin-top: 32px; }

/* narrower screens */
@media (max-width: 1240px) {
  .work { grid-template-columns: 440px minmax(0, 1fr); gap: 28px; }
  .output-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-wrap { max-width: 560px; }
}
@media (max-width: 980px) {
  .page { padding: 20px 24px 28px; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .facts { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 16px 16px 24px; }
  .hero { flex-direction: column; gap: 14px; }
  .fig { width: 100%; max-width: 260px; }
  .hero h1 { font-size: 40px; }
  .lede { font-size: 17px; }
  .nav { gap: 16px; font-size: 12px; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .align { grid-template-columns: minmax(0, 1fr); }
}
