/* =====================================================================
   PVURA Control — Design Rebuild layer (2026-10)
   Object-centric · state-first · exception-driven.

   Loaded after pvura.css. Reuses every Design System 2.0 token from
   pvura.css (colors, fonts, motion, light theme) — this file adds
   composition, not a second palette. Rules of the system:

   Surfaces (five roles, no others):
     page        var(--pvura-bg)              the canvas
     work        var(--pv-work)               ONE grouping surface per region
     raised      var(--pvura-surface-raised)  menus, drawers' inner chrome
     status      .pv-status-* tints           only where state needs it
     overlay     dialog.pv-drawer / sheet     intentional actions

   Hierarchy comes from type, spacing and hairlines — a bordered box is
   used only where it marks a real group (the exception queue, a drawer).

   Color roles never mix:
     brand accent  --brand-text     interaction + identity (links, focus, tabs)
     safety state  --success/--warning/--danger/--neutral-text   meaning only
     sector accent --sector-accent  context only (nav rail, org context)
   ===================================================================== */

:root {
  --pv-work: var(--pvura-surface);
  --pv-hair: rgba(244, 241, 234, 0.07);
  --pv-hair-strong: rgba(244, 241, 234, 0.12);
  --pv-row-hover: rgba(244, 241, 234, 0.035);
  --pv-state-ready: var(--success-text);
  --pv-state-attn: var(--warning-text);
  --pv-state-block: var(--danger-text);
  --pv-state-retired: var(--neutral-text);
  --pv-tint-block: rgba(255, 98, 87, 0.09);
  --pv-tint-attn: rgba(245, 185, 66, 0.075);
  --pv-tint-retired: rgba(244, 241, 234, 0.035);
  --pv-radius: 12px;
}
[data-theme="light"] {
  --pv-hair: rgba(20, 24, 27, 0.08);
  --pv-hair-strong: rgba(20, 24, 27, 0.14);
  --pv-row-hover: rgba(20, 24, 27, 0.03);
  --pv-tint-block: rgba(196, 41, 29, 0.06);
  --pv-tint-attn: rgba(138, 90, 0, 0.06);
  --pv-tint-retired: rgba(20, 24, 27, 0.035);
}

/* ---------- Typography primitives ---------- */
.pv-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.pv-num { font-variant-numeric: tabular-nums; }
.pv-muted { color: var(--text-tertiary); }
.pv-quiet { color: var(--text-secondary); }
.pv-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* State word — the one way state is written everywhere: a shape + a word,
   never color alone (WCAG 1.4.1). */
.pv-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pv-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pv-state.is-block::before { border-radius: 2px; transform: rotate(45deg); }
.pv-state.is-attn::before { border-radius: 2px; }
.pv-state.is-retired::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.is-ready { color: var(--pv-state-ready); }
/* Healthy rows recede so exceptions carry the eye: green marker, neutral word. */
.pv-state.is-calm { color: var(--text-secondary); font-weight: 520; }
.pv-state.is-calm::before { background: var(--success-solid); }
.is-attn { color: var(--pv-state-attn); }
.is-block { color: var(--pv-state-block); }
.is-retired { color: var(--pv-state-retired); }

/* ---------- Buttons (refinements, same .btn base from pvura.css) ---------- */
.pv-btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.pv-btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}
.btn.pv-btn-quiet:hover { background: var(--pv-row-hover); color: var(--text-primary); }
.pv-arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-text);
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
}
.pv-arrow-link::after { content: "→"; transition: transform var(--motion-fast) var(--motion-easing); }
.pv-arrow-link:hover::after { transform: translateX(3px); }

/* ---------- Inline empty state (rule: size matches importance) ---------- */
.pv-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}
.pv-empty::before {
  content: "";
  width: 14px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.6;
  flex-shrink: 0;
}
/* Page-level empty state — only when a whole page has no data at all. */
.pv-page-empty {
  padding: 56px 0 40px;
  max-width: 46ch;
}
.pv-page-empty h2 { margin: 0 0 8px; font-size: 1.35rem; letter-spacing: -0.02em; }
.pv-page-empty p { margin: 0 0 20px; color: var(--text-secondary); }

/* ---------- Section heading (restrained) ---------- */
.pv-sechead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}
.pv-sechead h2, .pv-sechead h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}
.pv-sechead .pv-count { color: var(--text-tertiary); font-weight: 500; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ---------- Page head (replaces .hero on rebuilt pages) ---------- */
.pv-pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin: 4px 0 28px;
}
.pv-pagehead h1 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.pv-pagehead p.pv-sub { margin: 6px 0 0; color: var(--text-secondary); font-size: 0.95rem; }

/* =====================================================================
   SHELL — sidebar, header, mobile bar
   ===================================================================== */
.app-shell { background: var(--pvura-bg); }

@media (min-width: 960px) {
  /* The rail's column color runs the full document height, not just the
     sticky 100vh aside, so long pages never show the rail "ending". */
  .app-shell:has(> .sidebar) { background: linear-gradient(to right, var(--sidebar-bg) 235px, var(--pv-hair) 235px, var(--pv-hair) 236px, var(--pvura-bg) 236px); }
  .sidebar.pv-rail {
    width: 236px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--pv-hair);
    /* Only the link list scrolls; brand, the "Kom i gang" entry and the
       footer stay pinned, so the entry is visible on any viewport height. */
    overflow: hidden;
  }
  .sidebar.pv-rail .sidebar-nav { overflow-y: auto; min-height: 0; }
}
.pv-rail .pv-rail-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 4px;
}
.pv-rail .pv-rail-brand img { height: 17px; width: auto; display: block; }
[data-theme="light"] .pv-rail .pv-rail-brand img.on-dark { display: none; }
.pv-rail .pv-rail-brand img.on-light { display: none; }
[data-theme="light"] .pv-rail .pv-rail-brand img.on-light { display: block; }

.pv-org {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 12px 6px;
  padding: 10px;
  border-radius: 10px;
  color: var(--text-primary);
  transition: background-color var(--motion-fast) ease;
}
.pv-org:hover { background: var(--pv-row-hover); }
.pv-org-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 750;
  font-size: 0.85rem;
  color: var(--pvura-text);
  background: var(--pvura-surface-soft);
  box-shadow: inset 0 0 0 1px var(--pv-hair-strong);
  overflow: hidden;
}
[data-theme="light"] .pv-org-mark { color: var(--pvura-text); }
.pv-org-mark img { width: 100%; height: 100%; object-fit: cover; }
.pv-org-text { min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.pv-org-name { display: block; font-weight: 650; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-org-sector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-tertiary);
}
.pv-org-sector::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sector-accent);
}

.pv-rail .sidebar-nav { padding: 6px 12px 12px; gap: 1px; }
.pv-rail .sidebar-nav-label {
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  opacity: 1;
  color: var(--text-tertiary);
  padding: 16px 10px 6px;
}
.pv-rail .sidebar-link {
  gap: 11px;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 520;
  border-radius: 8px;
  color: var(--sidebar-text);
  box-shadow: none;
  position: relative;
}
.pv-rail .sidebar-link svg { width: 17px; height: 17px; opacity: 0.7; }
.pv-rail .sidebar-link:hover { background: var(--pv-row-hover); color: var(--text-primary); }
.pv-rail .sidebar-link.active {
  background: var(--pv-row-hover);
  color: var(--text-primary);
  font-weight: 620;
  box-shadow: none;
}
.pv-rail .sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sector-accent);
}
.pv-rail .sidebar-link.active svg { opacity: 1; color: var(--sector-accent); }
.pv-rail-foot {
  padding: 16px 22px 22px;
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  color: var(--text-tertiary);
  opacity: 0.75;
}

@media (min-width: 960px) {
  .desktop-header.pv-header {
    min-height: 58px;
    gap: 12px;
    padding: 0 28px;
    background: color-mix(in srgb, var(--pvura-bg) 88%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--pv-hair);
  }
}
.pv-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 380px;
}
.pv-search svg { position: absolute; left: 11px; color: var(--text-tertiary); pointer-events: none; }
.pv-search input[type="search"] {
  width: 100%;
  height: 36px;
  padding: 0 40px 0 34px;
  border-radius: 9px;
  border: 1px solid var(--pv-hair);
  background: var(--pv-work);
  font-size: 0.88rem;
  color: var(--text-primary);
}
.pv-search input[type="search"]:hover { border-color: var(--pv-hair-strong); }
.pv-search kbd {
  position: absolute;
  right: 9px;
  font: 600 0.7rem var(--font-ui);
  color: var(--text-tertiary);
  border: 1px solid var(--pv-hair-strong);
  border-radius: 5px;
  padding: 1px 6px;
}
.pv-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: 600 0.86rem var(--font-ui);
  cursor: pointer;
  position: relative;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease;
}
.pv-iconbtn:hover { background: var(--pv-row-hover); color: var(--text-primary); }
.pv-iconbtn .nav-badge { position: absolute; top: 3px; right: 3px; }
.pv-header .user-chip summary { padding: 4px 4px 4px 10px; border-radius: 10px; }
.pv-header .user-chip-avatar { width: 30px; height: 30px; font-size: 0.8rem; }

