/* Städisen design system, direction A "Arbetsordern" (design/riktning-a.md): the site's own paperwork, not a web app.
   Square corners, 2px ink frames, 1px ink rules between columns, dotted rules between rows. No soft shadows, no gradients, no tinted pills.
   Type: Archivo 700/800 for titles, figures and stamps; Plex Mono 500 for labels, table heads, numbers and money; Plex Sans for the rest.
   Scale: 12 / 13 / 14 / 16 / 20 / 28, plus 36 and 44 for page titles. Spacing: multiples of 4.
   The public website has its own sheet, site.css, on top of this one. */

@import url('/assets/fonts.css');

:root {
  --paper: #FBFBF8; --desk: #F1F0EA; --sheet: #FFFFFF; --rule: #111111;
  --ink: #111111; --ink-2: #333333; --muted: #555555;
  --accent: #FF6A13; --accent-ink: #111111;
  --ok: #1F7A3D; --warn: #9A3A00; --warn-bg: #FFF1E6; --stop: #B3261E;
  --radius: 0;
  --dot: 1px dotted var(--rule);
  --display: 'Archivo', 'IBM Plex Sans', system-ui, sans-serif;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  /* The names from before direction A, pointed at the values above, so inline styles and site.css read the same few colours. Blue is gone: it is ink. */
  --faint: var(--muted); --line: var(--rule); --line-2: var(--rule); --line-3: var(--rule); --line-strong: var(--rule);
  --bg: var(--paper); --panel: var(--sheet); --soft: var(--desk); --hover: var(--desk);
  --nav: var(--ink); --nav-2: var(--ink-2); --nav-3: var(--ink-2); --nav-line: var(--muted); --nav-ink: var(--paper); --nav-muted: var(--desk);
  --brand: var(--accent); --blue: var(--ink); --blue-2: var(--ink-2); --blue-bg: var(--desk);
  --green: var(--ok); --green-bg: var(--sheet); --green-mark: var(--ok);
  --amber: var(--warn); --amber-bg: var(--warn-bg); --amber-mark: var(--warn);
  --orange: var(--warn); --orange-bg: var(--warn-bg);
  --info: var(--ink); --info-bg: var(--desk); --grey: var(--muted); --grey-bg: var(--desk);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 400 14px/20px var(--font); font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--warn); }
