:root {
  --font-size: 16px;
  /* ScandiForge v2: rolig nordisk arbeidsflate */
  --bg: #f2eee7;
  --panel: #fbfaf7;
  --panel-muted: #eae5dc;
  --text: #252b2d;
  --muted: #687078;
  --faint: #8a8e8f;
  --line: #d8d3ca;
  --line-strong: #bbb7ae;
  --brand: #8d503a;
  --brand-strong: #6e3b2e;
  --brand-soft: #efe0d7;
  --on-brand: #fffaf5;
  --success: #54705a;
  --success-soft: #e4eee5;
  --warning: #9b6d2e;
  --warning-soft: #f2e8d3;
  --danger: #a9574b;
  --danger-soft: #f3e1de;
  --shadow: 0 18px 50px rgba(60, 48, 38, 0.09);
  --radius: 16px;
  --radius-small: 10px;
}

body[data-theme="dark"] {
  /* Dusk: mørk nok til lange arbeidsøkter, varm nok til å ikke bli klinisk */
  --bg: #17191a;
  --panel: #222426;
  --panel-muted: #2b2a28;
  --text: #f0ece4;
  --muted: #b6b0a7;
  --faint: #8d8d89;
  --line: #3a3a37;
  --line-strong: #54504a;
  --brand: #d08a61;
  --brand-strong: #e0a17a;
  --brand-soft: #3a2923;
  --on-brand: #2a1b14;
  --success: #9bb699;
  --success-soft: #25352a;
  --warning: #d3aa66;
  --warning-soft: #3c3324;
  --danger: #d78e84;
  --danger-soft: #3a2726;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

body[data-text-size="small"] { --font-size: 14px; }
body[data-text-size="large"] { --font-size: 18px; }

* { box-sizing: border-box; }

html { font-size: var(--font-size); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  transition: background-color 160ms ease, color 160ms ease;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 70px;
  padding: 10px clamp(18px, 3.2vw, 52px);
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-lockup { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { width: 126px; height: auto; display: block; }
.product-label { padding-left: 12px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .02em; }
.brand .logo-for-light { display: block; }
.brand .logo-for-dark { display: none; }
body[data-theme="dark"] .brand .logo-for-light { display: none; }
body[data-theme="dark"] .brand .logo-for-dark { display: block; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.top-context { margin-left: auto; color: var(--muted); font-size: .82rem; font-weight: 750; }
.logout-button { margin-left: 3px; }
.icon-button, .text-size-button {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
}
.text-size-button { min-width: auto; font-size: 0.8rem; }

.page-wrap { width: 100%; max-width: 1680px; margin: 0 auto; padding: 32px clamp(20px, 3.2vw, 52px) 62px; }
.screen { animation: appear 180ms ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.screen-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: clamp(32px, 4vw, 58px); align-items: start; }
.side-nav { position: sticky; top: 96px; display: grid; gap: 3px; padding-right: 22px; border-right: 1px solid var(--line); }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 650;
}
.side-nav a:hover, .side-nav a[aria-current="page"] { color: var(--brand-strong); background: var(--brand-soft); }
.side-nav small { display: block; margin: 27px 11px 5px; color: var(--faint); font-size: 0.68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.side-nav .help-link { margin-top: 1px; }
.ui-icon { width: 1em; height: 1em; flex: 0 0 auto; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a > .ui-icon { width: 18px; height: 18px; color: var(--faint); }
.side-nav a[aria-current="page"] > .ui-icon, .side-nav a:hover > .ui-icon { color: var(--brand-strong); }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-intro h1 { margin: 3px 0 6px; font-size: clamp(1.6rem, 2.6vw, 2.08rem); line-height: 1.08; letter-spacing: -0.035em; }
.page-intro p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--brand); font-size: .73rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.intro-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.button, .button-secondary, .button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 10px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.button .ui-icon, .button-secondary .ui-icon, .button-quiet .ui-icon { width: 16px; height: 16px; }
.button:hover, .button-secondary:hover, .button-quiet:hover { transform: translateY(-1px); }
.button { border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); }
.button:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.button-secondary { border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); }
.button-quiet { border: 1px solid transparent; background: transparent; color: var(--brand-strong); }
.button.small, .button-secondary.small, .button-quiet.small { min-height: 35px; padding: 7px 10px; font-size: .82rem; }

.status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--panel);
}
.status-banner.success { border-color: color-mix(in srgb, var(--success) 25%, var(--line)); background: var(--success-soft); }
.status-banner.warning { border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); background: var(--warning-soft); }
.status-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; background: var(--success); color: var(--on-brand); font-weight: 900; }
.status-mark .ui-icon { width: 17px; height: 17px; }
.status-banner.warning .status-mark { background: var(--warning); }
.status-banner strong { display: block; }
.status-banner p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.status-banner .button-quiet { margin-left: auto; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 29px; }
.metric { padding: 16px 17px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--panel); }
.metric-label { color: var(--muted); font-size: .8rem; }
.metric-value { margin-top: 5px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.metric-note { margin-top: 4px; color: var(--muted); font-size: .78rem; }

.status-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: .78rem; font-weight: 800; white-space: nowrap; }
.status-inline.warning { color: var(--warning); }
.status-inline .ui-icon { width: 15px; height: 15px; }