/* Mobile bar + menu sheet */
.pv-mbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 8px 0 16px;
  background: color-mix(in srgb, var(--pvura-bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pv-hair);
}
.pv-mbar .pv-org { margin: 0; padding: 4px; min-width: 0; }
.pv-mbar-actions { display: flex; gap: 2px; }
@media (min-width: 960px) { .pv-mbar { display: none; } }

dialog.pv-sheet {
  margin: 0 0 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  width: min(340px, 88vw);
  padding: 0;
  border: none;
  border-left: 1px solid var(--pv-hair);
  background: var(--sidebar-bg);
  color: var(--text-primary);
}
dialog.pv-sheet::backdrop { background: var(--pvura-overlay); }
.pv-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 20px; }
.pv-sheet-head img { height: 16px; }
.pv-sheet .nav-links { display: block; overflow: visible; padding: 0; border: none; }
.pv-sheet .sidebar-nav { display: flex; flex-direction: column; padding: 4px 12px 24px; gap: 1px; }
.pv-sheet .sidebar-nav-label { font-size: 0.66rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); opacity: 1; padding: 16px 10px 6px; }
.pv-sheet .nav-links a.sidebar-link, .pv-sheet .sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 520;
  color: var(--sidebar-text);
  background: none;
  white-space: normal;
}
.pv-sheet .sidebar-link svg { width: 18px; height: 18px; opacity: 0.7; flex-shrink: 0; }
.pv-sheet .nav-links a.sidebar-link.active { background: var(--pv-row-hover); color: var(--text-primary); font-weight: 620; }
.pv-sheet .nav-links a.sidebar-link.active svg { color: var(--sector-accent); opacity: 1; }
.pv-sheet .sidebar-link .nav-badge { margin-left: auto; }
.pv-sheet .pv-search input[type="search"] { height: 40px; }

/* =====================================================================
   DASHBOARD — command surface
   ===================================================================== */
.pv-dash { display: flex; flex-direction: column; gap: 36px; }

.pv-readiness {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr);
  gap: 24px 56px;
  align-items: end;
  padding: 8px 0 4px;
}
.pv-ready-figure {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 12px 0 2px;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}
.pv-ready-figure .pv-big {
  font-size: clamp(3.4rem, 6.4vw, 5.4rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  color: var(--text-primary);
}
.pv-ready-figure .pv-of {
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-tertiary);
}
.pv-ready-caption {
  margin: 8px 0 0;
  font-size: 1.02rem;
  color: var(--text-secondary);
}
.pv-ready-caption strong { color: var(--text-primary); font-weight: 650; }
.pv-verdict {
  margin: 22px 0 0;
  max-width: 44ch;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--text-primary);
  font-weight: 520;
}
.pv-verdict.is-calm { color: var(--text-secondary); }

/* Proportion bar — the one visualization kept: composition of the fleet,
   readable in a glance, honest at any size (replaces the donut). */
.pv-bar {
  display: flex;
  gap: 3px;
  height: 8px;
  margin-top: 26px;
}
.pv-bar span { display: block; height: 100%; border-radius: 2px; min-width: 3px; }
.pv-bar .seg-ready { background: var(--success-solid); opacity: 0.85; }
.pv-bar .seg-attn { background: var(--warning-solid); }
.pv-bar .seg-block { background: var(--danger-solid); }
.pv-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.pv-bar-legend .pv-state { font-weight: 550; font-size: 0.78rem; }

.pv-breakdown { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--pv-hair); }
.pv-breakdown li { border-bottom: 1px solid var(--pv-hair); }
.pv-breakdown a, .pv-breakdown .pv-bd-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 6px 11px 2px;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: background-color var(--motion-fast) ease;
}
.pv-breakdown a:hover { background: var(--pv-row-hover); color: var(--text-primary); }
.pv-bd-count {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.pv-bd-count.is-zero { color: var(--text-tertiary); font-weight: 600; }
.pv-bd-chev { color: var(--text-tertiary); }

/* Exception queue — the primary work area: ONE surface, rows divided by
   hairlines. The surface is kept on purpose: it is the page's work tray. */
.pv-queue {
  background: var(--pv-work);
  border: 1px solid var(--pv-hair);
  border-radius: var(--pv-radius);
  overflow: hidden;
}
.pv-queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
}
.pv-queue-head h2 { margin: 0; font-size: 1.02rem; font-weight: 650; }
.pv-queue-cols, .pv-qrow {
  display: grid;
  grid-template-columns: 150px minmax(170px, 1.15fr) minmax(200px, 1.6fr) minmax(130px, 1fr) 128px 150px;
  gap: 16px;
  align-items: center;
  padding: 0 20px;
}
.pv-queue-cols {
  padding-bottom: 8px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--pv-hair);
}
.pv-qrow {
  position: relative;
  min-height: 62px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pv-hair);
  transition: background-color var(--motion-fast) ease;
}
.pv-qrow:last-child { border-bottom: none; }
.pv-qrow:hover { background: var(--pv-row-hover); }
.pv-qrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--tone, transparent);
}
.pv-qrow .pv-q-state { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; }
.pv-q-object a { color: var(--text-primary); font-weight: 620; }
.pv-q-object a:hover { color: var(--brand-text); }
.pv-q-object small { display: block; margin-top: 1px; color: var(--text-tertiary); font-size: 0.78rem; font-weight: 500; }
.pv-q-why { color: var(--text-primary); font-size: 0.88rem; line-height: 1.35; }
.pv-q-who { color: var(--text-secondary); font-size: 0.84rem; line-height: 1.35; min-width: 0; }
.pv-q-who span { display: block; color: var(--text-tertiary); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-q-when { font-size: 0.84rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pv-q-when.is-late { color: var(--pv-state-attn); }
.pv-q-act { justify-self: end; }
.pv-q-act .btn { min-height: 34px; padding: 0.4rem 0.85rem; font-size: 0.84rem; white-space: nowrap; }
.pv-qrow.is-block { --tone: var(--danger-solid); color: var(--text-secondary); }
.pv-qrow.is-attn { --tone: var(--warning-solid); color: var(--text-secondary); }
.pv-queue-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--pv-hair);
  font-size: 0.84rem;
  color: var(--text-tertiary);
}
.pv-allclear {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  color: var(--text-secondary);
}
.pv-allclear svg { color: var(--pv-state-ready); flex-shrink: 0; }
.pv-allclear strong { display: block; color: var(--text-primary); font-weight: 650; }

.pv-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 36px 56px;
}
.pv-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--pv-hair); }
.pv-list > li { border-bottom: 1px solid var(--pv-hair); }
.pv-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 10px 2px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}
a.pv-list-row { border-radius: 6px; transition: background-color var(--motion-fast) ease; }
a.pv-list-row:hover { background: var(--pv-row-hover); }
.pv-list-row strong { color: var(--text-primary); font-weight: 600; }
.pv-list-row small { display: block; color: var(--text-tertiary); font-size: 0.78rem; }
.pv-list-row .pv-right { text-align: right; font-variant-numeric: tabular-nums; }
.pv-meter {
  display: flex;
  gap: 2px;
  width: 96px;
  height: 5px;
  margin-top: 5px;
  margin-left: auto;
}
.pv-meter span { height: 100%; border-radius: 1px; }

/* =====================================================================
   EQUIPMENT PASSPORT — the object
   ===================================================================== */
.pv-passport { display: flex; flex-direction: column; }

.pv-object {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 28px 56px;
  margin: 0 -16px;
  padding: 28px 16px 32px;
  border-radius: 16px;
}
.pv-object.tone-block { background: linear-gradient(180deg, var(--pv-tint-block), transparent 85%); }
.pv-object.tone-attn { background: linear-gradient(180deg, var(--pv-tint-attn), transparent 85%); }
.pv-object.tone-retired { background: linear-gradient(180deg, var(--pv-tint-retired), transparent 85%); }
.pv-object-type { margin: 0; }
.pv-object-id {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.6vw, 3.5rem);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.pv-object.tone-retired .pv-object-id { color: var(--text-secondary); }
.pv-object-sub { margin: 10px 0 0; color: var(--text-secondary); font-size: 0.92rem; }
.pv-object-sub span + span::before { content: "·"; margin: 0 8px; color: var(--text-tertiary); }

