:root {
  --ink: #16324a;
  --ink-soft: #2c4a63;
  --page: #eef1f0;
  --surface: #fcfcfb;
  --line: #d9dedc;
  --grid: #e1e0d9;
  --text: #10202d;
  --text-2: #4a5661;
  --muted: #6f7a83;
  --now: #e3ecf2;
  --good: #006300;
  --bad: #b3261e;
  --radius: 10px;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 16px/1.5 var(--body); }
h1, h2 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 2rem; line-height: 1.15; font-weight: 700; }
h2 { font-size: 1.125rem; font-weight: 700; margin-bottom: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #2a78d6; outline-offset: 2px; }

/* ---------- ramme ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(to top, #2a78d6 0 28%, #eb6834 28% 50%, #1baf7a 50% 68%, #eda100 68% 84%, #e87ba4 84%); }
.brand-name { font: 700 1.05rem/1.2 var(--display); }
.brand-product { font-size: .8125rem; color: #b9c8d4; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #d5e0e8; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--ink-soft); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--ink); }
.side-foot { margin-top: auto; display: grid; gap: 12px; padding: 0 8px; }
.lang { display: flex; border: 1px solid #44617a; border-radius: 8px; overflow: hidden; }
.lang button { flex: 1; background: none; border: 0; color: #d5e0e8; padding: 6px 0; font-size: .875rem; cursor: pointer; }
.lang button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; }
.sync { font-size: .8125rem; color: #b9c8d4; }
.sync::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #8fa3b3; margin-right: 8px; }
.sync-ok::before { background: #5fd08f; }
.sync-err { color: #ffc9c2; }
.sync-err::before { background: #ff8a7d; }
.main { padding: 36px 40px 120px; max-width: 1240px; width: 100%; outline: none; }

.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.lede { margin: 6px 0 0; color: var(--text-2); max-width: 68ch; }
.hint { margin: -6px 0 14px; color: var(--muted); font-size: .875rem; max-width: 70ch; }
.hint.warn { color: var(--bad); margin: 12px 0 0; }
.empty { color: var(--text-2); margin: 4px 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-2 .panel { margin-bottom: 20px; }

/* ---------- knapper og felt ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid #b9c2c8; background: var(--surface); cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-soft); }
.btn-danger { color: var(--bad); border-color: #e0b4b0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-weight: 500; text-decoration: underline; text-decoration-color: #b9c2c8; text-underline-offset: 3px; }
input[type="text"], input[type="search"], input[type="number"], input[type="month"], input[type="url"], input[type="password"], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid #b9c2c8; border-radius: 8px; background: #fff; }
textarea { resize: vertical; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: .875rem; font-weight: 500; color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.check { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; }
.check input { width: 18px; height: 18px; }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 16px; }

/* ---------- merkelapper ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--text-2); white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; border: 1px solid #c3ccd2; color: var(--text-2); background: #fff; white-space: nowrap; }
.pill-planned { border-color: var(--ink); color: var(--ink); }
.pill-progress { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill-done { border-color: var(--good); color: var(--good); }
.pill-done::before { content: '✓ '; }
.pill-rejected { text-decoration: line-through; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }

/* ---------- oversikt ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile-label { font-size: .875rem; color: var(--text-2); }
.tile-value { font: 700 1.75rem/1.2 var(--display); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: .8125rem; color: var(--muted); }
.alloc { display: grid; gap: 12px; }
.alloc-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 118px; gap: 12px; align-items: center; border-radius: 6px; }
.alloc-track { position: relative; height: 14px; background: #eceeed; border-radius: 4px; }
.alloc-fill { height: 100%; border-radius: 0 4px 4px 0; }
.alloc-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.alloc-num { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; font-size: .9375rem; }
.alloc-num span { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--grid); }
.row-btn { width: 100%; background: none; border: 0; padding: 10px 4px; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; cursor: pointer; border-radius: 6px; }
.row-btn:hover { background: #f1f4f3; }
.row-title { font-weight: 500; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.row-meta { display: flex; gap: 10px; align-items: center; flex: none; }
.when { font-size: .875rem; font-variant-numeric: tabular-nums; }

/* ---------- forespørsler ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { width: 100%; height: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.card:hover { border-color: var(--ink); }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.card-title { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; overflow-wrap: break-word; hyphens: auto; }
.card-desc { color: var(--text-2); font-size: .9375rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- veikart ---------- */
.lane-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 6px; }
.lane { display: grid; grid-template-columns: repeat(var(--n), minmax(146px, 1fr)); gap: 8px; }
.lane-col { background: #f1f3f2; border-radius: 8px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.lane-col.is-now { background: var(--now); }
.lane-head { font: 700 .9375rem var(--display); display: flex; justify-content: space-between; padding: 2px 4px 4px; }
.lane-head span { font: 400 .8125rem var(--body); color: var(--muted); }
.road-card { text-align: left; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 6px; padding: 8px 10px; cursor: pointer; display: grid; gap: 4px; }
.road-card:hover { border-color: var(--ink); border-left-color: var(--c); }
.road-title { font-weight: 600; font-size: .9375rem; line-height: 1.3; overflow-wrap: break-word; hyphens: auto; }
.road-meta { font-size: .75rem; color: var(--text-2); }
.loose { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

/* ---------- kapasitet ---------- */
.chart { padding-top: 8px; }
.chart-plot { position: relative; height: 300px; }
.bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.bar-col { display: grid; grid-template-rows: 22px minmax(0, 1fr) 28px; justify-items: center; border-radius: 6px; }
.bar-col:hover .bar-stack { opacity: .85; }
.bar-total { font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; align-self: end; }
.bar-total.is-over { color: var(--bad); }
.bar-total.is-over::before { content: '▲ '; }
.bar-stack { width: min(56px, 70%); display: flex; flex-direction: column-reverse; gap: 2px; border-bottom: 1px solid #c3c2b7; height: 100%; }
.seg { width: 100%; min-height: 2px; }
.seg:last-of-type { border-radius: 4px 4px 0 0; }
.bar-label { font-size: .8125rem; color: var(--muted); align-self: center; text-align: center; }
/* Streken ligger i samme høydeområde som søylene (mellom tall-raden og etikett-raden). */
.cap-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--text); z-index: 1; pointer-events: none; }
.cap-line span { position: absolute; right: 0; bottom: 4px; font-size: .75rem; font-weight: 600; background: var(--surface); padding: 0 4px; }

/* ---------- tabeller ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { font-size: .8125rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { margin-top: 2px; }
.pos { color: var(--good); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
.muted { color: var(--muted); }

/* ---------- status ---------- */
.status-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.count { font: 400 .875rem var(--body); color: var(--muted); }
.status-rows { list-style: none; margin: 0; padding: 0; }
.status-rows li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; }
.status-rows li + li { border-top: 1px solid var(--grid); }
.status-title { font-weight: 600; overflow-wrap: break-word; hyphens: auto; }
.status-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8125rem; color: var(--muted); }
.status-when { flex: none; font-weight: 500; text-align: right; font-size: .9375rem; }

