/* Weibull Deal Studio v28 — utseendet fra Weibull Studio (weibull-ecc).
 * Tokens er hentet fra app/globals.css i weibull-ecc: blekkblå sidemeny, IBM Plex,
 * okerknapper med mørk tekst, hvite kort med hårstrek og 10 px radius.
 * Lysbildene i forhåndsvisningen (.slide) beholder sine egne farger.
 */
html:root {
  --navy: #14213d; --navy2: #14213d; --navy-light: #1f3157; --navy-dim: rgba(20, 33, 61, 0.06);
  --orange: #c8752a; --orange-light: #d07f34; --orange-dim: rgba(200, 117, 42, 0.12);
  --sidebar: #14213d;
  --bg: #f6f7f9; --card: #ffffff; --border: #e5e8ed;
  --text: #1c2430; --text-sec: #4a5570; --text-muted: #656d7f; --ink-dim: #4a5570; --ink-faint: #656d7f;
  --green: #1c7849; --green-bg: #e8f5ee; --red: #b3362b; --red-bg: #fdeeec;
  --radius: 10px;
  --shadow-sm: none; --shadow-md: 0 2px 6px rgb(16 32 64 / 0.07), 0 8px 24px rgb(16 32 64 / 0.07);
  --s28-line: rgb(20 33 61 / 0.11); --s28-control: rgb(20 33 61 / 0.22); --s28-sunken: #eef3fa;
  --s28-warn: #a15c00; --s28-warn-bg: #fdf3e2; --s28-ochre-2: #e9ae5a;
  --s28-sans: 'IBM Plex Sans', 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  --s28-serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
}
/* Lysbildene skal se ut som før — gi dem v26-fargene tilbake */
.slide, #presViewport, #previewSlideGrid { --navy: #14263C; --navy2: #14263C; --orange: #E8871E; --orange-light: #F0A34C; --border: #E4E6EA; --text: #22303F; --text-sec: #5A6675; --text-muted: #8C97A5; }