/* State → Why → What now. Keeps the .sra class (golden tests slice the
   rendered HTML from it) but is now the dominant element of the page. */
.pv-object .sra {
  display: block;
  min-width: 0;
  margin-top: 28px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}
.pv-stateline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.pv-stateline::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 16%, transparent);
}
.pv-stateline.is-block::before { border-radius: 3px; transform: rotate(45deg); width: 12px; height: 12px; }
.pv-stateline.is-attn::before { border-radius: 3px; }
.pv-stateline.is-retired::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.pv-why {
  margin: 12px 0 0;
  max-width: 54ch;
  font-size: 1.08rem;
  line-height: 1.45;
  color: var(--text-primary);
}
.pv-why .pv-why-label { color: var(--text-tertiary); font-weight: 600; margin-right: 4px; }
.pv-why-more { margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.9rem; color: var(--text-secondary); }
.pv-why-more li { padding: 3px 0 3px 16px; position: relative; }
.pv-why-more li::before { content: ""; position: absolute; left: 2px; top: 0.85em; width: 6px; height: 1.5px; background: var(--text-tertiary); }
.pv-calm { margin: 8px 0 0; color: var(--text-secondary); font-size: 1rem; }
.pv-now { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pv-now .btn-primary.sra-action, .pv-now .btn-primary { color: var(--action-fg); font-weight: 650; }
.pv-now .btn-primary { min-height: 44px; padding: 0.65rem 1.25rem; font-size: 0.95rem; }
.pv-now .pv-admin-note { color: var(--text-tertiary); font-size: 0.88rem; }
.pv-now .sra-action { margin: 0; }

/* Facts — the object's identity card, typographic not boxed. */
.pv-facts {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 0 28px;
  padding-top: 4px;
}
.pv-fact { padding: 12px 0; border-bottom: 1px solid var(--pv-hair); min-width: 0; }
.pv-fact.is-wide { grid-column: 1 / -1; }
.pv-fact dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.pv-fact dd { margin: 4px 0 0; font-size: 0.98rem; font-weight: 560; color: var(--text-primary); overflow-wrap: anywhere; }
.pv-fact dd small { display: block; margin-top: 2px; font-size: 0.8rem; font-weight: 500; color: var(--text-tertiary); }
.pv-fact dd small.is-late { color: var(--pv-state-attn); }

.pv-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin: 4px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--pv-hair);
  border-bottom: 1px solid var(--pv-hair);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Tabs */
.pv-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 28px;
  border-bottom: 1px solid var(--pv-hair);
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--pvura-bg);
}
@media (min-width: 960px) { .pv-tabs { top: 58px; } }
@media (max-width: 959px) { .pv-tabs { top: 56px; } }
.pv-tabs::-webkit-scrollbar { display: none; }
.pv-tab {
  appearance: none;
  border: none;
  background: none;
  padding: 13px 12px 12px;
  margin-bottom: -1px;
  font: 560 0.9rem var(--font-ui);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.pv-tab:hover { color: var(--text-primary); }
.pv-tab[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--brand-text); font-weight: 640; }
.pv-tab .pv-count { color: var(--text-tertiary); font-weight: 500; margin-left: 5px; font-variant-numeric: tabular-nums; }
.pv-panel { scroll-margin-top: 120px; }
.pv-panels.is-tabbed .pv-panel[hidden] { display: none; }
.pv-panels:not(.is-tabbed) .pv-panel + .pv-panel { margin-top: 44px; }

.pv-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
  gap: 32px 56px;
}

/* Lifecycle rail — the object's story */
.pv-rail-tl { margin: 0; padding: 0; list-style: none; position: relative; }
.pv-rail-tl::before {
  content: "";
  position: absolute;
  left: 104px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--pv-hair-strong);
}
.pv-ev {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 32px;
  padding: 9px 0;
}
.pv-ev-date { font-size: 0.8rem; color: var(--text-tertiary); font-variant-numeric: tabular-nums; padding-top: 2px; text-align: right; }
.pv-ev-body { min-width: 0; }
.pv-ev-body::before {
  content: "";
  position: absolute;
  left: 101px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pvura-bg);
  box-shadow: 0 0 0 1.5px var(--text-tertiary);
}
.pv-ev-title { font-size: 0.92rem; font-weight: 560; color: var(--text-secondary); }
.pv-ev-sum { margin-top: 2px; font-size: 0.86rem; color: var(--text-secondary); line-height: 1.4; }
.pv-ev-actor { margin-top: 2px; font-size: 0.78rem; color: var(--text-tertiary); }
.pv-ev.is-major { padding: 12px 0; }
.pv-ev.is-major .pv-ev-title { font-size: 0.98rem; font-weight: 650; color: var(--text-primary); }
.pv-ev.is-major .pv-ev-body::before { width: 11px; height: 11px; left: 99px; top: 16px; background: var(--text-secondary); box-shadow: 0 0 0 4px var(--pvura-bg); }
.pv-ev.tone-danger .pv-ev-body::before { background: var(--danger-solid); }
.pv-ev.tone-success .pv-ev-body::before { background: var(--success-solid); }
.pv-ev.tone-info .pv-ev-body::before { box-shadow: 0 0 0 1.5px var(--info); }
.pv-ev.tone-danger .pv-ev-title { color: var(--text-primary); }

/* Record lists (inspections, deviations, maintenance) */
.pv-records { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--pv-hair); }
.pv-rec {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 4px 20px;
  align-items: baseline;
  padding: 13px 2px;
  border-bottom: 1px solid var(--pv-hair);
}
a.pv-rec { color: inherit; border-radius: 6px; transition: background-color var(--motion-fast) ease; }
a.pv-rec:hover { background: var(--pv-row-hover); }
.pv-rec-date { font-size: 0.82rem; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.pv-rec-main { min-width: 0; }
.pv-rec-title { font-weight: 600; font-size: 0.92rem; color: var(--text-primary); }
.pv-rec-desc { margin-top: 2px; font-size: 0.86rem; color: var(--text-secondary); line-height: 1.4; }
.pv-rec-meta { margin-top: 3px; font-size: 0.78rem; color: var(--text-tertiary); }
.pv-rec-side { text-align: right; }

.pv-dl { margin: 0; border-top: 1px solid var(--pv-hair); }
.pv-dl > div { display: grid; grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--pv-hair); }
.pv-dl dt { color: var(--text-tertiary); font-size: 0.84rem; }
.pv-dl dd { margin: 0; color: var(--text-primary); font-size: 0.9rem; font-weight: 520; text-align: right; overflow-wrap: anywhere; }

.pv-dl-stack > div { grid-template-columns: 1fr; gap: 3px; }
.pv-dl-stack dd { text-align: left; font-size: 0.95rem; }
.pv-doc-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 40px; }

/* =====================================================================
   ACTION LAYER — drawers (inspection, deviation, maintenance, …)
   ===================================================================== */
dialog.pv-drawer {
  margin: 0 0 0 auto;
  width: min(500px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  padding: 0;
  border: none;
  border-left: 1px solid var(--pv-hair-strong);
  background: var(--pvura-surface);
  color: var(--text-primary);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.35);
}
dialog.pv-drawer[open] { display: flex; flex-direction: column; animation: pv-drawer-in var(--motion-slow) var(--motion-easing); }
dialog.pv-drawer::backdrop { background: var(--pvura-overlay); animation: pv-fade-in var(--motion-base) ease; }
@keyframes pv-drawer-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  dialog.pv-drawer[open], dialog.pv-drawer::backdrop { animation: none; }
}
.pv-drawer form { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0; }
.pv-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--pv-hair);
}
.pv-drawer-head h2 { margin: 4px 0 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.015em; }
.pv-drawer-head p { margin: 6px 0 0; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.45; }
.pv-drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.pv-drawer-body .field { margin: 0; }
/* Component display rules (.field is display:flex in pvura.css) must never
   defeat the hidden attribute - the inspection form relies on it. */
.pv-drawer [hidden], .field[hidden], [data-blocks-question][hidden] { display: none !important; }
.pv-drawer-body .result-picker { gap: 8px; }
.pv-drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--pv-hair);
  background: var(--pvura-surface);
}
.pv-drawer-foot .btn { min-height: 42px; }
.pv-hint { margin: 0; color: var(--text-tertiary); font-size: 0.82rem; line-height: 1.45; }
.pv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .pv-two { grid-template-columns: 1fr; } }

/* Action menu inside the "Handlinger" drawer */
.pv-actions-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--pv-hair); }
.pv-actions-list li { border-bottom: 1px solid var(--pv-hair); }
.pv-action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  width: 100%;
  padding: 13px 4px;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 6px;
}
.pv-action-item:hover { background: var(--pv-row-hover); }
.pv-action-item strong { font-weight: 620; font-size: 0.94rem; }
.pv-action-item span { grid-column: 1; font-size: 0.82rem; color: var(--text-tertiary); }
.pv-action-item::after { content: "›"; grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--text-tertiary); font-size: 1.2rem; }
.pv-action-group { margin: 6px 0 8px; }

