:root {
  --bg: #07090F;
  --bg-2: #0E1118;
  --line: #262A33;
  --line-2: #3A3F4A;
  --cream: #F4F0E8;
  --muted: #A39E91;
  --dim: #6F6B62;
  --green: #2A8C55;
  --green-hi: #3BA86B;
  --green-ink: #0D2A1A;
  --brick: #C2654F;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--cream); }
button { font: inherit; color: inherit; }
::selection { background: var(--green); color: #fff; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--cream); color: var(--bg); padding: 8px 12px; }

/* Topbar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.brand .product {
  font-family: var(--serif); font-style: italic; color: var(--muted);
  font-size: 17px; padding-left: 14px; border-left: 1px solid var(--line-2);
}
.topbar .meta { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--muted); }
.save-state { display: inline-flex; align-items: center; gap: 8px; min-height: 20px; }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); transition: background .3s; }
.save-state.ok .dot { background: var(--green-hi); }
.save-state.busy .dot { background: var(--muted); animation: pulse 1s infinite; }
.save-state.warn .dot { background: var(--brick); }
@keyframes pulse { 50% { opacity: .3; } }

/* Progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--green); transition: width .6s var(--ease); }

/* Stage and screens */
.stage { min-height: 100vh; min-height: 100dvh; position: relative; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 110px 28px 150px;
  opacity: 0; visibility: hidden; transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease), visibility 0s linear .55s;
}
.screen.active {
  position: relative; opacity: 1; visibility: visible; transform: none;
  transition: opacity .55s var(--ease) .12s, transform .55s var(--ease) .12s, visibility 0s;
}
.screen.leaving { opacity: 0; transform: translateY(-18px); }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; }

/* Start */
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--green-hi); margin: 0 0 22px; }
.hero {
  font-family: var(--serif); font-weight: normal;
  font-size: clamp(44px, 8.5vw, 96px); line-height: 1.02; letter-spacing: -.02em;
  margin: 0 0 26px;
}
.hero em { color: var(--green-hi); }
.lede { font-size: 19px; color: var(--muted); max-width: 560px; margin: 0 0 40px; }

.field-label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.title-input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-2);
  color: var(--cream); font-family: var(--serif); font-size: 28px; padding: 6px 0 12px; outline: none;
  transition: border-color .25s;
}
.title-input::placeholder { color: var(--dim); }
.title-input:focus { border-color: var(--green); }

fieldset.modes { padding: 0; min-width: 0; margin-inline: 0; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 34px 0 36px; border: 1px solid var(--line); }
.mode { position: relative; cursor: pointer; padding: 20px 22px; display: block; }
.mode + .mode { border-left: 1px solid var(--line); }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode .name { font-family: var(--serif); font-size: 22px; display: block; margin-bottom: 4px; }
.mode .info { font-size: 14px; color: var(--muted); }
.mode .tick {
  position: absolute; top: 20px; right: 20px; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line-2); transition: all .25s;
}
.mode:has(input:checked) { background: var(--bg-2); }
.mode:has(input:checked) .tick { border-color: var(--green-hi); background: var(--green-hi); box-shadow: inset 0 0 0 3px var(--bg-2); }
.mode:has(input:focus-visible) { outline: 2px solid var(--green-hi); outline-offset: -2px; }

.how { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.how li { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.how b { display: block; font-family: var(--serif); font-weight: normal; color: var(--cream); font-size: 17px; margin-bottom: 4px; }
.how .n { font-family: var(--serif); color: var(--green-hi); font-size: 14px; display: block; margin-bottom: 6px; }

/* Buttons */
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1px solid var(--line-2); background: transparent; color: var(--cream);
  padding: 13px 22px; font-size: 15px; cursor: pointer; border-radius: 2px;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
}
.btn:hover { border-color: var(--cream); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--green-hi); outline-offset: 3px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-hi); border-color: var(--green-hi); }
.btn.big { padding: 17px 30px; font-size: 17px; }
.btn.ghost { border-color: transparent; color: var(--muted); padding-left: 6px; padding-right: 6px; }
.btn.ghost:hover { color: var(--cream); }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.resume-note { font-size: 14px; color: var(--muted); }

