:root {
  --bg:          #f6f2ea;
  --surface:     #fdfbf7;
  --surface-2:   #efe9dd;
  --ink:         #16191c;
  --ink-2:       #3f454b;
  --line:        #d8d0bf;
  --line-2:      #e5dfd2;
  --accent:      #0f4f5e;   /* --brand-petrol: the internal curve (spec.md §9) */
  --accent-hover:#0b3d49;
  --accent-ink:  #ffffff;
  --accent-2:    #e4eef0;
  --amber:       #a8763e;   /* --brand-amber: the external curve. 3.53:1 on paper —
                               a LINE may carry it, a LABEL may not. Labels are --ink. */
  --danger:      #93000e;
  --danger-bg:   #fbeceb;
  --warn:        #6a4a00;
  --warn-bg:     #f9f0d8;
  --ok:          #1c5c30;

  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 24, 18, .05), 0 1px 6px rgba(28, 24, 18, .04);
  --tap: 44px;
  --gap: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  --pad: clamp(1rem, 0.7rem + 1.5vw, 1.75rem);
  --measure: 34rem;

  --font: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* the shared widgets (ui.css) follow the app's face */
  --ui-font: var(--font);

  /* Pinned: this file loads after ui.css, so these unconditional declarations outrank its
     prefers-color-scheme block, which would otherwise put dark-scheme greys on light surfaces. */
  color-scheme: light;
  --ui-muted: #5c564a;
  --ui-line: #cfc7b8;
  --ui-danger: #b3261e;
  --ui-focus: #0b57d0;
}
.diagramruta { margin: var(--gap) 0 0; }
.diagramruta figcaption { margin-top: .4rem; }
.diagram { width: 100%; height: auto; display: block; }

.diagram .rutnat { color: var(--ink); stroke-opacity: .1; stroke-width: 1; }
/* The zones are a background, and they alternate rather than each carrying a meaning of its own:
   the NAME is what says which zone this is, drawn inside the band (spec.md §9). */
.diagram .zon--a { color: var(--surface-2); fill-opacity: .6; }
.diagram .zon--b { color: var(--accent-2); fill-opacity: .55; }

