/* Rådgiverportal (/radgiver/) – bygger på studio-shell.css (header/nav/hero) og design-tokens i styles.css.
   Mobil først (≥ 320 px). Innhold maks 820 px, review-editor 1240 px.
   Kort og bokser skal IKKE ha tykk venstre-border som dekor – jevn 1 px ramme. */
.ap-body { padding-bottom: 0; }
.ap-body.ap-has-bottomnav { padding-bottom: calc(var(--sh-bottom-h) + env(safe-area-inset-bottom)); }
@media (min-width: 721px) { .ap-body.ap-has-bottomnav { padding-bottom: 0; } }
.ap-main { max-width: 820px; min-width: 0; overflow-x: hidden; overflow-x: clip; }
.ap-main:has(.ap-login) { max-width: 1120px; }
.ap-loading { display: grid; place-items: center; padding: 60px 0; }
.ap-skel { max-width: 820px; }

/* Typografi */
.ap-h1 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; letter-spacing: -.015em; margin: 6px 0 8px; line-height: 1.15; }
.ap-lead { color: var(--color-text-secondary); font-size: 15.5px; line-height: 1.55; margin: 0 0 22px; max-width: 64ch; }
.ap-h2 { font-size: 16px; font-weight: 700; margin: 30px 0 12px; letter-spacing: -.005em; }
.ap-card .ap-h2:first-child, .ap-card > h2:first-child { margin-top: 0; }
.ap-card .ap-h2 { margin-top: 22px; }
.ap-muted { color: var(--color-text-secondary); font-size: 13px; }
.ap-small { font-size: 12px; }
.ap-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.ap-stack { display: flex; flex-direction: column; gap: 16px; }

/* Kort */
.ap-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; padding: 20px; box-shadow: 0 1px 2px rgba(16, 32, 48, .04), 0 1px 3px rgba(16, 32, 48, .03); min-width: 0; max-width: 100%; }
@media (min-width: 721px) { .ap-card { padding: 22px 24px; } }
.ap-card > p { margin: 0 0 16px; }
.ap-card > p:last-child, .ap-card > p.ap-hint { margin-bottom: 0; }
.ap-card h3 { margin: 0 0 10px; font-size: 16px; letter-spacing: -.005em; }
.ap-card + .ap-card, .ap-card + .ap-stack, .ap-stack + .ap-card, .ap-facts + .ap-card, .ap-msg + .ap-card, .ap-card + .ap-kpis, .ap-lead + .ap-kpis, #as-actions > .ap-card + .ap-card, #as-actions + .ap-card, #as-actions:not(:empty) + .ap-card { margin-top: 16px; }
.ap-empty { padding: 28px 16px; text-align: center; color: var(--color-text-secondary); }
.ap-empty strong { display: block; color: var(--color-text); font-size: 15px; margin-bottom: 4px; }
@media (max-width: 400px) { .ap-card { padding: 16px; border-radius: 14px; } }