/* Chapter splash */
.chapter-splash { text-align: left; cursor: pointer; }
.chapter-splash .count { font-family: var(--serif); color: var(--green-hi); font-size: 18px; margin-bottom: 18px; }
.chapter-splash h2 { font-family: var(--serif); font-weight: normal; font-size: clamp(40px, 7vw, 76px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -.015em; }
.chapter-splash p { font-size: 19px; color: var(--muted); margin: 0; }
.chapter-splash .rule { height: 2px; width: 0; background: var(--green); margin: 30px 0 0; transition: width 1.4s var(--ease); }
.screen.active .chapter-splash .rule { width: 120px; }

/* Question */
.q-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 26px; font-size: 13px; color: var(--muted); }
.q-head .chap { color: var(--green-hi); letter-spacing: .08em; text-transform: uppercase; }
.q-num {
  position: absolute; right: -10px; top: -70px; z-index: -1;
  font-family: var(--serif); font-size: clamp(140px, 22vw, 260px); line-height: 1; color: var(--bg-2);
  pointer-events: none; user-select: none;
}
.q-body { position: relative; }
.q-text { font-family: var(--serif); font-weight: normal; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 14px; }
.q-why { color: var(--muted); font-size: 15px; margin: 0 0 30px; display: flex; gap: 8px; }
.q-why::before { content: ""; flex: 0 0 18px; height: 1px; background: var(--green); margin-top: 11px; }
.answer {
  width: 100%; min-height: 150px; max-height: 46vh; resize: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 2px;
  color: var(--cream); font-family: var(--sans); font-size: 18px; line-height: 1.55;
  padding: 18px 20px; outline: none; transition: border-color .25s, background .25s;
}
.answer::placeholder { color: var(--dim); }
.answer:focus { border-color: var(--green); background: #10141C; }
.answer-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin: 8px 2px 0; }

.basis { margin: 24px 0 0; }
.basis-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; transition: all .2s;
}
.chip:hover { color: var(--cream); border-color: var(--cream); }
.chip[aria-pressed="true"] { background: var(--cream); color: var(--bg); border-color: var(--cream); }
.chip[data-basis="malt"][aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--green-hi); outline-offset: 2px; }

.q-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.q-nav .right { display: flex; gap: 10px; align-items: center; }
.kbd-hint { font-size: 12px; color: var(--dim); margin-top: 14px; }
.kbd-hint kbd { font-family: var(--sans); border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 3px; font-size: 11px; }

/* Chapter map */
.chapmap {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 16px 28px 20px; background: var(--bg); border-top: 1px solid var(--line);
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.chapmap.show { opacity: 1; pointer-events: auto; }
.chapmap ol { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; display: flex; gap: 4px; }
.chapmap li { flex: 1; }
.chapmap button {
  width: 100%; height: 22px; background: none; border: 0; padding: 0; cursor: pointer; position: relative;
}
.chapmap button::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 4px; background: var(--line);
  transition: background .3s;
}
.chapmap button i { position: absolute; left: 0; bottom: 8px; height: 4px; background: var(--green); transition: width .5s var(--ease); }
.chapmap button.current::before { background: var(--line-2); }
.chapmap button:hover::before { background: var(--dim); }
.chapmap button:focus-visible { outline: 2px solid var(--green-hi); }
.chapmap .label { max-width: 760px; margin: 2px auto 0; font-size: 12px; color: var(--dim); display: flex; justify-content: space-between; }