.diagram .kurva { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.diagram .kurva--intern   { color: var(--accent); }  /* --brand-petrol */
.diagram .kurva--extern-1 { color: var(--amber); }   /* --brand-amber  */
.diagram .kurva--extern-2 { color: var(--ok); }
.diagram .kurva--extern-3 { color: var(--warn); }
.diagram .kurva--extern-4 { color: var(--ink-2); }
/* The band itself: heavier, and in ink rather than in a colour, because it is the answer and not
   one of the inputs. */
.diagram .kurva--spann { color: var(--ink); stroke-width: 3; }
/* A schablon run is dashed AS WELL AS badged in the table — no information by colour alone. */
.diagram .linje--schablon { stroke-dasharray: 6 4; }
.diagram .punkt--schablon { fill-opacity: .45; }
.diagram .markor { color: var(--accent); }

.diagram .etikett { fill: var(--ink); font-size: 12px; }
.diagram .etikett--axel { fill: var(--ink-2); font-size: 11px; }
.diagram .etikett--zon { fill: var(--ink-2); font-size: 11px; }
/* The föreslagen lön's label sits ON the band by construction — the marker is at that amount, and
   the band passes through it. Printed, the line ran straight through the digits and read as a
   strikethrough on an amount somebody is about to offer. A halo in the page colour, painted behind
   the glyphs, fixes it without moving the label away from the point it labels. CSS only: the SVG
   still carries no colour of its own (spec.md §9). */
.diagram .etikett--markor {
  font-weight: 600;
  paint-order: stroke fill;
  stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round;
}

/* ── the underlag: the review on screen, and the same blocks on paper ─────── */
/*
   `ui/underlag.js` produces ONE block list and `ui/print.js` renders it. Step 6 shows it on
   screen; `#print-area` shows it on paper. Both use the classes below, which is what makes the
   review a review — what the user reads before pressing print is the document, not a summary of
   it (spec.md §13, app-ux-guide.md's rule about a step with a consequence).
*/
.kv { margin: 0; }
.kv > div {
  display: flex; flex-wrap: wrap; gap: .25rem 1rem;
  padding: .3rem 0; border-bottom: 1px solid var(--line-2);
}
.kv dt { flex: 1 1 14rem; margin: 0; color: var(--ink-2); }
.kv dd { flex: 1 1 14rem; margin: 0; font-variant-numeric: tabular-nums; }

.underlag { margin-top: var(--gap); }
.underlag h2 { font-size: 1.05rem; margin-bottom: .2rem; }
.underlag h3 { font-size: .98rem; margin-bottom: .2rem; }

/* A caveat is a bordered box and a WORD, never a colour: a printer is often monochrome, and a
   warning that survives only in colour has not survived (spec.md §9's rule, applied to paper). */
.printvarning {
  margin: .4rem 0;
  padding: .4rem .6rem;
  border: 1px solid var(--amber); border-left-width: 3px;
  border-radius: var(--radius-sm);
}
.printtabell table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.printtabell th, .printtabell td {
  padding: .35rem .5rem; border-bottom: 1px solid var(--line-2); text-align: left;
}
.printtabell td.num, .printtabell th + th { text-align: right; }
.printtabell caption { caption-side: bottom; padding-top: .4rem; font-size: .9rem; color: var(--ink-2); }
.printfoot { margin-top: .6rem; font-size: .9rem; color: var(--ink-2); }

/* ── print: the PDF is the browser's own output (spec.md §10) ─────────────── */

@media print {
  @page { margin: 18mm 16mm; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .appbar, .savebar, .banner, .skip-link, button, .no-print { display: none !important; }
  #app { display: none; }
  #print-area { display: block !important; }
  /* Every flag, badge and warning renders IN PLACE and in full — never as a marker resolved in
     a legend. A colleague reading the PDF in 2029 has no legend. */
  .badge { border: 1px solid #000; color: #000; background: transparent; }
  .spanntabell th, .spanntabell td { border-bottom: 1px solid #999; }
  a[href]::after { content: ""; }

  #print-area h1 { font-size: 17pt; margin: 0 0 .4em; }
  /* A heading at the foot of a page with its section overleaf is a document that reads as two. */
  #print-area h2 { font-size: 12.5pt; margin: 1.1em 0 .3em; break-after: avoid; page-break-after: avoid; }
  #print-area h3 { font-size: 11pt; margin: .9em 0 .2em; break-after: avoid; page-break-after: avoid; }
  #print-area .kv > div { border-bottom: .4pt solid #999; padding: 2pt 0; }
  #print-area .kv dt { color: #000; }
  /* A caveat split across a page fold has been deleted, only slowly. */
  #print-area .printvarning {
    border: .8pt solid #000; border-left-width: 2.5pt;
    break-inside: avoid; page-break-inside: avoid;
  }
  /* A source's heading and its stamps are one statement; a page fold through the middle of them
     leaves "Lönebegrepp: grundlön" on a page that does not say which source it belongs to. */
  #print-area .blockgrupp { break-inside: avoid; page-break-inside: avoid; }
  #print-area table { border-collapse: collapse; width: 100%; break-inside: avoid; page-break-inside: avoid; }
  #print-area th, #print-area td { border: .4pt solid #666; padding: 3pt 5pt; text-align: left; }
  #print-area td.num { text-align: right; }
  #print-area .printfoot {
    margin-top: 1.2em; border-top: .4pt solid #666; padding-top: .4em; font-size: 9pt; color: #000;
  }
  /* The chart is the browser's own render of the same SVG the screen shows — no rasteriser, no
     hard-coded hex anywhere in it (spec.md §9). Capped so it cannot push the sources onto a
     third page on its own. */
  #print-area .diagramruta { break-inside: avoid; page-break-inside: avoid; margin: .5em 0 1em; }
  #print-area .diagram { width: 100%; max-height: 95mm; }
}
#print-area { display: none; }

/* The Expo web build: its root is #root, the browser app's is #app. */
@media print { #root { display: none !important; } }