/* Oppdragskort («task») */
.ap-card-link { display: block; text-decoration: none; color: inherit; transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast); }
.ap-card-link:hover { border-color: rgba(38, 166, 154, .55); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ap-card-link:active { transform: translateY(0); }
.ap-task { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; }
.ap-task-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--color-primary-bg); color: var(--color-primary-dark); }
.ap-task-icon svg { width: 22px; height: 22px; }
.ap-task-invited .ap-task-icon { background: rgba(245, 158, 11, .14); color: #b45309; }
.ap-task-confirm .ap-task-icon { background: rgba(245, 158, 11, .14); color: #b45309; }
.ap-task-going .ap-task-icon { background: rgba(37, 99, 235, .1); color: #1d4ed8; }
.ap-task-done .ap-task-icon { background: var(--color-border-light); color: var(--color-text-secondary); }
.ap-task-body { min-width: 0; }
.ap-task-top { gap: 6px 8px; }
.ap-task-due { margin-left: auto; white-space: nowrap; }
.ap-card-title { font-weight: 700; font-size: 16.5px; margin: 10px 0 5px; line-height: 1.35; letter-spacing: -.005em; }
.ap-task-meta { color: var(--color-text-secondary); font-size: 13px; line-height: 1.5; }
.ap-card-next { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--color-primary-dark); }
.ap-card-next svg { width: 16px; height: 16px; transition: transform var(--transition-fast); }
.ap-card-link:hover .ap-card-next svg { transform: translateX(3px); }
@media (max-width: 480px) { .ap-task { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; } .ap-task-icon { width: 38px; height: 38px; border-radius: 11px; } .ap-task-icon svg { width: 19px; height: 19px; } .ap-task-due { margin-left: 0; flex: 1 0 100%; } }

/* Hjem-hero */
.ap-home-hero { margin-bottom: 8px; }
.ap-home-hero .sh-title { font-size: clamp(26px, 3vw, 34px); }
.ap-home-hero .sh-eyebrow::first-letter { text-transform: uppercase; }

/* Knapper – store trykkflater */
.ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); border-radius: 12px; padding: 11px 18px; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; min-height: 46px; transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast); }
.ap-btn:hover { background: var(--color-surface-hover); border-color: #cbd5e1; }
.ap-btn:active { transform: translateY(1px); }
.ap-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.ap-btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: 0 6px 16px -8px rgba(38, 166, 154, .7); }
.ap-btn-primary:hover { background: #1e8c82; border-color: #1e8c82; }
.ap-btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.ap-btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.ap-btn-ghost { background: transparent; border-color: transparent; }
.ap-btn-ghost:hover { background: var(--color-surface-hover); border-color: transparent; }
.ap-btn-sm { padding: 8px 12px; font-size: 13.5px; min-height: 36px; border-radius: 10px; white-space: nowrap; }
.ap-btn-lg { min-height: 52px; font-size: 16px; }
.ap-btn-block { width: 100%; }
.ap-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
@media (max-width: 480px) { .ap-actions .ap-btn { flex: 1 1 100%; } }

/* Skjema */
.ap-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; min-width: 0; max-width: 100%; }
.ap-field:last-child { margin-bottom: 0; }
.ap-field label { font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.ap-field input, .ap-field select, .ap-field textarea { display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); font-size: 16px; color: var(--color-text); font-family: inherit; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.ap-field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.ap-field input:hover, .ap-field select:hover, .ap-field textarea:hover { border-color: #cbd5e1; }
.ap-field input:focus, .ap-field select:focus, .ap-field textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--sh-ring); }
.ap-field input::placeholder, .ap-field textarea::placeholder { color: var(--color-text-tertiary); }
/* iOS/WebKit date-felt har stor intrinsisk min-width og sprenger ellers kortet */
.ap-field input[type="date"],
.ap-field input[type="datetime-local"],
.ap-field input[type="time"],
.ap-field input[type="month"],
.ap-field input[type="week"] {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.ap-field input[type="date"]::-webkit-datetime-edit,
.ap-field input[type="datetime-local"]::-webkit-datetime-edit {
    min-width: 0;
    overflow: hidden;
}
.ap-hint { font-size: 12.5px; color: var(--color-text-tertiary); line-height: 1.45; }
.ap-check { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; cursor: pointer; padding: 9px 0; line-height: 1.4; }
.ap-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--color-primary); flex: none; }
.ap-radio-group { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.ap-radio { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 12px; cursor: pointer; background: var(--color-surface); transition: border-color var(--transition-fast), background var(--transition-fast); }
.ap-radio:hover { border-color: #cbd5e1; }
.ap-radio input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--color-primary); flex: none; }
.ap-radio.checked { border-color: var(--color-primary); background: var(--color-primary-bg); }
.ap-error { color: var(--color-danger); font-size: 13.5px; }
.ap-ok { color: #047857; font-size: 13.5px; }

/* Badges – med statusprikk */
.ap-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--color-border-light); color: var(--color-text-secondary); white-space: nowrap; line-height: 1.5; }
.ap-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; flex: none; }
.ap-badge-ok { background: var(--color-success-bg); color: #047857; }
.ap-badge-warn { background: var(--color-warning-bg); color: #b45309; }
.ap-badge-danger { background: var(--color-danger-bg); color: #b91c1c; }
.ap-badge-info { background: rgba(37, 99, 235, .09); color: #1d4ed8; }

/* Definisjonsliste (profil) */
.ap-dl { display: grid; grid-template-columns: minmax(110px, 35%) 1fr; gap: 12px 18px; font-size: 14.5px; margin: 0; line-height: 1.45; }
.ap-dl dt { color: var(--color-text-secondary); }
.ap-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ap-dl dd .ap-badge, .ap-card .ap-badge-wrap .ap-badge { white-space: normal; max-width: 100%; text-align: left; }
@media (max-width: 400px) { .ap-dl { grid-template-columns: 1fr; gap: 3px; } .ap-dl dt { font-size: 12px; margin-top: 12px; } .ap-dl dt:first-child { margin-top: 0; } }

/* Onboarding-steg */
.ap-steps { display: flex; gap: 6px; margin: 0 0 16px; }
.ap-step { flex: 1; height: 6px; border-radius: 999px; background: var(--color-border); transition: background var(--transition-base); }
.ap-step.done { background: var(--color-primary); }
.ap-step.active { background: var(--color-primary-light); }
.ap-steplist { list-style: none; padding: 0; margin: 0; }
.ap-steplist li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--color-border-light); font-size: 15px; }
.ap-steplist li:last-child { border-bottom: 0; }
.ap-steplist .ap-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--color-border); display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--color-text-secondary); flex: none; }
.ap-steplist li.done .ap-dot { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Markdown-tekst (avtale) */
.ap-md { font-size: 15px; line-height: 1.65; max-height: 48vh; overflow: auto; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg); }
.ap-md h1 { font-size: 18px; margin: 0 0 10px; }
.ap-md h2 { font-size: 15px; margin: 16px 0 6px; }
.ap-md p { margin: 0 0 10px; }
.ap-md h3 { font-size: 14px; margin: 12px 0 4px; }
.ap-md ul { margin: 0 0 10px; padding-left: 20px; }
.ap-md li { margin: 0 0 4px; }
/* Fulltekst-dokumenter (avtale, personvern): ingen rullefelt, luftig lesevisning */
.ap-doc .ap-md { max-height: none; overflow: visible; border: 0; padding: 0; background: transparent; font-size: 15.5px; }
.ap-doc .ap-md h1 { font-size: 22px; margin: 0 0 14px; letter-spacing: -.01em; }
.ap-doc .ap-md h2 { font-size: 16px; margin: 22px 0 6px; color: var(--color-text); }
.ap-md-dialog { max-height: 55vh; }
.ap-list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ap-list-plain li { padding: 8px 0; border-bottom: 1px solid var(--color-border-light); }
.ap-list-plain li:last-child { border-bottom: 0; padding-bottom: 0; }
/* Avtale §4: forhåndsvisning av om-oss-kortet slik rådgiveren godkjenner det */
.ap-public-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px dashed var(--color-border); border-radius: 14px; background: var(--color-bg); }
.ap-public-card .ap-portrait { flex: 0 0 auto; }
.ap-public-card p { font-size: 14px; line-height: 1.55; }
@media (max-width: 480px) { .ap-public-card { flex-direction: column; } }
/* Global merknad over innholdet (oppgjørsmodus, ny avtale, profilgodkjenning) */
.ap-notice-wrap { max-width: 820px; width: 100%; margin: 0 auto; padding: clamp(14px, 2vw, 22px) var(--sh-gutter) 0; }
.ap-notice { margin: 0 0 10px; padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.5; border: 1px solid transparent; box-shadow: var(--shadow-sm); }
.ap-notice-info { background: var(--color-primary-bg); color: var(--color-primary-dark); border-color: rgba(15, 118, 110, .18); }
.ap-notice-warn { background: var(--color-warning-bg); color: #92400e; border-color: rgba(245, 158, 11, .25); }
.ap-notice-wrap .ap-notice a { font-weight: 600; color: inherit; }
.ap-notice-wrap:not([hidden]) + .ap-main { padding-top: 8px; }

/* Portrett / avatar i innhold */
.ap-portrait { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 22px; flex: none; }
.ap-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--color-primary-bg); color: var(--color-primary-dark); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }

