/* Farger fra SynkWorks Grow: lyst og mørkt tema (data-theme settes av theme.js). */
:root {
  color-scheme: light;
  --bg: #f5f7fb; --card: #fff; --panel2: #f1f4fa; --text: #18263a; --muted: #596b83; --line: #d9e1ed;
  --brand: #4169e1; --btn-text: #fff; --field-bg: #fff; --field-border: #b9c8dc; --nav-active: #e7edfd;
  --ok-bg: #ddf3ec; --ok: #14593f; --warn-bg: #fdf0d5; --warn: #7a4a00;
  --bad-bg: #fde2df; --bad: #a92c34; --seo-bg: #ebf0fc; --seo: #34449a; --radius: 12px;
  --shadow: 0 1px 2px rgba(24, 38, 58, .04), 0 8px 24px rgba(24, 38, 58, .05);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17191f; --card: #292d36; --panel2: #323844; --text: #f7f7f8; --muted: #b2bac9; --line: #444b59;
  --brand: #f29b50; --btn-text: #17191f; --field-bg: #242832; --field-border: #626a7a; --nav-active: #383b45;
  --ok-bg: #254b3e; --ok: #b4f4d3; --warn-bg: #4a3b1f; --warn: #f3c580;
  --bad-bg: #5d3034; --bad: #ffcbc4; --seo-bg: #34303a; --seo: #d9c8ff;
  --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; } h2 { font-size: 1.15rem; margin: 0 0 .75rem; } h3 { font-size: 1rem; margin: .5rem 0; }
small, .muted { color: var(--muted); }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { color: var(--text); font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); display: inline-block; }
.top nav { display: flex; gap: .25rem; flex: 1; }
.top nav a { color: var(--muted); padding: .35rem .7rem; border-radius: 6px; }
.top nav a.on { color: var(--text); background: var(--panel2); }
.top nav a:hover { text-decoration: none; color: var(--text); }

.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.head.small { margin-bottom: .5rem; }
.buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.buttons form { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
button, .button { font: inherit; padding: .5rem .9rem; border-radius: 7px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; display: inline-block; }
button:hover, .button:hover { border-color: var(--muted); text-decoration: none; }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: var(--btn-text); font-weight: 600; }
button.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); font-weight: 600; }
button.link { background: none; border: none; color: var(--muted); padding: 0; }
button.link.bad { color: var(--bad); }
input, textarea { font: inherit; width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); }
input[type=checkbox] { width: auto; }
label { display: block; margin-bottom: .9rem; font-weight: 500; }
label input, label textarea { margin-top: .25rem; font-weight: 400; }
label small { display: block; font-weight: 400; }
.form { max-width: 560px; }
.actions { display: flex; gap: 1rem; align-items: center; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stats b { display: block; font-size: 1.6rem; }
.stats span { color: var(--muted); font-size: .85rem; }
.stats .warn b { color: var(--warn); } .stats .bad b { color: var(--bad); }
.search { margin-bottom: 1rem; }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card table.list { border: none; }
.list th, .list td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.list th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.list tr:last-child td { border-bottom: none; }
.list td.check, .list th.check { width: 2rem; }
.list tr.has-update { background: color-mix(in srgb, var(--warn-bg) 40%, transparent); }

.tag { display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; background: var(--bg); color: var(--muted); margin: 0 .2rem .2rem 0; font-weight: 600; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); } .tag.seo { background: var(--seo-bg); color: var(--seo); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem 1rem; margin-bottom: 1.25rem; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.facts span:first-child { display: block; font-size: .78rem; color: var(--muted); }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; word-break: break-all; }
.connect ol { padding-left: 1.2rem; }
.inv { margin-top: 1.25rem; }
.group .sites { list-style: none; padding: 0; margin: 0; columns: 2 260px; }
.group .sites label { font-weight: 400; margin: .2rem 0; }
.empty { text-align: center; color: var(--muted); }
.empty ol { text-align: left; display: inline-block; }
.pre { white-space: pre-wrap; }
.danger { margin-top: 2rem; text-align: right; }
.login { max-width: 380px; margin: 4rem auto; }
.login h1 { margin-bottom: 1.25rem; }
@media (max-width: 640px) { .hide-s { display: none; } .top { flex-wrap: wrap; gap: .5rem; } }