/* Contact */
.screen-title { font-family: var(--serif); font-weight: normal; font-size: clamp(36px, 6vw, 60px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -.015em; }
.screen-title em { color: var(--green-hi); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 26px; margin: 34px 0 26px; }
.input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-2);
  color: var(--cream); font-size: 18px; padding: 8px 0 10px; outline: none; transition: border-color .25s; border-radius: 0;
}
.input:focus { border-color: var(--green); }
.input::placeholder { color: var(--dim); }
.input.invalid { border-color: var(--brick); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--muted); margin: 0 0 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green); flex: 0 0 18px; }
.check a { color: var(--cream); }
.err { color: var(--brick); font-size: 14px; min-height: 20px; margin: 10px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Done */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); margin: 36px 0 28px; }
.stat { padding: 20px 22px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .v { font-family: var(--serif); font-size: 40px; color: var(--green-hi); line-height: 1; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 8px; }
.basisbar { display: flex; height: 8px; margin: 6px 0 10px; background: var(--line); }
.basisbar span { display: block; height: 100%; transition: width .8s var(--ease); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.c-malt { background: var(--green-hi); }
.c-erfaring { background: #8AA6C1; }
.c-antakelse { background: #C9A85C; }
.c-vet_ikke { background: var(--dim); }
.c-none { background: var(--line-2); }
.callout { border-left: 2px solid var(--green); padding: 4px 0 4px 18px; color: var(--muted); margin: 26px 0; }
.callout b { color: var(--cream); font-weight: normal; font-family: var(--serif); font-size: 18px; display: block; margin-bottom: 4px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(4, 6, 10, .78); }
.modal.open { display: flex; }
.modal .box { background: var(--bg-2); border: 1px solid var(--line-2); max-width: 520px; width: 100%; padding: 30px; }
.modal h3 { font-family: var(--serif); font-weight: normal; font-size: 26px; margin: 0 0 10px; }
.modal p { color: var(--muted); margin: 0 0 18px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line-2); color: var(--cream); padding: 11px 12px; font-size: 14px; }

/* Footer */
.foot {
  border-top: 2px solid var(--green); padding: 22px 28px; display: flex; justify-content: space-between; gap: 20px;
  font-size: 13px; color: var(--dim); flex-wrap: wrap;
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--cream); }
body.in-flow .foot { display: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); z-index: 70;
  background: var(--cream); color: var(--bg); padding: 10px 16px; font-size: 14px; border-radius: 2px;
  opacity: 0; transition: all .35s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .topbar { padding: 14px 16px; }
  .brand img { height: 22px; }
  .brand .product { font-size: 15px; padding-left: 10px; }
  .topbar .meta .hide-sm { display: none; }
  .screen { padding: 92px 16px 140px; justify-content: flex-start; }
  .modes, .grid2, .stats { grid-template-columns: 1fr; }
  .mode + .mode, .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .how { grid-template-columns: 1fr; gap: 18px; margin-top: 40px; }
  .q-num { top: -40px; right: -4px; }
  .answer { font-size: 17px; min-height: 130px; }
  .q-nav { gap: 8px; }
  .q-nav .btn { padding: 12px 16px; }
  .chapmap { padding: 12px 16px 14px; }
  .chapmap .label { display: none; }
  .foot { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* Rettelser */
[hidden] { display: none !important; }
.save-state:not(.ok):not(.busy):not(.warn) { visibility: hidden; }
@media (hover: none) { .kbd-hint { display: none; } }
@media (min-width: 900px) { .q-num { right: -110px; top: -60px; } }

/* Vedlegg og finskrift */
.files { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.file-btn {
  display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: 2px; padding: 9px 14px; font-size: 14px; cursor: pointer; transition: all .2s;
}
.file-btn:hover { color: var(--cream); border-color: var(--cream); }
.file-btn:focus-visible { outline: 2px solid var(--green-hi); outline-offset: 2px; }
.file-btn[disabled] { opacity: .5; cursor: progress; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.file-list li {
  display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line);
  padding: 6px 6px 6px 12px; font-size: 13px; color: var(--cream); max-width: 100%;
}
.file-list li .nm { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li .sz { color: var(--dim); }
.file-list li.busy { color: var(--muted); }
.file-list button { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 2px 6px; font-size: 16px; line-height: 1; }
.file-list button:hover { color: var(--brick); }
.fineprint { font-size: 12px; line-height: 1.5; color: var(--dim); margin: 14px 0 0; max-width: 640px; }
.fineprint a { color: var(--muted); }

/* v1.8: svarboks med vedlegg, lenke på nytt, tynne kapitler */
.answer-box { border: 1px solid var(--line); background: var(--bg-2); border-radius: 2px; transition: border-color .25s, background .25s; }
.answer-box:focus-within { border-color: var(--green); background: #10141C; }
.answer-box.drag { border-color: var(--green-hi); border-style: dashed; }
.answer-box .answer { border: 0; background: transparent; }
.answer-box .answer:focus { background: transparent; }
.answer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 10px 12px; border-top: 1px solid var(--line); }
.answer-bar .answer-meta { margin: 0; display: flex; gap: 14px; font-size: 12px; color: var(--dim); }
.answer-bar .file-btn { border-style: solid; border-color: var(--line-2); padding: 7px 12px; font-size: 13px; }
.answer-bar .file-btn[disabled] { opacity: .45; cursor: not-allowed; }
.file-list:not(:empty) { margin-top: 10px; }
.relink { margin: 30px 0 0; max-width: 520px; }
.relink-row { display: flex; gap: 12px; align-items: flex-end; }
.relink-row .input { flex: 1; font-size: 16px; }
.relink-msg { font-size: 14px; color: var(--muted); min-height: 20px; margin: 8px 0 0; }
.thin { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.thin b { color: var(--cream); font-weight: normal; }
@media (max-width: 720px) {
  .answer-bar { flex-wrap: wrap; }
  .relink-row { flex-direction: column; align-items: stretch; }
}

/* Booking (v1.9) */
.book .screen { justify-content: flex-start; padding-top: 130px; }
.bk-note { color: var(--muted); font-size: 15px; }
.bk-note a { color: var(--cream); }
.bk-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin: 8px 0 22px; scrollbar-width: thin; }
.bk-day { flex: 0 0 auto; background: transparent; border: 1px solid var(--line-2); color: var(--muted); padding: 10px 14px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.bk-day:hover { color: var(--cream); border-color: var(--cream); }
.bk-day.on { background: var(--cream); color: var(--bg); border-color: var(--cream); }
.bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 28px; }
.bk-slot { background: transparent; border: 1px solid var(--line-2); color: var(--cream); padding: 13px 0; cursor: pointer; font-variant-numeric: tabular-nums; font-size: 16px; }
.bk-slot:hover { border-color: var(--green-hi); }
.bk-slot.on { background: var(--green); border-color: var(--green); color: #fff; }
.bk-day:focus-visible, .bk-slot:focus-visible { outline: 2px solid var(--green-hi); outline-offset: 2px; }
.bk-confirm { border-top: 1px solid var(--line); padding-top: 22px; }
.bk-confirm #bk-chosen { font-family: var(--serif); font-size: 24px; margin: 0 0 6px; }
.bk-confirm .bk-note { margin: 0 0 20px; max-width: 560px; }
.bk-done-box { border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 20px 22px; margin: 10px 0 18px; }
.bk-when { font-family: var(--serif); font-size: 24px; margin: 0 0 8px; }
.bk-done-box p { margin: 0 0 6px; }
.bk-done-box a { color: var(--green-hi); }