/* =====================================================================
   REGISTER — operational inventory
   ===================================================================== */
.pv-segments {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--pv-work);
  border: 1px solid var(--pv-hair);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.pv-segments::-webkit-scrollbar { display: none; }
.pv-segments a {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 560;
  color: var(--text-secondary);
  white-space: nowrap;
}
.pv-segments a:hover { color: var(--text-primary); }
.pv-segments a[aria-current="true"] { background: var(--pvura-surface-soft); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.pv-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0 6px;
}
.pv-filterbar .pv-search { flex: 1 1 280px; }
.pv-filterbar select {
  height: 36px;
  padding: 0 32px 0 12px;
  border-radius: 9px;
  border: 1px solid var(--pv-hair);
  background-color: var(--pv-work);
  font-size: 0.86rem;
  width: auto;
  max-width: 100%;
}
.pv-filterbar .btn { min-height: 36px; padding: 0 14px; font-size: 0.86rem; }
.pv-filter-active { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 0; font-size: 0.84rem; color: var(--text-tertiary); }
.pv-chip { padding: 3px 10px; border-radius: 999px; background: var(--pvura-surface-soft); color: var(--text-primary); font-size: 0.8rem; }

.pv-bulkbar {
  position: sticky;
  top: 66px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--pvura-surface-raised);
  border: 1px solid var(--pv-hair-strong);
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
}
.pv-bulkbar[hidden] { display: none; }
.pv-bulkbar select { height: 34px; width: auto; }
.pv-table-wrap { overflow-x: auto; max-width: 100%; }
.pv-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.pv-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--pv-hair-strong);
  background: none;
  white-space: nowrap;
}
.pv-table input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--brand); }
.pv-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--pv-hair);
  font-size: 0.88rem;
  color: var(--text-secondary);
  vertical-align: middle;
  background: none;
}
.pv-table tbody tr { transition: background-color var(--motion-fast) ease; cursor: pointer; }
.pv-table tbody tr:hover td { background: var(--pv-row-hover); }
.pv-table tbody tr:focus-within td { background: var(--pv-row-hover); }
.pv-id a { color: var(--text-primary); font-weight: 620; font-size: 0.92rem; }
.pv-id a:hover { color: var(--brand-text); }
.pv-id small { display: block; color: var(--text-tertiary); font-size: 0.78rem; margin-top: 1px; }
.pv-two-line { line-height: 1.35; }
.pv-two-line small { display: block; color: var(--text-tertiary); font-size: 0.78rem; }
.pv-table td.pv-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-table td.pv-chev { width: 24px; color: var(--text-tertiary); text-align: right; }
.pv-table tr.is-retired-row .pv-id a { color: var(--text-secondary); }

.pv-rows { display: none; margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--pv-hair); }
.pv-rows li { border-bottom: 1px solid var(--pv-hair); }
.pv-rows a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding: 12px 2px;
  color: var(--text-secondary);
  font-size: 0.86rem;
}
.pv-rows a strong { color: var(--text-primary); font-weight: 620; font-size: 0.95rem; }
.pv-rows .pv-r-sub { grid-column: 1 / -1; color: var(--text-tertiary); font-size: 0.8rem; }

/* =====================================================================
   EVIDENCE — explorer (web) / formal record (print)
   ===================================================================== */
.pv-ev-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: end;
  margin-bottom: 26px;
}
.pv-ev-head h1 { margin: 8px 0 0; font-family: var(--font-display); font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; }
.pv-ev-head h1 span { color: var(--text-tertiary); font-weight: 600; }
.pv-provenance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 12px;
  border-top: 1px solid var(--pv-hair-strong);
  border-bottom: 1px solid var(--pv-hair);
}
.pv-provenance > div { padding: 14px 20px 14px 0; min-width: 0; }
.pv-provenance > div + div { padding-left: 20px; border-left: 1px solid var(--pv-hair); }
.pv-provenance dt { font-size: 0.7rem; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-tertiary); }
.pv-provenance dd { margin: 5px 0 0; font-size: 0.95rem; font-weight: 580; color: var(--text-primary); overflow-wrap: anywhere; }
.pv-disclaimer { margin: 0 0 36px; max-width: 80ch; font-size: 0.82rem; color: var(--text-tertiary); line-height: 1.5; }
.pv-ev-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 40px 64px; align-items: start; }
.pv-ev-aside { position: sticky; top: 82px; }
.pv-ev-section + .pv-ev-section { margin-top: 44px; }
.pv-print-only { display: none; }

/* =====================================================================
   READINESS / LOCATIONS / PEOPLE — shared quiet composition
   ===================================================================== */
.pv-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--pv-hair-strong);
  border-bottom: 1px solid var(--pv-hair);
  margin-bottom: 40px;
}
.pv-figures > div { padding: 16px 20px 18px 0; }
.pv-figures > div + div { padding-left: 20px; border-left: 1px solid var(--pv-hair); }
.pv-figures .pv-fig {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 720;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.pv-figures .pv-fig.is-zero { color: var(--text-tertiary); }
.pv-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 16px 0;
  margin-bottom: 36px;
  border-top: 1px solid var(--pv-hair);
  border-bottom: 1px solid var(--pv-hair);
}
.pv-strip p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; max-width: 70ch; }
.pv-strip strong { color: var(--text-primary); }

