/* Ordremottak, demo. Lyst, rolig og tydelig. */
:root {
  color-scheme: light;
  --bg: #F3F5F7;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --ink: #17202A;
  --ink-2: #46515D;
  --ink-3: #66707C;
  --line: #E0E4E9;
  --line-2: #CBD2DA;
  --brand: #1F4E79;
  --brand-2: #173E61;
  --brand-soft: #E7EFF7;
  --ok: #1B7A4A;
  --ok-soft: #E8F5EE;
  --ok-line: #B5DCC5;
  --warn: #8A5300;
  --warn-ico: #C47A00;
  --warn-soft: #FFF5E1;
  --warn-line: #EFD198;
  --stop: #6B7480;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .05);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}
h1, h2, h3, h4 { line-height: 1.25; }
a { color: var(--brand); }
a:hover { color: var(--brand-2); }
button { font: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Topp */
.demo-stripe {
  margin: 0;
  padding: 8px 16px;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-line);
  color: #5E3B00;
  font-size: 13.5px;
  text-align: center;
}
.appbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; flex: none; }
.brand-text { display: grid; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-app { font-size: 13px; color: var(--ink-3); }
.user { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: 12.5px; display: grid; place-items: center; flex: none; }

.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 30px 0 22px; }
.intro h1 { font-size: 29px; letter-spacing: -0.01em; margin: 0 0 8px; font-weight: 700; }
.intro p { margin: 0; color: var(--ink-2); max-width: 70ch; font-size: 15.5px; }
.restart { flex: none; }

/* Knapper */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14.5px; font-weight: 600; line-height: 1.2;
  padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.quiet { background: transparent; }
.btn.small { font-size: 13px; padding: 6px 10px; }
.btn:focus-visible, .sample:focus-visible, .out:focus-visible, .file:focus-visible, .link-btn:focus-visible, .drop:focus-within {
  outline: 3px solid #8DB4E2; outline-offset: 2px;
}
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline; font-size: 14px; }

/* Oppsett */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }

