:root {
  --bg: #f6f5f1; --card: #fff; --ink: #1f2a2e; --muted: #667378; --line: #dcdad2;
  --accent: #1f5f4a; --accent-ink: #fff; --warn-bg: #fff4d6; --warn-ink: #6b4b00;
  --ok-bg: #e2f3e8; --err-bg: #fde4e1; --derived: #eef3f1; --changed: #fff0c2;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161a1b; --card: #1f2527; --ink: #e8ecec; --muted: #94a1a5; --line: #343d40;
    --accent: #5cc4a0; --accent-ink: #0c1a15; --warn-bg: #3a3014; --warn-ink: #f1d98f;
    --ok-bg: #1b3326; --err-bg: #3b1f1c; --derived: #242c2e; --changed: #4a3d12; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; gap: 24px; align-items: center; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); }
.top a { color: inherit; text-decoration: none; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; }
.top nav a { opacity: .9; } .top nav a:hover { opacity: 1; text-decoration: underline; }
.projectbar { background: var(--card); border-bottom: 1px solid var(--line); }
.projectbar h1 { margin: 12px 0 6px; font-size: 20px; }
.projectbar small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }
main { padding-top: 18px; padding-bottom: 30px; }
h1 { font-size: 22px; margin: 6px 0 12px; } h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
details.card > summary { cursor: pointer; } details.card > summary h2 { display: inline; }
.grid2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
label.f > span:first-child { color: var(--ink); }
label.f small { color: var(--muted); font-size: 12px; }
.in { display: flex; align-items: center; gap: 6px; } .in em { font-style: normal; color: var(--muted); min-width: 28px; }
input, select, button { font: inherit; color: inherit; }
input:not([type=checkbox]), select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
input:focus, select:focus, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[readonly] { background: var(--derived); }
.check { display: block; margin-top: 12px; font-size: 14px; } .check small { display: block; color: var(--muted); margin-left: 24px; }
button, .btn { cursor: pointer; border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 6px; text-decoration: none; color: var(--ink); display: inline-block; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.link { border: 0; background: none; color: var(--accent); padding: 2px 6px; } button.danger { color: #b3261e; }
.savebar { position: sticky; bottom: 0; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 40%); margin-top: 8px; }
.inline-form { display: flex; gap: 10px; align-items: end; margin: 8px 0 14px; } .inline-form label { flex: 1; font-size: 13px; }
.flash { padding: 9px 12px; border-radius: 6px; margin-bottom: 12px; } .flash.ok { background: var(--ok-bg); } .flash.err { background: var(--err-bg); }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px; border-radius: 6px; margin: 8px 0; font-size: 14px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 5px 8px; text-align: left; vertical-align: middle; }
.r { text-align: right; font-variant-numeric: tabular-nums; } .strong { font-weight: 600; }
.unit { color: var(--muted); font-size: 13px; }
table.list th { border-bottom: 2px solid var(--line); font-size: 13px; color: var(--muted); }
table.list td { border-bottom: 1px solid var(--line); background: var(--card); } .actions { display: flex; gap: 4px; justify-content: flex-end; }
.actions form { margin: 0; }
table.kv th { font-weight: 400; } table.kv td { text-align: right; font-variant-numeric: tabular-nums; }
table.kv tr + tr th, table.kv tr + tr td { border-top: 1px solid var(--line); }
table.kv.small { font-size: 13.5px; } table.kv tr.sub th, table.kv tr.sub td { font-weight: 600; }
table.kv tr.grand th, table.kv tr.grand td { font-weight: 700; font-size: 17px; border-top: 2px solid var(--ink); padding-top: 8px; }
tr.excluded th, tr.excluded td { color: var(--muted); text-decoration: line-through; }
details.sec { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
details.sec > summary { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; }
details.sec > summary::before { content: "▸"; color: var(--muted); } details.sec[open] > summary::before { content: "▾"; }
details.sec > summary .title { flex: 1; font-weight: 600; } details.sec > summary .sum { font-variant-numeric: tabular-nums; font-weight: 600; }
.badge { font-size: 12px; background: var(--warn-bg); color: var(--warn-ink); padding: 1px 8px; border-radius: 10px; }
table.rows { font-size: 13.5px; } table.rows th { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
table.rows td { border-bottom: 1px solid var(--line); } table.rows tr.zero td { color: var(--muted); }
table.rows tfoot td { border-bottom: 0; } td.post { color: var(--muted); white-space: nowrap; } td.post em { font-size: 12px; }
table.rows input { padding: 3px 6px; } table.rows input.num { width: 84px; text-align: right; } table.rows input.vn { width: 105px; } table.rows select.vn { width: 150px; max-width: 220px; padding: 3px 4px; font-size: 13px; }
input.changed { background: var(--changed); border-color: #d9b000; }
.derived { background: var(--derived); padding: 2px 6px; border-radius: 4px; cursor: help; }
.pack { color: var(--muted); }
details.sec > table, details.sec > p { margin: 0 14px 10px; width: calc(100% - 28px); }
.sec .table-wrap { overflow-x: auto; }
fieldset { border: 1px solid var(--line); border-radius: 6px; } legend { padding: 0 6px; font-size: 13px; color: var(--muted); }
.oprow { display: flex; gap: 6px; margin-bottom: 5px; } .oprow select { flex: 1; min-width: 0; } .oprow .qty { width: 64px; text-align: right; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
table.purchase { background: var(--card); margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; }
table.purchase caption { text-align: left; font-weight: 700; padding: 8px; }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 24px; }
@media (max-width: 700px) { details.sec { overflow-x: auto; } details.sec > table { min-width: 760px; } }
@media print {
  .top, .tabs, .savebar, .noprint, .foot, .inline-form { display: none !important; }
  body { background: #fff; color: #000; } .card, details.sec, table.purchase { border-color: #bbb; }
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.chips a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; background: var(--card); }
.supplier h3 { margin: 0; font-size: 17px; } .small { font-size: 13px; }
.supplier table.purchase { border: 0; margin-top: 8px; }
.supplier .row-head { margin-bottom: 4px; }
@media print { .supplier { break-inside: avoid-page; } }
ol.steps { padding-left: 20px; } ol.steps li { margin-bottom: 8px; }
code { background: var(--derived); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.sketch { background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.sketch .sk-t { fill: var(--ink); font: 14px system-ui, sans-serif; } .sketch .sk-b { font-weight: 700; }
.sketch .sk-ground { stroke: var(--muted); stroke-width: 2; } .sketch .sk-dash { stroke: var(--muted); stroke-dasharray: 5 4; }
.sketch .sk-raf { fill: #d9a35f; fill-opacity: .55; stroke: #a8702b; stroke-width: 1.2; }
.sketch .sk-wall { fill: var(--derived); stroke: var(--muted); }
.sketch .sk-roof { fill: #d9a35f; fill-opacity: .25; stroke: #a8702b; stroke-dasharray: 4 3; }
.sketch .sk-plan { fill: var(--derived); stroke: var(--muted); stroke-width: 2; }
.sketch .sk-hip { stroke: #b3261e; stroke-width: 2.5; } .sketch .sk-dot { fill: var(--ink); }
svg.rafter2d { width: 100%; height: auto; color: var(--ink); max-height: 560px; }

input[type=radio],input[type=checkbox]{width:auto}

/* taksperrer / betong */
.tak canvas, .betong canvas { width: 100%; display: block; background: #fbfcfc; border: 1px solid var(--line, #dcdcdc); border-radius: 4px; margin-top: 8px; }
.tak table, .betong table.spec { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tak th, .tak td, .betong table.spec th, .betong table.spec td { padding: 7px 10px; text-align: left; border-bottom: 1px solid #e3e8ec; }
.tak td:nth-child(2), .tak td:nth-child(3) { white-space: nowrap; }
.tak tr.highlight td { font-weight: 700; color: #b9470b; }
.tak td.sec { background: #e8f0ea; font-weight: 700; }
.tak td.ok { font-weight: 700; color: #1e8449; } .tak td.bad { font-weight: 700; color: #c0392b; }
.tak .assump { font-size: 13px; background: #fffaf0; border-left: 4px solid #e0a030; padding: 10px 14px; margin-top: 14px; border-radius: 3px; }
.tak .assump ul { margin: 6px 0 0 18px; padding: 0; }
.tak select, .betong select { padding: 8px; border: 1px solid #ccc; border-radius: 4px; background: #fff; }
.betong td.num, .betong th.num { text-align: right; }
.betong tr.row-total td { font-weight: 700; background: #eef5ef; }
.betong tr.row-grand td { font-weight: 700; background: #1f5c46; color: #fff; }

.sched { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 14px 12px; border-top: 1px dashed var(--line, #dcdcdc); font-size: 13px; }
.sched label { display: inline-flex; gap: 6px; align-items: center; } .sched input[type=date] { padding: 3px 6px; }
.ganttwrap { overflow-x: auto; } svg.gantt { display: block; max-width: none; color: var(--ink, #222); }

.dviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 10px; }
.dviews figure { margin: 0; } .dviews figcaption { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
svg.dview { width: 100%; height: auto; color: var(--ink, #222); background: #fbfcfc; border: 1px solid var(--line, #dcdcdc); border-radius: 4px; }
svg.dview .dt { font: 11px system-ui, sans-serif; fill: currentColor; }
.drivechip { font-size: 12px; font-weight: 400; margin-left: 10px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; vertical-align: middle; background: var(--card); }
.top { display: flex; align-items: center; gap: 16px; }
.top nav { flex: 1; }
.userbox { margin-left: auto; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.userbox a, .userbox button { color: inherit; opacity: .9; }
.authcard { max-width: 420px; margin: 40px auto; }
.authcard label { display: block; margin: 10px 0; } .authcard input { width: 100%; box-sizing: border-box; }

/* Timesheet */
.badge.okb { background: var(--ok-bg); }
.bar { display: inline-block; width: 110px; height: 8px; background: var(--line); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #1f5c46; } .bar.over > i { background: #c0392b; }
.workerpage { max-width: 560px; margin: 0 auto; } .workerpage label { display: block; margin: 10px 0 3px; font-weight: 600; }
.workerpage select, .workerpage input[type=date], .workerpage input[type=text], .workerpage input[type=number] { width: 100%; padding: 10px; font-size: 16px; box-sizing: border-box; }
.workerpage button.primary { width: 100%; padding: 12px; font-size: 17px; margin-top: 14px; }
.linkbox { font-family: monospace; font-size: 12.5px; word-break: break-all; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
a.portal { margin-right: 12px; font-size: 14px; white-space: nowrap; }

/* Hjelp / guide */
.help .hero { background: linear-gradient(135deg, var(--accent), #2f7d61); color: #fff; border-radius: 12px; padding: 28px 30px; margin-bottom: 22px; }
.help .hero h1 { margin: 0 0 8px; font-size: 28px; } .help .hero p { margin: 0 0 12px; max-width: 640px; font-size: 16px; line-height: 1.5; }
.help .hero .btn { border-color: #fff; } .help .hero .btn.primary { background: #fff; color: #1f5c46; }
.helpgrid { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: start; }
.toc { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc a { padding: 5px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); } .toc a:hover { background: var(--line); }
.helpmain h2 { margin: 26px 0 12px; scroll-margin-top: 14px; } .helpmain h2:first-child { margin-top: 0; }
.helpsec { scroll-margin-top: 14px; } .helpsec h2 { margin-top: 0; } .helpsec .lead { color: var(--muted); margin-top: 0; }
.helpsec ul { padding-left: 20px; line-height: 1.55; } .helpsec li { margin-bottom: 6px; }
.tip { background: var(--ok-bg); padding: 9px 12px; border-radius: 8px; margin: 12px 0 0; }
ol.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
ol.steps li { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
ol.steps .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
ol.steps p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; }
.flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.flow .fb { background: var(--ok-bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.flow .fb.base { flex-basis: 100%; text-align: center; background: var(--card); } .flow .fa { color: var(--muted); font-size: 20px; }
.flow .fa:nth-of-type(2), .flow .fa:nth-of-type(4) { flex-basis: auto; }
details.faq summary { cursor: pointer; font-weight: 600; } details.faq p { margin: 8px 0 0; }
@media (max-width: 800px) { .helpgrid { grid-template-columns: 1fr; } .toc { position: static; flex-direction: row; flex-wrap: wrap; } }
@media print { .toc { display: none; } .helpgrid { display: block; } .help .hero { background: none; color: #000; border: 1px solid #bbb; } }

/* Administrator-panel på hovedsiden */
.adminpanel h3 { margin: 18px 0 8px; font-size: 15px; }
.attrow { display: flex; align-items: center; gap: 12px; border: 1px solid #feebc8; background: var(--card); border-radius: 6px; padding: 8px 12px; margin-top: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
.attrow:hover { border-color: #dd6b20; } .attrow.info { border-color: var(--line); }
.attrow .cnt { background: #dd6b20; color: #fff; font-weight: 700; border-radius: 12px; padding: 1px 10px; font-size: 13px; } .attrow.info .cnt { background: #718096; }
.attrow .go { margin-left: auto; font-weight: 600; }
.okline { background: var(--ok-bg); padding: 8px 12px; border-radius: 6px; }
.minilist { list-style: none; padding: 0; margin: 0 0 6px; } .minilist li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* Meldinger fra administrator */
.notice { display: flex; gap: 12px; align-items: flex-start; border-radius: 8px; padding: 11px 14px; margin: 0 0 12px; border: 1px solid var(--line); border-left-width: 5px; background: var(--card); }
.notice .ni { font-size: 20px; line-height: 1.2; } .notice > div { flex: 1; } .notice .nclose { margin-left: auto; color: var(--muted); }
.notice.tip { border-left-color: #2f855a; background: var(--ok-bg); } .notice.info { border-left-color: #3182ce; }
.notice.warning { border-color: #e0a63a; border-left-color: #dd6b20; background: var(--warn-bg); color: var(--warn-ink); }
.notice[hidden] { display: none; }

/* Leverandørlenker */
details.suplink { border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; margin: 8px 0; } details.suplink > summary { cursor: pointer; font-weight: 600; }
.supplierpage table.supplierlines input.num { width: 90px; text-align: right; } .supplierpage table.supplierlines td input:not([type=checkbox]):not(.num):not([type=date]) { width: 100%; min-width: 120px; }
.supplierpage label.block { display: block; margin: 12px 0; }

.listname { font-size: 1.05rem; margin: .2rem 0 .8rem; }
.listname-edit { display: block; margin: .4rem 0 .8rem; }
.projectbar.ctx { background: var(--bg, #f6f6f2); }
.projectbar .ctxlabel { font-size: 12px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }

/* Tegning: veiledning */
ol.drawsteps { list-style: none; counter-reset: ds; margin: 12px 0; padding: 0; display: grid; gap: 10px; }
ol.drawsteps li { counter-increment: ds; position: relative; display: block; padding: 10px 12px 10px 52px; background: var(--bg, #f6f6f2); border: 1px solid var(--line); border-radius: 10px; line-height: 1.5; min-height: 44px; }
ol.drawsteps li::before { content: counter(ds); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink, #fff); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
ol.drawsteps li em { font-style: normal; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: .92em; }
.grid2 > .card h2 { margin-top: 0; }

/* Toppmeny på mobil: logo + bruker øverst, menyen som én rad som kan sveipes */
@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px 0; }
  .top a.portal { order: 0; margin-right: 0; flex-basis: 100%; }
  .top .brand { order: 1; }
  .top .userbox { order: 2; margin-left: auto; }
  .top nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { flex: none; padding: 10px 10px; white-space: nowrap; border-bottom: 3px solid transparent; }
  .top nav a:hover { text-decoration: none; border-bottom-color: rgba(255,255,255,.6); }
  .projectbar .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .projectbar .tabs a { flex: none; white-space: nowrap; }
}

.grid2 > *, .grid3 > * { min-width: 0; }
@media (max-width: 860px) {
  table.rows, table.list { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card { max-width: 100%; }
}
.inline-form { flex-wrap: wrap; }
.inline-form input[type=file], .inline-form input[type=url], .inline-form select { max-width: 100%; }

/* Beregning: rader */
.vh { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
input.pn { width: 100%; min-width: 130px; }
select.qk { max-width: 190px; font-size: 12px; }
select.un { max-width: 110px; }
td.rowact { white-space: nowrap; text-align: right; }
.iconbtn { padding: 2px 8px; min-width: 30px; line-height: 1.4; }
.iconbtn.del { color: #b03a2e; }
.rowtools { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.rowtools .small { font-size: 12px; }
select.qk { width: 170px; max-width: none; }
select.un { width: 108px; max-width: none; }
td.post { min-width: 190px; }
td.post .badge { display: inline-block; margin-top: 3px; }
details.sec table.rows { display: block; overflow-x: auto; }
select.qk { width: 150px; } select.un { width: 94px; } td.post { min-width: 160px; } input.pn { min-width: 120px; }

/* Prosjektliste: leverandøroppfølging og pristilbud */
td.follow { max-width: 320px; } .fsum { font-weight: 600; font-size: 13px; display: block; margin-bottom: 3px; }
.fchip { display: inline-block; font-size: 12px; background: var(--bg, #f6f6f2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin: 0 4px 3px 0; white-space: nowrap; }
.fchip.new, .ochip.new { border-color: #e0a800; background: #fff8e1; }
.ochip { display: inline-block; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; text-decoration: none; white-space: nowrap; background: var(--bg, #f6f6f2); }
.ochip.o-accepted { background: #e8f6ee; border-color: #b7e0c8; color: #1d6b3c; } .ochip.o-declined { background: #fdf0ec; border-color: #f2c9bd; color: #a5382a; }
.ochip.o-question { background: #fff8e1; border-color: #f0d98a; }
.ostat { margin: 4px 0; }

/* Fagfolk */
.tradefilter { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; } .tradefilter label { font-size: 13px; }
.tradefilter select { width: 100%; }
@media (max-width: 760px) { .tradefilter { grid-template-columns: 1fr; } }
label.tradecard { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; margin: 0 0 8px; cursor: pointer; }
label.tradecard:hover { background: var(--bg, #f6f6f2); } .tradecard input { width: 18px; height: 18px; flex: none; } .tc-main { min-width: 0; } .tc-main .block { display: block; }
.tstat { display: inline-block; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; background: var(--bg, #f6f6f2); }
.tstat.s-offered { background: #eef5ff; border-color: #b9d3f5; } .tstat.s-agreed, .tstat.s-progress, .tstat.s-done { background: #e8f6ee; border-color: #b7e0c8; color: #1d6b3c; }
.tstat.s-declined, .tstat.s-rejected { background: #fdf0ec; border-color: #f2c9bd; color: #a5382a; } .tstat.s-question { background: #fff8e1; border-color: #f0d98a; }
.tradeinv { border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px; padding: 10px 12px; margin: 10px 0; }
.tradeinv.offered { border-left-color: #3182ce; } .tradeinv.agreed, .tradeinv.progress, .tradeinv.done { border-left-color: #2f855a; } .tradeinv.rejected, .tradeinv.declined { border-left-color: #c0553f; opacity: .85; }
.tradeoffer { background: var(--bg, #f6f6f2); border-radius: 6px; padding: 8px 12px; margin: 8px 0; } .tprice { font-size: 20px; font-weight: 700; }
.trademsgs { margin: 8px 0; } .tmsg { border-radius: 8px; padding: 6px 10px; margin: 4px 0; max-width: 92%; } .tmsg.me { background: #e8f2ff; margin-left: auto; } .tmsg.them { background: var(--bg, #f6f6f2); border: 1px solid var(--line); }
.tradeacts { margin: 8px 0; gap: 8px; } .tradetools summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.tradepage { max-width: 900px; margin: 0 auto; } .tradeagree { border-left: 5px solid #2f855a; background: #f3fbf6; }
td.tradest .fsum { white-space: nowrap; }
.stdpick { margin: -6px 0 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.stdpick select { max-width: 100%; }
.stdrow { display: grid; grid-template-columns: 200px 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.stdrow textarea { width: 100%; }
.stdrow.new { padding-bottom: 12px; border-bottom: 1px solid var(--line, #e2e8f0); }
@media (max-width: 760px) { .stdrow { grid-template-columns: 1fr; } }
.admintabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.admintabs a { padding: 7px 12px; border: 1px solid var(--line, #cbd5e0); border-radius: 6px; text-decoration: none; color: inherit; font-size: 14px; }
.admintabs a.on { background: #0073aa; color: #fff; border-color: #0073aa; }
.admintabs.sub a { font-size: 13px; padding: 5px 10px; }
textarea.jsonedit { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.45; tab-size: 2; white-space: pre; overflow: auto; box-sizing: border-box; }
.dangerbox { border-color: #f5c6cb; background: #fff5f5; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.dangerbox p { margin: 0; flex-basis: 100%; }
.annedit summary { cursor: pointer; }
select.pst { font-size: 12.5px; padding: 3px 6px; border-radius: 12px; border: 1px solid var(--line, #cbd5e0); }
select.pst.st-tilbud { background: #eaf3ff; } select.pst.st-vunnet { background: #e6f6ea; } select.pst.st-pagar { background: #fff6e0; }
select.pst.st-ferdig { background: #e8f5e9; } select.pst.st-tapt { background: #fdecea; } select.pst.st-arkivert { background: #eee; color: #555; }
.pdrow { padding: 8px 0; border-bottom: 1px solid var(--line, #e2e8f0); }
.linkexp { margin: 6px 0; }
.linkexp input[type=date] { padding: 3px 6px; }

.vismodes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
.vismodes .btn.on { background: #0073aa; color: #fff; border-color: #0073aa; }
#visual input, #visual select { font-size: 13px; padding: 4px 6px; box-sizing: border-box; }
#visual td { padding: 3px 4px; vertical-align: top; }
#visual .tablewrap { overflow-x: auto; }
.dashtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.dashtiles > div { display: flex; flex-direction: column; } .dashtiles strong { font-size: 1.15rem; }
.dashcard h4 { margin: 0 0 4px; } .dashcard { display: flex; flex-direction: column; margin-bottom: 0; }
.dash { margin-bottom: 18px; }
.dashlist { list-style: none; margin: 0; padding: 0; } .dashlist li { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 3px 0; }
.msglayout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .msglayout { grid-template-columns: 1fr; } }
.msglist, .msgwin { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.msglist { overflow: hidden; } .msgwin { padding: 14px 16px; }
.msgfilter { display: flex; gap: 6px; padding: 10px; background: rgba(0,0,0,.03); border-bottom: 1px solid var(--line); }
.msgfilter .micwrap { flex: 1; } .msgfilter input[type=search] { width: 100%; box-sizing: border-box; }
.msgchips { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.msgchips a { font-size: 12px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; }
.msgchips a.on { background: #0073aa; color: #fff; border-color: #0073aa; }
.msgitem { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; border-left: 4px solid transparent; }
.msgitem:hover, .msgitem.on { background: rgba(0,115,170,.07); border-left-color: #0073aa; }
.msgitem strong { display: block; font-size: 14px; } .msgitem small { display: block; font-size: 12px; opacity: .7; }
.msghead { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.msghist { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 6px 4px 0; margin-bottom: 12px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.bubble.them { align-self: flex-start; background: rgba(0,0,0,.06); border-bottom-left-radius: 2px; }
.bubble.me { align-self: flex-end; background: #0073aa; color: #fff; border-bottom-right-radius: 2px; }
.bmeta { font-size: 11px; opacity: .8; margin-bottom: 3px; }
.msgform { border-top: 1px solid var(--line); padding-top: 10px; } .msgform .stdsel { margin-bottom: 6px; max-width: 100%; }
.micwrap { position: relative; display: flex; } .micwrap textarea { width: 100%; box-sizing: border-box; padding-right: 40px; }
.micbtn { position: absolute; right: 6px; top: 4px; background: none; border: 0; cursor: pointer; font-size: 15px; border-radius: 50%; padding: 3px 5px; }
.micbtn.listening { animation: kkpulse 1.2s infinite; background: #fed7d7; }
@keyframes kkpulse { 50% { transform: scale(1.15); } }
@media print { .msglist, .msgform, nav.tabs { display: none !important; } .msglayout { display: block; } .msghist { max-height: none; overflow: visible; } .bubble.me { background: #eee; color: #000; } }
.unread-badge { background: #d9534f; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; white-space: nowrap; }