/* v0.2 */
button.small, .button.small { padding: .3rem .7rem; font-size: .85rem; }
button.ghost { color: var(--muted); }
button:disabled { opacity: .6; cursor: default; }
.right { text-align: right !important; }
table.backup-list { overflow: visible; }
.backup-error { display: block; margin-top: .25rem; color: var(--bad); font-size: .82rem; line-height: 1.35; white-space: normal; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.list.sites td { vertical-align: middle; }
.crumb { margin: 0 0 .5rem; font-size: .9rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kpis div { background: var(--bg); border-radius: 8px; padding: .8rem 1rem; }
.kpis b { display: block; font-size: 1.4rem; }
.kpis span { color: var(--muted); font-size: .85rem; }
.kpis .bad b { color: var(--bad); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.plain li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: none; }
details.card summary { cursor: pointer; }
details.card[open] summary { margin-bottom: 1rem; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* Oppdateringsvindu */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem;
  background: rgba(10, 12, 18, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal { width: min(560px, 100%); max-height: 85vh; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal-head { display: flex; align-items: center; gap: 1rem; }
.modal-head h2 { margin: 0; }
.modal-head p { margin: .15rem 0 0; }
.spinner { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--brand); animation: spin .9s linear infinite; }
.spinner.done { animation: none; border-color: var(--ok); background: var(--ok-bg); }
.has-errors .spinner.done { border-color: var(--bad); background: var(--bad-bg); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--panel2); border-radius: 99px; margin: 1.1rem 0 .8rem; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--brand); transition: width .4s ease; }
.has-errors .progress div { background: var(--bad); }
.update-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.update-list li { display: grid; grid-template-columns: 12px 1fr auto; gap: .2rem .6rem; align-items: center;
  padding: .5rem 0; border-bottom: 1px solid var(--line); }
.update-list li small { grid-column: 2 / 4; color: var(--bad); }
.update-list .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.update-list .is-running .dot { background: var(--brand); animation: pulse 1s ease-in-out infinite; }
.update-list .is-done .dot { background: var(--ok); }
.update-list .is-failed .dot, .update-list .is-stuck .dot { background: var(--bad); }
.update-list .state { font-size: .85rem; color: var(--muted); }
.update-list .is-done .state { color: var(--ok); }
.update-list .is-failed .state, .update-list .is-stuck .state { color: var(--bad); font-weight: 600; }
@keyframes pulse { 50% { opacity: .35; } }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }

/* ---------- v0.3: moderne bokser ---------- */
:root { --purple: #8b5cf6; --purple-bg: rgba(139,92,246,.14); --blue-bg: color-mix(in srgb, var(--brand) 14%, transparent); --green: #22c55e; }
.ico { vertical-align: -4px; flex: none; }
.card { border-radius: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-head h2 .ico { color: var(--brand); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat-card { position: relative; display: flex; gap: .85rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 1rem 1.1rem; min-height: 96px; overflow: hidden; }
.stat-card .spark { position: absolute; right: .8rem; top: 1rem; width: 90px; height: 30px; opacity: .9; }
.badge-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; flex: none; }
.tone-purple.badge-ico { background: var(--purple-bg); color: var(--purple); }
.tone-blue.badge-ico { background: var(--blue-bg); color: var(--brand); }
.tone-green.badge-ico { background: var(--ok-bg); color: var(--ok); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-value { font-size: 1.2rem; display: flex; align-items: center; gap: .35rem; margin: .1rem 0; }
.stat-value.good { color: var(--ok); } .stat-value.bad { color: var(--bad); } .stat-value.warn { color: var(--warn); }
.stat-body small { color: var(--muted); font-size: .78rem; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 130px; gap: .8rem; align-items: stretch; }
.kpi { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; display: flex; flex-direction: column; justify-content: space-between; gap: .6rem; min-width: 0; }
.kpi b { display: block; font-size: 1.45rem; }
.kpi b.bad { color: var(--bad); }
.kpi span { display: block; color: var(--muted); font-size: .82rem; }
.kpi .spark { width: 100%; height: 34px; }
.delta { display: inline-block; font-size: .78rem; font-weight: 600; margin-top: .25rem; }
.delta.good { color: var(--ok); } .delta.bad { color: var(--bad); } .delta.flat { color: var(--muted); }

.spark .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .area { opacity: .16; }
.spark.tone-green .line { stroke: var(--green); } .spark.tone-green .area, .spark.tone-green .end { fill: var(--green); }
.spark.tone-blue .line { stroke: var(--brand); } .spark.tone-blue .area, .spark.tone-blue .end { fill: var(--brand); }
.spark.tone-purple .line { stroke: var(--purple); } .spark.tone-purple .area, .spark.tone-purple .end { fill: var(--purple); }
.spark.tone-red .line { stroke: var(--bad); } .spark.tone-red .area, .spark.tone-red .end { fill: var(--bad); }

.ring { position: relative; display: grid; place-items: center; }
.ring svg { width: 120px; height: 120px; }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--line); }
.ring .value { stroke: var(--green); stroke-linecap: round; }
.ring .value.warn { stroke: #f59e0b; } .ring .value.bad { stroke: var(--bad); }
.ring-text { position: absolute; text-align: center; }
.ring-text b { display: block; font-size: 1.2rem; }
.ring-text span { font-size: .75rem; color: var(--muted); }
.small-note { margin: .9rem 0 0; font-size: .85rem; }

.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.25rem; }
.grid-2 > .card { margin-bottom: 1.25rem; }
.chart { width: 100%; height: auto; display: block; margin-bottom: .75rem; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.5; }
.chart .area { fill: var(--brand); opacity: .12; }
.chart .pt { fill: var(--card); stroke: var(--brand); stroke-width: 2; }
ul.plain.compact li { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
ul.plain.compact li .ico { color: var(--ok); }
details.more summary { cursor: pointer; color: var(--brand); font-size: .9rem; margin: .25rem 0 .5rem; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .55rem 0 .55rem 1.6rem; }
.tl-dot { position: absolute; left: 0; top: .85rem; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--card); background: var(--brand); }
.tl-content .tl-dot { background: var(--purple); } .tl-down .tl-dot { background: var(--bad); }
.tl-text small { display: block; }
.tl-time { white-space: nowrap; }

@media (max-width: 1100px) { .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .kpi-row { grid-template-columns: 1fr 1fr; } }
.stat-card .spark { position: static; width: 100%; height: 26px; margin-top: .45rem; opacity: 1; }
.stat-value { font-size: 1.1rem; white-space: nowrap; }
.stat-body { flex: 1; }
.title-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; padding: .2rem .7rem; border-radius: 99px; background: var(--panel2); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.tone-red.badge-ico { background: var(--bad-bg); color: var(--bad); }
.list.sites { border-radius: 14px; }

/* ---------- v0.3.1: forside ---------- */
.lead { margin: .25rem 0 0; }
.tone-amber.badge-ico { background: rgba(245,158,11,.14); color: #f59e0b; }
.spark.tone-amber .line { stroke: #f59e0b; } .spark.tone-amber .area, .spark.tone-amber .end { fill: #f59e0b; }
.grid-dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.grid-dash > .card { margin-bottom: 0; }
.search.inline { position: relative; margin: 0; flex: 1; max-width: 320px; }
.search.inline .ico { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search.inline input { padding-left: 2.1rem; }
.list.flat { border: none; background: transparent; }
.list.flat th { padding-left: .4rem; }
.list.flat td { padding: .7rem .4rem; }
.site-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: .5rem; }
.site-dot.ok { background: var(--green); } .site-dot.warn { background: #f59e0b; } .site-dot.bad { background: var(--bad); }
.indent { margin-left: 1.15rem; }
.bad-text { color: var(--bad); } .good-text { color: var(--ok); } .warn-text { color: var(--warn); }
.big-number { font-size: 1.8rem; font-weight: 700; margin: 0 0 .5rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.big-number small { font-size: .85rem; font-weight: 400; }
.system { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.1rem; align-items: center; }
.system p { margin: .2rem 0 0; }
.big-ico { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; }
.big-ico.ok { background: var(--ok-bg); color: var(--ok); } .big-ico.bad { background: var(--bad-bg); color: var(--bad); }
.mini-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 1rem; }
.mini-stats div { display: flex; flex-direction: column; gap: .2rem; padding: 0 .8rem; border-left: 1px solid var(--line); }
.mini-stats div:first-child { border-left: none; padding-left: 0; }
.mini-stats .ico { color: var(--brand); }
.mini-stats span { font-size: .8rem; color: var(--muted); }
.mini-stats b { font-size: 1.1rem; }
@media (max-width: 980px) { .grid-dash { grid-template-columns: 1fr; } }
main { max-width: 1320px; }
.site-cell { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.site-cell small { display: block; }
.site-dot { margin-right: 0; flex: none; }
.list.flat td:nth-child(3), .list.flat td:nth-child(4) { white-space: nowrap; }
.row-actions { flex-wrap: nowrap; }
.list.flat td:nth-child(2) .pill { margin: 0 .2rem .2rem 0; }

/* ---------- Mobil ---------- */
.grid-dash, .grid-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid-2 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
@media (max-width: 980px) { .grid-dash, .grid-2 { grid-template-columns: minmax(0, 1fr); } }
html, body { overflow-x: hidden; }

@media (max-width: 640px) {
  main { padding: 1rem .75rem 2.5rem; }
  h1 { font-size: 1.3rem; }
  .card { padding: 1rem; }

  /* Toppmeny: én linje, rull sidelengs ved behov */
  .top { flex-wrap: nowrap; gap: .75rem; padding: .6rem .75rem; overflow-x: auto; }
  .top nav { flex: none; }
  .top nav a { padding: .35rem .5rem; white-space: nowrap; }
  .brand { white-space: nowrap; }
  .logout { margin-left: auto; }
  .logout button { white-space: nowrap; }

  /* Knapper i toppen fyller bredden */
  .head .buttons { width: 100%; }
  .head .buttons > *, .head .buttons form button { flex: 1; }
  .head .buttons form { display: flex; flex: 1; }
  .head .buttons .button, .head .buttons button { text-align: center; justify-content: center; }

  /* Statuskort: to per rad, ikon over teksten */
  .stat-cards { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat-card { flex-direction: column; gap: .5rem; padding: .8rem; min-height: 0; }
  .badge-ico { width: 32px; height: 32px; border-radius: 9px; }
  .badge-ico .ico { width: 17px; height: 17px; }
  .stat-value { font-size: 1.05rem; white-space: normal; }

  /* Søk under overskriften i kortet */
  .card-head { flex-direction: column; align-items: stretch; gap: .6rem; }
  .search.inline { max-width: none; }

  /* Nettstedslisten blir kort i stedet for tabell */
  .list.sites thead { display: none; }
  .list.sites, .list.sites tbody, .list.sites tr { display: block; width: 100%; }
  .list.sites tr { padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .list.sites tr:last-child { border-bottom: none; }
  .list.sites td { display: block; border: none; padding: .2rem 0 !important; text-align: left !important; }
  .list.sites td.hide-s { display: inline-block; margin-right: 1rem; font-size: .85rem; color: var(--muted); }
  .list.sites td.hide-s::before { content: attr(data-label) " "; }
  .list.sites .row-actions { justify-content: flex-start; margin-top: .35rem; }

  /* KPI-er og systemstatus */
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 1.2rem; }
  .ring svg { width: 104px; height: 104px; }
  .system { grid-template-columns: 1fr; }
  .big-ico { width: 46px; height: 46px; }
  .mini-stats div { padding: 0 .5rem; }
  .mini-stats b { font-size: .95rem; }

  /* Oppdateringsvindu */
  .modal { padding: 1rem; }
  .modal-foot { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .top { scrollbar-width: none; }
  .top::-webkit-scrollbar { display: none; }
  .brand-name { display: none; }
  .top nav { gap: 0; }
  .top nav a { font-size: .9rem; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; overflow: visible; row-gap: .4rem; }
  .brand-name { display: inline; }
  .top nav { order: 3; width: 100%; justify-content: space-between; }
  .top nav a { flex: 1; text-align: center; }
}
.head .buttons button .ico, .head .buttons .button .ico { margin-right: .25rem; }
@media (max-width: 640px) {
  .head .buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .head .buttons > *:first-child:nth-last-child(3) { grid-column: 1 / -1; }
  .head .buttons form, .head .buttons .button, .head .buttons button { width: 100%; }
}
@media (max-width: 640px) {
  .head .buttons .button, .head .buttons button { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 44px; }
  .head .buttons form { height: 100%; }
}

/* ---------- Hamburgermeny (alle skjermer) ---------- */
.top { flex-wrap: nowrap; justify-content: space-between; }
.menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px;
  padding: 0 10px; border-radius: 10px; background: transparent; border: 1px solid var(--line); }
.menu-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.mobile-menu { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(10,12,18,.45);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; transition: opacity .2s; }
.mobile-menu[hidden] { display: none; }
.mobile-menu.open { opacity: 1; }
.mobile-menu-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); background: var(--card);
  border-left: 1px solid var(--line); padding: 1rem; display: flex; flex-direction: column; gap: 1rem;
  transform: translateX(100%); transition: transform .2s ease; overflow-y: auto; }
.mobile-menu.open .mobile-menu-panel { transform: none; }
.mobile-menu-head { display: flex; align-items: center; justify-content: space-between; }
.menu-close { width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem; }
.mobile-menu nav { display: flex; flex-direction: column; gap: .2rem; }
.mobile-menu nav a { padding: .8rem .9rem; border-radius: 10px; color: var(--text); font-size: 1.05rem; font-weight: 500; }
.mobile-menu nav a.on { background: var(--panel2); color: var(--brand); }
.mobile-menu-actions { display: flex; flex-direction: column; gap: .5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.mobile-menu-actions button, .mobile-menu-actions .button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; }
.mobile-logout { margin-top: auto; border-top: 1px solid var(--line); padding-top: 1rem; }
.mobile-logout button { font-size: 1rem; }
body.no-scroll { overflow: hidden; }
.top .brand { margin-right: auto; }


/* Ikonknapp (Se etter oppdateringer) */
.icon-btn { display: inline-grid !important; place-items: center; width: 40px; height: 40px; padding: 0 !important; }
.icon-btn .ico { margin: 0 !important; }
.icon-btn:hover .ico { transform: rotate(90deg); transition: transform .25s; }
@media (max-width: 640px) {
  .head .buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
  .head .buttons > * { flex: 1 1 40%; }
  .head .buttons > form:has(.icon-btn) { flex: 0 0 44px; }
  .head .buttons .icon-btn { width: 44px; height: 44px; min-height: 44px; }
}
@media (max-width: 640px) {
  .head .buttons > * { flex: 1 1 auto; }
  .head .buttons button, .head .buttons .button { white-space: nowrap; padding-left: .7rem; padding-right: .7rem; }
}
.kpi-row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card-head h2 .tag { font-size: .72rem; margin-left: .2rem; }
@media (max-width: 1100px) { .kpi-row-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpi-row-5 { grid-template-columns: 1fr 1fr; } }

/* ---------- v0.5: skjemaer, kunder, innstillinger ---------- */
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem .2rem; margin: 0 0 1rem; }
legend { padding: 0 .4rem; font-weight: 600; color: var(--muted); font-size: .85rem; }
select { font: inherit; width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); margin-top: .25rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.new-client { border-left: 3px solid var(--brand); padding-left: .9rem; margin-bottom: .9rem; }
.new-client[hidden] { display: none; }
.report-preview { background: var(--panel2); border-radius: 10px; padding: .7rem .9rem; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .2rem; }
.form-card { max-width: 720px; }
.form-card .form { max-width: none; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.card-head .button.small { align-self: center; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }

/* ---------- v0.6: innlogging og konto ---------- */
.login-body footer { display: none; }
.login-body main { max-width: none; padding: 0; }
.login-body { min-height: 100vh;
  background: radial-gradient(1200px 600px at 15% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, rgba(14,192,148,.12), transparent 60%), var(--bg); }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 2rem 1.75rem; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand h1 { margin: .9rem 0 .3rem; font-size: 1.5rem; }
.login-brand p { margin: 0; }
.login-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; color: #fff;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.login-mark svg { width: 28px; height: 28px; }
.login-sso { display: flex !important; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  padding: .85rem 1rem; font-size: 1rem; font-weight: 600; border-radius: 10px; }
.login-note { text-align: center; font-size: .85rem; margin: .7rem 0 0; }
.login-form label { margin-bottom: .8rem; }
.login-submit { width: 100%; padding: .75rem; border-radius: 10px; font-weight: 600; }
.login-local { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.login-local summary { cursor: pointer; color: var(--muted); font-size: .85rem; text-align: center; list-style: none; }
.login-local summary::-webkit-details-marker { display: none; }
.login-local[open] summary { margin-bottom: 1rem; }
.login-foot { font-size: .8rem; margin-top: 1.2rem; }

.avatar { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: var(--brand); color: var(--btn-text); font-weight: 700; font-size: 1.2rem; }
.avatar.small { width: 28px; height: 28px; font-size: .8rem; }
.user-link { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); padding: .25rem .6rem .25rem .3rem; border-radius: 99px; }
.user-link:hover, .user-link.on { background: var(--panel2); text-decoration: none; }
.account-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.account-head > div { display: flex; flex-direction: column; }
.account-name { font-size: 1.15rem; }
table.kv { width: 100%; border-collapse: collapse; margin: .5rem 0 1.2rem; }
table.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: .5rem 0; width: 42%; vertical-align: top; }
table.kv td { padding: .5rem 0; }
table.kv tr + tr th, table.kv tr + tr td { border-top: 1px solid var(--line); }
.action-list { display: flex; flex-direction: column; gap: .5rem; }
.action-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; padding: .85rem;
  border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.action-row:hover { background: var(--panel2); text-decoration: none; border-color: var(--brand); }
.action-row small { display: block; }
.chev { color: var(--muted); font-size: 1.3rem; }
.mobile-logout { display: flex; align-items: center; justify-content: space-between; }
@media (max-width: 640px) { .top .user-link { display: none; } }

/* ---------- v0.7: rapporter og innstillinger ---------- */
.month-pick select { margin: 0; min-width: 170px; }
label.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .3rem; }
label.check small { display: block; color: var(--muted); }
.inline-form { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.inline-form label { flex: 1; margin: 0; min-width: 200px; }
code { background: var(--panel2); padding: .05rem .35rem; border-radius: 5px; font-size: .88em; }
.form-card + .form-card { margin-top: 1.25rem; }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- v0.8 backup ---------- */
.card-head form { margin: 0; }
.backup-live { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; margin-bottom: 1rem;
  border-radius: 10px; background: var(--warn-bg); }
.backup-live .spinner { width: 20px; height: 20px; flex: 0 0 20px; border-width: 2px; }
.backup-live.ok { background: var(--ok-bg); }
.backup-live.ok .spinner, .backup-live.bad .spinner { animation: none; }
.backup-live.bad { background: var(--bad-bg); }
table.backup-list { overflow: visible; }
.backup-error { display: block; margin-top: .25rem; color: var(--bad); font-size: .82rem; line-height: 1.35; white-space: normal; }
.row-actions { display: flex; gap: .6rem; align-items: center; justify-content: flex-end; white-space: nowrap; }
.row-actions form { margin: 0; }
details.dl { position: relative; }
details.dl > summary { list-style: none; cursor: pointer; }
details.dl > summary::-webkit-details-marker { display: none; }
.dl-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 230px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: .35rem; }
.dl-menu a { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .6rem; border-radius: 7px; text-decoration: none; }
.dl-menu a:hover { background: var(--panel2); }
.small-note { font-size: .85rem; margin: .8rem 0 0; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
@media (max-width: 640px) {
  .backup-list thead { display: none; }
  .backup-list tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "time status" "size actions";
    gap: .35rem .8rem; padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
  .backup-list tr:last-child { border-bottom: 0; }
  .backup-list td { display: block; padding: 0; border: 0; }
  .backup-list td:nth-child(1) { grid-area: time; font-weight: 600; }
  .backup-list td:nth-child(2) { display: none; }
  .backup-list td:nth-child(3) { grid-area: size; color: var(--muted); }
  .backup-list td:nth-child(4) { grid-area: status; text-align: right; }
  .backup-list td:nth-child(5) { grid-area: actions; }
  .backup-error { max-width: 220px; margin-left: auto; text-align: right; }
  .row-actions { gap: .8rem; }
  .dl-menu { min-width: 200px; }
}


/* ---------- v0.8.1: Grow-farger, lys/mørk og Kopperud Nordic-logo ---------- */
.brand .logo { width: 30px; height: 30px; display: block; flex: none; }
.brand { gap: .55rem; font-weight: 500; }
.brand b { font-weight: 750; }
.top { box-shadow: var(--shadow); }
.top nav a.on { background: var(--nav-active); color: var(--text); font-weight: 600; }
.card, .stats div, .facts div { box-shadow: var(--shadow); }
input, textarea, select { background: var(--field-bg); border-color: var(--field-border); color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; border-color: var(--brand); }
.kpis div, .tag, table.list thead th { background: var(--panel2); }
table.list thead th { color: var(--muted); }
.theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1.05rem; line-height: 1; flex: none; }
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle .moon { display: inline; } .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: inline; }
.mobile-menu-head .head-actions { display: flex; gap: .5rem; align-items: center; }
.login-mark img { width: 38px; height: 38px; }
.login-top { position: fixed; top: 1rem; right: 1rem; }
:root[data-theme="dark"] .modal-backdrop, :root[data-theme="dark"] .mobile-menu { background: rgba(0, 0, 0, .55); }
@media (max-width: 640px) {
  .top > .theme-toggle { margin-left: auto; width: 42px; height: 42px; }
  .top { gap: .5rem; }
}

details.advanced { margin: .2rem 0 1rem; }
details.advanced > summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-bottom: .6rem; }

/* ---------- v0.8.4: backupvindu ---------- */
.backup-pill { display: inline-flex; align-items: center; gap: .45rem; height: 36px; padding: 0 .8rem; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--line)); background: color-mix(in srgb, var(--brand) 12%, var(--card));
  color: var(--text); font-weight: 600; font-size: .85rem; white-space: nowrap; flex: none; }