/* Locations list */
.pv-locations { margin-bottom: 44px; }
.pv-loc {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) minmax(150px, 1fr) minmax(120px, 0.9fr) minmax(160px, 1.2fr) auto;
  gap: 8px 24px;
  align-items: center;
  padding: 14px 2px;
}
.pv-loc-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pv-loc-name img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.pv-loc-name a { color: var(--text-primary); }
.pv-loc-name small, .pv-loc-figure small { display: block; color: var(--text-tertiary); font-size: 0.78rem; }
.pv-loc-figure { font-size: 0.86rem; color: var(--text-secondary); }
.pv-loc-figure strong { color: var(--text-primary); font-size: 1.05rem; }
.pv-loc-meter { display: flex; gap: 2px; height: 6px; }
.pv-loc-meter span { border-radius: 1px; min-width: 3px; }
.pv-loc-flags { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pv-loc-actions { display: flex; gap: 2px; justify-content: flex-end; }
@media (max-width: 900px) {
  .pv-loc { grid-template-columns: minmax(0, 1fr) auto; }
  .pv-loc-meter { grid-column: 1 / -1; }
  .pv-loc-flags { grid-column: 1 / -1; }
  .pv-loc-actions { grid-column: 1 / -1; justify-content: flex-start; margin-left: -10px; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1180px) {
  .pv-queue-cols { display: none; }
  .pv-qrow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "state when"
      "object act"
      "why act"
      "who act";
    gap: 3px 16px;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .pv-q-state { grid-area: state; }
  .pv-q-object { grid-area: object; }
  .pv-q-why { grid-area: why; }
  .pv-q-who { grid-area: who; }
  .pv-q-when { grid-area: when; text-align: right; }
  .pv-q-act { grid-area: act; align-self: center; }
  .pv-q-who span { display: inline; }
  .pv-q-who span::before { content: " · "; }
}
@media (max-width: 900px) {
  .pv-readiness, .pv-object, .pv-overview, .pv-ev-grid { grid-template-columns: 1fr; }
  .pv-object { margin: 0 -16px; padding: 22px 16px 26px; border-radius: 0; }
  .pv-ev-aside { position: static; }
  .pv-provenance, .pv-figures { grid-template-columns: 1fr 1fr; }
  .pv-provenance > div:nth-child(3), .pv-figures > div:nth-child(3) { padding-left: 0; border-left: none; }
  .pv-provenance > div:nth-child(n+3), .pv-figures > div:nth-child(n+3) { border-top: 1px solid var(--pv-hair); }
}
@media (max-width: 768px) {
  .pv-table { display: none; }
  .pv-rows { display: block; }
  .pv-ev-head { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pv-dash { gap: 28px; }
  /* Phone: the verdict + bar already carry these numbers; the queue must
     stay within reach of the first screen. */
  .pv-breakdown { display: none; }
  .pv-queue-head { flex-direction: column; gap: 4px; }
  .pv-qrow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "state when"
      "object object"
      "why why"
      "who who"
      "act act";
  }
  .pv-q-act { justify-self: stretch; margin-top: 8px; }
  .pv-q-act .btn { width: 100%; justify-content: center; min-height: 42px; }
  .pv-queue-head, .pv-qrow, .pv-queue-foot, .pv-allclear { padding-left: 16px; padding-right: 16px; }
  .pv-facts { grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .pv-now .btn { flex: 1 1 auto; justify-content: center; }
  .pv-rail-tl::before { left: 6px; }
  .pv-ev, .pv-ev.is-major { grid-template-columns: 1fr; gap: 2px; padding-left: 26px; }
  .pv-ev-date { text-align: left; }
  .pv-ev-body::before { left: 3px !important; top: 13px !important; }
  .pv-ev.is-major .pv-ev-body::before { left: 1px !important; top: 15px !important; }
  .pv-ev-body { position: static; }
  .pv-ev-body { order: 2; }
  .pv-rec { grid-template-columns: minmax(0, 1fr) auto; }
  .pv-rec-date { grid-column: 1 / -1; }
  .pv-provenance > div, .pv-figures > div { padding-right: 12px; }
  .pv-provenance > div + div, .pv-figures > div + div { padding-left: 12px; }
  .pv-provenance > div:nth-child(3), .pv-figures > div:nth-child(3) { padding-left: 0; }
  .pv-figures .pv-fig { font-size: 1.7rem; }
  .pv-pagehead { margin-bottom: 22px; }
}

/* =====================================================================
   PRINT — evidence becomes a formal document
   ===================================================================== */
@media print {
  .pv-mbar, .pv-header, .pv-rail, .pv-tabs, dialog.pv-drawer, .pv-now { display: none !important; }
  .pv-print-only { display: block; }
  body { background: #fff !important; color: #000 !important; }
  .pv-ev-grid { display: block; }
  .pv-ev-aside { position: static; margin-top: 24px; }
  .pv-provenance, .pv-dl, .pv-records, .pv-rail-tl { border-color: #999 !important; }
  .pv-provenance > div, .pv-dl > div, .pv-rec, .pv-ev { border-color: #ccc !important; break-inside: avoid; }
  .pv-ev-head h1, .pv-provenance dd, .pv-dl dd, .pv-rec-title, .pv-ev-title, .pv-sechead h2 { color: #000 !important; }
  .pv-provenance dt, .pv-dl dt, .pv-rec-date, .pv-ev-date, .pv-rec-meta, .pv-ev-actor, .pv-disclaimer, .pv-rec-desc, .pv-ev-sum { color: #333 !important; }
  .pv-rail-tl::before { background: #999 !important; }
  .pv-ev-body::before { box-shadow: 0 0 0 1.5px #000 !important; background: #fff !important; }
  .pv-ev-section + .pv-ev-section { margin-top: 24px; }
  .pv-state { color: #000 !important; }
}

/* =====================================================================
   SECTOR EXPERIENCE V2 (product-owner approved 2026-10-05)
   One PVURA, five sector expressions. Sector colour is SPICE, never the
   UI background: the shell, rail and content stay neutral in every sector
   (~90-95% PVURA, ~5-10% sector). Sector colour answers "where am I";
   status colour answers "is it safe" - they never share a role.

   Sector colour MAY: logo line motif, active-nav indicator + active icon,
   hover/focus detail, selected saved view, a small org/sector marker, a
   context-panel detail line, non-status chart series.
   Sector colour may NEVER: be a background of rail/header/content, colour
   a status shape/word/rail, colour equipment rows or the Passport state
   hierarchy, fill a primary action, or be used as text (sector labels are
   neutral text beside a coloured marker - which also keeps every sector
   accessible regardless of hue).
   Hex values are documented once in sector_experience.py (tests assert
   these equal the contract).
   ===================================================================== */
:root {
  /* Neutral primary action (every sector). */
  --action-bg: #F4F1EA;
  --action-fg: #101214;
  --action-bg-hover: #FFFFFF;
  --action-bg-pressed: #E2DED5;
  /* Masterbrand line motif - the authoritative pvura_ gradient. */
  --logo-line-0: #FFE6BD; --logo-line-0-opacity: 0.8;
  --logo-line-1: #FF9542; --logo-line-2: #FF5A11; --logo-line-3: #FF390E; --logo-line-4: #FF0707;
}
[data-theme="light"] {
  --action-bg: #14181B;
  --action-fg: #FFFFFF;
  --action-bg-hover: #2A3035;
  --action-bg-pressed: #000000;
  --logo-line-0: #FA7500; --logo-line-0-opacity: 0.65;
  --logo-line-1: #FF6A00; --logo-line-2: #FF4B00; --logo-line-3: #FB2800; --logo-line-4: #EC0001;
}

[data-sector="maritime"] { --sector-primary: #0B6BDE; --sector-bright: #3D9BFF; --sector-mid: #0A52A8; --sector-dark: #0A2540; --sector-soft: #CFE3FF; --sector-tint: #EEF5FF; --sector-on-primary: #FFFFFF; }
[data-sector="offshore"] { --sector-primary: #E8590C; --sector-bright: #FF7D2E; --sector-mid: #B9450A; --sector-dark: #6E2A07; --sector-soft: #FFD9C2; --sector-tint: #FFF3EB; --sector-on-primary: #101214; }
[data-sector="energy"]   { --sector-primary: #2E9B3E; --sector-bright: #8BD450; --sector-mid: #237A31; --sector-dark: #165220; --sector-soft: #DCF3CA; --sector-tint: #F2FAEA; --sector-on-primary: #0B1F0F; }
[data-sector="industry"] { --sector-primary: #3E5C76; --sector-bright: #8FB3D3; --sector-mid: #2F4860; --sector-dark: #1E2B38; --sector-soft: #D5E1EC; --sector-tint: #EEF3F8; --sector-on-primary: #FFFFFF; }
[data-sector="fire_rescue"] { --sector-primary: #D0101B; --sector-bright: #E32219; --sector-mid: #A50F15; --sector-dark: #6E0A0E; --sector-soft: #F9D1CF; --sector-tint: #FDF1F0; --sector-on-primary: #FFFFFF; }

/* The accent the shell actually uses: bright on the dark shell, primary on light. */
[data-sector] { --sector-accent: var(--sector-bright); }
[data-theme="light"][data-sector] { --sector-accent: var(--sector-primary); }

/* Masterbrand pages (login, signup, platform admin) keep the coral focus;
   inside an organisation, focus follows the sector accent (interaction cue). */
[data-brand="sector"] :focus-visible { outline-color: var(--sector-accent); }

/* Logo: sector expression changes ONLY the line gradient. */
[data-brand="sector"] {
  --logo-line-0: var(--sector-soft); --logo-line-0-opacity: 0.85;
  --logo-line-1: var(--sector-bright); --logo-line-2: var(--sector-bright);
  --logo-line-3: var(--sector-primary); --logo-line-4: var(--sector-primary);
}
[data-theme="light"][data-brand="sector"] {
  --logo-line-0: var(--sector-soft); --logo-line-0-opacity: 1;
  --logo-line-1: var(--sector-primary); --logo-line-2: var(--sector-primary);
  --logo-line-3: var(--sector-mid); --logo-line-4: var(--sector-mid);
}
.pv-wordmark { display: block; width: auto; color: currentColor; }
.pv-rail .pv-rail-brand { padding: 22px 20px 6px; color: var(--text-primary); }
.pv-sheet-head .pv-wordmark { color: var(--text-primary); }

/* Neutral rail in every sector (product-owner override 3). */
@media (min-width: 960px) {
  .sidebar.pv-rail { background: var(--sidebar-bg); }
}
.pv-rail .sidebar-link:hover { background: var(--pv-row-hover); color: var(--text-primary); }
.pv-rail .sidebar-link:hover svg { color: var(--sector-accent); opacity: 0.9; }
.pv-rail .sidebar-link.active::before { background: var(--sector-accent); }
.pv-rail .sidebar-link.active svg, .pv-sheet .nav-links a.sidebar-link.active svg { color: var(--sector-accent); }
/* Sector label = neutral text + coloured marker (never coloured text). */
.pv-org-sector { color: var(--text-tertiary); }
.pv-org-sector::before { width: 10px; height: 3px; border-radius: 2px; background: var(--sector-accent); }
[data-brand="master"] .pv-org-sector::before { background: var(--pvura-coral); }

/* Saved views: selected view carries the sector cue. */
.pv-views { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; }
.pv-view { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--pv-hair-strong); color: var(--text-secondary); font-size: 0.86rem; font-weight: 560; background: transparent; }
.pv-view:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
/* Active view: neutral chip (a sector-coloured ring around "Krever handling"
   would read as a status colour - green as "ok", red as "blocked"). The
   sector appears only as a short underline, like the active tab. */
.pv-view[aria-current="true"] { position: relative; color: var(--text-primary); border-color: var(--text-secondary); background: var(--pv-row-hover); }
.pv-view[aria-current="true"]::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--sector-accent); }

/* Context panel: neutral surface, one restrained sector detail line. */
.pv-context { position: relative; padding: 18px 18px 14px; border-radius: var(--pv-radius); background: var(--pv-work); border: 1px solid var(--pv-hair); }
.pv-context::before { content: ""; position: absolute; left: 18px; top: 0; width: 28px; height: 2px; border-radius: 0 0 2px 2px; background: var(--sector-accent); }
.pv-context-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 0.68rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); }
.pv-context-eyebrow::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--sector-accent); }
.pv-context .pv-list { margin-top: 10px; }

/* Way back to ready (Passport). Status-coloured only; never sector. */
.pv-path { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pv-path li { padding: 12px 14px 14px; border-top: 3px solid var(--pv-hair-strong); border-radius: 0 0 10px 10px; min-width: 0; }
.pv-path li.is-done { border-top-color: var(--text-tertiary); }
.pv-path li.is-current { border-top-color: var(--text-primary); background: var(--pv-row-hover); }
.pv-path .pv-path-tag { display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); }
.pv-path li.is-current .pv-path-tag { color: var(--text-primary); }
.pv-path .pv-path-title { display: block; margin-top: 6px; font-size: 0.9rem; font-weight: 640; color: var(--text-primary); }
.pv-path li.is-pending .pv-path-title { color: var(--text-tertiary); }
.pv-path .pv-path-sub { display: block; margin-top: 3px; font-size: 0.8rem; color: var(--text-tertiary); line-height: 1.4; }
.pv-path ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.84rem; }
.pv-path ul a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) { .pv-path { grid-template-columns: 1fr; } .pv-path li { border-top: none; border-left: 3px solid var(--pv-hair-strong); border-radius: 0 10px 10px 0; } .pv-path li.is-done { border-left-color: var(--text-tertiary); } .pv-path li.is-current { border-left-color: var(--text-primary); } }

/* Consequence preview inside action drawers. */
.pv-consequence { padding: 14px 16px; border-radius: 10px; background: var(--pvura-bg); border: 1px solid var(--pv-hair-strong); }
.pv-consequence p { margin: 6px 0 0; font-size: 0.9rem; line-height: 1.45; color: var(--text-secondary); }
.pv-consequence .pv-state { font-size: 0.95rem; }

/* ---------- Control mobile V2: oversight + decisions ---------- */
.pv-mbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
dialog.pv-sheet { padding-bottom: env(safe-area-inset-bottom); }
.pv-drawer-foot { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
@media (max-width: 959px) {
  .page-shell { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .pv-iconbtn { min-width: 44px; min-height: 44px; }
  .pv-filterbar select, .pv-filterbar .pv-search input[type="search"], .pv-filterbar .btn { min-height: 44px; height: 44px; }
  .pv-view, .pv-segments a { min-height: 44px; display: inline-flex; align-items: center; }
  .pv-q-act .btn, .pv-now .btn, .pv-sechead .btn { min-height: 44px; }
  .pv-tab { min-height: 44px; }
  .pagination-btn { min-height: 44px; display: inline-flex; align-items: center; }
}
/* Passport tabs never clip on a phone: they wrap instead of scrolling hidden. */
@media (max-width: 600px) {
  .pv-tabs { flex-wrap: wrap; overflow: visible; position: static; gap: 0 2px; }
  .pv-tab { padding: 11px 10px; }
}

.pv-table tr.pv-group-row th { padding: 16px 12px 6px; font-size: 0.72rem; letter-spacing: 0.1em; color: var(--text-secondary); border-bottom: 1px solid var(--pv-hair-strong); cursor: default; }
.pv-table tr.pv-group-row:hover th { background: none; }

/* Inside an organisation, links are neutral text (never sector or coral
   text - a coral/red link in a Fire context reads as a warning); the
   affordance is the underline and the accent-coloured arrow glyph. */
[data-brand="sector"] .link, [data-brand="sector"] .pv-arrow-link { color: var(--text-primary); }
[data-brand="sector"] .link { text-decoration: underline; text-decoration-color: var(--pv-hair-strong); text-underline-offset: 3px; }
[data-brand="sector"] .link:hover { text-decoration-color: var(--sector-accent); }
[data-brand="sector"] .pv-arrow-link::after { color: var(--sector-accent); }
[data-brand="sector"] .pv-tab[aria-selected="true"] { border-bottom-color: var(--sector-accent); }
[data-brand="sector"] .user-chip-avatar { background: var(--pvura-surface-soft); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--pv-hair-strong); }

/* =====================================================================
   SECONDARY SURFACES - V2 coherence (deviations, people, settings,
   activation, reports, add/edit equipment, vehicles). The shared legacy
   primitives adopt the V2 grammar so every page speaks one language
   without a per-page redesign.
   ===================================================================== */
.hero { border-bottom: none; padding-bottom: 0; margin: 4px 0 28px; align-items: flex-end; }
.hero h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 2.6vw, 2.05rem); font-weight: 750; letter-spacing: -0.025em; line-height: 1.1; }
.hero-sub { margin-top: 6px; font-size: 0.95rem; }
.card { background: var(--pv-work); border: 1px solid var(--pv-hair); border-radius: var(--pv-radius); box-shadow: none; }
.card-header h2, .card-header h3 { font-size: 0.98rem; font-weight: 650; letter-spacing: -0.005em; }
.card-header { border-bottom-color: var(--pv-hair); }

/* Legacy .status-pill becomes the universal state word: shape + word,
   never a filled chip and never sector-coloured. */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0; border: none; border-radius: 0; background: none;
  font-size: 0.8rem; font-weight: 650; white-space: nowrap; box-shadow: none;
}
.status-pill::before { content: ""; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.status-pill.overdue, .status-pill.ute-av-tjeneste { color: var(--pv-state-block); background: none; border: none; }
.status-pill.overdue::before, .status-pill.ute-av-tjeneste::before { border-radius: 2px; transform: rotate(45deg); }
.status-pill.due-soon, .status-pill.avvik-under-oppfolging { color: var(--pv-state-attn); background: none; border: none; }
.status-pill.due-soon::before, .status-pill.avvik-under-oppfolging::before { border-radius: 2px; }
.status-pill.ok { color: var(--text-secondary); background: none; border: none; }
.status-pill.ok::before { background: var(--success-solid); }
.status-pill.retired { color: var(--pv-state-retired); background: none; border: none; }
.status-pill.retired::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

/* Context panel rows stack on narrow screens: a long status phrase
   ("Ute av tjeneste · ingen dekontaminering logget") must never squeeze
   the identity column to one word per line. */
@media (max-width: 600px) {
  .pv-context .pv-list-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pv-context .pv-list-row .pv-right { text-align: left; }
}

/* =====================================================================
   V2 acceptance correction - guided import (steps + reconciliation)
   ===================================================================== */
.pv-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 4px 0 22px; padding: 0; font-size: 0.84rem; color: var(--text-tertiary); }
.pv-steps li { display: inline-flex; align-items: center; gap: 8px; }
.pv-step-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--pv-hair-strong); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.pv-steps li.is-done { color: var(--text-secondary); }
.pv-steps li.is-done .pv-step-num { background: var(--pv-row-hover); }
.pv-steps li.is-current { color: var(--text-primary); font-weight: 620; }
.pv-steps li.is-current .pv-step-num { border-color: var(--action-bg); background: var(--action-bg); color: var(--action-fg); }
.pv-import-panel { max-width: 920px; padding: 20px; margin-bottom: 18px; border-radius: var(--pv-radius); background: var(--pv-work); border: 1px solid var(--pv-hair); }
.pv-import-panel.is-quiet { background: transparent; }
.pv-import-panel h2 { font-size: 1.02rem; margin: 0 0 6px; }
.pv-import-panel h2 .pv-count { color: var(--text-tertiary); font-weight: 500; margin-left: 6px; }
.pv-import-panel > p { margin: 0 0 12px; }
.pv-import-note { font-size: 0.86rem; margin-top: 12px; }
.pv-recon { list-style: none; margin: 10px 0 16px; padding: 0; }
.pv-recon-row { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1.2fr); gap: 6px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--pv-hair); }
.pv-recon-src strong { display: block; font-weight: 600; }
.pv-recon-src small, .pv-recon-dst small { display: block; font-size: 0.78rem; color: var(--text-tertiary); margin-top: 3px; }
.pv-recon-dst select { width: 100%; min-height: 40px; }
.pv-recon-dst p { margin: 0; font-size: 0.86rem; }
.pv-recon-arrow { color: var(--text-tertiary); text-align: center; }
.pv-recon-ok { color: var(--success-text, var(--text-secondary)) !important; }
.pv-import-big { font-size: 1.5rem; margin: 2px 0 10px; }
.pv-import-big strong { font-family: var(--font-display, inherit); font-size: 2.2rem; font-variant-numeric: tabular-nums; margin-right: 6px; }
.pv-import-facts { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.pv-import-facts li { color: var(--text-secondary); }
.pv-import-facts strong { color: var(--text-primary); font-variant-numeric: tabular-nums; margin-right: 4px; }
.pv-import-limit { color: var(--danger-text); font-weight: 600; }
.pv-import-secondary details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--text-secondary); }
.pv-import-secondary details form { margin-top: 10px; }
.pv-import-cancel { color: var(--text-secondary); }
@media (max-width: 600px) {
  .pv-recon-row { grid-template-columns: minmax(0, 1fr); }
  .pv-recon-arrow { display: none; }
  .pv-recon-dst select { min-height: 44px; }
  .pv-steps .pv-step-name { display: none; }
  .pv-steps li.is-current .pv-step-name { display: inline; }
}
.pv-field-label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.pv-readonly { margin: 0; font-weight: 600; color: var(--text-primary); }

/* =====================================================================
   V2 acceptance correction - sector colour on PRIMARY actions.
   Inside an organisation (data-brand="sector") the primary action takes
   the sector's action colour. The shell, rail and secondary buttons stay
   neutral; status colours never come from here (a .btn-danger stays
   danger in every sector). Every pair meets WCAG: text >= 4.5:1 on the
   button, button >= 3:1 against the page. Industry's steel blue is
   2.8:1 on the dark page, so dark theme uses the lighter steel blue with
   dark text; light theme uses the deep steel blue with white text.
   ===================================================================== */
/* Pressed (2026-10-12): sectors with dark action text (Offshore, Energi,
   Industri) press to their lighter palette tone - darkening them dropped the
   label below WCAG AA (#B9450A 3.5:1, #237A31 3.2:1). White-text sectors
   still press darker. Mirrored exactly by PVURA-appen (sectorTheme.ts). */
[data-brand="sector"][data-sector="fire_rescue"] { --action-bg: #D0101B; --action-fg: #FFFFFF; --action-bg-hover: #E32219; --action-bg-pressed: #A50F15; }
[data-brand="sector"][data-sector="maritime"]    { --action-bg: #0B6BDE; --action-fg: #FFFFFF; --action-bg-hover: #0A52A8; --action-bg-pressed: #0A2540; }
[data-brand="sector"][data-sector="offshore"]    { --action-bg: #E8590C; --action-fg: #101214; --action-bg-hover: #FF7D2E; --action-bg-pressed: #FF7D2E; }
[data-brand="sector"][data-sector="energy"]      { --action-bg: #2E9B3E; --action-fg: #0B1F0F; --action-bg-hover: #8BD450; --action-bg-pressed: #8BD450; }
[data-brand="sector"][data-sector="industry"]    { --action-bg: #8FB3D3; --action-fg: #101214; --action-bg-hover: #D5E1EC; --action-bg-pressed: #D5E1EC; }
[data-theme="light"][data-brand="sector"][data-sector="industry"] { --action-bg: #3E5C76; --action-fg: #FFFFFF; --action-bg-hover: #2F4860; --action-bg-pressed: #1E2B38; }
[data-brand="sector"] .btn-primary { box-shadow: none; }
[data-brand="sector"] .btn-primary:hover:not(:disabled) { background: var(--action-bg-hover); border-color: var(--action-bg-hover); color: var(--action-fg); }
[data-brand="sector"] .btn-primary:active:not(:disabled) { background: var(--action-bg-pressed); border-color: var(--action-bg-pressed); }
/* Active navigation: marker and icon in sector colour; the label stays
   high-contrast text (Fire red on the dark rail is 3.9:1 - too low for
   normal-size text). */
[data-brand="sector"] .pv-rail .sidebar-link.active { color: var(--text-primary); }

/* V2 acceptance correction - "Legg til utstyr" */
.pv-addnote { max-width: 920px; margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: var(--pv-row-hover); border: 1px solid var(--pv-hair); }
.pv-addchoice { max-width: 920px; padding: 22px; margin-bottom: 18px; border-radius: var(--pv-radius); background: var(--pv-work); border: 1px solid var(--pv-hair); }
.pv-addchoice h2 { font-size: 1.05rem; margin: 0 0 14px; }
.pv-addchoice-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.pv-addchoice-btn { min-height: 52px; padding: 0 22px; font-size: 1rem; display: inline-flex; align-items: center; gap: 10px; }
.pv-addform { max-width: 920px; }
.pv-addgroup { padding: 18px 20px; margin-bottom: 14px; border-radius: var(--pv-radius); background: var(--pv-work); border: 1px solid var(--pv-hair); }
.pv-addgroup h2 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin: 0 0 14px; }
.pv-addgroup .pv-step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--pv-hair-strong); font-size: 0.76rem; }
.pv-addgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.pv-addgrid .field { margin: 0; }
.pv-addgrid .field small { display: block; margin-top: 5px; font-size: 0.8rem; }
.pv-addgrid input[hidden] { display: none; }
.pv-addgrid .field > input + input { margin-top: 8px; }
.pv-addgrid .field > select + input { margin-top: 8px; }
.pv-addinline { display: flex; gap: 8px; }
.pv-addinline input { flex: 1; min-width: 0; }
.pv-optional { font-weight: 400; color: var(--text-tertiary); font-size: 0.8rem; margin-left: 4px; }
.pv-addmore { margin-top: 14px; }
.pv-addmore summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--text-secondary); font-size: 0.9rem; }
.pv-addmore .pv-addgrid { margin-top: 10px; }
.pv-addreview [data-add-summary] { margin: 0 0 14px; }
@media (max-width: 600px) {
  .pv-addgrid { grid-template-columns: minmax(0, 1fr); }
  .pv-addchoice-btn { width: 100%; justify-content: center; }
  .pv-addgroup { padding: 16px; }
}

/* V2 acceptance correction - Veiledning / help centre */
.pv-help { max-width: 860px; }
.pv-help-search { margin: 6px 0 18px; }
.pv-help-search label { display: block; font-weight: 620; margin-bottom: 8px; font-size: 1.02rem; }
.pv-help-search input { width: 100%; min-height: 48px; font-size: 1rem; padding: 0 14px; }
.pv-help-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.pv-help-cats a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--pv-hair-strong); color: var(--text-secondary); font-size: 0.86rem; }
.pv-help-cats a:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.pv-help-section { margin-bottom: 24px; scroll-margin-top: 80px; }
.pv-help-section h2 { font-size: 1.05rem; margin: 0 0 6px; }
.pv-help-item { border-top: 1px solid var(--pv-hair); }
.pv-help-item:last-child { border-bottom: 1px solid var(--pv-hair); }
.pv-help-item summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 0; font-weight: 560; }
.pv-help-item summary::-webkit-details-marker { display: none; }
.pv-help-item summary::after { content: "+"; color: var(--text-tertiary); font-size: 1.2rem; flex: none; }
.pv-help-item[open] summary::after { content: "–"; }
.pv-help-answer { padding: 0 0 14px; color: var(--text-secondary); line-height: 1.65; }
.pv-help-answer p { margin: 0 0 8px; }
.pv-help-answer ol, .pv-help-answer ul { margin: 0 0 8px; padding-left: 1.3rem; }
.pv-help-answer li { margin-bottom: 4px; }
.pv-help-answer strong { color: var(--text-primary); font-weight: 600; }
.pv-help-foot { margin-top: 10px; }
@media (max-width: 600px) { .pv-help-cats a { min-height: 44px; } }