.testlab-policy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 18px 0 24px; border: 1px solid var(--line); background: var(--line); }
.testlab-policy > div { display: grid; gap: 3px; padding: 15px 17px; background: var(--panel); }
.testlab-policy strong { font-size: .86rem; }
.testlab-policy span { color: var(--muted); font-size: .82rem; }
.testlab-layout { margin-top: 0; }
.testlab-list { display: grid; gap: 0; }
.testlab-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.testlab-row:last-child { border-bottom: 0; }
.testlab-row strong, .testlab-row span, .testlab-row small { display: block; }
.testlab-row span { margin-top: 2px; color: var(--muted); font-size: .82rem; }
.testlab-row small { margin-top: 3px; color: var(--faint); font-size: .75rem; }
.testlab-row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.testlab-form { margin-top: 19px; padding-top: 18px; border-top: 1px solid var(--line); }
.testlab-form h3 { margin: 0 0 12px; font-size: .98rem; }
.testlab-form .form-footer { margin-top: 16px; padding-top: 13px; }
.testlab-runs { margin-top: 14px; }
.testlab-run-list { display: grid; gap: 0; }
.testlab-run { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .82rem; }
.testlab-run:last-child { border-bottom: 0; }
.testlab-run > span:nth-child(2) { color: var(--muted); }
.test-route-panel { margin-bottom: 14px; border: 1px solid var(--line); background: var(--panel); }
.test-route-panel .section-heading { border-bottom: 1px solid var(--line); }
.test-route-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.test-route-card { display: grid; gap: 5px; min-height: 104px; padding: 14px 12px; border: 0; background: var(--panel); color: var(--muted); text-align: left; }
.test-route-card:hover, .test-route-card.selected { background: var(--brand-soft); color: var(--text); }
.test-route-card > span { color: var(--brand-strong); }
.test-route-card .ui-icon { width: 21px; height: 21px; }
.test-route-card strong { font-size: .82rem; line-height: 1.25; }
.test-route-card small { color: var(--faint); font-size: .7rem; line-height: 1.25; }
.test-route-card.selected small { color: var(--muted); }
.testlab-history-grid { margin-top: 14px; }
.test-console { margin-top: 14px; }
.console-output { max-height: 430px; overflow: auto; padding: 15px; border: 1px solid #343936; border-radius: 9px; background: #121615; color: #e5eee7; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; line-height: 1.5; }
.console-event { padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid #2d3731; }
.console-event:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.console-event > div { display: flex; align-items: baseline; gap: 9px; }
.console-level { color: #9ccaa3; font-size: .68rem; font-weight: 800; }
.console-event.warning .console-level { color: #e5bd73; }
.console-event.error .console-level { color: #ed9b8e; }
.console-event pre { margin: 9px 0 0; padding: 10px; overflow: auto; border: 1px solid #2d3731; border-radius: 6px; background: #1a211d; color: #cfe3d2; white-space: pre-wrap; word-break: break-word; }
.console-event p { margin: 9px 0 0; color: #b9c8bb; font-family: inherit; }
.console-event p strong { color: #eef7ef; }
.console-empty { color: #aab8ad; }

.two-column { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; margin-top: 26px; }
.critical-value { margin: 6px 0 4px; color: var(--text); font-size: 1.35rem; font-weight: 850; letter-spacing: -.025em; }
.quiet-help-panel { margin-top: 14px; }
.empty-state-text { margin: 0 0 15px; color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--panel); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 17px 10px; }
.panel-header h2 { margin: 0; font-size: 1rem; }
.panel-body { padding: 0 17px 17px; }
.report-filters { display: flex; align-items: end; gap: 12px; padding: 14px; margin-bottom: 18px; }
.report-filters .field { min-width: 190px; }
.report-filters .button { margin-left: auto; }
.report-amount { margin-left: auto; color: var(--text); font-weight: 800; white-space: nowrap; }
.activity-list, .help-list { list-style: none; padding: 0; margin: 0; }
.activity-list li, .help-list li { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.activity-list li:last-child, .help-list li:last-child { border-bottom: 0; }
.activity-time { min-width: 50px; color: var(--faint); font-size: .75rem; }
.activity-list strong { font-weight: 700; }
.help-list a { color: var(--brand-strong); text-decoration: none; }
.help-list span { color: var(--muted); font-size: .82rem; }

.setup-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 28px; align-items: start; }
.stepper { display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 29px 1fr; gap: 10px; align-items: start; padding: 10px 8px; border-radius: 10px; color: var(--muted); }
.step.active { background: var(--brand-soft); color: var(--text); }
.step-number { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: .8rem; font-weight: 800; }
.step.active .step-number { border-color: var(--brand); background: var(--brand); color: #fff; }
.step.done .step-number { border-color: var(--success); background: var(--success); color: #fff; }
.step strong { display: block; font-size: .88rem; }
.step small { display: block; margin-top: 2px; font-size: .77rem; }
.setup-card { padding: clamp(18px, 4vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.setup-card h2 { margin: 0 0 4px; font-size: 1.35rem; letter-spacing: -.025em; }
.setup-card > p { margin: 0 0 23px; color: var(--muted); }
.customer-form-card { max-width: 980px; }
.form-section + .form-section { margin-top: 25px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.form-section-heading h2 { margin: 3px 0 0; font-size: 1.05rem; }
.compact-form-section { padding-bottom: 2px; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.checkbox-field input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); }
.checkbox-field strong, .checkbox-field small { display: block; }
.checkbox-field strong { font-size: .84rem; }
.checkbox-field small { margin-top: 3px; color: var(--muted); font-size: .77rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.mapping-section { margin-top: 21px; padding-top: 20px; border-top: 1px solid var(--line); }
.mapping-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.mapping-heading h3 { margin: 0; font-size: 1rem; }
.mapping-heading p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }
.mapping-hint { color: var(--muted); font-size: .72rem; font-weight: 750; white-space: nowrap; }
.mapping-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.mapping-row { display: grid; grid-template-columns: 88px 1fr 1fr; gap: 13px; align-items: end; padding: 12px; border-bottom: 1px solid var(--line); }
.mapping-row:last-child { border-bottom: 0; }
.rate-badge { align-self: center; color: var(--text); font-size: .83rem; font-weight: 800; }
.mapping-footnote { margin: 9px 0 0; color: var(--faint); font-size: .73rem; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 800; }
.field input, .field select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); color: var(--text); }
.field input::placeholder { color: var(--faint); }
.field-help { color: var(--muted); font-size: .77rem; }
.secure-note { display: flex; gap: 10px; margin: 20px 0; padding: 12px 13px; border-radius: 9px; background: var(--panel-muted); color: var(--muted); font-size: .81rem; }
.secure-note strong { display: block; margin-bottom: 2px; color: var(--text); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--line); }
.test-result { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 13px; border: 1px solid color-mix(in srgb, var(--success) 25%, var(--line)); border-radius: 9px; background: var(--success-soft); color: var(--success); }
.test-result p { margin: 0; font-size: .84rem; }
.test-result strong { display: block; color: var(--text); }

.admin-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.search-box { position: relative; flex: 1; }
.search-box input { width: 100%; min-height: 44px; padding: 9px 12px 9px 39px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--text); }
.search-icon { position: absolute; top: 12px; left: 13px; color: var(--faint); }
.attention-item { display: flex; align-items: flex-start; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.attention-item:last-child { border-bottom: 0; }
.attention-dot { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; margin-top: 3px; color: var(--warning); }
.attention-dot .ui-icon { width: 17px; height: 17px; }
.attention-item strong { display: block; font-size: .84rem; }
.attention-item span { display: block; margin-top: 2px; color: var(--muted); font-size: .77rem; }

/* Arbeidsflate: tydelige seksjoner med lite pynt og god plass til innhold. */
.page-meta { color: var(--faint); font-size: .78rem; white-space: nowrap; }
.work-grid { display: grid; gap: 18px; }
.customer-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 23px; }
.admin-work-grid { grid-template-columns: minmax(0, 1.18fr) minmax(310px, .82fr); }
.work-section { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 72%, transparent); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px 13px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 3px 0 0; font-size: 1.03rem; letter-spacing: -.02em; }
.work-section-body { padding: 15px 20px 20px; }
.work-section-body > p { max-width: 62ch; margin: 0; color: var(--muted); font-size: .87rem; }
.work-section .critical-value { margin-top: 0; }
.quiet-help-panel { margin-top: 18px; }
.quiet-help-panel .section-heading { border-bottom: 0; padding-bottom: 0; }
.quiet-help-panel .work-section-body { padding-top: 8px; }
.work-toolbar { justify-content: space-between; min-height: 42px; padding: 0 1px; }
.system-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.attention-section .work-section-body { padding-top: 3px; }
.attention-item { padding: 15px 0; }
.attention-item .button-quiet { display: block; margin-top: 7px; padding-left: 0; }
.customer-directory-search { display: block; margin-bottom: 14px; }
.customer-list { overflow: hidden; border-top: 1px solid var(--line); }
.customer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 15px 2px; border-bottom: 1px solid var(--line); }
.customer-row-main { min-width: 0; }
.customer-row-main strong, .customer-row-main span { display: block; }
.customer-row-main strong { font-size: .9rem; }
.customer-row-main span { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.customer-row .button-secondary { white-space: nowrap; }
.customer-row .button-secondary .ui-icon { width: 15px; height: 15px; }
.customer-detail-panel { overflow: hidden; }
.package-layout { align-items: start; }
.package-list { border-top: 1px solid var(--line); }
.package-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.package-row strong, .package-row span, .package-row small { display: block; }
.package-row strong { font-size: .9rem; }
.package-row span { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.package-row small { margin-top: 4px; color: var(--faint); font-size: .75rem; }
.package-route-options { display: grid; gap: 3px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.package-route-options .checkbox-field { padding: 7px 0; }
.package-route-options .checkbox-field span { font-size: .82rem; }
.api-monitor-panel { overflow: hidden; }
.api-list { border-top: 1px solid var(--line); }
.api-row { padding: 17px 0; border-bottom: 1px solid var(--line); }
.api-row-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.api-row-heading strong, .api-row-heading span { display: block; }
.api-row-heading strong { font-size: .9rem; }
.api-row-heading span { margin-top: 4px; color: var(--muted); font-size: .8rem; }
.api-row-details { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.api-row-details b { color: var(--text); }
.api-row-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 11px; }
.api-row-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-strong); font-size: .78rem; font-weight: 750; text-decoration: none; }
.api-row-links .ui-icon { width: 14px; height: 14px; }
.api-tabs { display: flex; align-items: end; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.api-tabs .detail-label { margin: 0 3px 14px 0; white-space: nowrap; }
.api-tab { min-height: 48px; padding: 0 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 750; white-space: nowrap; }
.api-tab:hover, .api-tab[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--brand-strong); }
.api-entry { padding: 18px 0 4px; }
.api-entry + .api-entry { border-top: 1px solid var(--line); }
.detail-subsection + .detail-subsection { margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.inline-assignment-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.inline-assignment-form label { width: 100%; color: var(--muted); font-size: .77rem; font-weight: 750; }
.inline-assignment-form input, .inline-assignment-form select { min-height: 42px; min-width: min(260px, 100%); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); color: var(--text); }
.inline-assignment-form select { min-width: min(360px, 100%); }
.inline-assignment-form .form-message { flex-basis: 100%; }
.field label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-status { color: var(--muted); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.field-status.saved { color: var(--success); }
.field-status.missing { color: var(--warning); }
.credential-status-list { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.fiken-company-section { margin-top: 24px; }
.fiken-company-form { margin: 10px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.selected-assignment { display: grid; gap: 4px; margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--success); background: var(--panel-soft); }
.selected-assignment strong { font-size: .78rem; }
.selected-assignment span { color: var(--muted); font-size: .82rem; }
.test-warning { display: grid; gap: 4px; margin-top: 18px; padding: 12px 14px; border-left: 3px solid var(--warning); background: var(--panel-soft); color: var(--muted); font-size: .8rem; line-height: 1.45; }
.test-warning strong { color: var(--text); }
.customer-detail-summary { display: flex; align-items: center; gap: 18px; padding: 17px 20px; color: var(--muted); font-size: .82rem; }
.customer-tabs { display: flex; gap: 22px; padding: 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-x: auto; }
.customer-tab { min-height: 48px; padding: 0 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 750; white-space: nowrap; }
.customer-tab:hover, .customer-tab[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--brand-strong); }
.customer-tab-content { padding: 24px 20px 28px; }
.detail-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 38px; }
.detail-info-grid > div { min-width: 0; }
.detail-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .77rem; font-weight: 750; }
.detail-info-grid strong { font-size: .9rem; line-height: 1.55; }
.detail-empty h3 { margin: 0 0 5px; font-size: 1rem; }
.detail-empty > p { max-width: 64ch; margin: 0 0 18px; color: var(--muted); font-size: .87rem; }
.detail-list { border-top: 1px solid var(--line); }
.detail-list-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-list-row strong, .detail-list-row span { display: block; }
.detail-list-row strong { font-size: .87rem; }
.detail-list-row span { margin-top: 3px; color: var(--muted); font-size: .79rem; }
.detail-list-row .detail-meta { margin-top: 0; white-space: nowrap; }
.detail-row-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 14px; }

.auth-shell { display: grid; grid-template-columns: minmax(0, 520px) minmax(300px, 480px); align-items: center; justify-content: center; gap: clamp(28px, 8vw, 110px); min-height: calc(100vh - 74px); padding: 50px clamp(20px, 5vw, 80px); }
.auth-card { padding: clamp(24px, 5vw, 45px); border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.auth-card .brand-lockup { margin-bottom: 35px; }
.auth-card .brand img { width: 168px; }
.auth-card .product-label { font-size: .82rem; }
.auth-card h1 { margin: 0 0 7px; font-size: 2rem; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 25px; color: var(--muted); }
.auth-form { display: grid; gap: 15px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 75px; }
.password-wrap button { position: absolute; right: 8px; top: 6px; min-height: 32px; border: 0; background: transparent; color: var(--brand-strong); font-size: .78rem; font-weight: 750; }
.auth-options { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--muted); font-size: .8rem; }
.auth-options label { display: flex; gap: 7px; align-items: center; }
.auth-options a { color: var(--brand-strong); text-decoration: none; font-weight: 700; }
.auth-form .button { width: 100%; margin-top: 3px; }
.form-message { margin: 0; padding: 10px 12px; border: 1px solid #e7b6b6; border-radius: 9px; background: #fff4f4; color: #9b2c2c; font-size: .84rem; }
.bootstrap-card { max-width: 540px; }
.bootstrap-qr { display: grid; justify-items: center; gap: 11px; margin: 4px 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: center; }
.bootstrap-qr img { width: 230px; height: 230px; image-rendering: pixelated; border-radius: 8px; background: #fff; }
.bootstrap-qr p { max-width: 36ch; margin: 0; color: var(--muted); font-size: .83rem; }
.auth-note { display: flex; gap: 9px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.auth-aside { max-width: 390px; }
.auth-aside h2 { margin: 0 0 10px; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.08; letter-spacing: -.05em; }
.auth-aside p { margin: 0 0 24px; color: var(--muted); font-size: 1.02rem; }
.auth-points { display: grid; gap: 10px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--line); }
.auth-point strong { display: block; font-size: .86rem; }
.auth-point span { display: block; margin-top: 2px; color: var(--muted); font-size: .79rem; }
.loading-shell { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }

.screen-switch-note { margin-top: 28px; color: var(--faint); font-size: .75rem; text-align: center; }
.empty-state { padding: 30px; color: var(--muted); text-align: center; }

@media (max-width: 1050px) {
  .screen-layout { grid-template-columns: 1fr; gap: 14px; }
  .side-nav { position: static; display: flex; gap: 4px; padding: 0 0 3px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav small { display: none; }
  .side-nav a { white-space: nowrap; }
  .side-nav .help-link { margin-top: 0; }
  .auth-shell { grid-template-columns: minmax(0, 520px) minmax(240px, 360px); gap: 35px; }
  .testlab-policy { grid-template-columns: 1fr; }
  .test-route-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .topbar { min-height: auto; padding-block: 11px; gap: 10px; }
  .brand img { width: 126px; }
  .top-actions { margin-left: auto; }
  .page-wrap { padding-top: 20px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 15px; }
  .intro-actions { justify-content: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .setup-layout, .admin-work-grid { grid-template-columns: 1fr; }
  .customer-work-grid { grid-template-columns: 1fr; }
  .page-meta { white-space: normal; }
  .customer-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .customer-row .status-inline { grid-column: 1; justify-self: start; }
  .customer-row .button-secondary { grid-column: 2; grid-row: 1 / span 2; }
  .detail-info-grid { grid-template-columns: 1fr; gap: 17px; }
  .detail-row-actions { justify-content: flex-start; }
  .package-layout { grid-template-columns: 1fr; }
  .customer-detail-summary, .customer-tabs, .customer-tab-content { padding-left: 15px; padding-right: 15px; }
  .api-tabs { padding-left: 15px; padding-right: 15px; gap: 17px; }
  .customer-detail-summary { justify-content: space-between; }
  .customer-tabs { gap: 17px; }
  .mapping-row { grid-template-columns: 75px 1fr 1fr; gap: 9px; }
  .report-filters { align-items: stretch; flex-direction: column; }
  .report-filters .field { min-width: 0; }
  .report-filters .button { margin-left: 0; }
  .setup-layout { gap: 15px; }
  .testlab-row { align-items: flex-start; flex-direction: column; }
  .testlab-row-actions { justify-content: flex-start; }
  .testlab-run { grid-template-columns: 1fr; gap: 3px; }
  .test-route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper { grid-template-columns: repeat(4, 1fr); display: grid; gap: 5px; }
  .step { display: block; padding: 8px; text-align: center; }
  .step-number { margin: 0 auto 6px; }
  .step small { display: none; }
  .auth-shell { display: block; padding: 28px 18px 45px; }
  .auth-card { max-width: 520px; margin: 0 auto; }
  .auth-aside { display: none; }
}

@media (max-width: 480px) {
  .topbar { padding-inline: 14px; }
  .topbar .product-label, .topbar .top-context { display: none; }
  .top-actions { gap: 4px; }
  .top-actions .icon-button, .top-actions .text-size-button { min-width: 34px; height: 34px; padding-inline: 7px; }
  .top-actions .logout-button { white-space: nowrap; }
  .metric-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .field.full { grid-column: auto; }
  .mapping-heading { display: block; }
  .mapping-hint { display: inline-block; margin-top: 9px; }
  .mapping-row { grid-template-columns: 1fr; gap: 8px; }
  .rate-badge { margin-bottom: -1px; }
  .status-banner { align-items: flex-start; }
  .status-banner .button-quiet { margin-left: 0; padding-inline: 0; }
  .status-banner { flex-wrap: wrap; }
  .section-heading, .work-section-body { padding-left: 15px; padding-right: 15px; }
  .form-footer { align-items: stretch; flex-direction: column-reverse; }
  .form-footer .button, .form-footer .button-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