.backup-pill[hidden] { display: none; }
.mini-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-top-color: var(--brand); animation: spin .8s linear infinite; }
.modal-backdrop[hidden] { display: none; }
.backup-jobs { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.backup-jobs li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.backup-jobs li:last-child { border-bottom: 0; }
.bj-top { display: grid; grid-template-columns: 12px 1fr auto; gap: .6rem; align-items: center; }
.bj-top a { color: var(--text); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bj-top .state { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.backup-jobs .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.backup-jobs .is-running .dot { background: var(--brand); animation: pulse 1s ease-in-out infinite; }
.backup-jobs .is-queued .dot { background: var(--muted); opacity: .6; }
.backup-jobs .is-done .dot { background: var(--ok); }
.backup-jobs .is-failed .dot { background: var(--bad); }
.backup-jobs .is-done .state { color: var(--ok); }
.backup-jobs .is-failed .state { color: var(--bad); font-weight: 600; }
.bj-bar { height: 8px; margin: .45rem 0 .3rem 1.35rem; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.bj-bar div { height: 100%; border-radius: 99px; background: var(--brand); transition: width .8s ease; }
.is-running .bj-bar div { min-width: 6%;
  background-image: linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.28) 75%, transparent 75%);
  background-size: 18px 18px; animation: bj-stripes .9s linear infinite; }
.is-queued .bj-bar { background-image: linear-gradient(90deg, var(--panel2) 0%, color-mix(in srgb, var(--muted) 18%, var(--panel2)) 50%, var(--panel2) 100%);
  background-size: 200% 100%; animation: bj-wait 1.6s ease-in-out infinite; }
.is-done .bj-bar div { background: var(--ok); }
.is-failed .bj-bar div { background: var(--bad); }
.backup-jobs small { display: block; margin-left: 1.35rem; color: var(--muted); font-size: .82rem; }
.backup-jobs .is-failed small { color: var(--bad); }
@keyframes bj-stripes { to { background-position: 18px 0; } }
@keyframes bj-wait { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (max-width: 640px) {
  .top > .backup-pill { margin-left: auto; height: 42px; }
  .top > .backup-pill + .theme-toggle { margin-left: 0; }
  .backup-pill [data-backup-pill-text] { display: none; }
  .backup-pill { width: 42px; justify-content: center; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .is-running .bj-bar div, .is-queued .bj-bar, .mini-spin { animation: none; }
}
#backup-modal .progress div { background: var(--brand); }

/* ---------- v0.9: gjenoppretting ---------- */
.restore-confirm { gap: .2rem; }
.restore-confirm h2 { margin: 0 0 .6rem; }
.restore-confirm p { margin: 0 0 .9rem; }
.restore-confirm .modal-foot { justify-content: flex-end; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
:root[data-theme="dark"] button.danger { color: #17191f; }
.backup-live button { margin-left: auto; }
.restore-note.done { color: var(--ok); }
.restore-note.failed { color: var(--bad); }

/* ---------- v0.9.1: Backup-oversikt ---------- */
small.block { display: block; margin-top: .15rem; }
.backup-overview td { vertical-align: top; }
.backup-overview .tag { white-space: nowrap; }
.backup-overview tr.st-off td, .backup-overview tr.st-disconnected td { opacity: .65; }
@media (max-width: 640px) {
  .backup-overview thead { display: none; }
  .backup-overview tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "site status" "last actions" "err err";
    gap: .35rem .8rem; padding: .75rem .8rem; border-bottom: 1px solid var(--line); }
  .backup-overview tr:last-child { border-bottom: 0; }
  .backup-overview td { display: block; padding: 0; border: 0; }
  .backup-overview td:nth-child(1) { grid-area: site; }
  .backup-overview td:nth-child(2) { grid-area: last; font-size: .9rem; }
  .backup-overview td:nth-child(3) { display: none; }
  .backup-overview td:nth-child(4) { display: contents; }
  .backup-overview td:nth-child(4) .tag { grid-area: status; justify-self: end; align-self: start; }
  .backup-overview td:nth-child(4) .backup-error { grid-area: err; max-width: none; margin: 0; text-align: left; }
  .backup-overview td:nth-child(5) { grid-area: actions; align-self: end; }
}

/* ---------- v0.9.3: SEO-kort ---------- */
.seo-kpis { margin-bottom: 1rem; }
.seo-kpis .kpi b small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.seo-kpis .kpi b.good { color: var(--ok); } .seo-kpis .kpi b.warn { color: var(--warn); } .seo-kpis .kpi b.bad { color: var(--bad); }
.seo-card .mini-spin { display: inline-block; vertical-align: -2px; margin-right: .4rem; }
.pos { display: inline-block; min-width: 2.4rem; text-align: center; padding: .1rem .5rem; border-radius: 99px; font-weight: 700;
  font-variant-numeric: tabular-nums; background: var(--panel2); }
.pos.top3 { background: var(--ok-bg); color: var(--ok); }
.pos.top10 { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.seo-kpis.kpi-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