/* Acceptance correction GEAR-01/02 - selection and deletion */
.pv-checkcell { display: inline-flex; align-items: center; gap: 10px; min-width: 32px; min-height: 32px; cursor: pointer; }
.pv-checkcell input { width: 18px; height: 18px; margin: 0; }
.pv-bulkbar .btn-danger { margin-left: auto; }
.pv-bulk-clear { min-height: 36px; }
.register-cards.is-selectable > li { display: flex; align-items: stretch; }
.register-cards.is-selectable > li > a { flex: 1; min-width: 0; }
.pv-card-check { padding: 0 6px 0 2px; }
.pv-card-selectall { padding: 6px 2px; color: var(--text-secondary); font-size: 0.9rem; }
.pv-action-danger .pv-action-item strong { color: var(--danger-text); }
.pv-delete-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 4px; }
.pv-delete-history { margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--pv-hair-strong); }
.pv-delete-history p { margin: 0 0 8px; }
.pv-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 560; cursor: pointer; }
.pv-check input { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .pv-checkcell { min-width: 44px; min-height: 44px; justify-content: center; }
  .pv-checkcell input { width: 22px; height: 22px; }
  .pv-bulkbar { position: sticky; bottom: 0; z-index: 5; flex-wrap: wrap; gap: 8px; padding: 10px; background: var(--pv-work); }
  .pv-bulkbar .btn, .pv-bulkbar select { min-height: 44px; }
  .pv-bulkbar .btn-danger { margin-left: 0; }
}
@media (max-width: 600px) {
  .pv-import-archive table, .pv-import-archive tbody, .pv-import-archive tr, .pv-import-archive td { display: block; width: 100%; }
  .pv-import-archive thead { display: none; }
  .pv-import-archive tr { padding: 12px 0; border-bottom: 1px solid var(--pv-hair); }
  .pv-import-archive td { border: 0; padding: 3px 0; white-space: normal !important; overflow-wrap: anywhere; }
  .pv-import-archive td[data-label]::before { content: attr(data-label) ": "; color: var(--text-tertiary); font-size: 0.8rem; }
  .pv-import-archive td .btn { min-height: 44px; margin: 6px 6px 0 0; }
}

