/* App-spesifikke tillegg: innlogging, dialoger, statuslinjer. Dokumentstilene ligger i _dok.css. */
.wm { font-weight: 900; letter-spacing: -0.01em; font-size: 19px; line-height: 1; }
.wm i { font-style: normal; color: var(--accent); }

dialog.dlg {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  box-shadow: var(--shadow-xl);
  font-family: var(--font-sans);
  color: var(--text-default);
}
dialog.dlg::backdrop { background: rgba(3, 38, 54, 0.55); }
.dlg header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: var(--navy-800); color: #fff; }
.dlg header h3 { margin: 0; font-size: 16px; font-weight: 900; color: #fff; }
.dlg header button { font: inherit; font-size: 20px; line-height: 1; background: transparent; border: 0; color: var(--navy-100); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.dlg header button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.dlg .body { padding: 16px 20px 20px; overflow-y: auto; max-height: calc(min(80vh, 720px) - 56px); }
.dlg .body p { font-size: 13.5px; margin: 0 0 12px; }
.dlg .rev { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-default); font-size: 13.5px; }
.dlg .rev:last-child { border-bottom: 0; }
.dlg .rev span { flex: 1; min-width: 0; }
.dlg .rev small { display: block; color: var(--text-muted); font-size: 12px; }
.btn {
  font-family: inherit; font-size: 13px; font-weight: 800; border: 0; cursor: pointer;
  border-radius: 999px; padding: 9px 18px; background: var(--accent); color: #fff; white-space: nowrap;
}
.btn:hover { background: var(--orange-600); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.sec { background: var(--navy-50); color: var(--navy-800); }
.btn.sec:hover { background: var(--navy-100); }
.btn.sm { font-size: 12px; padding: 6px 12px; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }

.fld { display: block; margin: 0 0 14px; }
.fld span { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy-700); margin: 0 0 4px; }
.fld input, .fld select {
  width: 100%; font: inherit; font-size: 15px; color: var(--navy-900);
  border: 1.5px solid var(--border-default); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.fld input:focus, .fld select:focus { outline: none; border-color: var(--accent); background: var(--orange-50); }
.fld small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.msg { font-size: 13.5px; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.msg.err { background: var(--danger-soft); color: var(--danger); }
.msg.ok { background: var(--success-soft); color: var(--success); }
.msg:empty { display: none; }

.side .stat.err { color: var(--orange-300); font-weight: 800; }
.side .link { font: inherit; font-size: 11.5px; font-weight: 700; color: var(--navy-200); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.side .link:hover { color: #fff; }
.adminbar { background: var(--navy-50) !important; border-color: var(--navy-300) !important; }
.adminbar b { background: var(--navy-800) !important; }
.adminbar a { font-weight: 800; }

body.loading .main{visibility:hidden}
/* «Flere valg»-meny nederst i sidepanelet */
.side .more { position: relative; }
.side #morebtn { width: 100%; }
.side .menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 30;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-xl); padding: 6px;
}
.side .menu[hidden] { display: none; }
.side .acts .menu button, .side .menu a {
  display: block; width: 100%; text-align: left; background: none; border: 0 !important; border-radius: 8px;
  padding: 9px 12px; font: inherit; font-size: 13px; font-weight: 700; color: var(--navy-800); text-decoration: none; cursor: pointer;
}
.side .acts .menu button:hover, .side .menu a:hover, .side .acts .menu button:focus-visible, .side .menu a:focus-visible { background: var(--navy-50); outline: none; }
.side .acts .menu button.dang { color: var(--danger); }
.side .menu hr { border: 0; border-top: 1px solid var(--border-default); margin: 4px 6px; }
.side .menu [hidden] { display: none !important; }
@media (max-width:760px) {
  .app .side { overflow: visible; }
  .app .side .acts { flex-direction: row; align-items: center; gap: 6px; }
  .app .side .acts #rapbtn { padding: 8px 12px; font-size: 12px; }
  .side .more { position: static; }
  .side #morebtn { width: auto; padding: 8px 12px; font-size: 12px; }
  .side .menu { left: auto; right: 10px; bottom: auto; top: calc(100% + 4px); width: 250px; }
  .side .menu #reset, .side .menu #logout, .side .menu #history { display: block; }
}

/* Hjelpetekster («Slik gjør du» og «?»), se js/hjelp.js */
.tip { font-family: inherit; cursor: pointer; border: 0; }
.tip.q {
  display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 6px; padding: 0;
  border-radius: 999px; background: var(--navy-100); color: var(--navy-800);
  font-size: 11px; font-weight: 900; line-height: 1; vertical-align: 1px; text-transform: none; letter-spacing: 0;
}
.tip.q:hover, .tip.q[aria-expanded="true"] { background: var(--navy-800); color: #fff; }
.tip.how {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800;
  background: var(--orange-50); color: var(--orange-700); border-radius: 999px; padding: 5px 12px 5px 5px;
}
.tip.how span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 900; }
.tip.how:hover, .tip.how[aria-expanded="true"] { background: var(--accent); color: #fff; }
.tip.how:hover span, .tip.how[aria-expanded="true"] span { background: #fff; color: var(--accent); }
.tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tipbox {
  position: fixed; z-index: 1000; background: var(--navy-900); color: #fff; border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow-xl); font-size: 13px; line-height: 1.5;
}
.tipbox p { margin: 0 0 7px; }
.tipbox p:last-child { margin: 0; }
.tipbox b { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange-300); margin-bottom: 1px; }
@media print { .tip, .tipbox { display: none !important; } }

/* Rapporter, se js/rapport.js */
.side .rapnext { font-size: 11.5px; color: var(--navy-200); margin: -2px 0 4px; }
.rapdlg { width: min(620px, calc(100vw - 32px)); }
.rapgl { display: flex; gap: 10px; align-items: flex-end; margin: 0 0 12px; }
.rapgl .fld { flex: 1; margin: 0; }
.raplist { display: grid; gap: 6px; margin: 0 0 16px; }
.rapitem {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: #fff; border: 1.5px solid var(--border-default); border-radius: 10px; padding: 9px 12px;
}
.rapitem:hover { border-color: var(--navy-300); }
.rapitem[aria-checked="true"] { border-color: var(--accent); background: var(--orange-50); }
.rapitem .rt { flex: 1; min-width: 0; }
.rapitem .rt b { display: block; font-size: 13.5px; color: var(--navy-900); }
.rapitem .rt small { font-size: 12px; color: var(--text-muted); }
.rapitem .rs { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 3px 9px; background: var(--slate-100); color: var(--slate-600); white-space: nowrap; }
.rapitem.ready .rs { background: var(--success-soft); color: var(--success); }
.rapitem.current .rs { background: var(--orange-50); color: var(--orange-700); }
.rapitem.upcoming { opacity: 0.8; }
.rapdlg .btn#rapmake { width: 100%; padding: 12px; }

body.rapporting { overflow: hidden; }
body.rapporting .app { display: none !important; }
.rap { display: none; }
body.rapporting .rap { display: block; position: fixed; inset: 0; z-index: 900; overflow-y: auto; background: var(--sand-50); }
.raptb { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--navy-800); color: #fff; }
.raptb span { flex: 1; font-weight: 900; }
.rdoc { max-width: 900px; margin: 24px auto 60px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 40px 48px; color: var(--text-default); font-size: 13.5px; line-height: 1.55; }
.rhead { display: flex; gap: 24px; align-items: flex-start; border-bottom: 3px solid var(--navy-800); padding-bottom: 18px; margin-bottom: 22px; }
.rhead img { width: 130px; height: auto; margin-top: 6px; }
.reyebrow { font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.rhead h1 { font-size: 28px; font-weight: 900; color: var(--navy-900); margin: 0 0 4px; line-height: 1.15; }
.rmeta { margin: 0; color: var(--text-muted); font-size: 13px; }
.rstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.rstat { background: var(--navy-50); border-radius: 10px; padding: 12px 14px; }
.rstat b { display: block; font-size: 24px; font-weight: 900; color: var(--navy-800); line-height: 1.1; }
.rstat span { font-size: 12px; color: var(--slate-700); font-weight: 700; }
.rwarn { background: var(--warning-soft); border-left: 4px solid var(--warning); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; font-size: 13px; }
.rsec { margin: 26px 0 0; break-inside: auto; }
.rsec h2 { font-size: 17px; font-weight: 900; color: var(--navy-900); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-default); break-after: avoid; }
.rnote { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.rempty { font-size: 13px; color: var(--text-muted); font-style: italic; margin: 4px 0; }
.rtab { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0 8px; }
.rtab th { text-align: left; font-size: 10.5px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy-700); background: var(--navy-50); padding: 7px 8px; }
.rtab td { padding: 7px 8px; border-bottom: 1px solid var(--border-default); vertical-align: top; white-space: pre-wrap; }
.rtab td.c, .rpuls th:not(:first-child) { text-align: center; }
.rtab tr { break-inside: avoid; }
.rcard { border: 1.5px solid var(--navy-100); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; break-inside: avoid; }
.rcard h3 { font-size: 15px; font-weight: 900; color: var(--navy-900); margin: 0 0 2px; }
.rowner { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; }
.rkv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rkv th { width: 30%; text-align: left; vertical-align: top; font-weight: 800; color: var(--navy-700); padding: 5px 10px 5px 0; }
.rkv td { padding: 5px 0; vertical-align: top; }
.rtxt { white-space: pre-wrap; }
.muted { color: var(--text-muted); }
.rmiss { color: var(--danger); font-weight: 700; }
.rdot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.rdot.g { background: var(--success); } .rdot.y { background: var(--warning); } .rdot.r { background: var(--danger); }
.up { color: var(--success); font-weight: 800; } .down { color: var(--danger); font-weight: 800; }
.rchk { list-style: none; padding: 0; margin: 4px 0 8px; }
.rchk li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border-default); font-size: 12.5px; }
.rchk li span { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--navy-300); border-radius: 4px; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #fff; }
.rchk li.ok span { background: var(--success); border-color: var(--success); }
.rlist { margin: 4px 0; padding-left: 18px; }
.rassess { margin: 10px 0 0; padding: 10px 12px; background: var(--sand-50); border-radius: 8px; }
.rassess b { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy-700); }
.rgrid3 { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0; font-size: 12px; }
.rgrid3 span::before { content: ""; display: inline-block; width: 13px; height: 13px; border: 1.5px solid var(--navy-400); border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.rgrid3 i.rdot { margin-right: 4px; }
.rlines span, .rline { display: block; border-bottom: 1px dotted var(--navy-300); min-height: 26px; font-size: 11.5px; color: var(--text-muted); padding-top: 6px; }
.rq { padding-left: 20px; margin: 4px 0; }
.rq li { margin: 0 0 10px; font-size: 13px; }
.rq .rline { min-height: 30px; }
.rfoot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--border-default); font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 760px) {
  .rdoc { margin: 0; border-radius: 0; padding: 22px 16px; }
  .rhead { flex-direction: column; gap: 10px; }
  .rstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rkv th { width: 38%; }
  .raptb span { display: none; }
}
@media print {
  body.rapporting .rap { position: static; overflow: visible; background: #fff; }
  body.rapporting .rdoc { box-shadow: none; border-radius: 0; margin: 0; padding: 0; max-width: none; }
  body.rapporting dialog { display: none !important; }
  .rstat, .rwarn, .rtab th, .rdot, .rchk li.ok span, .rassess { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Gevinstbiblioteket: smal valgkolonne og klikkbare rader */
.lib th.velg { width: 42px; text-align: center; padding-left: 0 !important; padding-right: 0 !important; font-size: 13px; }
.lib tbody td:first-child { text-align: center; padding-left: 0 !important; padding-right: 0 !important; }
.lib tbody tr:not(.own) { cursor: pointer; }
.lib tbody tr:not(.own):not(.sel):hover td { background: var(--navy-50); }

/* Første side: veiviser («Neste steg») og de tre fasene */
.doc .veiviser { background: var(--orange-50); border: 1.5px solid var(--orange-200, #ffd0ad); border-radius: 16px; padding: 22px 24px; margin: 0 0 8px; }
.doc .veiviser:empty { display: none; }
.doc .veiviser .vv-k { font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange-700); margin: 0 0 6px; }
.doc .veiviser h2 { font-size: 22px; font-weight: 900; color: var(--navy-900); margin: 0 0 6px; }
.doc .veiviser > p { font-size: 14.5px; color: var(--slate-800); margin: 0 0 14px; max-width: 70ch; }
.doc .veiviser .vv-act { display: flex; flex-wrap: wrap; gap: 8px; }
.doc .veiviser .vv-act .btn { font-size: 14px; padding: 11px 20px; }
.doc .veiviser .vv-count { font-size: 12px; font-weight: 800; color: var(--navy-700); margin: 18px 0 6px; }
.doc .vv-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.doc .vv-steps li { margin: 0; }
.doc .vv-steps button {
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 5px 12px 5px 8px;
  background: #fff; border: 1px solid var(--border-default); color: var(--slate-700); display: inline-flex; align-items: center; gap: 6px;
}
.doc .vv-steps button::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--navy-300); box-sizing: border-box; flex: none; }
.doc .vv-steps li.done button { color: var(--navy-800); }
.doc .vv-steps li.done button::before { background: var(--success); border-color: var(--success); box-shadow: inset 0 0 0 3px #fff; }
.doc .vv-steps li.now button { border-color: var(--accent); color: var(--navy-900); }
.doc .vv-steps li.now button::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #fff; }
.doc .veiviser .vv-extra { font-size: 13px; background: #fff; border-left: 4px solid var(--warning); border-radius: 8px; padding: 9px 12px; margin: 14px 0 0; max-width: none; }
.doc .veiviser .vv-extra .link { font: inherit; font-weight: 800; color: var(--navy-800); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.doc p.intro { font-size: 15px; color: var(--slate-800); }
.doc p.hint { font-size: 13px; color: var(--text-muted); margin: -2px 0 8px; }
.doc .faser { list-style: none; padding: 0; margin: 14px 0 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.doc .faser > li { margin: 0; background: #fff; border: 1.5px solid var(--navy-100); border-radius: 14px; padding: 16px 16px 12px; position: relative; }
.doc .faser > li.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--orange-50); }
.doc .faser .fnr { font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange-700); margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.doc .faser .here { font-size: 10.5px; letter-spacing: 0.04em; text-transform: none; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px; }
.doc .faser h3 { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--navy-900); margin: 0 0 2px; font-weight: 900; }
.doc .faser .fsub { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; }
.doc .faser ul { list-style: none; padding: 0; margin: 0; }
.doc .faser ul li { margin: 0; padding: 8px 0; border-top: 1px solid var(--border-default); }
.doc .faser ul a { display: block; font-weight: 800; color: var(--navy-800); text-decoration: none; font-size: 14px; }
.doc .faser ul a:hover { color: var(--accent); }
.doc .faser ul span { display: block; font-size: 12.5px; color: var(--slate-700); line-height: 1.45; }
@media (max-width: 900px) { .doc .faser { grid-template-columns: minmax(0, 1fr); } }
@media print { .doc .veiviser { display: none; } .doc .faser > li.now { box-shadow: none; border-color: var(--navy-100); } .doc .faser .here { display: none; } }

/* GO-LIVE-dato på Roller og ansvar (ved siden av kommune og kontaktperson) */
.doc .meta.m3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.doc .meta .golive input {
  display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; color: var(--navy-900);
  border: 0; border-bottom: 1.5px dotted var(--navy-300); background: transparent; padding: 1px 2px; min-height: 1.5em;
}
.doc .meta .golive input:focus { outline: none; border-bottom-color: var(--accent); background: var(--orange-50); }
.doc .meta .golive small { display: block; font-size: 11.5px; min-height: 1.2em; margin-top: 3px; color: var(--text-muted); }
.doc .meta .golive small.ok { color: var(--success); }
.doc .meta .golive small.err { color: var(--danger); }
@media (max-width: 760px) { .doc .meta.m3 { grid-template-columns: minmax(0, 1fr) !important; } }