/* Stegene */
.steps { list-style: none; margin: 0; padding: 0; min-width: 0; }
.step { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; padding-bottom: 30px; scroll-margin-top: 14px; }
.step::before { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: var(--line); border-radius: 2px; }
.step:last-child::before { display: none; }
.step[data-state="done"]::before { background: var(--ok-line); }
.marker {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-2);
  color: var(--ink-3); font-weight: 650; font-size: 14px;
  position: relative; z-index: 1; transition: background .2s, border-color .2s, box-shadow .2s;
}
.marker > * { grid-area: 1 / 1; }
.marker svg { width: 18px; height: 18px; display: none; }
.marker .spinner { display: none; }
.step[data-state="active"] .marker { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.step[data-state="busy"] .marker { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.step[data-state="busy"] .marker .num { display: none; }
.step[data-state="busy"] .marker .spinner { display: block; }
.step[data-state="done"] .marker { background: var(--ok); border-color: var(--ok); color: #fff; }
.step[data-state="done"] .marker .num { display: none; }
.step[data-state="done"] .marker .i-check { display: block; }
.step[data-state="warn"] .marker { background: var(--warn-ico); border-color: var(--warn-ico); color: #fff; box-shadow: 0 0 0 4px var(--warn-soft); }
.step[data-state="warn"] .marker .num { display: none; }
.step[data-state="warn"] .marker .i-warn { display: block; }
.step[data-state="stopped"] .marker { border-style: dashed; background: var(--surface-2); }

.step-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-height: 36px; padding-top: 5px; }
.step-head h2 { font-size: 18px; margin: 0; font-weight: 650; }
.step[data-state="idle"] .step-head h2, .step[data-state="stopped"] .step-head h2 { color: var(--ink-2); }
.step-status { font-size: 13.5px; color: var(--ink-3); }
.step[data-state="done"] .step-status { color: var(--ok); font-weight: 550; }
.step[data-state="warn"] .step-status { color: var(--warn); font-weight: 550; }
.step[data-state="busy"] .step-status, .step[data-state="active"] .step-status { color: var(--brand); font-weight: 550; }
.step-content { margin-top: 8px; min-width: 0; }
.idle-text { margin: 0; color: var(--ink-3); font-size: 14.5px; max-width: 62ch; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--brand-soft); border-top-color: var(--brand);
  animation: snurr .8s linear infinite;
}
@keyframes snurr { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Steg 1 */
.lead-in { margin: 0 0 12px; color: var(--ink-2); }
.samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sample {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: inherit; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sample:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(31, 78, 121, .12); transform: translateY(-1px); }
.sample-thumb { height: 128px; overflow: hidden; background: #ECEFF2; border-bottom: 1px solid var(--line); padding: 10px 14px 0; }
.sample-thumb img { width: 100%; display: block; border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.sample-text { display: grid; gap: 2px; padding: 12px 14px 14px; }
.sample-text strong { font-size: 14.5px; font-weight: 650; }
.sample-text span { font-size: 13.5px; color: var(--ink-2); }
.sample-text .sample-hint { margin-top: 6px; color: var(--brand); font-weight: 550; }

.upload { margin-top: 14px; }
.drop {
  display: grid; gap: 3px; justify-items: center; text-align: center;
  padding: 18px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop strong { font-size: 14.5px; }
.drop span { font-size: 13.5px; color: var(--ink-2); }
.drop u { color: var(--brand); }
.fine { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }

.received { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.received-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.received-text { min-width: 0; flex: 1; }
.received-text b { font-weight: 650; }
.received-text .muted { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.received-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.narrow-doc { display: none; margin-top: 10px; }
.narrow-doc img { width: 100%; display: block; border: 1px solid var(--line-2); border-radius: 6px; max-height: 260px; object-fit: cover; object-position: top; background: #fff; }

/* Steg 2 */
.reading { display: flex; align-items: center; gap: 10px; color: var(--brand); font-weight: 550; padding: 6px 0; }
.reading .muted { font-weight: 400; }
.summary { margin: 0 0 10px; font-size: 15px; }
.summary b { font-weight: 650; }
.pills { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill-chk {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  transition: background .2s, border-color .2s, color .2s;
}
.pill-chk[data-s="ok"] { background: var(--ok-soft); border-color: var(--ok-line); color: #145C38; }
.pill-chk[data-s="warn"] { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.ico { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.ico svg { width: 13px; height: 13px; }
.ico.ok { background: var(--ok); color: #fff; }
.ico.warn { background: var(--warn-ico); color: #fff; }
.ico .spinner { width: 15px; height: 15px; border-width: 2px; }

.read { padding: 16px 16px 12px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 20px; margin: 0 0 14px; }
.facts > div { min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--ink-3); }
.facts dd { margin: 1px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.facts.small dd { font-size: 13.5px; }

.table-wrap { overflow-x: auto; margin: 0 -2px; }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.lines th.num { text-align: right; }
.lines td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines tr.row { opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; }
.lines tr.row.in { opacity: 1; transform: none; }
.lines td.flag { background: var(--warn-soft); }
.lines .nr { white-space: nowrap; }
.sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; white-space: normal; }
.sub.warn { color: var(--warn); font-weight: 550; }
.sub.ok { color: var(--ok); }

.totals { display: grid; justify-content: end; margin: 10px 0 0; }
.totals > div { display: grid; grid-template-columns: auto 140px; gap: 16px; font-size: 14px; padding: 2px 10px; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 650; border-top: 1px solid var(--line-2); margin-top: 3px; padding-top: 5px; }
.totals .grand dt { color: var(--ink); }

.note { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.note-label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }

.errorbox { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--warn-line); background: var(--warn-soft); }
.errorbox p { margin: 0 0 10px; }

/* Steg 3 */
.approve { padding: 16px; }
.approve-lead { margin: 0 0 12px; font-weight: 600; }
.issue { border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.issue.info { border-color: var(--line); background: var(--surface-2); }
.issue h3 { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; margin: 0 0 6px; font-weight: 650; }
.issue h3 .ico { margin-top: 1px; }
.issue p { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.issue p:last-child { margin-bottom: 0; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); margin-top: 8px; max-width: 100%; }
.field select, .field input, .price-input {
  font: inherit; font-size: 14px; color: var(--ink);
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  max-width: 100%; min-width: 0;
}
.field select { width: 100%; }
.price-input { width: 120px; padding: 5px 8px; margin-left: 4px; }
.choices { border: 0; margin: 4px 0 0; padding: 0; min-width: 0; }
.choice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.choice input[type="radio"], .check input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 6px !important; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.stamp { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--ok-soft); border: 1px solid var(--ok-line); font-weight: 600; }
.stamp.stop { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-2); }
.decisions { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.decisions li { display: flex; gap: 8px; align-items: flex-start; }
.decisions .ico { width: 18px; height: 18px; margin-top: 2px; }

/* Steg 4 */
.outs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.out {
  display: grid; gap: 4px; align-content: start; text-align: left;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: inherit;
  cursor: pointer; box-shadow: var(--shadow);
  opacity: .5; transition: opacity .25s, border-color .15s, box-shadow .15s;
}
.out.in { opacity: 1; }
.out[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.out-title { display: flex; gap: 8px; align-items: flex-start; font-weight: 650; font-size: 14px; line-height: 1.35; }
.out-title .ico { margin-top: -1px; }
.out-sub { font-size: 13px; color: var(--ink-2); padding-left: 28px; }
.out .ico.wait { background: var(--surface-2); border: 1.5px solid var(--line-2); }
.out-more { font-size: 12.5px; color: var(--brand); padding-left: 28px; }

.mock { margin-top: 12px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 4px 16px rgba(16, 24, 40, .06); }
.mock-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; font-size: 12.5px; min-width: 0; }
.mock-name { font-weight: 650; flex: none; }
.mock-path { opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mock-erp .mock-bar { background: #2C3A48; color: #E9EEF3; }
.mock-crm .mock-bar { background: #E6F2F1; color: #1E4F4B; border-bottom: 1px solid #C9E2DF; }
.mock-folder .mock-bar { background: #EEF0F3; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.mock-body { padding: 14px 16px 16px; }
.mock-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mock-head h3 { margin: 0; font-size: 17px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid; }
.tag.ok { color: #145C38; background: var(--ok-soft); border-color: var(--ok-line); }
.tag.draft { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.mock-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mock-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.mock-table th.num { text-align: right; }
.mock-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mock-table tr.changed td { background: #FFFAEE; }
.mock-table .nr { white-space: nowrap; }
.sumlist { display: grid; justify-content: end; margin: 10px 0 0; font-size: 13.5px; }
.sumlist > div { display: grid; grid-template-columns: auto 130px; gap: 14px; padding: 1px 8px; }
.sumlist dt { color: var(--ink-2); }
.sumlist dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sumlist .grand { font-weight: 650; }
.sumlist .grand dt { color: var(--ink); }
.mock-foot { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-3); }

.crm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.crm-avatar { width: 40px; height: 40px; border-radius: 10px; background: #D8ECEA; color: #1E4F4B; font-weight: 700; display: grid; place-items: center; flex: none; }
.crm-head h3 { margin: 0; font-size: 16px; }
.crm-head p { margin: 0; font-size: 13px; color: var(--ink-3); }
.crm-box { border-radius: 8px; padding: 10px 12px; margin: 4px 0 12px; font-size: 13.5px; }
.crm-box.changed { background: #EEF7F6; border: 1px solid #C9E2DF; }
.crm-box.same { background: var(--surface-2); border: 1px solid var(--line); }
.crm-box h4, .crm-sub { margin: 0 0 4px; font-size: 13px; font-weight: 650; }
.crm-box ul { margin: 0; padding-left: 18px; }
.crm-box p { margin: 0; color: var(--ink-2); }
.activity { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.activity li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.activity li span:first-child { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.activity li.new { font-weight: 600; }
.activity li.new span:first-child { color: #1E4F4B; }

.files { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.file {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: inherit; cursor: pointer;
}
.file.on { border-color: var(--brand); background: var(--brand-soft); }
.file svg { flex: none; }
.file span { display: grid; min-width: 0; }
.file b { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.file small { font-size: 12.5px; color: var(--ink-3); }
.file-view { border-top: 1px solid var(--line); padding-top: 12px; }
.file-view img { width: 100%; max-width: 420px; display: block; border: 1px solid var(--line-2); max-height: 360px; object-fit: cover; object-position: top; }
.sheet { border: 1px solid var(--line-2); border-radius: 6px; padding: 14px 16px; background: #FDFDFC; font-size: 13.5px; }
.sheet h4 { margin: 0 0 4px; font-size: 15px; }
.sheet-meta { margin: 0 0 10px; color: var(--ink-3); font-size: 13px; }
.sheet-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.sheet-list li { display: flex; gap: 8px; align-items: flex-start; }
.sheet-list .ico { width: 18px; height: 18px; margin-top: 1px; }
.sheet-list.plain li { padding-left: 2px; }
.sheet-sign { margin: 0 0 6px; font-weight: 600; }
.sheet-sub { margin: 8px 0 4px; font-size: 12.5px; color: var(--ink-3); }

/* Steg 5 */
.mail { overflow: hidden; }
.mail-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; background: var(--surface-2); }
.mail-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 13px; }
.mail-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; font-size: 14px; }
.mail-row > span:first-child { color: var(--ink-3); }
.mail-row > span:last-child { overflow-wrap: anywhere; }
.mail-body { padding: 14px 16px 6px; font-size: 14.5px; line-height: 1.6; outline: none; }
.mail-body p { margin: 0 0 12px; }
.mail-body[contenteditable="true"] { background: #FCFDFF; box-shadow: inset 0 0 0 2px var(--brand-soft); }
.mail-lines { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; width: 100%; max-width: 560px; }
.mail-lines td { padding: 3px 12px 3px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.mail-lines td:last-child { padding-right: 0; }
.mail-lines tr.sum td { border-bottom: 0; padding-top: 6px; }
.mail-actions { display: flex; gap: 10px; padding: 12px 16px 16px; flex-wrap: wrap; }

/* Sidepanel */
.side { position: sticky; top: 16px; display: grid; gap: 16px; min-width: 0; max-height: calc(100vh - 32px); grid-template-rows: auto minmax(0, 1fr); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.link { font-size: 13.5px; font-weight: 550; }
.doc-view { padding: 12px; background: #ECEFF2; max-height: 50vh; overflow: auto; }
.doc-view img { width: 100%; display: block; border: 1px solid var(--line-2); background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.doc-view .doc-object { width: 100%; height: 48vh; border: 0; display: block; background: #fff; }
.placeholder { margin: 0; padding: 26px 12px; text-align: center; color: var(--ink-3); font-size: 14px; }
.log { list-style: none; margin: 0; padding: 4px 14px 10px; font-size: 13px; overflow: auto; min-height: 90px; max-height: 34vh; }
.log li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log .log-empty { display: block; color: var(--ink-3); border: 0; }

/* Bunn */
.site-foot { margin-top: 36px; border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0 30px; font-size: 14px; color: var(--ink-2); }
.site-foot p { margin: 0 0 8px; }
.site-foot .made { color: var(--ink-3); font-size: 13.5px; margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 8px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Smalere skjermer */
@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; grid-template-rows: auto; }
  .doc-panel { display: none; }
  .narrow-doc { display: block; }
  .log { max-height: 320px; }
}
@media (max-width: 760px) {
  .samples { grid-template-columns: minmax(0, 1fr); }
  .sample { flex-direction: row; }
  .sample-thumb { width: 96px; height: auto; min-height: 104px; flex: none; border-bottom: 0; border-right: 1px solid var(--line); padding: 8px 8px 0; }
  .outs { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  body { font-size: 15px; }
  .intro { padding: 22px 0 18px; }
  .intro h1 { font-size: 23px; }
  .intro p { font-size: 15px; }
  .step { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
  .step::before { left: 14px; top: 34px; }
  .marker { width: 30px; height: 30px; font-size: 13px; }
  .marker svg { width: 16px; height: 16px; }
  .step-head { min-height: 30px; padding-top: 3px; }
  .step-head h2 { font-size: 17px; }
  .read, .approve { padding: 14px 12px; }
  .user-name { display: none; }
  .received { flex-wrap: wrap; }
  .received-actions { flex-direction: row; align-items: center; gap: 14px; width: 100%; padding-left: 52px; }

  /* Ordrelinjene som kort */
  .lines thead { display: none; }
  .lines, .lines tbody { display: block; }
  .lines tr.row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .lines td { display: block; border: 0; padding: 0; }
  .lines td.desc { grid-column: 1 / -1; order: -2; font-weight: 600; }
  .lines td.nr { order: -1; white-space: normal; }
  .lines td.nr.ours { grid-column: span 2; }
  .lines td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
  .lines td.num { text-align: left; }
  .lines td.flag { background: var(--warn-soft); border-radius: 6px; padding: 2px 6px; margin: 0 -6px; }
  .totals { justify-content: stretch; }
  .totals > div { grid-template-columns: 1fr auto; }

  .mock-body { padding: 12px; }
  /* Ordresystemets linjer som kort: nummer og navn, så antall, pris og beløp */
  .mock-table thead { display: none; }
  .mock-table, .mock-table tbody { display: block; }
  .mock-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
  .mock-table td { display: block; border: 0; padding: 0; }
  .mock-table td.nr { grid-column: 1; grid-row: 1; font-weight: 600; }
  .mock-table td.navn { grid-column: 2 / -1; grid-row: 1; }
  .mock-table td.ant { grid-column: 1; grid-row: 2; text-align: left; color: var(--ink-2); }
  .mock-table td.pris { grid-column: 2; grid-row: 2; text-align: left; color: var(--ink-2); }
  .mock-table td.pris::before { content: "à "; }
  .mock-table td.belop { grid-column: 3; grid-row: 2; font-weight: 600; }
  .mock-table tr.changed { background: #FFFAEE; }
  .mock-table tr.changed td { background: transparent; }
  /* E-postens linjer: beløpet under teksten */
  .mail-lines, .mail-lines tbody { display: block; }
  .mail-lines tr { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 0 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
  .mail-lines td { border: 0; padding: 0; }
  .mail-lines td.num { text-align: left; }
  .mail-lines td:last-child { grid-column: 2; color: var(--ink-2); }
  .mail-lines tr.sum { grid-template-columns: minmax(0, 1fr) auto; border: 0; padding: 2px 0; }
  .mail-lines tr.sum td:first-child { display: none; }
  .mail-lines tr.sum td:last-child { grid-column: auto; color: var(--ink); text-align: right; }
  .mail-body { padding: 12px 12px 4px; }
  .mail-head { padding: 12px; }
  .mail-actions { padding: 10px 12px 14px; }
  .field select, .field input, .price-input { font-size: 16px; }
  .activity li { grid-template-columns: 78px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .8s !important; }
  .lines tr.row { transform: none; }
}