/* ---------- Kom i gang med PVURA (onboarding) ----------
   Secondary assistance, never a dashboard card: a compact entry at the
   bottom of the rail (and top of the mobile menu sheet) that opens the
   steps in the standard drawer. Neutral PVURA styling; sector colour only
   on the next-step marker. Not a safety-state colour. */
.pv-onboard-slot { padding: 8px 12px 0; }
.pv-onboard-slot.is-sheet { padding: 0 0 12px; }
.pv-onboard-entry {
  display: flex; flex-direction: column; gap: 7px;
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--pv-hair); border-radius: var(--pv-radius);
  background: transparent; color: var(--text-secondary);
  font: inherit; text-align: left; cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.pv-onboard-entry:hover { background: var(--pv-row-hover); border-color: var(--pv-hair-strong); }
.pv-onboard-entry:focus-visible { outline: 2px solid var(--sector-accent); outline-offset: 2px; }
.pv-onboard-entry-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.8rem; font-weight: 650; color: var(--text-primary); }
.pv-onboard-entry-count { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pv-onboard-entry-next { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 0.82rem; }
.pv-onboard-entry-next span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-onboard-entry-next svg { flex-shrink: 0; opacity: 0.7; }
.pv-onboard-entry.is-done { margin: 0; cursor: default; color: var(--text-primary); border-color: color-mix(in srgb, var(--logo-line-2) 35%, var(--pv-hair)); }
/* Five segments, one per step. A done segment shows its own slice of the
   pvura_ line motif (--logo-line-0..4: the masterbrand line, or the
   sector's line inside an organisation), so the done segments read as one
   continuous brand line - an onboarding brand moment (DESIGN_SYSTEM_2
   gradient policy), not a safety state. */
.pv-onboard-segs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; width: 100%; }
.pv-onboard-seg { position: relative; height: 5px; border-radius: 999px; background: var(--pv-hair); overflow: hidden; }
.pv-onboard-entry .pv-onboard-seg { height: 4px; }
.pv-onboard-seg::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--logo-line-0), var(--logo-line-1) 28%, var(--logo-line-2) 52%, var(--logo-line-3) 76%, var(--logo-line-4));
  background-size: 500% 100%;
  background-position: calc(var(--i, 0) * 25%) 0;
  transform: scaleX(0); transform-origin: left center;
}
.pv-onboard-seg.is-done::before { transform: none; }
.pv-onboard-seg.is-done { box-shadow: 0 0 10px -3px color-mix(in srgb, var(--logo-line-2) 70%, transparent); }
/* Next step: a slightly brighter NEUTRAL track - a sector tint read as a
   half-alarm in Fire. */