/* Toasts / modal */
.ap-toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--sh-bottom-h) + 14px + env(safe-area-inset-bottom)); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 721px) { .ap-toasts { bottom: 18px; } }
.ap-toast { pointer-events: auto; margin: 0 auto; max-width: 480px; width: 100%; background: #111827; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: aptoast .18s ease-out; }
@keyframes aptoast { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ap-toast-error { background: #7f1d1d; }
.ap-toast-ok { background: #065f46; }
.ap-modal { position: fixed; inset: 0; z-index: 300; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: end center; padding: 0; }
@media (min-width: 721px) { .ap-modal { place-items: center; padding: 14px; } }
.ap-modal.hidden { display: none; }
.ap-modal-card { width: 100%; max-width: 520px; background: var(--color-surface); border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-xl); max-height: 92vh; max-height: 92dvh; overflow: auto; animation: apsheet .22s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 721px) { .ap-modal-card { border-radius: 18px; padding: 22px; animation: appop .16s ease-out; } }
@keyframes apsheet { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes appop { from { transform: scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.ap-modal-card h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.005em; }
.ap-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 480px) { .ap-modal-actions .ap-btn { flex: 1 1 45%; } }

/* Logg inn – todelt på desktop (merkevare + skjema), én kolonne på mobil */
.ap-login { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 0 auto; max-width: 480px; }
.ap-login-brand { display: none; }
.ap-login-card { padding: 26px 22px; }
.ap-login-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.ap-login-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: rgba(255, 255, 255, .9); line-height: 1.45; }
.ap-login-points svg { width: 20px; height: 20px; flex: none; color: #4db6ac; margin-top: 1px; }
@media (min-width: 900px) {
  .ap-login { grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); gap: 28px; max-width: none; align-items: stretch; margin-top: clamp(8px, 4vh, 48px); }
  .ap-login-brand { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 48px); }
  .ap-login-brand .sh-title { font-size: clamp(30px, 3.2vw, 40px); max-width: 16ch; }
  .ap-login-card { align-self: center; padding: 34px 32px; }
}
.hidden { display: none !important; }

/* Notater (info/advarsel/ok) */
.ap-note { margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.ap-note-warn { background: var(--color-warning-bg); color: #92400e; border: 1px solid rgba(245, 158, 11, .25); }
.ap-note-ok { background: var(--color-success-bg); color: #065f46; border: 1px solid rgba(16, 185, 129, .25); }
.ap-note-info { background: var(--color-primary-bg); color: var(--color-primary-dark); }

/* ───────────── Oppdrag og review-editor (M3) ───────────── */
/* Nøkkelinfo-fliser (frist, honorar, tid) */
.ap-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.ap-fact { background: var(--color-surface); border: 1px solid var(--color-border-light); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.ap-fact-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-tertiary); margin-bottom: 2px; }
.ap-fact-value { display: block; font-size: 15px; font-weight: 700; color: var(--color-text); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .ap-fact { padding: 9px 10px; } .ap-fact-value { font-size: 14px; } }
/* 320–360 px: tre fakta-kort får ikke plass uten avkorting → frist i full bredde, honorar/tid side om side */
@media (max-width: 360px) { .ap-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .ap-facts .ap-fact:first-child { grid-column: 1 / -1; } .ap-fact-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.ap-msg-top { margin: 0 0 14px; }

.ap-msg { margin-top: 14px; padding: 12px 16px; background: var(--color-primary-bg); border: 1px solid rgba(15, 118, 110, .18); border-radius: 12px; font-size: 14.5px; line-height: 1.5; }
.ap-msg strong { display: block; font-size: 12.5px; color: var(--color-text-secondary); margin-bottom: 4px; }
.ap-linkbtn { background: none; border: 0; padding: 4px 0; color: var(--color-primary-dark); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.ap-linkbtn:hover { text-decoration: underline; }
.ap-linkbtn-danger { color: #b91c1c; }

/* Layout: én kolonne på mobil, artikkel + panel på desktop */
.ap-review-head { margin-bottom: 16px; }
.ap-review-head .ap-row { margin-bottom: 6px; }
.ap-review-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .ap-main:has(.ap-review) { max-width: 1240px; }
  .ap-review-grid { grid-template-columns: minmax(0, 1fr) 372px; align-items: start; gap: 16px; }
  .ap-review-side { position: sticky; top: calc(var(--sh-header-h) + 12px); max-height: calc(100vh - var(--sh-header-h) - 24px); overflow: auto; scrollbar-width: thin; }
}
.ap-review-wrap { padding: 8px 18px 18px; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 400px) { .ap-review-wrap { padding: 6px 10px 12px; } }
/* Artikkel-CSS (artikler.css) bruker --c-* som bare finnes på .article-page. Speil dem her
   slik at sjekklister, kort, CTA og inline-stiler i rå HTML ser like ut som på nettsiden. */
.ap-review-wrap, .ap-review-doc {
    --c-primary: var(--color-primary);
    --c-primary-hover: #1e8c82;
    --c-primary-dark: var(--color-primary-dark);
    --c-primary-bg: var(--color-primary-bg);
    --c-bg: var(--color-bg);
    --c-surface: var(--color-surface);
    --c-text: var(--color-text);
    --c-text-secondary: var(--color-text-secondary);
    --c-text-tertiary: var(--color-text-tertiary);
    --c-border: var(--color-border);
    --c-border-light: var(--color-border-light);
    --c-text-on-dark: #fff;
    --c-text-on-dark-muted: rgba(255, 255, 255, .7);
}
.ap-review-doc { max-width: none; }
.ap-review-doc.article-wrap { max-width: none; padding-left: 0; padding-right: 0; }
.ap-review-doc .article-wrap { max-width: none; }
.ap-review-doc > :first-child, .ap-review-doc > .article-lead-card:first-child { margin-top: 0; } /* offentlig CSS gir 40px etter H1 – i portalen står H1 utenfor kortet */
.ap-review-doc img, .ap-review-doc svg { max-width: 100%; height: auto; }
.ap-review-doc .article-lead-card { background: var(--color-bg); }
.ap-review-doc .article-btn--primary { background: var(--c-primary); color: #fff; }
.ap-review-doc .article-btn--primary:hover { background: var(--c-primary-hover); color: #fff; }
.ap-review-doc .article-btn--ghost { background: transparent; color: var(--c-primary-dark); border: 1.5px solid var(--c-border); }
.ap-review-doc ul:not(.article-checklist),
.ap-review-doc ol {
    margin: 12px 0 18px;
    padding-left: 1.4em;
    line-height: 1.6;
}
.ap-review-doc ul:not(.article-checklist) { list-style: disc; }
.ap-review-doc ol { list-style: decimal; }
.ap-review-doc li { margin: 0 0 8px; }
.ap-review-doc li:last-child { margin-bottom: 0; }
.ap-review-doc .article-checklist { list-style: none; margin: 14px 0 18px; padding: 0; }
.ap-review-doc .article-checklist li { margin: 0; }
.ap-review-doc [data-block-id] { position: relative; scroll-margin-top: calc(var(--sh-header-h) + 16px); }
.ap-review-doc .ap-out-of-scope { opacity: .38; }
.ap-review-doc .ap-in-scope { box-shadow: -3px 0 0 var(--color-primary-light); padding-left: 8px; margin-left: -11px; }
.ap-review-doc .ap-block-commented { box-shadow: -3px 0 0 #f59e0b; padding-left: 8px; margin-left: -11px; }
.ap-review-doc .ap-flash, .ap-comment.ap-flash, mark.ap-flash { animation: apflash 1.5s ease-out; }
@keyframes apflash { 0% { background-color: rgba(37, 99, 235, .28); } 100% { background-color: transparent; } }
.ap-review-faq h2 { font-size: 17px; margin: 18px 0 8px; }
.ap-review-faq details { border-top: 1px solid var(--color-border); padding: 8px 0; }
.ap-review-faq summary { cursor: pointer; font-weight: 600; }
mark.ap-hl { background: rgba(37, 99, 235, .16); border-bottom: 2px solid rgba(37, 99, 235, .7); color: inherit; cursor: pointer; padding: 0 1px; border-radius: 2px; }
mark.ap-hl-important { background: rgba(245, 158, 11, .22); border-bottom-color: #d97706; }
mark.ap-hl-critical { background: rgba(220, 38, 38, .16); border-bottom-color: #dc2626; }
mark.ap-hl-other { background: rgba(107, 114, 128, .14); border-bottom-style: dashed; }
mark.ap-hl-done { opacity: .6; border-bottom-style: dotted; }

/* Kommentarpanel */
.ap-comment { border: 1px solid var(--color-border); border-left-width: 4px; border-radius: 12px; padding: 14px 16px; font-size: 14.5px; line-height: 1.5; background: var(--color-surface); scroll-margin-top: calc(var(--sh-header-h) + 16px); }
.ap-comment-suggestion { border-left-color: #2563eb; }
.ap-comment-important { border-left-color: #d97706; }
.ap-comment-critical { border-left-color: #dc2626; }
.ap-comment-other { background: var(--color-bg); }
.ap-comment-body { margin-top: 8px; white-space: pre-wrap; }
.ap-comment-actions { margin-top: 10px; gap: 16px; }
.ap-quote { margin: 10px 0; padding: 6px 12px; border-left: 3px solid var(--color-border); color: var(--color-text-secondary); font-size: 13.5px; font-style: italic; overflow-wrap: anywhere; }
.ap-suggest { margin-top: 10px; padding: 10px 12px; background: var(--color-success-bg); border-radius: 8px; font-size: 14px; white-space: pre-wrap; }
.ap-suggest .ap-small { display: block; margin-bottom: 2px; }
.ap-reply { margin: 10px 0 0 10px; padding: 8px 12px; border-left: 2px solid var(--color-border); font-size: 14px; white-space: pre-wrap; }
.ap-reply-admin { border-left-color: var(--color-primary); background: var(--color-primary-bg); border-radius: 0 8px 8px 0; }
.ap-review-submit { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--color-border); }
.ap-sev-group { flex-direction: row; flex-wrap: wrap; }
.ap-sev-group .ap-radio { flex: 1 1 30%; padding: 9px 10px; font-size: 14px; }
@media (max-width: 400px) { .ap-sev-group .ap-radio { flex: 1 1 100%; } }

/* Flytende «kommenter»-knapp ved markering: mobil nederst, desktop rett ved markeringen */
/* Mobil handlingslinje for gjennomgang (over bunn-nav) */
.ap-mobilebar { position: fixed; left: 0; right: 0; bottom: calc(var(--sh-bottom-h) + env(safe-area-inset-bottom)); z-index: 140; display: flex; gap: 8px; padding: 10px var(--sh-gutter); background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); border-top: 1px solid var(--color-border-light); }
.ap-mobilebar .ap-btn { flex: 1 1 0; justify-content: center; padding: 11px 12px; }
.ap-mobilebar .ap-btn-ghost { flex: 0 0 auto; background: var(--color-surface); border: 1px solid var(--color-border-light); }
.ap-mobilebar .ap-btn { white-space: nowrap; min-width: 0; }
@media (max-width: 400px) { .ap-mobilebar { gap: 6px; padding: 8px 10px; } .ap-mobilebar .ap-btn { padding: 11px 10px; font-size: 14px; } .ap-mobilebar .ap-btn-ghost { padding-left: 12px; padding-right: 10px; } }
@media (max-width: 360px) { .ap-mobilebar .ap-mb-long { display: none; } }
.ap-mobilebar b { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--color-primary-bg); color: var(--color-primary-dark); font-size: 12px; line-height: 20px; text-align: center; }
.ap-body:has(.ap-mobilebar) { padding-bottom: calc(var(--sh-bottom-h) + 64px + env(safe-area-inset-bottom)); }
.ap-body:has(.ap-mobilebar) .ap-selbar { bottom: calc(var(--sh-bottom-h) + 72px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .ap-mobilebar { display: none; } .ap-body:has(.ap-mobilebar) { padding-bottom: 0; } .ap-body:has(.ap-mobilebar) .ap-selbar { bottom: 20px; } }
@media (min-width: 721px) and (max-width: 899px) { .ap-mobilebar { bottom: 0; } .ap-body:has(.ap-mobilebar) { padding-bottom: 72px; } .ap-body:has(.ap-mobilebar) .ap-selbar { bottom: 80px; } }

.ap-selbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--sh-bottom-h) + 14px + env(safe-area-inset-bottom)); z-index: 150; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.ap-selbar .ap-btn { pointer-events: auto; box-shadow: var(--shadow-lg); }
@media (min-width: 721px) { .ap-selbar { bottom: 20px; } }
.ap-selbar.ap-selbar-float { right: auto; bottom: auto; justify-content: flex-start; animation: apselpop .14s ease-out; }
.ap-selbar.ap-selbar-float .ap-btn-sm { background: var(--color-surface); }
@keyframes apselpop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Bottom sheet for skjema */
.ap-sheet { position: fixed; inset: 0; z-index: 320; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: end center; }
@media (min-width: 721px) { .ap-sheet { place-items: center; padding: 14px; } }
.ap-sheet-card { width: 100%; max-width: 560px; background: var(--color-surface); border-radius: 20px 20px 0 0; padding: 18px 18px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-xl); max-height: 92vh; max-height: 92dvh; overflow: auto; animation: apsheet .22s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 721px) { .ap-sheet-card { border-radius: 18px; padding: 22px; animation: appop .16s ease-out; } }
.ap-noscroll { overflow: hidden; }
/* Kompakt review-visning på små skjermer: fjern doble innrykk fra artikkel-CSS */
@media (max-width: 600px) {
  .ap-review-doc.article-wrap { padding-left: 0; padding-right: 0; }
  .ap-review-doc .article-lead-card { padding: 14px 12px; }
  .ap-review-wrap.ap-card { border-radius: 12px; }
}
/* M4: bekreftelse (diff) og kreditering */
.ap-diff-block { border: 1px solid var(--color-border); border-left-width: 4px; border-radius: 12px; padding: 12px 14px; margin-top: 8px; font-size: 14.5px; line-height: 1.55; }
.ap-diff-block.added { border-left-color: var(--color-success); }
.ap-diff-block.removed { border-left-color: var(--color-danger); }
.ap-diff-block.changed { border-left-color: var(--color-warning); }
.ap-diff ins.rv-diff-ins { background: #d1fae5; color: #065f46; text-decoration: none; border-radius: 3px; padding: 0 2px; }
.ap-diff del.rv-diff-del { background: #fee2e2; color: #991b1b; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.ap-steps { margin: 6px 0 10px; gap: 4px; }
.ap-card-credit { padding: 0; overflow: hidden; }
.ap-card-credit .ap-card-inner { display: grid; padding: 20px; text-decoration: none; color: inherit; border-radius: 0; border: 0; }
@media (min-width: 721px) { .ap-card-credit .ap-card-inner { padding: 22px 24px; } }
.ap-card-credit .ap-card-inner:hover { background: var(--color-surface-hover); transform: none; box-shadow: none; }
.ap-credit { border-top: 1px solid var(--color-border); padding: 16px 20px 18px; background: #fafbfc; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
@media (min-width: 721px) { .ap-credit { padding: 18px 24px 20px; } }
.ap-credit .ap-muted { line-height: 1.5; }
.ap-credit .ap-linkbtn { padding: 4px 0 0; }
.ap-credit-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-secondary); margin-bottom: 2px; }
.ap-diff-legend { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 12px; margin-right: 6px; }
.ap-diff-legend-del { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.ap-diff-legend-ins { background: #d1fae5; color: #065f46; }

/* UX-lag: lenker, hjelpetekster, KPI-er */
.ap-main a:not(.ap-btn):not(.ap-card-link):not(.ap-card-inner):not(.sh-hero-stat):not(.ap-back) { color: var(--color-primary-dark); text-decoration: underline; text-underline-offset: 2px; }
.ap-main a:not(.ap-btn):not(.ap-card-link):not(.ap-card-inner):not(.sh-hero-stat):not(.ap-back):hover { color: var(--color-primary); }

/* Tilbake-lenke (pille med pil) */
.ap-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 6px 12px 6px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--color-text-secondary); background: var(--color-surface); border: 1px solid var(--color-border-light); text-decoration: none; transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast); }
.ap-back::before { content: ''; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M19 12H5M11 6l-6 6 6 6'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M19 12H5M11 6l-6 6 6 6'/></svg>") center / contain no-repeat; }
.ap-back:hover { color: var(--color-primary-dark); border-color: var(--color-border); background: #fff; }
.ap-card-soft { background: var(--color-bg); box-shadow: none; }
.ap-field-title { font-size: 13.5px; font-weight: 600; margin: 0 0 8px; }
.ap-howto { margin: 0; padding-left: 22px; font-size: 14.5px; line-height: 1.55; }
.ap-howto li { margin: 0 0 10px; padding-left: 4px; }
.ap-howto li:last-child { margin-bottom: 0; }
.ap-howto li::marker { font-weight: 700; color: var(--color-primary-dark); }
.ap-howto-compact { font-size: 13.5px; }
.ap-howto-compact li { margin-bottom: 5px; }
.ap-tip { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--color-primary-bg); border: 1px dashed var(--color-primary-light); }
.ap-tip-title { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; color: var(--color-primary-dark); }
.ap-more { margin-top: 28px; }
.ap-more[open] summary { margin-bottom: 12px; }
.ap-more summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.ap-more summary::-webkit-details-marker { display: none; }
.ap-more summary::before { content: '▸'; color: var(--color-text-secondary); font-size: 13px; transition: transform var(--transition-fast); }
.ap-more[open] summary::before { transform: rotate(90deg); }
.ap-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 8px; }
.ap-kpi { margin: 0 !important; padding: 18px; }
.ap-kpi-label { font-size: 12.5px; color: var(--color-text-secondary); line-height: 1.3; min-height: 2.6em; }
.ap-kpi-value { font-size: 24px; font-weight: 800; margin: 6px 0 4px; letter-spacing: -.01em; }
.ap-ledger-row { display: flex; gap: 10px 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--color-border-light); }
.ap-card:has(> .ap-ledger-row) { padding: 0; overflow: hidden; }
.ap-ledger-row:last-child { border-bottom: 0; }

/* Reduser bevegelse for dem som ønsker det */
@media (prefers-reduced-motion: reduce) { .ap-card-link, .ap-btn, .ap-modal-card, .ap-sheet-card, .ap-toast, .sh-menu { transition: none !important; animation: none !important; } }

/* BankID (fase 2) */
.ap-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--color-text-muted); font-size: 13px; }
.ap-or::before, .ap-or::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }
.ap-btn-bankid { background: #39134c; color: #fff; border-color: #39134c; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.ap-btn-bankid:hover { background: #4a1a63; border-color: #4a1a63; }
.ap-btn-bankid img { width: 22px; height: 22px; }
