:root {
  --ink: #1c2b29; --muted: #5b6966; --line: #dbe2e0; --bg: #f4f6f5; --card: #fff;
  --brand: #14453f; --brand-2: #1d5f57; --tint: #e3eeeb; --amber: #e5a43b;
  --yes: #1f7a4d; --yes-bg: #e0f2e7; --work: #805300; --work-bg: #fcefd3; --no: #a5342a; --no-bg: #fbe6e3;
  --r: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Segoe UI Variable Text", "Segoe UI", -apple-system, "Helvetica Neue", sans-serif; }
a { color: var(--brand-2); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1.125rem; line-height: 1.35; font-weight: 650; }
h3 { font-size: .9375rem; font-weight: 650; margin: 18px 0 4px; }
ul { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--muted); font-weight: 400; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 9; background: #fff; padding: 8px 12px; }

/* Ramme */
.top { display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand); font-size: 1.125rem; font-weight: 650; text-decoration: none; }
.me { margin-left: auto; display: flex; align-items: center; gap: 20px; font-size: .9375rem; }
.me a { text-decoration: none; color: var(--ink); }
.me a:hover { text-decoration: underline; }
.menu { display: none; }
main { max-width: 1120px; padding: 32px 32px 72px; margin: 0 auto; }
.has-nav { display: grid; grid-template: 60px 1fr / 248px minmax(0, 1fr); min-height: 100vh; }
.has-nav .top { grid-column: 1 / -1; }
.has-nav main { width: 100%; margin: 0; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 20px 12px; }
.side .ws { display: block; padding: 0 12px 16px; text-decoration: none; color: var(--ink); line-height: 1.35; }
.side .ws span { display: block; font-size: .875rem; color: var(--muted); }
.side ul { padding: 10px 0; border-top: 1px solid var(--line); }
.side li a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .9375rem; }
.side li a:hover { background: var(--bg); }
.side li a[aria-current] { background: var(--tint); color: var(--brand); font-weight: 600; }