body { font-family: var(--s28-sans); background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
::selection { background: rgb(152 182 225 / 0.45); }
:focus-visible { outline: 2px solid #a85f1e; outline-offset: 2px; }

/* ── Sidemeny ── */
#sidebar.s28 { width: 256px; background: #14213d; color: #fff; border-right: 0; display: flex; flex-direction: column; flex-shrink: 0; }
.s28-brand { display: flex; align-items: center; gap: 10px; padding: 24px 20px 20px; }
.s28-brand img { height: 32px; width: auto; display: block; border-radius: 0; }
.s28-brand span { font-size: 12px; font-weight: 600; letter-spacing: 0.22em; color: rgb(255 255 255 / 0.55); margin-top: 2px; }
.s28-nav { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.s28-sec { margin-top: 16px; } .s28-sec:first-child { margin-top: 4px; }
.s28-label { padding: 0 20px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(255 255 255 / 0.55); }
#sidebar .s28-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 16px 7px 20px; font-size: 14px; line-height: 1.5; color: rgb(255 255 255 / 0.65); text-decoration: none; cursor: pointer; border-radius: 0; margin: 0; background: transparent; transition: background .15s, color .15s; }
#sidebar .s28-item:hover { background: rgb(255 255 255 / 0.04); color: #fff; }
#sidebar .s28-item.active { background: rgb(255 255 255 / 0.08); color: #fff; font-weight: 500; }
#sidebar .s28-item.active::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 0 3px 3px 0; background: #c8752a; }
.s28-tag { margin-left: auto; border-radius: 4px; background: rgb(255 255 255 / 0.10); padding: 1px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: rgb(255 255 255 / 0.6); }
.s28-foot { border-top: 1px solid rgb(255 255 255 / 0.10); padding: 14px 20px; }
.s28-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.s28-avatar { width: 28px !important; height: 28px !important; flex-shrink: 0; border-radius: 50%; background: rgb(255 255 255 / 0.10) !important; color: #e9ae5a !important; font-size: 12px !important; font-weight: 600 !important; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px rgb(200 117 42 / 0.4); }
.s28-who { flex: 1; min-width: 0; background: transparent; border: 0; color: rgb(255 255 255 / 0.7); font-size: 12px; font-family: inherit; padding: 2px 0; cursor: pointer; }
.s28-who option { color: #1c2430; }
.s28-conf { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: 0.18em; color: rgb(255 255 255 / 0.55); }
.s28-ver { display: none; }

/* ── Toppfelt ── */
.topbar.t28 { position: sticky; top: 0; z-index: 10; height: auto; min-height: 48px; padding: 10px 24px; display: flex; align-items: center; gap: 16px; background: rgb(255 255 255 / 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--s28-line); }
.t28 .topbar-title { font-size: 14px; font-weight: 600; color: #1c2430; font-family: var(--s28-sans); letter-spacing: 0; white-space: nowrap; }
.t28-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.t28-meta { font-size: 12px; color: #656d7f; white-space: nowrap; }
.t28-fig { font-variant-numeric: tabular-nums; }
.t28-save:not(:empty)::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #1c7849; margin-right: 6px; vertical-align: 1px; }
#autosave-ind { opacity: 1 !important; }
.t28-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--s28-line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-family: inherit; color: #4a5570; cursor: pointer; white-space: nowrap; }
.t28-pill .anon-dot { width: 6px; height: 6px; border-radius: 50%; background: #c3c8d2; }
.t28-pill.on { border-color: rgb(200 117 42 / 0.5); color: #14213d; background: #fdf6ea; }
.t28-pill.on .anon-dot { background: #c8752a; }
.t28-mandat { display: flex; align-items: center; gap: 8px; }
.t28-eyebrow, .e28 { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #656d7f; }
.t28-case { border: 1px solid var(--s28-line); background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 14px; font-weight: 500; color: #204478; font-family: inherit; min-width: 220px; max-width: 300px; }
.t28-help { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--s28-line); background: #fff; font-size: 12px; font-weight: 600; color: #4a5570; cursor: pointer; font-family: inherit; }
.t28-help:hover { border-color: rgb(32 68 120 / 0.4); color: #204478; }
.t28-progress { height: 3px; background: rgb(20 33 61 / 0.07); flex-shrink: 0; }
.t28-progress .progress-fill { height: 3px; background: #c8752a !important; border-radius: 0; transition: width .18s; }
.t28-banner { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--s28-line); background: #fdf3e2; padding: 8px 32px; font-size: 12px; color: #1c2430; flex-shrink: 0; }
.t28-banner[hidden] { display: none; }
.t28-banner .dot { width: 6px; height: 6px; border-radius: 50%; background: #a15c00; flex-shrink: 0; transform: translateY(-1px); }
.t28-banner p { flex: 1; margin: 0; }
.t28-banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ── Innholdsflate ── */
.content-area { padding: 28px 32px; }
.view { max-width: 1152px; }
.view-header { margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid #14213d; }
.view-header h1 { font-family: var(--s28-serif) !important; font-weight: 400 !important; font-size: 28px !important; line-height: 1.1; letter-spacing: -0.02em !important; color: #14213d; margin-bottom: 4px; }
.view-header p { font-size: 14px !important; color: #4a5570 !important; line-height: 1.5 !important; max-width: 672px; }
.card, .collapsible, .export-btn-card, .stat-card, .case-card { background: #fff; border: 1px solid var(--s28-line) !important; border-radius: 10px !important; box-shadow: none !important; }
.card { padding: 20px; }
.section-title { font-family: var(--s28-serif) !important; font-size: 16px !important; font-weight: 400 !important; letter-spacing: 0 !important; text-transform: none !important; color: #14213d !important; margin-bottom: 12px; }
.section-title::before { display: none !important; }
.btn { white-space: nowrap; font-family: var(--s28-sans) !important; border-radius: 8px !important; font-weight: 500 !important; font-size: 14px; padding: 8px 14px; box-shadow: none !important; }
.btn-sm { font-size: 12px !important; padding: 4px 10px !important; }
.btn-lg { padding: 10px 18px !important; }
.btn-accent { background: #c8752a !important; color: #14213d !important; }
.btn-accent:hover { background: #d07f34 !important; }
.btn-accent svg { stroke: #14213d !important; }
.btn-primary { background: #14213d !important; color: #fff !important; }
.btn-primary:hover { background: #1f3157 !important; }
.btn-outline { background: #fff !important; border: 1px solid rgb(20 33 61 / 0.25) !important; color: #14213d !important; }
.btn-outline:hover { border-color: rgb(20 33 61 / 0.5) !important; background: #eef3fa !important; }
.form-field input, .form-field textarea, .form-field select, .content-area input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), .content-area textarea, .content-area select {
  font-family: var(--s28-sans); font-size: 14px; border: 1px solid var(--s28-control); border-radius: 8px; background: #fff; color: #1c2430; padding: 7px 10px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus, .content-area input:focus, .content-area textarea:focus, .content-area select:focus { border-color: #a85f1e; outline: none; box-shadow: 0 0 0 3px rgb(200 117 42 / 0.15); }
.field-label, .form-field > label { font-size: 12px !important; font-weight: 600 !important; color: #4a5570 !important; }
.badge { border-radius: 4px !important; font-size: 12px !important; font-weight: 600 !important; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px !important; }
.badge-orange { background: rgb(200 117 42 / 0.15) !important; color: #a85f1e !important; }
.badge-green { background: #e8f5ee !important; color: #1c7849 !important; }
.badge-gray { background: rgb(0 0 0 / 0.05) !important; color: #4a5570 !important; }
.collapsible-header { background: #fff !important; }
.col-num { background: #14213d !important; color: #fff !important; border-radius: 6px !important; font-family: var(--s28-sans) !important; }
.stat-card .st-val { font-family: var(--s28-sans) !important; font-weight: 500 !important; font-size: 28px !important; color: #14213d !important; }
.stat-card .st-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #656d7f; }
.verify-banner { border-radius: 10px !important; }
.dropzone { border-radius: 10px !important; border-color: rgb(20 33 61 / 0.25) !important; background: #fff !important; }
#chat-fab { background: #14213d !important; }

/* ── Dashboard (som Weibull Studio) ── */
.d28 { max-width: 1152px; }
.d28-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #14213d; margin-bottom: 24px; }
.d28-head h1 { font-family: var(--s28-serif); font-weight: 400; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; color: #14213d; margin: 0; }
.d28-head p { margin: 4px 0 0; font-size: 14px; color: #4a5570; max-width: 672px; }
.b28 { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; font-weight: 500; font-size: 14px; padding: 8px 14px; cursor: pointer; font-family: inherit; border: 1px solid rgb(20 33 61 / 0.25); background: #fff; color: #14213d; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.b28:hover { border-color: rgb(20 33 61 / 0.5); background: #eef3fa; }
.b28.p { background: #c8752a; border-color: #c8752a; color: #14213d; }
.b28.p:hover { background: #d07f34; border-color: #d07f34; }
.b28.d { background: #14213d; border-color: #14213d; color: #fff; }
.b28.g { border-color: transparent; background: transparent; color: #4a5570; }
.b28.g:hover { background: rgb(0 0 0 / 0.05); color: #1c2430; }
.b28.sm { padding: 4px 10px; font-size: 12px; }
.b28:disabled { opacity: .5; pointer-events: none; }
.d28-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.k28 { border: 1px solid var(--s28-line); background: #fff; border-radius: 10px; padding: 20px; }
.k28 .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.k28 .val { margin-top: 8px; display: flex; align-items: baseline; gap: 6px; }
.k28 .num { font-size: 28px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums lining-nums; color: #14213d; }
.k28 .num.ok { color: #1c7849; } .k28 .num.warn { color: #a15c00; } .k28 .num.bad { color: #b3362b; }
.k28 .unit { font-size: 12px; font-weight: 500; color: #656d7f; letter-spacing: 0.02em; }
.k28 .sub { margin-top: 4px; font-size: 12px; color: #4a5570; }
.k28 .bar { margin-top: 8px; height: 4px; border-radius: 4px; background: rgb(20 33 61 / 0.07); }
.k28 .bar span { display: block; height: 4px; border-radius: 4px; background: #c8752a; }
.k28 .bar span.full { background: #1c7849; }
.k28 svg { width: 16px; height: 16px; stroke: #656d7f; flex-shrink: 0; }
.d28-row { margin-top: 16px; display: grid; gap: 16px; }
.d28-row.r3 { grid-template-columns: 2fr 1fr; } .d28-row.r2 { grid-template-columns: 1fr 1fr; }
.c28 { border: 1px solid var(--s28-line); background: #fff; border-radius: 10px; padding: 20px; min-width: 0; }
.c28-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.c28-h h2 { font-family: var(--s28-serif); font-weight: 400; font-size: 16px; color: #14213d; margin: 0; }
.c28-h p { margin: 2px 0 0; font-size: 12px; color: #4a5570; }
.c28-h a { font-size: 12px; color: #14213d; text-decoration: none; cursor: pointer; white-space: nowrap; }
.c28-h a:hover { text-decoration: underline; }
.c28 .empty { padding: 40px 0; text-align: center; font-size: 14px; color: #4a5570; }
.c28 .empty a { color: #14213d; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.imp28 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.imp28 li { display: flex; gap: 8px; font-size: 12px; }
.imp28 svg { width: 14px; height: 14px; stroke: #656d7f; flex-shrink: 0; margin-top: 2px; }
.imp28 .t { font-weight: 500; color: #1c2430; } .imp28 .o { color: #656d7f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.task28 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task28 li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #1c2430; }
.task28 li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #c8752a; flex-shrink: 0; }
.m28 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.m28 button { display: flex; width: 100%; align-items: center; gap: 12px; border-radius: 8px; border: 1px solid var(--s28-line); background: #fff; padding: 8px 12px; text-align: left; cursor: pointer; font-family: inherit; }
.m28 button:hover { background: #f7f8fa; }
.m28 button.cur { border-color: rgb(200 117 42 / 0.5); background: #fdf6ea; }
.m28 .n { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: #1c2430; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m28 .sb { width: 96px; height: 4px; border-radius: 4px; background: rgb(20 33 61 / 0.07); flex-shrink: 0; }
.m28 .sb span { display: block; height: 4px; border-radius: 4px; background: #14213d; }
.m28 .p { width: 40px; text-align: right; font-size: 12px; color: #656d7f; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.new28 { display: flex; gap: 8px; margin-top: 12px; }
.new28 input { flex: 1; min-width: 0; border: 1px solid var(--s28-control); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-family: inherit; }
.new28-st { font-size: 12px; color: #656d7f; margin-top: 6px; min-height: 18px; }
.chk28 { list-style: none; margin: 0 0 12px; padding: 0; }
.chk28 li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid #f0f2f5; font-size: 14px; color: #1c2430; cursor: pointer; }
.chk28 li:last-child { border-bottom: 0; }
.chk28 .i { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.chk28 .i.ok { background: #e8f5ee; color: #1c7849; } .chk28 .i.no { background: #fdeeec; color: #b3362b; } .chk28 .i.opt { background: rgb(0 0 0 / 0.05); color: #656d7f; }
.act28 { display: flex; flex-wrap: wrap; gap: 8px; }
.seg28 { display: inline-flex; border: 1px solid var(--s28-line); border-radius: 8px; overflow: hidden; }
.seg28 button { border: 0; background: #fff; padding: 6px 12px; font-size: 12px; font-family: inherit; color: #4a5570; cursor: pointer; }
.seg28 button.on { background: #14213d; color: #fff; }
.note28 { border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.5; margin: 10px 0; }
.note28.warn { background: #fdf3e2; color: #6b3d00; } .note28.ok { background: #e8f5ee; color: #155c38; }
.status28 { font-size: 12px; color: #4a5570; margin-top: 8px; }
.status28 .mr-status { display: flex !important; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.thumbs28 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.thumbs28 .slide { display: block !important; width: 100%; max-width: none; border-radius: 4px; box-shadow: 0 0 0 1px var(--s28-line); cursor: pointer; }
.hero28 { margin: 64px auto 0; max-width: 512px; text-align: center; }
.hero28 h1 { margin: 8px 0 0; font-size: 24px; font-weight: 600; color: #14213d; }
.hero28 p { margin: 12px 0 0; font-size: 14px; line-height: 1.65; color: #4a5570; }
.hero28 .new28 { margin-top: 24px; }
.hero28 .new28 input { font-size: 16px; padding: 10px 12px; }
.det28 summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #14213d; margin-top: 12px; }
.det28 textarea, .det28 input { width: 100%; border: 1px solid var(--s28-control); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; margin-top: 6px; }
.set28 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.set28 label { font-size: 12px; font-weight: 600; color: #4a5570; display: block; margin-bottom: 4px; }
.set28 input { width: 100%; border: 1px solid var(--s28-control); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-family: inherit; }
.i28 .c28 { margin-bottom: 16px; }
.i28 p { font-size: 14px; color: #4a5570; line-height: 1.55; margin: 0 0 12px; }
@media (max-width: 1200px) { .d28-kpis { grid-template-columns: repeat(2, 1fr); } .d28-row.r3, .d28-row.r2 { grid-template-columns: 1fr; } .thumbs28 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1100px) { .t28-pill { display: none; } }

/* v29: rutenett krymper i stedet for å presse kort ut av skjermen (ICP ved 1280 px) */
.view [style*="grid-template-columns"] > * { min-width: 0; }
.view textarea, .view input { max-width: 100%; box-sizing: border-box; }
.card-grid > * { min-width: 0; }
.card-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
