html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html, body { margin: 0; }
img { max-width: 100%; }

/* Layout: one narrow column. Crew pages (opened by QR/NFC tag via the hash) are a signed-in checklist with a confirm button; #dashboard is the managers' live status board. English or Icelandic from a selector. */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --ink: #14202b;
  --muted: #5b6874;
  --line: #d3dae1;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --ok: #1f7a4d;
  --warn: #b4540a;
  --bad: #b3261e;
  --focus: #0b5cad;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f161d; --surface: #18222c; --ink: #e8edf1; --muted: #93a1ad; --line: #2b3946;
    --accent: #ff7a2e; --accent-ink: #1a0d03; --ok: #5ccb93; --warn: #ffa45c; --bad: #ff8a80; --focus: #6bb4ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f161d; --surface: #18222c; --ink: #e8edf1; --muted: #93a1ad; --line: #2b3946;
  --accent: #ff7a2e; --accent-ink: #1a0d03; --ok: #5ccb93; --warn: #ffa45c; --bad: #ff8a80; --focus: #6bb4ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45;
  padding-block: 0 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: 720px; margin: 0 auto; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

header { padding-top: 14px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; flex-wrap: wrap; }
.tools { display: flex; gap: 8px; align-items: center; }
.lang { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 14px; color: var(--ink); min-height: 40px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.back { font-family: var(--mono); font-size: 13px; color: var(--muted); }
h1 { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; margin: 6px 0 14px; letter-spacing: .01em; text-transform: uppercase; overflow-wrap: anywhere; }
.field { display: grid; gap: 4px; font-size: 12px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.field input { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-family: var(--body); font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); min-width: 0; width: 100%; }

.idbox { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 56px; }
.idbox img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.idbox .nm { font-weight: 600; overflow-wrap: anywhere; }
.idbox.warn { border-color: var(--warn); }
.idbox .sub { font-size: 12px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: block; }

.progress { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding: 12px 0 10px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.progress-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 13px; }
.progress-row b { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.bar.done i { background: var(--ok); }
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }

section.group { margin-top: 22px; }
.group h2 { font-family: var(--display); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.group h2 span { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.items li + li { border-top: 1px solid var(--line); }
.item { display: flex; gap: 14px; align-items: flex-start; padding: 14px; min-height: 56px; cursor: pointer; }
.item input { appearance: none; -webkit-appearance: none; flex: none; width: 28px; height: 28px; margin: 1px 0 0; border: 2px solid var(--muted); border-radius: 6px; background: var(--surface); display: grid; place-content: center; cursor: pointer; }
.item input::after { content: ""; width: 14px; height: 8px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.item input:checked { background: var(--ok); border-color: var(--ok); }
.item input:checked::after { opacity: 1; }
.item .t { min-width: 0; }
.item .name { display: block; font-weight: 500; overflow-wrap: anywhere; }
.item .note { display: block; font-size: 13px; color: var(--muted); }
.item input:checked ~ .t .name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }

.kmbox { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 6px; }
.kmbox .field input { font-family: var(--mono); font-size: 22px; letter-spacing: .04em; padding: 12px; }

.foot { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 12px; }
.foot h2 { font-family: var(--display); font-size: 24px; text-transform: uppercase; letter-spacing: .03em; margin: 0; }
.foot p { margin: 0; color: var(--muted); font-size: 14px; }
textarea { width: 100%; min-height: 110px; resize: vertical; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px; color: var(--ink); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 12px 16px; font-weight: 600; cursor: pointer; min-height: 48px; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.btn.small { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); flex: 1 1 200px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.quiet { color: var(--muted); }
.status { font-size: 14px; min-height: 20px; }
.status.good { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.bad { color: var(--bad); }
.reset { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.done-card { margin-top: 14px; background: var(--surface); border: 2px solid var(--ok); border-radius: 8px; padding: 14px 16px; }
.done-card b { color: var(--ok); }

.home { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.home a { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; color: var(--ink); text-decoration: none; min-height: 64px; }
.home .nm { font-family: var(--display); font-size: 28px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.home .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.hint { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* login and users */
.logincard { margin-top: 18px; max-width: 420px; }
.logincard form { display: grid; gap: 12px; }
.urow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; }
.urow + .urow { border-top: 1px solid var(--line); }
.uname { min-width: 0; overflow-wrap: anywhere; font-size: 14px; color: var(--muted); }
.uname b { color: var(--ink); font-size: 16px; }
.userchip { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
form.foot .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { form.foot .row2 { grid-template-columns: 1fr; } }
.field select { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 16px; text-transform: none; letter-spacing: 0; }
/* dashboard */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 6px; }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.tile b { display: block; font-family: var(--display); font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums; }
.tile span { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile.bad b { color: var(--bad); } .tile.warn b { color: var(--warn); } .tile.ok b { color: var(--ok); }
.banner { margin-top: 14px; border: 1px solid var(--bad); background: var(--surface); border-radius: 8px; padding: 12px 14px; }
.banner strong { color: var(--bad); }
.toast { margin-top: 14px; border: 1px solid var(--ok); background: var(--surface); border-radius: 8px; padding: 10px 14px; }
.toast strong { color: var(--ok); }
.board { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.eq { padding: 14px; display: grid; gap: 8px; }
.eq + .eq { border-top: 1px solid var(--line); }
.eq.fresh { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.eq-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.eq-name { font-family: var(--display); font-size: 26px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.pill { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.soon { color: var(--warn); } .pill.overdue, .pill.never { color: var(--bad); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 600; }
.flag { color: var(--warn); font-weight: 600; }
.more { display: grid; gap: 10px; padding-top: 4px; font-size: 14px; }
.more h3 { margin: 0 0 2px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.more ul { margin: 0; padding-left: 18px; }
.more .cmt { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.more .int { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.more .int input { width: 84px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-family: var(--mono); }
.feed { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.feed li { padding: 10px 14px; font-size: 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feed li + li { border-top: 1px solid var(--line); }
.feed .when { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.empty { padding: 18px 14px; color: var(--muted); font-size: 14px; }
h2.sec { font-family: var(--display); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 26px 0 8px; }