/* ---------- dialog, tips, beskjed ---------- */
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 24px 60px rgba(16, 32, 45, .35); }
.dialog::backdrop { background: rgba(16, 32, 45, .5); }
.dialog form { padding: 22px; }
.dialog h2 { font-size: 1.375rem; margin-bottom: 16px; }
details { margin: 4px 0 12px; }
summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.calc { margin: 6px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.5em; }
.form-error { color: var(--bad); font-weight: 600; margin: 0 0 8px; }
.dialog-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.spacer { flex: 1; }
.tip { position: fixed; z-index: 50; background: var(--text); color: #fff; font-size: .8125rem; line-height: 1.45; padding: 8px 10px; border-radius: 6px; white-space: pre-line; pointer-events: none; max-width: 260px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 99px; z-index: 60; font-weight: 500; }
[hidden] { display: none !important; }
.fab { position: fixed; right: 28px; bottom: 28px; z-index: 20; display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 22px 0 18px; border-radius: 99px; border: 0; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 8px 22px rgba(16, 32, 45, .3); }
.fab span:first-child { font-size: 1.6rem; line-height: 1; margin-top: -3px; }

.side-add { background: #fff; color: var(--ink); border: 0; border-radius: 8px; min-height: 44px; font-weight: 600; cursor: pointer; margin: -8px 0 -8px; }
.side-add:hover { background: #dfe8ee; }
.fab { display: none; }

/* ---------- mobil ---------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 15; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); display: block; }
  .brand, .side-foot, .side-add { display: none; }
  .fab { display: inline-flex; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 10px 14px; font-size: .9375rem; }
  .main { padding: 20px 14px 150px; }
  h1 { font-size: 1.625rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-value { font-size: 1.375rem; }
  .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters input[type="search"] { grid-column: 1 / -1; }
  .alloc-row { grid-template-columns: minmax(0, 1fr) 100px; }
  .alloc-name { grid-column: 1 / -1; }
  .panel { padding: 16px 14px; }
  .fab { right: 14px; bottom: calc(66px + env(safe-area-inset-bottom)); width: 58px; height: 58px; padding: 0; justify-content: center; }
  .fab-label { display: none; }
  .fab span:first-child { font-size: 2rem; }
  .toast { bottom: 140px; }
  .bar-label { font-size: .6875rem; }
  .status-rows li { flex-direction: column; gap: 2px; }
  .status-when { text-align: left; }
  .dialog-actions { flex-wrap: wrap; }
}

/* ---------- versjon 1.1: tagger, team, tidslinje, kundeønsker ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; padding: 1px 8px; border-radius: 4px; background: #e6ebee; color: var(--text-2); border: 0; }
.tag button { border: 0; background: none; cursor: pointer; padding: 0 2px; font-size: 1rem; line-height: 1; }
button.tag { cursor: pointer; min-height: 28px; }
button.tag:hover { background: #d5dde2; }
.tag-suggest { margin: -6px 0 12px; }
.jira { font-size: .8125rem; color: var(--ink); font-weight: 500; }
.nowrap { white-space: nowrap; }
.card-wrap { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-wrap:hover { border-color: var(--ink); }
.card-wrap .card { border: 0; background: none; flex: 1; }
.card-link { padding: 0 16px 12px; }
.filters-4 { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
.chipbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chipbar button, .seg-switch button { min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid #b9c2c8; background: var(--surface); cursor: pointer; font-weight: 500; font-size: .9375rem; }
.chipbar button[aria-pressed="true"], .seg-switch button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg-switch { display: flex; gap: 6px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--text-2); }
.inline-field select { width: auto; }

.tl-scroll { overflow-x: auto; }
.tl { min-width: 640px; }
.tl-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: center; min-height: 34px; }
.tl-row + .tl-row { border-top: 1px solid var(--grid); }
.tl-label { background: none; border: 0; text-align: left; padding: 6px 12px 6px 0; cursor: pointer; font-size: .875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-label:hover { text-decoration: underline; }
.tl-track { position: relative; height: 34px;
  background: repeating-linear-gradient(to right, var(--grid) 0 1px, transparent 1px calc(100% / var(--n))); }
.tl-bar { position: absolute; top: 8px; height: 18px; border: 0; border-radius: 4px; cursor: pointer; min-width: 6px; padding: 0; box-shadow: 0 0 0 2px var(--surface); }
.tl-bar:hover { filter: brightness(.9); }
.tl-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tl-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-bar.is-done { opacity: .45; }
.tl-months { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); height: 26px; background: none; }
.tl-months span { font-size: .75rem; color: var(--muted); padding-left: 3px; white-space: nowrap; overflow: visible; border-left: 1px solid transparent; }
.tl-months span.is-year { border-left-color: var(--text-2); color: var(--text); font-weight: 600; }
.tl-group { font: 700 .9375rem var(--display); padding: 14px 0 4px; border-top: 1px solid var(--grid); }

.row-wish { align-items: flex-start; }
.wish-main { display: grid; gap: 4px; min-width: 0; }
.dups { list-style: none; margin: 0; padding: 0; }
.dups li { padding: 12px 0; display: grid; gap: 8px; }
.dups li + li { border-top: 1px solid var(--grid); }
.dup-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dup-side { text-align: left; background: #f1f3f2; border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; cursor: pointer; display: grid; gap: 6px; }
.dup-side:hover { border-color: var(--ink); }
.dup-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dup-box { background: #fff6dd; border: 1px solid #e9cf86; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: .9375rem; display: grid; gap: 4px; }

.al-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 84px 92px minmax(0, 1.3fr) 42px; gap: 6px; margin-bottom: 8px; }
.btn-icon { padding: 0; font-size: 1.25rem; }
.calc.warn { color: var(--bad); }
#depBox select { margin-top: 8px; }
.dialog-wide { width: min(860px, calc(100vw - 24px)); }
.dialog-wide > div { padding: 22px; }
.dialog-wide .panel { padding: 0; border: 0; margin: 18px 0 0; background: none; }
.sum-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 6px; }
.sum-facts div { background: #f1f3f2; border-radius: 8px; padding: 10px 14px; display: grid; }
.sum-facts span { font-size: .8125rem; color: var(--text-2); }
.sum-facts strong { font: 700 1.25rem var(--display); }
.verdict { font-weight: 600; margin: 8px 0 14px; }
table.compact { font-size: .8125rem; }
table.compact th, table.compact td { padding: 7px 8px; }
.team-table td { padding: 6px 8px 6px 0; }
.team-table input { min-width: 110px; }

@media (max-width: 860px) {
  .filters-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-4 select:last-child { grid-column: 1 / -1; }
  .tl-row { grid-template-columns: 130px minmax(0, 1fr); }
  .dup-pair { grid-template-columns: minmax(0, 1fr); }
  .al-row { grid-template-columns: minmax(0, 1fr) 80px 42px; }
  .al-row select[data-al="team"] { grid-column: 1 / -1; }
  .al-row select[data-al="after"] { grid-column: 1 / 3; }
  .row-wish { flex-direction: column; }
  .row-wish .row-meta { flex-wrap: wrap; }
}

/* ---------- versjon 1.2: produkter, kalender, månedsvelger, enkel visning ---------- */
.product-bar { margin-bottom: 18px; }
.panel-tight { padding: 4px 16px; }
.req-row { justify-content: flex-start; padding: 9px 4px; }
.req-row .row-title { flex: 1; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; }
.prod-row { display: grid; grid-template-columns: minmax(0, 320px) auto; gap: 8px; margin-bottom: 8px; justify-content: start; }
.calc { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.notice { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; background: #fff6dd; border: 1px solid #e9cf86; border-radius: 8px; padding: 10px 14px; margin: 14px 0 0; font-weight: 500; }

.u0 { background: #f1f3f2; color: var(--muted); }
.u1 { background: #d3e3f6; color: var(--text); }
.u2 { background: #9ec0ea; color: var(--text); }
.u3 { background: #1f5fae; color: #fff; }
.u4 { background: var(--bad); color: #fff; font-weight: 600; }
table.cal { border-collapse: separate; border-spacing: 2px; }
table.cal th, table.cal td { border-bottom: 0; }
table.cal .cal-cell { text-align: center; border-radius: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 52px; }
table.cal td:first-child { padding-left: 0; white-space: nowrap; }

.tl { min-width: 0; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.tl:active { cursor: grabbing; }
.tl-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.tl-hint { margin: 12px 0 0; }
.tl-bar.is-soft { opacity: .45; }
.tl-months span.is-now { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.tl-caprow { min-height: 30px; }
.tl-caplabel { color: var(--text-2); cursor: inherit; font-weight: 400; }
.tl-caplabel:hover { text-decoration: none; }
.tl-cap { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; height: 24px; background: none; }
.tl-cap span { border-radius: 3px; font-size: .6875rem; line-height: 24px; text-align: center; overflow: hidden; white-space: nowrap; font-variant-numeric: tabular-nums; }

.mp { position: relative; }
.mp-btn { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid #b9c2c8; border-radius: 8px; background: #fff; text-align: left; cursor: pointer; }
.mp-btn::after { content: '▾'; float: right; color: var(--muted); }
.mp-pop { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; width: min(280px, 100%); min-width: 240px; background: #fff; border: 1px solid #b9c2c8; border-radius: 10px; padding: 10px; box-shadow: 0 12px 30px rgba(16, 32, 45, .22); }
.mp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mp-head button { width: 36px; height: 36px; border: 1px solid #b9c2c8; border-radius: 8px; background: #fff; cursor: pointer; }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 8px; }
.mp-grid button { min-height: 38px; border: 1px solid transparent; border-radius: 8px; background: #f1f3f2; cursor: pointer; text-transform: capitalize; }
.mp-grid button:hover { border-color: var(--ink); }
.mp-grid button.is-now { border-color: #b9c2c8; }
.mp-grid button[aria-pressed="true"] { background: var(--ink); color: #fff; }

#viewBody { padding: 22px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: -8px 0 14px; }
.detail-desc { white-space: pre-line; color: var(--text-2); margin: 0 0 14px; }
.dl { margin: 0 0 14px; }
.dl-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--grid); }
.dl dt { color: var(--text-2); font-size: .875rem; }
.dl dd { margin: 0; font-weight: 500; display: flex; flex-wrap: wrap; gap: 4px 6px; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .tl-row { grid-template-columns: 104px minmax(0, 1fr); }
  .tiles-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-row { grid-template-columns: 112px minmax(0, 1fr); }
  .tl-cap span { font-size: .5625rem; }
}

/* ---------- versjon 1.3: justeringer i skjema ---------- */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-grid-3 { grid-template-columns: minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.2fr); }
.al-row { grid-template-columns: minmax(0, 1.3fr) 88px auto minmax(0, 1.3fr) 42px; align-items: center; }
.al-unit { color: var(--text-2); font-size: .9375rem; padding-right: 4px; }
.dup-box { position: relative; padding-right: 44px; }
.dup-close { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; border-radius: 6px; color: var(--text-2); }
.dup-close:hover { background: #f1e3b3; color: var(--text); }
.mp-grid button:disabled { background: none; color: #b4bcc2; cursor: not-allowed; border-color: transparent; }
.mp-head button:disabled { color: #b4bcc2; cursor: not-allowed; }
@media (max-width: 860px) {
  .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid-3 .field:last-child { grid-column: 1 / -1; }
  .al-row { grid-template-columns: minmax(0, 1fr) auto 42px; }
  .al-row select[data-al="team"] { grid-column: 1 / -1; }
  .al-row select[data-al="after"] { grid-column: 1 / -1; grid-row: 3; }
  .al-row .btn-icon { grid-row: 2; grid-column: 3; }
}

/* ---------- versjon 1.4: tannhjul, språkvelger, status, teamtabell ---------- */
.side-icons { display: grid; gap: 6px; justify-items: start; }
.side-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; border: 0; background: none; color: #d5e0e8; cursor: pointer; }
.side-icon:hover { background: var(--ink-soft); color: #fff; }
.side-icon[aria-current="page"] { background: #fff; color: var(--ink); }
.lang-menu { position: relative; }
.lang-pop { position: absolute; bottom: 0; left: 52px; background: #fff; border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); display: grid; gap: 2px; min-width: 170px; z-index: 30; }
.lang-pop button { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 0; background: none; color: var(--text); padding: 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.lang-pop button:hover { background: #eef1f0; }
.lang-pop button[aria-pressed="true"] { background: #e3ecf2; font-weight: 600; }
.lang-pop svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; }
.nav a.nav-gear { display: none; }
select.status-select { border: 2px solid #e8731a; }
.unit-in { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .9375rem; }
.team-table { table-layout: fixed; min-width: 760px; }
.team-table th:nth-child(1) { width: 24%; }
.team-table th:nth-child(3) { width: 150px; }
.team-table th:nth-child(4) { width: 110px; }
.team-table th:nth-child(5) { width: 84px; }
.team-table input { min-width: 0; }
@media (max-width: 860px) {
  .nav a.nav-gear { display: grid; place-items: center; padding: 6px 12px; }
}

/* ---------- versjon 1.5: justert kapasitet, egne typer ---------- */
.bar-stack { position: relative; }
.cap-mark { position: absolute; left: -10px; right: -10px; height: 0; border-top: 3px solid var(--text); box-shadow: 0 0 0 1px var(--surface); pointer-events: none; }
.cap-key { display: inline-block; width: 18px; border-top: 3px solid var(--text); }
.center { text-align: center; }
.cal-btn { width: 44px; height: 44px; color: var(--text); }
.cal-btn.is-set { border-color: #e8731a; border-width: 2px; }
.team-table { min-width: 880px; }
.team-table th:nth-child(4) { width: 170px; }
.team-table th:nth-child(5) { width: 110px; }
.team-table th:nth-child(6) { width: 84px; }
.adj-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 10px; }
.adj-later span { color: var(--muted); }
.type-row { display: grid; grid-template-columns: 14px minmax(0, 300px) auto auto; gap: 12px; align-items: center; margin-bottom: 8px; justify-content: start; }
.type-row .check { margin: 0; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 860px) {
  .adj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .type-row { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .type-row .check { grid-column: 2 / -1; grid-row: 2; white-space: normal; }
}

@media print {
  .side, .fab, .no-print, .toast, .tip { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .status-group, .panel { break-inside: avoid; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .card, .nav a { transition: background-color .12s, border-color .12s; }
}