button, input, select, textarea { font: inherit; color: inherit; border-radius: 0; }
h1, h2, h3, h4, p { margin: 0; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::placeholder { color: var(--muted); opacity: 1; }

/* Text roles */
.t-title { font: 800 36px/40px var(--display); letter-spacing: -0.03em; }
/* The state of an order as a sentence, at the top of its page. */
.t-sentence { max-width: 22em; font: 800 36px/40px var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.t-sub { margin-top: 8px; font-size: 16px; line-height: 24px; color: var(--ink-2); }
.t-section { font: 500 12px/16px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.t-strong { font-weight: 600; }
.t-meta { font-size: 13px; line-height: 18px; color: var(--muted); }
.t-small { font-size: 12px; line-height: 16px; color: var(--muted); }
.t-mono { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-2); }
.t-num { font: 800 20px/28px var(--display); letter-spacing: -0.02em; }
.t-right { text-align: right; }
.t-warn, .t-amber { color: var(--warn); }
.t-ok { color: var(--ok); }
/* A label on a form: field names, table heads, meta lines. */
.field-l, .th, .tl.h, .colh, .kpi span, .step span, .doc-facts span, .doc-lines th, .navsec, .org span, .demo label, .crumb, .legend, .loading {
  font: 500 11px/16px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* App shell: the menu is the form's own side column. */
.app { display: flex; min-height: 100vh; }
.nav { width: 232px; flex-shrink: 0; background: var(--paper); border-right: 2px solid var(--rule); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; font: 500 13px/18px var(--mono); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 800 20px/24px var(--display); letter-spacing: -0.02em; text-transform: uppercase; text-decoration: none; }
a.brand:hover { color: var(--ink); }
.nav .brand { flex: none; height: 56px; padding: 0 16px; border-bottom: 2px solid var(--rule); }
.org { padding: 12px 16px; border-bottom: 2px solid var(--rule); background: var(--desk); }
.org b { display: block; font: 600 14px/20px var(--font); overflow-wrap: anywhere; }
.navlink { display: flex; align-items: center; gap: 10px; flex: none; min-height: 44px; padding: 0 16px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.navlink:hover { background: var(--desk); color: var(--ink); }
.navlink.on, .navlink.on:hover { background: var(--ink); color: var(--paper); }
/* How many things wait for you: the one orange mark in the menu. */
.navlink .count, .tab small { min-width: 24px; height: 24px; padding: 0 6px; background: var(--accent); color: var(--accent-ink); font: 500 13px/24px var(--mono); text-align: center; }
/* A plain count on a tab is framed; orange is kept for the ones that wait for someone (.need). */
.tab small:not(.need) { height: 22px; padding: 0 5px; border: 1px solid currentColor; background: none; color: inherit; line-height: 20px; }
.navlink .count { margin-left: auto; }
.navsec { padding: 20px 16px 6px; border-bottom: 1px solid var(--rule); }
.navfoot { margin-top: auto; border-top: 2px solid var(--rule); display: flex; flex-direction: column; }
.navhelp { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--rule); font-size: 12px; line-height: 18px; color: var(--muted); }
.navhelp a { overflow-wrap: anywhere; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.me > div { min-width: 0; }
.me b { display: block; font: 600 13px/18px var(--font); overflow-wrap: anywhere; }
.me span { font-size: 12px; line-height: 16px; color: var(--muted); }
.me .av { background: var(--ink); color: var(--paper); }
.me button { margin-left: auto; min-height: 44px; padding: 0 4px; background: none; border: 0; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.me button:hover { color: var(--warn); }
.demo { padding: 12px 16px; border-bottom: 1px solid var(--rule); background: var(--desk); display: flex; flex-direction: column; gap: 6px; }
.demo select, .demo button { height: 36px; border: 2px solid var(--rule); background: var(--sheet); padding: 0 8px; font-size: 12px; cursor: pointer; }
.demo button:hover { background: var(--ink); color: var(--paper); }

.content { flex: 1; min-width: 0; padding: 32px 40px 56px; }
.wrap { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.wrap.narrow { max-width: 880px; }

/* Mobile shell */
.topbar { display: none; }
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .nav { display: none; }
  .nav.open { display: flex; position: fixed; inset: 56px 0 0 0; width: auto; height: auto; z-index: 20; border-right: 0; }
  .topbar { display: flex; align-items: stretch; justify-content: space-between; height: 56px; padding-left: 16px; background: var(--paper); border-bottom: 2px solid var(--rule); position: sticky; top: 0; z-index: 21; }
  .topbar button { width: 56px; border: 0; border-left: 2px solid var(--rule); background: none; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
  .topbar button[aria-label="Stäng meny"] { background: var(--ink); color: var(--paper); }
  .topbar button:focus-visible { outline-offset: -4px; }
  /* The top bar already shows the name; the opened menu does not repeat it. */
  .nav .brand { display: none; }
  .navlink { min-height: 48px; font-size: 14px; }
  .content { padding: 20px 16px 40px; }
}

/* Page header: the letterhead of the page, closed by a rule. */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; padding-bottom: 20px; border-bottom: 2px solid var(--rule); }
.head .t-meta { margin-top: 8px; font-size: 16px; line-height: 24px; color: var(--ink-2); }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 8px; font-size: 12px; }
.crumb .t-mono { color: inherit; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head .actions { gap: 12px; }
/* An order or job: mono meta line, the sentence, and the status stamped in the corner. */
.ohead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 24px; align-items: end; padding-bottom: 20px; border-bottom: 2px solid var(--rule); }
.ohead > .crumb { grid-column: 1 / -1; }
.ohead > .stamp { margin: 0 8px 6px 0; }
.ohead > .actions { grid-column: 1 / -1; margin-top: 20px; }
.ohead > .actions:empty { display: none; }
/* A page with a status of its own (an invoice, a settlement): the stamp stands beside the title. */
.head-t { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.head-t .stamp { font-size: 16px; line-height: 20px; padding: 4px 10px; }
@media (max-width: 700px) {
  .t-title { font-size: 28px; line-height: 32px; }
  .t-sentence { font-size: 28px; line-height: 32px; }
  .head { padding-bottom: 16px; }
  .head .t-meta, .t-sub { font-size: 14px; line-height: 20px; }
  /* The stamp goes above the sentence, so the sentence keeps the full width. */
  .ohead { grid-template-columns: minmax(0, 1fr); padding-bottom: 16px; }
  .ohead > .stamp { grid-row: 2; justify-self: start; margin: 4px 0 12px 2px; font-size: 16px; padding: 4px 10px; }
  .ohead > .actions { margin-top: 16px; }
}

/* Buttons. One orange main action on a screen (.main, with the only shadow there is); black for the others that do something; a frame for the quiet ones. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 2px solid var(--rule); background: var(--sheet); color: var(--ink); font: 600 14px/20px var(--font); white-space: nowrap; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--ink); background: var(--desk); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--ink-2); color: var(--paper); }
.btn.main { background: var(--accent); color: var(--accent-ink); box-shadow: 5px 5px 0 var(--rule); font: 700 15px/20px var(--display); }
.btn.main:hover { background: var(--accent); color: var(--accent-ink); transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--rule); }
.btn.main:active { transform: translate(5px, 5px); box-shadow: none; }
.btn.link, .btn.link:hover { min-height: 0; padding: 0; border: 0; background: none; font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.btn.link:hover { color: var(--warn); }
.btn.link.sm { min-height: 0; padding: 0; font-size: 13px; }
.btn.link.danger, .btn.link.danger:hover { color: var(--stop); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn.main.lg { font-size: 18px; }
.btn.block { width: 100%; }
/* Not available: grey on the desk colour, readable, and without the shadow that says "press here". */
.btn:disabled, .btn:disabled:hover { background: var(--desk); border-color: var(--muted); color: var(--muted); box-shadow: none; transform: none; cursor: not-allowed; }
.btn.link:disabled { background: none; }
/* Quiet buttons side by side share a border, as cells on a form. Not on a phone, where they wrap. */
@media (min-width: 701px) { .head .actions > .btn.quiet + .btn.quiet, .ohead .actions > .btn.quiet + .btn.quiet { margin-left: -14px; } }
@media (max-width: 700px) { .btn, .btn.sm { min-height: 44px; } .btn.link, .btn.link.sm { min-height: 0; } }

/* Panels: a white sheet in a 2px frame, its heading closed by a 2px rule. */
.panel { background: var(--sheet); border: 2px solid var(--rule); min-width: 0; }
.ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; min-height: 44px; padding: 6px 16px; border-bottom: 2px solid var(--rule); }
.ph a, .ph .btn.link { font-size: 13px; }
.pb { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.pfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--desk); border-top: 1px solid var(--rule); font: 500 13px/18px var(--mono); color: var(--ink-2); }
.pfoot b { color: var(--ink); font-weight: 500; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 1100px) { .grid-main, .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Status is a stamp: the word in its colour inside a frame of the same colour, no fill.
   Green = in order, ink = waiting or being staffed, warn = late or needs someone, grey = closed. */
.chip, .stamp { display: inline-flex; align-items: center; border: 2px solid currentColor; color: var(--ink); font-family: var(--display); text-transform: uppercase; white-space: nowrap; }
.chip { max-width: 100%; min-height: 24px; padding: 2px 6px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.04em; }
/* A long status ("Betalas senast 10 dec") in a narrow column breaks into two lines rather than being cut. */
.tr .chip { white-space: normal; }
.chip i { display: none; }
.chip.live, .chip.ok, .chip.paid, .stamp.live, .stamp.ok, .stamp.paid { color: var(--ok); }
.chip.staff, .stamp.staff { color: var(--ink); }
.chip.act, .stamp.act { color: var(--warn); }
.chip.done, .stamp.done { color: var(--muted); }
/* The status of the whole page, stamped a little askew. */
.stamp { border-width: 3px; padding: 6px 14px; font-size: 20px; line-height: 24px; font-weight: 800; letter-spacing: 0.06em; transform: rotate(-4deg); }

/* Tables built from grid rows: a rule between the columns, a dotted rule between the rows. */
.table { overflow-x: auto; }
.tr { display: grid; align-items: stretch; min-height: 52px; border-bottom: var(--dot); color: inherit; text-decoration: none; }
.tr > * { min-width: 0; padding: 10px 12px; border-left: 1px solid var(--rule); align-content: center; }
.tr > :first-child { padding-left: 16px; border-left: 0; }
.tr > :last-child { padding-right: 16px; }
.tr > .prog { justify-content: center; }
/* A column without a heading or a value (the arrow, a button that is not there) has no rule of its own. */
.tr > :empty { border-left: 0; }
/* Money, hours and dates stand in columns: mono. */
.tr > .t-right, .tr > .t-mono { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.tr > .t-right .t-meta { font-family: var(--font); font-weight: 400; }
.tr:last-child { border-bottom: 0; }
/* Rows that each sit in a wrapper of their own (a row that opens) still get the line between them. */
.table > div:not(.tr):not(:last-child) > .tr { border-bottom: var(--dot); }
a.tr:hover, button.tr:hover { background: var(--desk); color: inherit; }
button.tr { width: 100%; padding: 0; border: 0; border-bottom: var(--dot); background: none; text-align: left; cursor: pointer; font: inherit; }
.tr.th { min-height: 36px; background: var(--desk); border-bottom: 1px solid var(--rule); }
.tr.th > * { padding-top: 8px; padding-bottom: 8px; font: inherit; }
.tgroup { padding: 8px 16px; background: var(--desk); border-bottom: 1px solid var(--rule); font: 500 12px/16px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.tr:has(+ .tgroup) { border-bottom: 1px solid var(--rule); }
.tgroup .btn.link { font-family: var(--mono); font-size: 12px; text-transform: none; letter-spacing: 0; }
.cell-main b { display: block; font-weight: 600; }
.cell-main span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.cell-main .id06 { display: flex; font-size: 13px; line-height: 18px; color: var(--ok); }
.cell-main .id06.t-warn { color: var(--warn); }
.tr > .chev { display: grid; place-items: center end; padding: 0 16px 0 0; border-left: 0; color: var(--ink); }
/* A square of initials in a column of its own keeps its size. */
.tr > .av { align-self: center; justify-self: center; padding: 0; border: 1px solid var(--rule); }
/* A stamp that is a column of its own keeps its frame and stands free of the rules. */
.tr > .chip { align-self: center; justify-self: start; margin: 0 16px 0 12px; padding: 2px 6px; border: 2px solid currentColor; }
.cols-orders { grid-template-columns: minmax(180px, 2.1fr) minmax(120px, 1fr) minmax(150px, 1.3fr) minmax(150px, 1fr) minmax(104px, .9fr) 32px; min-width: 800px; }

/* Progress: one square per place. */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; height: 8px; width: 96px; }
.seg span { border: 1px solid var(--rule); background: var(--sheet); }
.seg .g { background: var(--ok); border-color: var(--ok); }
.seg .a { background: var(--warn); border-color: var(--warn); }
.seg.big { height: 12px; width: 100%; gap: 4px; }
.prog { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 18px; }

/* People: square blocks of initials. */
.av { width: 32px; height: 32px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid var(--rule); background: var(--desk); color: var(--ink); font: 500 12px/16px var(--mono); }
.av.alt { background: var(--desk); }
.av.sm { width: 24px; height: 24px; font-size: 11px; }
.avs { display: flex; align-items: center; }
.avs .av { margin-left: -1px; }
.avs .av:first-child { margin-left: 0; }
.person { display: grid; grid-template-columns: 32px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 12px 16px; border-bottom: var(--dot); }
.person:last-child { border-bottom: 0; }
.id06 { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ok); }
.state { text-align: right; font-size: 13px; line-height: 18px; }
.state b { display: block; font-weight: 600; }
.state span { display: block; font: 500 12px/16px var(--mono); color: var(--muted); }
.state.warn b { color: var(--warn); }

/* Key-value list: a column of figures. */
.kv { display: flex; flex-direction: column; font: 500 13px/18px var(--mono); }
/* A value too long to stand beside its label goes on a line of its own, to the right, rather than breaking in the middle of a word. */
.kv > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 10px 0; border-bottom: var(--dot); }
.kv > div:first-child { padding-top: 0; }
.kv > div:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.kv b { min-width: 0; margin-left: auto; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.kv .total { align-items: baseline; border-top: 2px solid var(--rule); border-bottom: 0; margin-top: -1px; padding: 12px 0 0; }
.kv .total span, .kv .total b { color: var(--ink); font: 800 20px/28px var(--display); letter-spacing: -0.02em; }
.kv .total span { font-size: 16px; font-weight: 700; }
.kv .input { font-family: var(--font); }
.note { padding: 10px 12px; border: 1px solid var(--rule); background: var(--desk); font-size: 13px; line-height: 18px; color: var(--ink-2); }
.field-l { margin-bottom: 4px; }
/* A hint after a label: "valfritt", what the field is for. As small as the label, so inputs in one row stay aligned. */
.field-l small { margin-left: 6px; font: 400 12px/16px var(--font); letter-spacing: 0; text-transform: none; color: var(--muted); }

/* Steps and KPI rows: figures in cells that share their rules. */
.steps, .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--sheet); border: 2px solid var(--rule); }
.step, .kpi { min-width: 0; padding: 12px 16px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.step:last-child, .kpi:last-child { border-right: 0; }
.step b, .kpi b, .kpi .t-num { font: 800 28px/32px var(--display); letter-spacing: -0.03em; }
.step b small { font: 500 13px/18px var(--mono); letter-spacing: 0; color: var(--muted); }
.kpi small { font-size: 12px; line-height: 16px; color: var(--muted); }
.step.is-done b { color: var(--ok); }
/* Where the job stands now: the step that is not full yet. */
.step.is-current { box-shadow: inset 0 -4px 0 var(--accent); }
/* Two-up KPI row: declared before the media query so phones still get their own layout. */
.kpis.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Two columns: every cell has a rule under it, and the frame hides the one under the last row. */
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; } .kpi { margin-bottom: -1px; border-bottom: 1px solid var(--rule); } .kpi:nth-child(2n) { border-right: 0; } }
@media (max-width: 700px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .step:nth-child(2) { border-right: 0; } .step:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .step b, .kpi b, .kpi .t-num { font-size: 20px; line-height: 28px; }
}

/* Timeline: the team as a ruled table, hours across. */
/* The table follows the width of its own panel, not the window: the panel is narrow beside a side column and wide alone. */
.team { container: team / inline-size; }
.tl { display: grid; grid-template-columns: minmax(170px, 210px) minmax(0, 1fr) 150px; align-items: stretch; }
.tl > * { min-width: 0; padding: 10px 12px; align-content: center; }
.tl > :first-child { padding-left: 16px; border-right: 1px solid var(--rule); }
.tl > :nth-child(3) { padding-right: 16px; border-left: 1px solid var(--rule); }
.tl.h { min-height: 36px; background: var(--desk); border-bottom: 1px solid var(--rule); }
.tl.h > * { padding-top: 8px; padding-bottom: 8px; }
.tl.r { min-height: 64px; border-bottom: var(--dot); }
.tl.r:last-child { border-bottom: 0; }
.tl > .hours, .tl > .track { margin: 0 20px; padding: 0; }
.hours { position: relative; min-height: 16px; align-self: center; }
.hours span { position: absolute; top: 0; transform: translateX(-50%); }
/* Booked time is an empty frame; time on site fills it in. */
.track { position: relative; min-height: 22px; }
.track .seg-plan, .track .seg-in, .track .seg-late { position: absolute; top: 50%; height: 14px; margin-top: -7px; }
.track .seg-plan { border: 1px solid var(--rule); background: var(--sheet); }
.track .seg-in { background: var(--ok); }
.track .seg-late { background: var(--warn); }
.track .seg-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--rule); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 16px; background: var(--desk); border-top: 1px solid var(--rule); }
.legend i { display: inline-block; width: 14px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.legend i.plan { border: 1px solid var(--rule); background: var(--sheet); }
.legend i.in { background: var(--ok); }
.legend i.late { background: var(--warn); }
.legend i.now { width: 2px; height: 12px; background: var(--rule); }
.tl.r.open { background: var(--warn-bg); }
.tl.r.open .cell-main b { color: var(--warn); }
.av.open { background: none; border: 1px dashed var(--rule); }
/* What can be done about a person, on a line of its own under the name and firm */
.tl > .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; grid-column: 1 / -1; padding: 8px 16px; border: 0; border-top: var(--dot); }
.row-actions .btn.link { font-size: 12px; }
.row-actions > div { flex-basis: 100%; }
.row-actions .inline { justify-content: flex-start !important; margin-top: 0 !important; }
.row-actions .err { width: 100%; }
/* A panel too narrow for the hours: name and status side by side, as on a phone. */
@container team (max-width: 520px) {
  .tl { grid-template-columns: minmax(0, 1fr) auto; }
  .tl.h, .tl .track, .legend { display: none; }
  .tl > :first-child { border-right: 0; }
  .tl.r .state { display: contents; }
  .tl.r .st { grid-column: 2; grid-row: 1; align-self: center; padding: 10px 16px 10px 12px; text-align: right; }
  .tl.r .row-actions { grid-row: 2; }
}