.head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.head > div:first-child { flex: 1 1 320px; min-width: 0; }
.lead { color: var(--muted); margin-top: 6px; max-width: 65ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sec { margin: 32px 0 12px; scroll-margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 24px; margin-bottom: 20px; }
.card > h2 { margin-bottom: 12px; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.cardhead a { font-size: .9375rem; white-space: nowrap; }
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Knapper */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid #b9c5c2; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: .9375rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--no); border-color: #dfb5b0; }
.btn.danger:hover { background: var(--no-bg); border-color: var(--no); }
.btn.full { width: 100%; margin-top: 4px; }
.link { border: 0; background: none; padding: 0; font: inherit; color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.link.small { font-size: .8125rem; color: var(--muted); }

/* Skjema */
input, select, textarea { font: inherit; color: inherit; width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #aebbb8; border-radius: 6px; background: #fff; }
textarea { line-height: 1.5; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--brand); flex: none; }
input:focus, select:focus, textarea:focus { outline: 3px solid #bcd6cf; outline-offset: 0; border-color: var(--brand); }
.field { margin-bottom: 18px; min-width: 0; }
.field > label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: .875rem; margin-top: 4px; }
.check label, .opt { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.opt { padding: 6px 0; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 600; font-size: .9375rem; padding: 0; margin-bottom: 4px; }
.form { max-width: 840px; }
.formend { display: flex; gap: 8px; }
.danger form { display: inline; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quick input[name=title] { flex: 1 1 260px; width: auto; }
.quick select, .quick input[type=date] { flex: 0 1 190px; width: auto; }
section > .quick { margin-top: 16px; }
.filter { max-width: 360px; margin-bottom: 12px; }

/* Meldinger */
.flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: 20px; background: var(--yes-bg); color: #12492e; }
.flash.warn { background: var(--work-bg); color: #593a00; }
.flash.err { background: var(--no-bg); color: #7c241c; }
.flash a { color: inherit; }
.copy { display: flex; gap: 8px; margin-bottom: 20px; }
.empty { padding: 48px 24px; text-align: center; border: 1px dashed #b9c5c2; border-radius: var(--r); color: var(--muted); }
.empty .btn { margin-top: 16px; }

/* Status */
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .875rem; font-weight: 600; white-space: nowrap; width: fit-content; background: #e9eeec; color: #43514e; }
.pill.yes { background: var(--yes-bg); color: var(--yes); }
.pill.work { background: var(--work-bg); color: var(--work); }
.pill.no { background: var(--no-bg); color: var(--no); }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.prio { color: var(--no); font-size: .875rem; }
.check-note { color: var(--work); font-weight: 600; font-size: .9375rem; }
.late { color: var(--no); font-weight: 600; }
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 16px; }
.seats a { display: flex; flex-direction: column; height: 100%; min-height: 92px; padding: 11px 14px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); text-decoration: none; line-height: 1.35; overflow-wrap: anywhere; }
.seats a:hover { border-color: currentColor; }
.seats .role { font-size: .875rem; margin-bottom: 4px; }
.seats .st { font-size: .875rem; margin-top: auto; padding-top: 4px; }
.seats .yes { background: var(--yes-bg); }
.seats .yes .st { color: #17613d; font-weight: 600; }
.seats .work { background: var(--work-bg); }
.seats .work .st { color: #6d4700; font-weight: 600; }
.seats .open { background: #fff; border: 1px dashed #8b9b97; }
.seats .open strong { font-weight: 400; color: var(--muted); }
.seats .open .st { color: var(--muted); }
.hero h2 { font-size: 1.375rem; }

/* Lister */
.card.list { padding: 0 24px; }
.person { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 220px; gap: 8px 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.list > :first-child { border-top: 0; }
.who span, .sub { display: block; font-size: .9375rem; }
.sub { color: var(--muted); }
.what { max-width: 62ch; }
.what p + p { margin-top: 6px; }
.person .meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: .9375rem; }
.person .meta form { width: 100%; }
.rowitem { display: flex; justify-content: space-between; align-items: center; gap: 8px 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.rowitem > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.rowactions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 16px; font-size: .9375rem; }
.rowactions .inline { display: flex; gap: 8px; }
.tasks li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.tasks li:first-child { border-top: 0; }
.tasks li a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.tasks li a:hover { text-decoration: underline; }
.tasks p { color: var(--muted); font-size: .9375rem; margin-top: 2px; }
.tasks .meta { text-align: right; font-size: .9375rem; color: var(--muted); }
.tasks .meta span { display: block; }
.tasks .meta .late { color: var(--no); }
.tasks .done > div a { color: var(--muted); text-decoration: line-through; }
.tick { position: relative; width: 24px; height: 24px; padding: 0; border: 2px solid #8b9b97; border-radius: 6px; background: #fff; cursor: pointer; font-size: 0; }
.tick::before { content: ""; position: absolute; inset: -10px; }
.tick::after { content: ""; position: absolute; left: 6px; top: 1px; width: 6px; height: 12px; border: solid transparent; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.tick:hover { border-color: var(--brand); }
.tick:hover::after { border-color: #a9c3bd; }
.done .tick { background: var(--yes); border-color: var(--yes); }
.done .tick::after { border-color: #fff; }
.log li { padding: 10px 0; border-top: 1px solid var(--line); font-size: .9375rem; overflow-wrap: anywhere; }
.log li:first-child { border-top: 0; }
.log time { display: block; color: var(--muted); font-size: .875rem; }
.logform { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tablewrap { padding: 4px 24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .875rem; color: var(--muted); font-weight: 600; }
th, td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td { font-size: .9375rem; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.note { display: flex; flex-direction: column; gap: 8px; margin: 0; color: var(--ink); text-decoration: none; }
.note:hover { border-color: var(--brand); }
.note p { font-size: .9375rem; flex: 1; }
.note .muted { font-size: .875rem; }
.scen { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: start; }
.scen .card { margin: 0; }
.scen .chosen { border: 2px solid var(--yes); }
.setup { background: var(--bg); border-radius: 6px; padding: 12px 14px; margin-top: 6px; }
dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.doc { max-width: 800px; }
.doc > h3:first-child { margin-top: 0; }
.doc p { max-width: 70ch; }
.sheet { padding: 40px 48px; }
.sheet h2 { font-size: 1.5rem; }
.sheet table { margin: 28px 0; }
.sheet td { font-size: 1rem; }
.org { color: var(--muted); }
.steps { margin: 0 0 14px; padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.steps + p { margin-bottom: 14px; }

/* Innlogging */
.auth main { max-width: 420px; padding: 11vh 20px 40px; }
.authbrand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; color: var(--brand); font-size: 1.625rem; font-weight: 650; letter-spacing: -.01em; }
.authbox .card { padding: 28px; }
.authbox h1 { font-size: 1.375rem; margin-bottom: 18px; }
.authbox .card > p { margin-bottom: 16px; }
.authbox .center { margin: 18px 0 0 !important; text-align: center; }

@media (max-width: 980px) {
  .cols, .cols.even { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .person { grid-template-columns: minmax(0, 1fr) 210px; }
  .person .what { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .has-nav { display: block; }
  .top { padding: 0 16px; gap: 12px; }
  .menu { display: block; min-height: 40px; padding: 0 12px; border: 1px solid #b9c5c2; border-radius: 6px; background: #fff; font: inherit; font-weight: 600; }
  .has-nav .brand span { display: none; }
  .me { gap: 14px; font-size: .875rem; }
  .plain .top, .has-nav .top { height: auto; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
  .me { flex-wrap: wrap; justify-content: flex-end; flex: 1; }
  .side { display: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .side.open { display: block; }
  main { padding: 24px 16px 56px; }
  h1 { font-size: 1.5rem; }
  .seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 18px 16px; }
  .card.list, .tablewrap { padding: 0 16px; }
  .grid, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .person { grid-template-columns: minmax(0, 1fr); }
  .person .what { grid-row: auto; }
  .rowitem { flex-direction: column; align-items: flex-start; }
  .rowactions { justify-content: flex-start; }
  .rowactions .inline { flex-wrap: wrap; }
  .tasks li { grid-template-columns: 24px minmax(0, 1fr); }
  .tasks .meta { grid-column: 2; text-align: left; display: flex; flex-wrap: wrap; gap: 0 14px; }
  #cands thead { display: none; }
  #cands tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  #cands td { display: block; border: 0; padding: 2px 0; }
  #cands td[data-l]:empty { display: none; }
  #cands td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); }
  .sheet { padding: 24px 16px; }
  .sheet th, .sheet td { padding-right: 8px; font-size: .875rem; }
  dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dd { margin-bottom: 10px; }
}
[hidden] { display: none !important; }
@media print {
  .top, .side, .head, .flash, .noprint { display: none !important; }
  body, .has-nav { display: block; background: #fff; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; max-width: none; }
}

main:focus { outline: 0; }
.busy::before { content: ""; position: fixed; z-index: 10; inset: 0 0 auto; height: 3px; background: var(--amber); transform-origin: left; animation: busy 2s ease-out .15s both; }
@keyframes busy { from { transform: scaleX(0); } to { transform: scaleX(.9); } }
@media (prefers-reduced-motion: reduce) { .busy::before { animation: none; } }
.muted + .btn { margin-top: 12px; }
.opts { display: flex; flex-wrap: wrap; gap: 0 24px; margin-bottom: 8px; }
.others { display: block; font-size: .9375rem; margin-bottom: 5px; }
.people small { display: block; color: var(--muted); font-size: .875rem; margin-top: 4px; }
.more { border: 0; background: none; padding: 4px 0; font: inherit; font-size: .9375rem; color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.more:hover { color: var(--brand); }
.card > .more { margin: -8px 0 12px; }
.brief { color: var(--muted); font-size: .9375rem; margin-top: 2px; }
.brief .more { padding: 0; }
dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; padding: 28px 32px; border: 0; border-radius: 12px; color: var(--ink); box-shadow: 0 16px 48px rgb(12 40 36 / .28); }
dialog::backdrop { background: rgb(16 40 37 / .5); }
dialog h2 { font-size: 1.25rem; margin-bottom: 14px; }
.prose { font-size: 1rem; }
.prose p, .prose ol { margin: 0 0 14px; }
.tasks .prose p { color: inherit; font-size: inherit; margin: 0 0 14px; }
.prose ol { padding-left: 24px; }
.prose li, .tasks .prose li { display: list-item; padding: 0 0 6px 4px; border: 0; }
@media print { .more { display: none; } }
@media (max-width: 760px) { dialog { padding: 22px 20px; } }
.side li a .count { float: right; min-width: 24px; padding: 0 7px; border-radius: 12px; background: var(--brand); color: #fff; font-size: .8125rem; line-height: 24px; font-weight: 600; text-align: center; }
.tasks + .list { border-top: 1px solid var(--line); }
.card > p + .btn { margin-top: 14px; }
fieldset > p { font-size: .9375rem; }
.result { max-width: 900px; }
.result fieldset { margin: 0; padding: 18px 0 12px; border-top: 1px solid var(--line); }
.result fieldset:first-of-type { border-top: 0; }
.result legend { float: left; width: 100%; font-size: 1.0625rem; margin: 0; }
.result fieldset > p { clear: both; margin-bottom: 10px; }
.resrow { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 3fr) 110px; gap: 0 16px; }
.resrow .field { margin-bottom: 8px; }
.confirm { padding: 18px 0 22px; border-top: 1px solid var(--line); }
.confirm .opt { margin-bottom: 14px; flex-wrap: nowrap; }
@media (max-width: 760px) { .resrow { grid-template-columns: minmax(0, 1fr); } }