.pv-onboard-seg.is-next { background: color-mix(in srgb, var(--text-tertiary) 45%, var(--pv-hair)); }
/* Completed since this browser last looked: fill, then one shimmer pass. */
.pv-onboard-seg.is-new::before { animation: pv-seg-fill 650ms var(--motion-easing, cubic-bezier(.2, .8, .2, 1)) calc(var(--seq, 0) * 140ms + 150ms) both; }
.pv-onboard-seg.is-new::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.7) 50%, transparent 80%);
  transform: translateX(-110%);
  animation: pv-seg-shimmer 900ms ease-out calc(var(--seq, 0) * 140ms + 650ms) both;
}
.pv-onboard-entry.is-done .pv-onboard-seg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.7) 50%, transparent 80%);
  transform: translateX(-110%);
  animation: pv-seg-shimmer 1100ms ease-out calc(var(--i, 0) * 120ms + 300ms) 2 both;
}
.pv-onboard-step.is-new .pv-onboard-mark.is-done { animation: pv-mark-pop 520ms cubic-bezier(.3, 1.6, .5, 1) 200ms both; }
@keyframes pv-seg-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pv-seg-shimmer { to { transform: translateX(110%); } }
@keyframes pv-mark-pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .pv-onboard-seg.is-new::before, .pv-onboard-seg.is-new::after,
  .pv-onboard-entry.is-done .pv-onboard-seg::after,
  .pv-onboard-step.is-new .pv-onboard-mark.is-done { animation: none; }
}
.pv-onboard-drawer .pv-onboard-segs { margin-bottom: 4px; }
.pv-onboard-entry.is-done .pv-onboard-entry-top span:first-child { display: inline-flex; align-items: center; gap: 8px; }

/* Expanded view - inside dialog.pv-drawer#kom-i-gang */
.pv-onboard-drawer .pv-drawer-body { gap: 6px; }
.pv-onboard-steps { list-style: none; margin: 8px 0 0; padding: 0; }
.pv-onboard-step { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--pv-hair); }
.pv-onboard-step:first-child { border-top: 0; }
.pv-onboard-step.is-done { padding: 10px 0; }
.pv-onboard-mark {
  width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px var(--text-tertiary);
  display: inline-flex; align-items: center; justify-content: center;
}
.pv-onboard-step.is-next .pv-onboard-mark { box-shadow: inset 0 0 0 2px var(--sector-accent); }
.pv-onboard-mark.is-pending { box-shadow: inset 0 0 0 2px var(--text-secondary); background: linear-gradient(90deg, var(--text-secondary) 50%, transparent 50%); }
.pv-onboard-mark.is-done { background: var(--text-secondary); box-shadow: none; }
.pv-onboard-mark.is-done::after { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid var(--pvura-bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pv-onboard-title { margin: 0; line-height: 1.4; }
.pv-onboard-step.is-done .pv-onboard-title strong { color: var(--text-secondary); font-weight: 560; }
.pv-onboard-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--pv-hair-strong); font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); vertical-align: 1px; }
.pv-onboard-why { margin: 4px 0 10px; color: var(--text-secondary); font-size: 0.92rem; }
.pv-onboard-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pv-onboard-actions .btn { min-height: 44px; }
.pv-onboard-note { font-size: 0.88rem; color: var(--text-tertiary); }
.pv-onboard-help { margin: 0; }
.pv-onboard-help[open] { flex-basis: 100%; }
.pv-onboard-help summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--text-secondary); min-height: 44px; display: inline-flex; align-items: center; }
.pv-onboard-help-body { margin-top: 2px; font-size: 0.9rem; color: var(--text-secondary); max-width: 68ch; }
.pv-onboard-help-body p, .pv-onboard-help-body ol { margin: 0 0 8px; }
.pv-onboard-help-body ol { padding-left: 1.2em; }
.pv-onboard-help-body strong { color: var(--text-primary); }
@media (max-width: 640px) {
  .pv-onboard-step.is-next .pv-onboard-actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }
}

/* ---------- Password visibility toggle (.pv-pw, shared script in base.html) ----------
   The eye sits inside the field on the right; the input keeps room for it
   so text never runs underneath, and toggling never shifts layout. */
.pv-pw { position: relative; display: block; width: 100%; }
.pv-pw > input { width: 100%; box-sizing: border-box; }
.pv-pw.has-toggle > input { padding-right: 52px; }
.pv-pw-toggle {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 48px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0; padding: 0; border: 0; background: transparent;
  color: var(--text-tertiary); cursor: pointer;
  border-radius: 0 var(--pv-radius, 8px) var(--pv-radius, 8px) 0;
  transition: color var(--motion-fast, 120ms);
}
.pv-pw-toggle:hover { color: var(--text-primary); }
.pv-pw-toggle[aria-pressed="true"] { color: var(--text-secondary); }
.pv-pw-toggle:focus-visible { outline: 2px solid var(--sector-accent, currentColor); outline-offset: -4px; }
.pv-pw-toggle svg { display: block; pointer-events: none; }
/* Edge/IE built-in reveal button would double up with ours. */
.pv-pw > input::-ms-reveal, .pv-pw > input::-ms-clear { display: none; }