/* Events: the diary of the job. */
.ev { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 16px; border-bottom: var(--dot); font-size: 13px; line-height: 18px; }
.ev:last-child { border-bottom: 0; }
.ev time { font: 500 13px/18px var(--mono); color: var(--ink-2); }
.ev b { font-weight: 500; }
.ev p { color: var(--muted); margin-top: 2px; }

/* Lists of attention items */
.item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border-bottom: var(--dot); text-decoration: none; }
.item:last-child { border-bottom: 0; }
/* Phone: a button or chip in the third column goes under the text instead of squeezing it. */
@media (max-width: 700px) {
  .item { grid-template-columns: 28px minmax(0, 1fr); }
  .item > :nth-child(3) { grid-column: 2; justify-self: start; }
  .item > span:nth-child(3):empty { display: none; }
}
.fold > summary { padding: 12px 16px; font: 500 12px/20px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.fold[open] > summary { border-bottom: 1px solid var(--rule); }
a.item { color: inherit; }
a.item:hover { background: var(--desk); color: inherit; }
.item h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
.item p { font-size: 13px; line-height: 18px; color: var(--muted); margin-top: 2px; }
.item .chip { flex-shrink: 0; }
/* The mark in front of an item: a framed square in the colour of what it is about. */
.ico { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid currentColor; color: var(--ink); }
.ico.o, .ico.a { color: var(--warn); }
.ico.g { color: var(--ok); }
.auto { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; background: var(--desk); border-top: 1px solid var(--rule); font-size: 13px; line-height: 18px; color: var(--ink-2); }
.auto b { color: var(--ink); font-weight: 600; }

/* Board */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col { border-right: 1px solid var(--rule); min-width: 0; }
.col:last-child { border-right: 0; }
.colh { display: flex; justify-content: space-between; align-items: center; min-height: 36px; padding: 0 16px; background: var(--desk); border-bottom: 1px solid var(--rule); color: var(--ink); }
.colh span { color: var(--muted); }
.card { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 12px 16px; border: 0; border-bottom: var(--dot); background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.card:hover { background: var(--desk); color: inherit; }
.card .r1, .card .r3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .r1 b { font-weight: 600; }
.card .r2 { font-size: 13px; line-height: 18px; color: var(--muted); }
.card .r3 { font-size: 13px; line-height: 18px; }
.colempty { padding: 16px; font-size: 13px; color: var(--muted); }
.board.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .board, .board.c2 { grid-template-columns: minmax(0, 1fr); } .col { border-right: 0; border-bottom: 1px solid var(--rule); } .col:last-child { border-bottom: 0; } }

/* Tabs: cells that share their borders; the chosen one is black. They sit on the frame of the sheet below. */
.tabs { display: flex; align-self: flex-start; max-width: 100%; border: 2px solid var(--rule); background: var(--sheet); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-left: 1px solid var(--rule); background: none; color: var(--ink); font: 500 13px/18px var(--mono); white-space: nowrap; cursor: pointer; }
.tab:first-child { border-left: 0; }
.tab:hover { background: var(--desk); }
.tab.on, .tab.on:hover { background: var(--ink); color: var(--paper); }
.tab:focus-visible { outline-offset: -4px; }
.wrap > .tabs + .panel, .wrap > .tabs + section { margin-top: -26px; }

/* Forms */
.form { display: flex; flex-direction: column; }
.fsec { padding: 20px 16px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; }
.fsec:last-child { border-bottom: 0; }
.flabel { font: 700 16px/24px var(--display); }
.flabel small { margin-left: 6px; font: 400 13px/18px var(--font); color: var(--muted); }
/* Choices are cells in one frame; the chosen one is black, here and everywhere else something is selected. */
.opts { display: grid; padding: 0 2px 2px 0; }
.opts.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .opts.c2, .opts.c3, .opts.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.opt { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 48px; margin: 0 -2px -2px 0; padding: 10px 14px; border: 2px solid var(--rule); background: var(--sheet); text-align: left; cursor: pointer; }
.opt:hover { background: var(--desk); }
.opt b { font-weight: 600; }
.opt span { font-size: 12px; line-height: 16px; color: var(--muted); }
.opt.on, .opt.on:hover { background: var(--ink); color: var(--paper); }
.opt.on span { color: var(--paper); }
.opt:focus-visible { position: relative; z-index: 1; }
.opt:disabled { background: var(--desk); color: var(--muted); cursor: not-allowed; }
.stepper { display: inline-flex; align-items: stretch; border: 2px solid var(--rule); background: var(--sheet); }
.stepper button { width: 48px; min-height: 44px; border: 0; background: none; font: 500 20px/1 var(--mono); cursor: pointer; }
.stepper button:hover { background: var(--ink); color: var(--paper); }
.stepper button:disabled { background: var(--desk); color: var(--muted); cursor: not-allowed; }
.stepper button:focus-visible { outline-offset: -4px; }
.stepper output { min-width: 64px; text-align: center; font: 800 20px/44px var(--display); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.input, textarea.input, select.input { width: 100%; min-height: 44px; padding: 8px 12px; border: 2px solid var(--rule); border-radius: 0; background: var(--sheet); }
textarea.input { min-height: 76px; resize: vertical; }
.input:disabled { background: var(--desk); color: var(--muted); }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
/* A tick box is a framed square; ticked, it is filled in. */
input[type="checkbox"], input[type="radio"] { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 2px solid var(--rule); background: var(--sheet); vertical-align: -4px; cursor: pointer; }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--ink); box-shadow: inset 0 0 0 3px var(--sheet); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { border-color: var(--muted); background-color: var(--desk); cursor: not-allowed; }
.check { display: grid; grid-template-columns: 20px 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: var(--dot); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check:hover { background: var(--desk); }
.check.off { cursor: not-allowed; color: var(--muted); }
.check.off:hover { background: none; }
.sticky { position: sticky; top: 24px; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum-total b { font: 800 28px/36px var(--display); letter-spacing: -0.03em; }
/* Order form on a phone: the price and the button follow along while the choices are made. The full summary is at the end of the page,
   and the page keeps room under it so the bar never lies over the last field. */
.orderbar { display: none; }
@media (max-width: 700px) {
  .orderbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--sheet); border-top: 2px solid var(--rule); }
  .orderbar > div { min-width: 0; display: flex; flex-direction: column; }
  .orderbar b { font: 800 20px/24px var(--display); letter-spacing: -0.02em; }
  .orderbar span { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .orderbar .btn.main { box-shadow: 3px 3px 0 var(--rule); margin-right: 3px; }
  .wrap.has-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
.err { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--stop); }
.success { display: flex; gap: 12px; align-items: flex-start; padding: 16px; }
.success h3 { font: 700 20px/28px var(--display); }
.success p { color: var(--ink-2); margin-top: 4px; }

/* Empty and loading: said plainly, flush left like everything else on the sheet. */
.empty { padding: 24px 16px; color: var(--muted); font-size: 13px; line-height: 18px; }
.empty b { display: block; color: var(--ink); font: 700 16px/24px var(--display); margin-bottom: 2px; }
.wrap > .empty { border: 2px solid var(--rule); background: var(--sheet); }
.loading { padding: 80px 20px; text-align: center; font-size: 12px; }

/* The small public pages (login, invitation, sign-up, interest): one sheet on the paper, under the name. */
.pub { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; background: var(--paper); font-size: 16px; line-height: 24px; }
.pub-body { width: 100%; max-width: 520px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.pub-body > .brand { align-self: flex-start; font-size: 28px; line-height: 32px; letter-spacing: -0.03em; }
.pub-sheet { background: var(--sheet); border: 2px solid var(--rule); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.pub-sheet .t-title { font-size: 28px; line-height: 32px; padding-bottom: 12px; border-bottom: 2px solid var(--rule); }
.pub-sheet .t-meta { font-size: 14px; line-height: 20px; color: var(--ink-2); }
.pub-sheet .btn.main { margin: 4px 5px 5px 0; width: calc(100% - 5px); }
.pub-sheet .input { min-height: 48px; font-size: 16px; }
.pub .opt b { font-size: 14px; line-height: 20px; }
@media (max-width: 700px) { .pub { justify-content: flex-start; } .pub-sheet { padding: 20px 16px; } }

/* Worker (mobile first) — the work order on a phone: paper ground, 2px ink frames, square corners.
   .wk, .wk-body and .wk-card also frame the small public forms (invitation, password, network). */
.wk { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font: 400 16px/24px var(--font); }
.wk :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The wordmark lines up with the 520px column below; on a phone the language cell runs out to the edge. */
.wk-bar { display: flex; justify-content: space-between; align-items: stretch; gap: 12px; min-height: 56px; padding-inline: max(16px, calc((100% - 520px) / 2 + 16px)) max(0px, calc((100% - 520px) / 2 + 16px)); border-bottom: 2px solid var(--rule); background: var(--paper); color: var(--ink); }
.wk-bar b { align-self: center; font: 800 18px/24px var(--display); letter-spacing: -0.02em; text-transform: uppercase; }
.wk-end { display: flex; align-items: stretch; gap: 12px; min-width: 0; }
.wk-who { align-self: center; min-width: 0; padding: 6px 0; font: 500 12px/16px var(--mono); color: var(--ink-2); text-align: end; overflow-wrap: anywhere; }
/* Language: a globe and a short code as a cell of the bar, with the real select lying invisible on top. */
.wk-lang { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 72px; min-height: 52px; padding: 0 12px; border-inline: 2px solid var(--rule); font: 500 14px/20px var(--mono); color: var(--ink); }
.wk-lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
/* The select itself is invisible, so the cell shows the focus: it turns black, like a pressed cell. */
.wk-lang:focus-within { background: var(--ink); color: var(--paper); outline: 2px solid var(--accent); outline-offset: -6px; }
@media (max-width: 519px) { .wk-lang { border-inline-end: 0; } }
.wk-body { width: 100%; max-width: 520px; margin: 0 auto; padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
/* Mono uppercase label: meta lines a person glances at. What must be read is 16px or more. */
.wk-label { font: 500 12px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wk-date { font: 500 16px/22px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
/* The time is the headline of the order; it shrinks a little on a narrow phone and never breaks. */
.wk-time { margin-top: 4px; font: 800 clamp(44px, 14vw, 54px)/1.04 var(--display); letter-spacing: -0.03em; white-space: nowrap; }
.wk-proj { font: 700 20px/26px var(--display); overflow-wrap: anywhere; }
.wk-head .wk-proj { margin-top: 6px; }
.wk-card, .wk-sheet { background: var(--sheet); border: 2px solid var(--rule); border-radius: 0; }
.wk-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
/* The facts as one ruled sheet: address, the site's own words, what to bring. */
.wk-sheet > * { padding: 12px 14px; }
.wk-sheet > * + * { border-top: 1px dotted var(--rule); }
.wk-addr { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; color: var(--ink); font-weight: 500; text-decoration: none; }
a.wk-addr:hover { color: var(--ink); background: var(--desk); }
.wk-dir { flex: none; max-width: 45%; font-weight: 600; text-align: end; text-decoration: underline; text-underline-offset: 3px; }
/* The label above the site's own words: which language they are in. */
.wk-inst { display: flex; flex-direction: column; gap: 4px; }
.wk-link { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.wk-link:hover { color: inherit; }
/* The one main action of the screen: orange, black text, black frame, hard shadow. */
.wk-big { width: 100%; min-height: 76px; margin-bottom: 5px; padding: 16px; border: 2px solid var(--rule); border-radius: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 5px 5px 0 var(--rule); font: 800 24px/28px var(--display); letter-spacing: -0.01em; text-align: center; cursor: pointer; }
.wk-big:hover { background: var(--accent); color: var(--accent-ink); }
.wk-big:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--rule); }
/* An orange ring would vanish beside the orange ground. */
.wk-big:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.wk-big:disabled, .wk-go:disabled { background: var(--desk); color: var(--muted); box-shadow: none; transform: none; cursor: not-allowed; }
/* The same button as a link: "Ring StädPro" on a page whose link has stopped working. */
a.wk-big { display: grid; place-items: center; text-decoration: none; }
/* The send of an opened form: black, so the orange button stays the only one. */
.wk-go { width: 100%; min-height: 56px; padding: 12px 16px; border: 2px solid var(--rule); border-radius: 0; background: var(--ink); color: var(--paper); font: 700 18px/24px var(--display); text-align: center; cursor: pointer; }
/* The other choices are cells of one form: they share their borders. */
.wk-cells { display: flex; flex-direction: column; }
.wk-cells > * + * { margin-top: -2px; }
.wk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wk-two > * + * { margin-inline-start: -2px; }
.wk-two > :only-child { grid-column: 1 / -1; }
.wk-sec { min-height: 56px; padding: 12px 8px; border: 2px solid var(--rule); border-radius: 0; background: var(--sheet); color: var(--ink); font: 700 16px/20px var(--display); text-align: center; text-decoration: none; cursor: pointer; display: grid; place-items: center; }
.wk-sec:hover { background: var(--desk); color: var(--ink); }
.wk-sec.on, .wk-sec.on:hover { background: var(--ink); color: var(--paper); }
.wk-sec:disabled { color: var(--muted); cursor: not-allowed; }
.wk-sec:focus-visible, .wk-go:focus-visible { position: relative; z-index: 1; }
/* An opened form keeps a little air above it when it is scrolled into view. */
.wk-form { scroll-margin: 12px; }
.wk-q { margin-bottom: 6px; font-weight: 600; }
.wk-input { display: block; width: 100%; min-height: 56px; padding: 12px; border: 2px solid var(--rule); border-radius: 0; background: var(--sheet); color: var(--ink); font: 400 16px/24px var(--font); }
input.wk-input { font: 500 20px/28px var(--mono); }
.wk-hint { color: var(--muted); }
.wk-err { padding: 12px 14px; border: 2px solid var(--stop); background: var(--sheet); color: var(--stop); font-weight: 500; }
.wk-cells > .wk-err { margin-block: 12px; }
.wk-notice { padding: 12px 14px; border: 2px solid var(--rule); background: var(--desk); font-weight: 500; }
.wk-notice.warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
/* What the person has sent: the meta line and their own words. */
.wk-sent { gap: 4px; }
/* Checked in: the state as a line, the pass as a framed bar. */
.wk-state { display: flex; align-items: center; gap: 10px; font: 800 20px/26px var(--display); letter-spacing: -0.02em; }
.wk-state b { font-weight: inherit; }
.wk-dot { flex: none; width: 14px; height: 14px; background: var(--ok); }
.wk-prog { height: 16px; border: 2px solid var(--rule); background: var(--sheet); }
.wk-prog span { display: block; height: 100%; background: var(--ok); }
.wk-ends { display: flex; justify-content: space-between; font: 500 14px/20px var(--mono); color: var(--ink-2); }
/* The receipt: a square tick and the thanks as the headline. */
.wk-ok { align-self: flex-start; display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--ok); color: var(--ok); }
.wk-thanks { font: 800 28px/32px var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
/* The team as a ruled list. */
.wk-team { border-top: 2px solid var(--rule); }
.wk-team .wk-label { padding: 10px 0 8px; }
.wk-mate { padding: 10px 0; border-top: 1px dotted var(--rule); font-weight: 500; }
.wk-foot { text-align: center; font-size: 14px; line-height: 20px; }
.wk-foot .wk-link { display: inline-block; padding: 14px 12px; font-weight: 400; }
.wk-loading { padding: 80px 20px; text-align: center; font: 500 14px/20px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* Arabic: the hard shadow falls the other way, and joined letters take no tracking. Borders and cells follow from the logical properties above. */
.wk[dir="rtl"] .wk-big { box-shadow: -5px 5px 0 var(--rule); }
.wk[dir="rtl"] .wk-big:active { transform: translate(-3px, 3px); box-shadow: -2px 2px 0 var(--rule); }
.wk[dir="rtl"] .wk-big:disabled { box-shadow: none; transform: none; }
.wk[dir="rtl"] :is(.wk-label, .wk-date, .wk-loading, .wk-thanks, .wk-state, .wk-big) { letter-spacing: 0; }
/* The mono face has no Arabic letters and its stand-in breaks the joins; labels take the text face, a size up. */
.wk[dir="rtl"] :is(.wk-label, .wk-date, .wk-loading) { font-family: var(--font); }
.wk[dir="rtl"] :is(.wk-label, .wk-loading) { font-size: 14px; line-height: 20px; }
/* Gate, staff register and what to bring are what the person must not miss. */
.wk .note { font-size: 14px; line-height: 20px; color: var(--ink); }
/* Choices on the public forms read as options, lighter than the button below them. */
.wk .opt b { font-size: 14px; line-height: 20px; }

/* Toast (used only for errors) */
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 16px; border: 2px solid var(--rule); background: var(--ink); color: var(--paper); font-size: 13px; line-height: 18px; font-weight: 500; z-index: 50; }
@media (max-width: 700px) { .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

/* Invoice and settlement (A4, printable): the form in full. A framed sheet, facts in ruled cells, figures in mono, the sum to pay in a frame of its own. */
.cols-inv { grid-template-columns: 136px minmax(180px, 2fr) 108px 108px 128px 150px; min-width: 800px; }
.doc { background: var(--sheet); border: 2px solid var(--rule); padding: 40px 48px 32px; display: flex; flex-direction: column; gap: 28px; font-size: 13px; line-height: 18px; max-width: 840px; }
.doc p { margin: 0; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--rule); }
.doc-brand { display: flex; align-items: center; gap: 10px; font: 800 28px/32px var(--display); letter-spacing: -0.03em; text-transform: uppercase; }
.doc-title { text-align: right; }
.doc-title h1 { font: 800 28px/32px var(--display); letter-spacing: -0.03em; text-transform: uppercase; }
.doc-title p { margin-top: 2px; font: 500 13px/18px var(--mono); color: var(--ink); }
.doc-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.doc-parties b { font-size: 16px; line-height: 24px; font-weight: 600; }
.doc-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--rule); }
.doc-facts div { min-width: 0; padding: 8px 12px 10px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; }
.doc-facts div:first-child { border-left: 0; }
.doc-facts b, .doc-facts b.t-mono { font: 500 13px/18px var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.doc-lines { width: 100%; border-collapse: collapse; }
.doc-lines th { text-align: left; padding: 0 8px 8px 0; border-bottom: 2px solid var(--rule); }
.doc-lines th.t-right { text-align: right; }
.doc-lines td { padding: 10px 8px 10px 0; border-bottom: var(--dot); vertical-align: top; }
.doc-lines td.t-right, .doc-lines td.t-mono { font: 500 13px/18px var(--mono); color: var(--ink); }
.doc-lines td small { display: block; font-size: 12px; color: var(--muted); }
/* Lines grouped per project, with the customer's marking and a subtotal */
.doc-lines tr.grp td { padding-top: 16px; font-weight: 600; border-bottom: 1px solid var(--rule); }
.doc-lines tr.grp td small { display: inline; margin-left: 8px; font-weight: 400; }
.doc-lines tr.sub td { font-weight: 600; border-bottom: 1px solid var(--rule); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-total { margin-left: auto; width: 320px; display: flex; flex-direction: column; border: 2px solid var(--rule); font: 500 13px/18px var(--mono); }
.doc-total div { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; padding: 0 12px; border-bottom: var(--dot); }
.doc-total span { color: var(--ink-2); }
.doc-total b { font-weight: 500; }
.doc-total .pay { min-height: 52px; border-top: 2px solid var(--rule); border-bottom: 0; margin-top: -1px; }
.doc-total .pay span, .doc-total .pay b { font: 800 20px/28px var(--display); letter-spacing: -0.02em; color: var(--ink); }
.doc-total .pay span { font-size: 16px; font-weight: 700; }
.doc-foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-top: 12px; border-top: 2px solid var(--rule); font-size: 12px; line-height: 16px; color: var(--ink-2); }
.doc-foot b { display: block; margin-bottom: 2px; font: 500 11px/16px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 700px) {
  .doc { padding: 20px 16px; gap: 20px; } .doc-parties, .doc-facts, .doc-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); } .doc-total { width: 100%; }
  .doc-brand, .doc-title h1 { font-size: 20px; line-height: 24px; }
  .doc-facts div:nth-child(odd) { border-left: 0; } .doc-facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
.doc-lines th:last-child, .doc-lines td:last-child { padding-right: 0; }
.inv-lines .ln-m { display: none; }
/* Phone: each invoice line is a block, description and amount on top, the rest on one line under */
@media (max-width: 700px) {
  .inv-lines, .inv-lines tbody { display: block; }
  .inv-lines thead, .inv-lines .ln-d { display: none; }
  .inv-lines tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 0; border-bottom: var(--dot); }
  .inv-lines tr td { padding: 0; border: 0; }
  .inv-lines tr.grp { display: block; padding: 0; border-bottom: 0; }
  .inv-lines tr.grp td { display: block; }
  .inv-lines tr.sub { display: flex; justify-content: space-between; border-bottom: 1px solid var(--rule); }
  .inv-lines tr.sub td { border: 0; }
  .inv-lines td.ln-m { display: block; grid-column: 1 / -1; padding-top: 2px; font: 500 12px/16px var(--mono); color: var(--muted); }
}

/* Requirement checklist */
.req { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border-bottom: var(--dot); }
.req:last-child { border-bottom: 0; }
/* A firm on a job page: name and number, what it answered, booking on its behalf */
.firm { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-bottom: var(--dot); }
.firm:last-child { border-bottom: 0; }
.firm .r { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.firm .r b { font-weight: 600; }
.firm .r a { font-size: 13px; white-space: nowrap; }
.firm .m { font-size: 13px; line-height: 18px; color: var(--muted); }
.firm .inline { justify-content: flex-start !important; }
/* A tick, a clock or a warning in a framed square of its own colour. */
.mark { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border: 2px solid currentColor; }
.mark.sm { width: 18px; height: 18px; border-width: 1px; }
.mark.ok { color: var(--ok); }
.mark.warn, .mark.bad { color: var(--warn); }
.mark.bad { background: var(--warn-bg); }
.req span.send { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
/* Kontroller: a matrix on wide screens, a list of what is missing per company on a phone */
.chk-list { display: none; }
.chk-line { margin: 4px 0 0; font-size: 13px; line-height: 18px; }
@media (max-width: 700px) { .chk-wide { display: none; } .chk-list { display: block; } }
.req b { display: block; font-weight: 600; }
.req span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.req span.mark { display: grid; }
.req span.t-warn, .req span.t-amber { color: var(--warn); }
.req span.t-ok { color: var(--ok); }
.req-form { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.req-form .input { width: auto; min-height: 40px; }
.req-form label span { display: inline; }
.req .req-btns { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; line-height: 18px; color: inherit; }
.req .req-act { font-size: 13px; }
@media (max-width: 700px) {
  .req { grid-template-columns: 24px minmax(0, 1fr); }
  .req > .req-act, .req > .btn { grid-column: 2; justify-self: start; }
  .req .req-btns { flex-wrap: wrap; white-space: normal; }
}
.meter { height: 10px; border: 1px solid var(--rule); background: var(--sheet); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); }
.meter span.warn { background: var(--warn); }
.meter span.bad { background: var(--stop); }

/* Banners: a framed note on the page, not a tinted pill. The frame carries the tone:
   warn (the default: something is or soon will be wrong), info (something to know), ok (done), muted (closed or ended). */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--warn); background: var(--warn-bg); color: var(--ink); font-size: 14px; line-height: 20px; text-decoration: none; }
.banner > svg { margin-top: 1px; color: var(--warn); }
.banner b { color: var(--warn); font-weight: 600; }
.banner.info { border-color: var(--rule); background: var(--sheet); }
.banner.ok { border-color: var(--ok); background: var(--sheet); }
.banner.muted { border: 2px dashed var(--muted); background: var(--desk); color: var(--ink-2); }
.banner.info > svg, .banner.info b, .banner.muted b { color: var(--ink); }
.banner.ok > svg, .banner.ok b { color: var(--ok); }
.banner.muted > svg { color: var(--muted); }
.banner a { color: inherit; }
button.banner { width: 100%; font: inherit; text-align: left; cursor: pointer; }
a.banner:hover, button.banner:hover { color: var(--ink); box-shadow: inset 0 0 0 1px currentColor; }

@page { size: A4; margin: 14mm 16mm; }
@media print {
  body { background: #fff; }
  .doc-lines tr, .doc-total, .doc-foot { break-inside: avoid; }
  .nav, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  /* On paper the sheet is the page: no frame around it. */
  .doc { border: 0; padding: 0; max-width: none; }
}

/* The order table in a narrow place (a phone, or a column beside another on a detail page): each row becomes a card of two columns
   instead of a table that scrolls sideways. It follows the width of its own panel, not the window. */
.table { container-type: inline-size; }
@container (max-width: 780px) {
  .tr.cols-orders { grid-template-columns: minmax(0, 1fr) auto; min-width: 0; gap: 6px 12px; padding: 12px 16px; }
  .tr.cols-orders > * { padding: 0; border-left: 0; }
  .tr.cols-orders.th { display: none; }
  .tr.cols-orders > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .tr.cols-orders > :nth-child(2) { grid-column: 1; grid-row: 2; }
  .tr.cols-orders > :nth-child(3) { grid-column: 1; grid-row: 3; }
  .tr.cols-orders > :nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; }
  .tr.cols-orders > :nth-child(5) { grid-column: 2; grid-row: 2; }
  .tr.cols-orders > :nth-child(6) { display: none; }
  .tr.cols-orders .cell-main b[style] { font-size: 13px; color: var(--ink-2); }
}
/* Phone: team rows drop the ID06 column */
@media (max-width: 700px) {
  .person { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .person > .id06 { display: none; }
  /* Team timeline: name and status side by side, the actions on a row of their own */
  .tl { grid-template-columns: minmax(0, 1fr) auto; min-width: 0; }
  .tl.h, .tl .track, .legend { display: none; }
  .tl > :first-child { border-right: 0; }
  .tl.r .state { display: contents; }
  .tl.r .st { grid-column: 2; grid-row: 1; align-self: center; padding: 10px 16px 10px 12px; text-align: right; }
  .tl.r .row-actions { grid-row: 2; }
}

/* Planering: staff as rows, days or hours across */
.seg-ctl { display: inline-flex; border: 2px solid var(--rule); background: var(--sheet); }
.seg-ctl button { min-height: 36px; padding: 0 14px; white-space: nowrap; border: 0; border-left: 1px solid var(--rule); background: none; color: var(--ink); font: 500 13px/18px var(--mono); cursor: pointer; }
.seg-ctl button:first-child { border-left: 0; }
.seg-ctl button:hover { background: var(--desk); }
.seg-ctl button.on { background: var(--ink); color: var(--paper); }
.seg-ctl button:focus-visible { outline-offset: -4px; }
@media (max-width: 700px) { .seg-ctl button { min-height: 40px; } }
.cal-wrap { overflow-x: auto; }
.cal { display: grid; }
.cal > * { border-right: 1px solid var(--rule); border-bottom: var(--dot); }
.cal-h { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 8px 12px; background: var(--desk); border-bottom: 1px solid var(--rule); }
.cal-day { align-items: flex-start; }
.cal-dbtn { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.cal-offer { font-size: 12px; line-height: 16px; font-weight: 600; }
.cal-day:hover { background: var(--sheet); }
.cal-day b { font: 500 12px/16px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.cal-day span { font-size: 12px; color: var(--muted); }
/* Today: the column head is black, like everything chosen. */
.cal-day.today, .cal-day.today:hover { background: var(--ink); color: var(--paper); }
.cal-day.today span, .cal-day.today .cal-offer, .cal-day.today a { color: var(--paper); }
.cal-name { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 12px; position: sticky; left: 0; z-index: 1; background: var(--sheet); }
.cal-name b { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cal-name.open, .dl-row.open .cal-name { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; background: var(--warn-bg); }
.cal-name.open b, .dl-row.open .cal-name b { color: var(--warn); }
.cal-h.cal-name { align-items: flex-start; min-height: 52px; background: var(--desk); }
.pjob .a.miss { color: var(--warn); font-weight: 600; }
.cal-cell { display: flex; flex-direction: column; gap: 6px; min-height: 64px; padding: 6px; }
.cal-cell.open { background: var(--warn-bg); }
.cal-add { align-self: stretch; flex: 1; min-height: 40px; border: 1px dashed transparent; background: none; color: transparent; font: 500 20px/1 var(--mono); cursor: pointer; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { border-color: var(--rule); color: var(--ink); }
.cal-add.more { flex: none; min-height: 24px; font-size: 14px; line-height: 1; }
.cal-cell.past { background: var(--desk); }
.dl-track.past { cursor: default; }
.p-past { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--desk); font-size: 13px; line-height: 18px; color: var(--muted); }
.p-offer { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--warn-bg); font-size: 13px; line-height: 18px; }
.p-offer b { font-weight: 600; }
.p-offer a { white-space: nowrap; font-weight: 600; }
.is-loading { opacity: .55; }
/* The job form: two columns that become one on a phone; Från and Till stay side by side */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
/* A job in the plan: a framed slip. The firm's own job is white with a black edge; a Städisen pass has the orange edge.
   Short of people: a dashed frame. */
.pjob { display: block; width: 100%; text-decoration: none; padding: 5px 8px; border: 1px solid var(--rule); border-left: 4px solid var(--rule); background: var(--sheet); color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.pjob:hover { background: var(--desk); }
.pjob.short { border-style: dashed; border-left-style: solid; }
.pjob.pass { border-left-color: var(--accent); }
.pjob .t { display: block; font: 500 12px/16px var(--mono); color: var(--ink-2); white-space: nowrap; }
.pjob b { display: block; overflow: hidden; font-size: 12px; line-height: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pjob .a { display: block; overflow: hidden; font-size: 12px; line-height: 16px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.dayline { min-width: 880px; }
.dl-row { display: grid; grid-template-columns: 168px minmax(0, 1fr); border-bottom: var(--dot); }
.dl-row:last-child { border-bottom: 0; }
.dl-row .cal-name { border-right: 1px solid var(--rule); }
/* One rule per hour, drawn as a 1px image so no gradient shows. */
.dl-track { position: relative; min-height: 72px; cursor: copy; background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px); background-size: calc(100% / 14) 100%; background-position: -1px 0; }
.dl-head { border-bottom: 1px solid var(--rule); }
.dl-head .cal-name, .dl-head .dl-track { min-height: 36px; background-color: var(--desk); cursor: default; }
.dl-head .dl-track span { position: absolute; top: 10px; transform: translateX(4px); font: 500 11px/16px var(--mono); color: var(--muted); }
.dl-track .pjob { position: absolute; top: 8px; height: 56px; width: auto; min-width: 48px; }
.cal-none { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; font-size: 13px; }
.cal-none b { font-weight: 600; }
.cal-none span { font-size: 12px; color: var(--muted); }
/* Phone: the day as a list per person, with the week as a strip of days above it */
.pstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 2px solid var(--rule); background: var(--desk); }
.pstrip button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; padding: 6px 0; border: 0; border-left: 1px solid var(--rule); background: none; color: var(--ink); font: inherit; cursor: pointer; }
.pstrip button:first-child { border-left: 0; }
.pstrip button span { font: 500 11px/16px var(--mono); text-transform: uppercase; color: var(--muted); }
.pstrip button b { font: 800 16px/20px var(--display); }
.pstrip button.today b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pstrip button.on { background: var(--ink); color: var(--paper); }
.pstrip button.on span, .pstrip button.on b { color: var(--paper); }
.pstrip button:focus-visible { outline-offset: -4px; }
.pstrip i { width: 6px; height: 6px; }
.pstrip i.dot { background: var(--accent); }
.pl-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-bottom: var(--dot); }
.pl-row:last-child { border-bottom: 0; }
.pl-row.open { background: var(--warn-bg); }
.pl-row.open .pl-name b { color: var(--warn); }
.pl-name { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.pl-name b { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pl-row .pjob { padding: 8px 10px; }
.pl-free.past { cursor: default; color: var(--muted); }
.pl-free { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 0 12px; border: 1px dashed var(--rule); background: none; color: var(--ink-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
@media (max-width: 420px) { .lbl-wide { display: none; } }
@media (max-width: 700px) { .cal-name { min-width: 0; } .head .actions { flex-wrap: wrap; } }
/* Phones have no hover: keep the empty-cell "+" visible there. */
@media (hover: none) { .cal-add { border-color: var(--muted); color: var(--muted); } }
/* Phone: wide tables marked .stack become wrapped cards instead of scrolling sideways */
@media (max-width: 700px) {
  .tr.stack { display: flex !important; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0 !important; padding: 12px 16px; }
  .tr.stack > * { padding: 0; border-left: 0; }
  .tr.stack.th { display: none !important; }
  .tr.stack > .cell-main { flex: 1 1 60%; }
  .tr.stack > .t-right { text-align: left; }
  .tr.stack > .ph-hide, .tr.stack > .chev { display: none; }
  .tr.stack > .ph-push { margin-left: auto; text-align: right; }
  .tr.stack > .ph-full { flex-basis: 100%; text-align: left; }
  .tr.stack > .ph-full .btn { width: 100%; }
  .tr.stack > .ph-full .cell-main { display: flex; flex-direction: column; gap: 4px; }
  /* A labelled summary line that stands in for the columns hidden on a phone */
  .tr.stack > .ph-line { display: block; flex-basis: 100%; font-size: 13px; line-height: 20px; color: var(--ink-2); }
  .tr.stack .cell-main .ph-sub { display: block; }
  .tr.stack .cell-main .ph-wide { display: none; }
}
.tr > .ph-line, .cell-main .ph-sub { display: none; }
.ph-only { display: none; }
@media (max-width: 700px) { .ph-only { display: inline; } }
/* An inline question before an action that tells someone else (send, remind, pay): a framed slip. */
.confirm { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 2px solid var(--rule); background: var(--desk); font-size: 13px; line-height: 18px; color: var(--ink-2); }
.confirm > b { color: var(--ink); font: 700 16px/24px var(--display); }
.panel > .confirm { margin: 12px 16px; }
[role="alertdialog"].note { border-width: 2px; }
details.tech > summary { cursor: pointer; padding: 12px 16px; font: 500 12px/20px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); list-style: none; }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech[open] > summary { border-bottom: 1px solid var(--rule); }
