/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* greenhouse — minimal, svartvitt i släkt med gronare, plus växthusgrön accent */
:root { --ink: #1a1a1a; --muted: #737373; --line: #e5e5e5; --soft: #fafafa; --accent: #2e7d4f; --warn: #b45309; --crit: #b91c1c;
  --accent-ink: #26663f; --accent-wash: #f3f9f5; --accent-line: #cfe6d8; --warn-wash: #fdf6ec; --crit-wash: #fdf0ef; }

/* Turbo Drive laddningsindikator — syns vid sega navigeringar (motorkoll, sync,
   ombygge). Grön, tydligare än Turbos default så man ser att något händer. */
.turbo-progress-bar { height: 3px; background: var(--accent); box-shadow: 0 0 6px rgba(46,125,79,0.6); }
body { font-family: ui-sans-serif, system-ui, sans-serif; color: var(--ink); margin: 0; border-top: 3px solid var(--accent); }
.topnav { border-bottom: 1px solid var(--line); }
.topnav-inner { display: flex; gap: 1.5rem; align-items: center; max-width: 70rem; margin: 0 auto; padding: 0.9rem 2rem; }
.topnav a { color: var(--ink); text-decoration: none; padding: 0.15rem 0; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--accent); }
.topnav a.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.topnav-right { margin-left: auto; display: flex; gap: 1.5rem; align-items: baseline; }
.topnav-right form { display: inline; }
.linklike { background: none; border: 0; padding: 0; color: #737373; cursor: pointer; font: inherit; }
/* Base .flash — kept for in-flow banners that are NOT toasts: inline form-error
   boxes (.flash.flash-alert), the auth-layout flash, and the DB-backed
   .flash.activation-offer aktiveringsprompt under the page header. */
.flash { max-width: 70rem; margin: 0 auto; padding: 0.6rem 2rem; font-size: 0.9rem; display: flex; align-items: baseline; gap: 1rem; }
.flash-notice { background: #f0f7f0; color: #1a4d1a; }
.flash-alert { background: #fdf0f0; color: #7a1a1a; }

/* Toasts — flytande notiser uppe till höger under navet, fixed OVANPÅ innehållet så
   layouten under aldrig förskjuts. Vit/ljus tint-botten, hårfin ram, mjuk skugga, färgad
   statusprick. success/notis självdör (8 s) med en tömningslist; varning/fel ligger kvar
   tills de stängs. Stacken släpper igenom klick i mellanrummen (pointer-events). */
.toaststack { position: fixed; top: 3.6rem; right: 1.25rem; z-index: 60; display: flex; flex-direction: column; gap: 0.6rem; width: min(420px, calc(100vw - 2.5rem)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; display: flex; align-items: flex-start; gap: 0.6rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem 0.85rem 0.75rem; font-size: 0.88rem; line-height: 1.35; color: var(--ink); box-shadow: 0 6px 24px rgba(15,20,17,0.14); overflow: hidden; }
.toast-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 0.4rem; background: var(--muted); }
.toast-msg { flex: 1; min-width: 0; }
.toast-close { flex: none; margin: -0.15rem -0.2rem 0 0; background: none; border: 0; cursor: pointer; font-size: 1.05rem; line-height: 1; color: currentColor; opacity: 0.6; padding: 0.1rem 0.3rem; border-radius: 4px; }
.toast-close:hover { opacity: 1; }
.toast-close:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; opacity: 1; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform-origin: left; transform: scaleX(1); background: currentColor; opacity: 0.45; animation-name: toastdrain; animation-timing-function: linear; animation-fill-mode: forwards; animation-play-state: paused; }
@keyframes toastdrain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast-success { border-color: var(--accent-line); background: var(--accent-wash); color: var(--accent-ink); }
.toast-success .toast-dot { background: var(--accent); }
.toast-warning { border-color: #f0d68a; background: var(--warn-wash); color: #7a5a10; }
.toast-warning .toast-dot { background: var(--warn); }
.toast-error { border-color: #f0c4c0; background: var(--crit-wash); color: #7a1a1a; }
.toast-error .toast-dot { background: var(--crit); }
@media (prefers-reduced-motion: reduce) { .toast-bar { animation: none; display: none; } }
.qr svg { max-width: 220px; height: auto; }
body.auth { display: grid; place-items: center; min-height: 100vh; background: #fafafa; }
.auth-card { max-width: 22rem; width: 100%; background: #fff; border: 1px solid #e5e5e5; padding: 2.5rem; }
.auth-brand { display: block; margin-bottom: 1.5rem; }
.auth-card input[type="email"], .auth-card input[type="password"], .auth-card input[type="text"] { width: 100%; box-sizing: border-box; padding: 0.5rem; margin: 0.25rem 0 0.75rem; border: 1px solid #d4d4d4; font: inherit; }
main { padding: 2rem; max-width: 70rem; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; }
h1, h2 { font-weight: 600; text-transform: lowercase; }
table { border-collapse: collapse; width: 100%; margin-top: 1rem; }
th { text-align: left; font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: #737373; }
th, td { padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid #e5e5e5; }
.mono { font-family: ui-monospace, monospace; font-size: 0.85em; }
.muted { color: #737373; }
.btn { background: #0a0a0a; color: #fff; border: 0; padding: 0.5rem 1rem; cursor: pointer; text-decoration: none; }
.timeline { list-style: none; padding: 0; }
.timeline li { padding: 0.5rem 0; border-bottom: 1px solid #eee; display: flex; gap: 1rem; }
.timeline .kind { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: #737373; align-self: center; }

/* dashboard */
.head-note { font-size: 0.85rem; display: flex; gap: 0.4rem; align-items: baseline; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 1.5rem 0 2rem; }
.kpi { background: #fff; padding: 1.1rem 1.25rem; text-decoration: none; display: block; color: var(--ink); }
.kpi:hover { background: var(--soft); }
.kpi .n { font-size: 1.9rem; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .n small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.kpi .l { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; }
.kpi.attn .n { color: var(--warn); }
.num { font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 2.5rem; align-items: start; }
@media (max-width: 56rem) { .cols { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; }
.mt { margin-top: 1rem; }

/* statuschips */
.chip { display: inline-block; font-size: 0.72rem; padding: 0.15rem 0.55rem; border-radius: 2px; white-space: nowrap; }
.chip.ok { background: #eef6f0; color: var(--accent); }
.chip.warn { background: #fbf3e8; color: var(--warn); }
.chip.crit { background: #fdf0f0; color: var(--crit); }
.chip.still { background: #f1f5f9; color: #475569; }

/* händelseflöde */
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 0.9rem; padding: 0.55rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; align-items: baseline; }
.feed .kind { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.feed .kind::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d4d4d4; margin-right: 0.45rem; position: relative; top: -1px; }
.feed .kind.k-form::before, .feed .kind.k-pay::before { background: var(--accent); }
.feed .kind.k-invoice::before { background: #64748b; }
.feed .kind.k-deploy::before { background: #0ea5e9; }
.feed .kind.k-mail::before { background: #a855f7; }
.feed time { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
/* verbose event detail tucked in a details/summary expander (reuses .setdisc) */
.feed-detail { margin-top: 0.3rem; }
.feed-detail > div { margin-top: 0.2rem; }
/* compact struktur-status bredvid motor-pillen på sajtvyn — wrappern påverkar inte layouten
   (display:contents), chippet dyker upp bara vid avvikelse eller mall-notis */
.structure-chip { display: contents; }

/* kundvy */
.cust-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.cust-meta { font-size: 0.88rem; margin-top: -0.5rem; }
.panel { border: 1px solid var(--line); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.panel h2 { margin-top: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1.25rem; font-size: 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sitecard { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.sitecard:last-child { border-bottom: 0; }

/* sajtadmin + formulär */
.section-gap { margin-top: 2.5rem; }
.h2-note { font-weight: 400; font-size: 0.85em; }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.btn.small { font-size: 0.78rem; padding: 0.3rem 0.7rem; }
.head-note .btn { text-decoration: none; display: inline-block; }
.narrow { max-width: 24rem; display: flex; flex-direction: column; gap: 0.25rem; }
.narrow label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 0.8rem; }
.narrow input[type="text"], .narrow input[type="email"], .narrow input[type="tel"], .narrow input[type="date"], .narrow input[type="number"], .narrow select, .narrow textarea { padding: 0.5rem; border: 1px solid #d4d4d4; font: inherit; }
.head-actions { margin-left: auto; display: flex; gap: 0.5rem; }
.head-actions .btn { text-decoration: none; }
.row-dim td { color: var(--muted); }
.unread-dot { color: var(--accent); }
blockquote.message { border-left: 3px solid var(--line); margin: 1.25rem 0; padding-left: 1rem; font-size: 0.95rem; }
.checklist { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
.checklist .check { all: unset; cursor: pointer; }
.panel-action { font-size: 0.75rem; font-weight: 400; text-transform: none; margin-left: 0.6rem; }
.inline-add { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.inline-add input[type="email"] { flex: 1; padding: 0.4rem; border: 1px solid #d4d4d4; font: inherit; font-size: 0.85rem; }
.stat-totals { margin: 0 0 0.6rem; font-size: 0.9rem; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 3.2rem; }
.spark span { flex: 1; background: var(--accent); opacity: 0.75; min-height: 2px; border-radius: 1px 1px 0 0; }
.narrow.wide { max-width: 40rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-form input { padding: 0.5rem; border: 1px solid #d4d4d4; font: inherit; }
.code-input { font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.btn.is-loading { opacity: 0.6; cursor: progress; }
.chip.lock { background: #f1f5f9; color: #475569; }
.reveal-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* shared row style: features + listings panels */
.lrows { display: flex; flex-direction: column; }
.lrow { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 0.25rem 1rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.lrow.lrow-2 { grid-template-columns: 1fr auto; }
.lrow:last-child { border-bottom: 0; }
.lrow form { display: inline; }
.chip.cat { background: #eef2f8; color: #3b5b8c; }
.chip.art { background: #f6efe8; color: #8a5a2b; }

/* feature toggle switch */
button.switch { width: 2.4rem; height: 1.3rem; border-radius: 999px; border: 1px solid #d4d4d4; background: #e5e5e5; padding: 0.1rem; cursor: pointer; display: inline-flex; align-items: center; transition: background 0.15s ease; }
button.switch .knob { width: 1rem; height: 1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s ease; }
button.switch.is-on { background: var(--accent); border-color: var(--accent); }
button.switch.is-on .knob { transform: translateX(1.05rem); }
button.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { button.switch, button.switch .knob { transition: none; } }

/* listing preset picker */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; max-width: 60rem; }
.preset { border: 1px solid var(--line); padding: 1rem 1.1rem; cursor: pointer; display: block; }
.preset:hover { background: var(--soft); }
.preset:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.preset input[type="radio"] { position: absolute; opacity: 0; }
.preset .name { font-weight: 600; display: block; }
.preset .desc { font-size: 0.82rem; color: var(--muted); margin-top: 0.3rem; display: block; line-height: 1.45; }
.preset .from { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 0.3rem; }
.warnbox { background: #fdf6ee; border: 1px solid #f0dcc0; border-left: 3px solid var(--warn); padding: 0.8rem 1rem; font-size: 0.9rem; max-width: 32rem; }
.warnbox ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.preview { background: var(--soft); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 0.8rem 1rem; font-size: 0.85rem; margin-top: 1.5rem; max-width: 28rem; }
.preview ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.reveal-row .reveal-value { word-break: break-all; }
@keyframes gh-spin { to { transform: rotate(360deg); } }
.btn.is-loading::after { content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-left: 0.5em; vertical-align: -0.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gh-spin 0.6s linear infinite; }
.narrow textarea { padding: 0.5rem; border: 1px solid #d4d4d4; font: inherit; }
.kv .linklike, .kv form { display: inline; }
.narrow .btn { margin-top: 1.2rem; align-self: flex-start; }
.small-note { font-size: 0.8rem; }

/* ============================================================
   Kundportalen — softer, warmer chrome per the approved mockup.
   Scoped under body.portal so it never touches the operator UI.
   ============================================================ */
body.portal { line-height: 1.55; }
body.portal a { color: var(--ink); }

/* Thin banner when an operator views a customer's portal from greenhouse. */
.portal-operatorbar { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.4rem 1.5rem; font-size: 0.82rem; background: var(--accent); color: #fff; }
.portal-operatorbar form { display: inline; }
.portal-operatorbar .linklike { color: #fff; text-decoration: underline; font-size: 0.82rem; }

.portalbar { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--line); max-width: 60rem; margin: 0 auto; }
.portalbar .wordmark { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.portalbar .wordmark .leaf, .portal-foot .wordmark .leaf { color: var(--accent); }
.portal-site { color: var(--muted); font-size: 0.88rem; }
.portal-who { margin-left: auto; color: var(--muted); font-size: 0.85rem; display: flex; gap: 1rem; align-items: center; }
.portal-who .linklike { color: var(--muted); }
.portal-avatar { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #eef6f0; color: var(--accent); display: grid; place-items: center; font-size: 0.78rem; font-weight: 600; }

.portaltabs { max-width: 60rem; margin: 0 auto; display: flex; gap: 0.3rem; padding: 0 1.5rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.portaltabs .tab { padding: 0.7rem 0.3rem; margin-right: 1.1rem; color: var(--muted); text-decoration: none; font-size: 0.92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.portaltabs .tab.here { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }

.portal-flash { max-width: 60rem; margin: 1rem auto -0.5rem; padding: 0.6rem 1.5rem; font-size: 0.9rem; border-radius: 3px; }
.portal-main { padding: 2.25rem 1.5rem 1rem; max-width: 60rem; margin: 0 auto; }
body.portal h1 { font-weight: 600; text-transform: lowercase; font-size: 1.55rem; margin: 0 0 0.2rem; letter-spacing: -0.01em; }
body.portal h2 { font-weight: 600; text-transform: lowercase; font-size: 1.05rem; margin: 0 0 0.9rem; }
body.portal h3 { font-weight: 600; font-size: 0.95rem; margin: 0 0 0.4rem; }
body.portal .lede { color: var(--muted); font-size: 1rem; margin: 0 0 1.9rem; }
body.portal .panel { border: 1px solid var(--line); border-radius: 4px; padding: 1.25rem 1.4rem; margin-bottom: 1.35rem; }
body.portal .panel.pad-sm { padding: 1rem 1.15rem; }
body.portal .panel h2 { margin-top: 0; }
.portal-cta { background: var(--soft); }
.portal-cta .muted { font-size: 0.9rem; margin: 0.2rem 0 1rem; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.panel-head h2 { margin: 0; }
body.portal .grid2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.35rem; align-items: start; }
@media (max-width: 44rem) { body.portal .grid2 { grid-template-columns: 1fr; } .portal-site { display: none; } }

body.portal .btn { border-radius: 3px; padding: 0.62rem 1.15rem; font-size: 0.9rem; text-decoration: none; display: inline-block; }
body.portal .btn.accent { background: var(--accent); color: #fff; }
body.portal .btn.accent:hover { background: #26663f; }

body.portal .chip.ok { background: #eef6f0; color: var(--accent); }
body.portal .chip.info { background: #eef2f8; color: #3b5b8c; }

.trust { display: flex; align-items: center; gap: 0.85rem; background: #eef6f0; border: 1px solid #d5e8dc; border-radius: 4px; padding: 0.95rem 1.2rem; margin-bottom: 1.5rem; }
.trust .mark { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.05rem; flex: none; }
.trust .txt strong { display: block; font-size: 0.98rem; }
.trust .txt span { color: #4b6b58; font-size: 0.85rem; }

.stat-total { font-size: 2.1rem; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1; }
.stat-total small { font-size: 0.95rem; color: var(--muted); font-weight: 400; }
.stat-sub { color: var(--muted); font-size: 0.85rem; margin: 0.35rem 0 1.1rem; }
.per-site { list-style: none; margin: 0 0 1.1rem; padding: 0; }
.per-site li { display: flex; justify-content: space-between; gap: 0.9rem; padding: 0.3rem 0; font-size: 0.88rem; border-bottom: 1px solid #f1f1f1; }
.per-site .host { color: var(--muted); }
.per-site .count { font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 5rem; }
.bars .bar { flex: 1; background: var(--accent); opacity: 0.8; min-height: 3px; border-radius: 2px 2px 0 0; }
.conv { margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.conv b { color: var(--accent); }

body.portal .rows { list-style: none; margin: 0; padding: 0; }
body.portal .rows li { display: flex; gap: 0.9rem; align-items: baseline; padding: 0.7rem 0; border-bottom: 1px solid #f1f1f1; font-size: 0.92rem; }
body.portal .rows li:last-child { border-bottom: 0; }
body.portal .rows .when { color: var(--muted); font-size: 0.78rem; white-space: nowrap; font-variant-numeric: tabular-nums; margin-left: auto; }
body.portal .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; align-self: center; }

body.portal .form { display: flex; flex-direction: column; gap: 0.35rem; }
body.portal .form label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 1rem; }
body.portal .form label:first-of-type { margin-top: 0; }
body.portal .form input, body.portal .form textarea { padding: 0.65rem 0.75rem; border: 1px solid #d4d4d4; border-radius: 3px; font: inherit; font-size: 0.95rem; }
body.portal .form textarea { min-height: 7rem; resize: vertical; }
body.portal .form .hint { font-size: 0.82rem; color: var(--muted); }
body.portal .dropzone { position: relative; }
body.portal .dropzone-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
body.portal .dropzone-inner { display: flex; align-items: center; gap: 0.7rem; padding: 1.1rem 1.2rem; border: 1.5px dashed #c4c4c4; border-radius: 5px; background: #fafafa; color: var(--muted); font-size: 0.9rem; cursor: pointer; text-transform: none; letter-spacing: 0; margin-top: 0; transition: border-color 0.15s, background 0.15s; }
body.portal .dropzone-inner:hover { border-color: var(--accent); background: #f4f9f5; }
body.portal .dropzone.is-drag .dropzone-inner { border-color: var(--accent); background: #eef6f0; color: var(--accent); }
body.portal .dropzone-input:focus-visible + .dropzone-inner { outline: 2px solid var(--accent); outline-offset: 2px; }
body.portal .dropzone-clip { flex: none; color: var(--accent); }
body.portal .dropzone-text b { color: var(--ink); font-weight: 600; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { display: flex; gap: 0.8rem; padding: 0.55rem 0; font-size: 0.92rem; }
.steps li::before { counter-increment: s; content: counter(s); flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #eef6f0; color: var(--accent); font-weight: 600; font-size: 0.82rem; display: grid; place-items: center; }
.steps li b { display: block; }
.steps li span span { color: var(--muted); font-size: 0.85rem; }

body.portal table { border-collapse: collapse; width: 100%; margin-top: 0; }
body.portal th { text-align: left; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
body.portal th, body.portal td { padding: 0.7rem 0.5rem 0.7rem 0; border-bottom: 1px solid #f1f1f1; font-size: 0.92rem; }
body.portal td.amt { font-variant-numeric: tabular-nums; }
.plan-box { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.plan-box .price { font-size: 1.7rem; font-weight: 300; }
body.portal .kv { grid-template-columns: auto 1fr; gap: 0.45rem 1.5rem; font-size: 0.92rem; margin-top: 0.3rem; }

.portal-foot { max-width: 60rem; margin: 2.5rem auto 0; padding: 1.6rem 1.5rem 2.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; color: var(--muted); font-size: 0.88rem; flex-wrap: wrap; }
.portal-foot .wordmark { font-weight: 600; color: var(--ink); }
.portal-foot a { color: var(--accent); text-decoration: none; }

.portal-auth { max-width: 24rem; }
.portal-authnote { font-size: 0.82rem; margin-top: 1.2rem; }
.portal-auth a { color: var(--accent); }

/* Ändringshistorik (P2) — a warm list of published changes + calm revert. */
body.portal .btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
body.portal .btn.ghost:hover { background: var(--soft); }
body.portal .btn.small { font-size: 0.82rem; padding: 0.38rem 0.8rem; }

.portal-siteswitch { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: -0.8rem 0 1.6rem; }
.portal-siteswitch a { font-size: 0.85rem; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.8rem; }
.portal-siteswitch a.here { color: var(--accent); border-color: #d5e8dc; background: #eef6f0; }

.change { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 0.9rem; overflow: hidden; }
.change-head { display: flex; align-items: center; gap: 0.8rem; padding: 0.95rem 1.15rem; }
.change-head .avatar { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #eef6f0; color: var(--accent); display: grid; place-items: center; font-size: 0.78rem; font-weight: 600; flex: none; }
.change-head .what { font-size: 0.95rem; }
.change-head .what .when { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.1rem; }
.change-head .actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
@media (max-width: 44rem) {
  .change-head { flex-wrap: wrap; }
  .change-head .actions { margin-left: 2.7rem; }
}

.confirm { background: var(--soft); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; padding: 1rem 1.15rem; margin-top: 1rem; font-size: 0.92rem; }
.confirm strong { display: block; margin-bottom: 0.3rem; }
.confirm .buttons { margin-top: 0.9rem; display: flex; gap: 0.6rem; align-items: center; }
.confirm .buttons form { display: inline; }

/* ── ändringshistorik: progressiv före/efter-diff (redesign) ── */
.peekhint { display: flex; align-items: center; gap: 0.55rem; color: var(--muted); font-size: 0.84rem; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem; margin: -0.6rem 0 1.4rem; width: fit-content; }
.peekhint .k { color: var(--accent); }

.change.open { border-color: #d5e8dc; }
.change-head { cursor: pointer; }
.change-head:hover { background: var(--soft); }
.change-head .avatar.alt { background: #eef2f8; color: #3b5b8c; }
.change-head .peek { color: var(--accent); font-size: 0.82rem; display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; text-decoration: none; }
.change-head .peek .chev { transition: transform 0.18s; display: inline-block; }
.change.open .change-head .peek .chev { transform: rotate(90deg); }
.change-body { padding: 0 1.15rem 1.15rem 3.9rem; }
@media (max-width: 40rem) { .change-body { padding-left: 1.15rem; } .change-head .peek .txt { display: none; } }

.skel-diff { border-left: 3px solid var(--line); padding: 0.5rem 0 0.3rem 1rem; margin-top: 0.3rem; }
.skel-line { height: 0.7rem; border-radius: 3px; margin: 0.55rem 0; background: linear-gradient(90deg, #ececec 25%, #f5f5f5 37%, #ececec 63%); background-size: 400% 100%; animation: gh-shimmer 1.3s ease-in-out infinite; }
.skel-line.w1 { width: 30%; } .skel-line.w2 { width: 78%; } .skel-line.w3 { width: 55%; } .skel-line.w4 { width: 66%; }
.skel-note { color: var(--muted); font-size: 0.8rem; margin-top: 0.7rem; display: flex; align-items: center; gap: 0.45rem; }
.spin { width: 0.8rem; height: 0.8rem; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: gh-spin 0.7s linear infinite; display: inline-block; }
@keyframes gh-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.diff { border-left: 3px solid #d5e8dc; padding: 0.3rem 0 0.3rem 1rem; font-size: 0.92rem; margin: 0.3rem 0 0; }
.diff .field { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0.85rem 0 0.3rem; }
.diff .field:first-child { margin-top: 0; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; align-items: stretch; }
@media (max-width: 34rem) { .ba { grid-template-columns: 1fr; } }
.ba .cell { border: 1px solid var(--line); border-radius: 4px; padding: 0.55rem 0.7rem; font-size: 0.9rem; }
.ba .cell .tag { font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; display: block; margin-bottom: 0.25rem; }
.ba .before .tag { color: #a12b2b; }
.ba .after .tag { color: #235c3a; }
.ba .before { background: #fdecec; border-color: #d98b8b; }
.ba .after { background: #eef6f0; border-color: #d5e8dc; }
.ba .before .val { color: #a12b2b; text-decoration: line-through; text-decoration-color: #d98b8b; }
.ba .after .val { color: #235c3a; }
.ba .cell img { display: block; width: 100%; height: 5.5rem; object-fit: cover; border-radius: 3px; margin-top: 0.1rem; }

.prose { margin-top: 0.2rem; }
.prose del { background: #fdecec; color: #a12b2b; text-decoration: line-through; text-decoration-color: #d98b8b; padding: 0 0.15rem; border-radius: 2px; }
.prose ins { background: #eef6f0; color: #235c3a; text-decoration: none; padding: 0 0.15rem; border-radius: 2px; }

.revert-line { margin-top: 1rem; }
.revert-line .btn.ghost { color: var(--muted); }
.diff-error { color: var(--crit); font-size: 0.9rem; padding: 0.5rem 0; }

.loadmore { text-align: center; margin: 1.6rem 0 0.4rem; }
.loadmore .btn.ghost { min-width: 12rem; }
.loadmore .count { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.7rem; }
.helpline { color: var(--muted); font-size: 0.85rem; margin-top: 1.6rem; }
.helpline a { color: var(--accent); }

/* ============================================================
   Meddelanden (portal inbox) — contact-form leads, read-only + mailto reply.
   Same warm chrome as the rest of the portal; light palette only.
   ============================================================ */
/* unread badge on the "meddelanden" tab */
.portaltabs .tab .tabdot { display: inline-grid; place-items: center; min-width: 1.05rem; height: 1.05rem; padding: 0 0.28rem; margin-left: 0.35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.62rem; font-weight: 600; line-height: 1; vertical-align: middle; }

/* tie-in banner: this is the form Grönare set up */
.formnote { display: flex; align-items: center; gap: 0.85rem; background: #eef6f0; border: 1px solid #d5e8dc; border-radius: 4px; padding: 0.85rem 1.1rem; margin-bottom: 1.5rem; }
.formnote .mark { width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1rem; flex: none; }
.formnote .txt { font-size: 0.9rem; }
.formnote .txt strong { display: block; }
.formnote .txt span { color: #4b6b58; font-size: 0.84rem; }

/* multi-site segmented switcher (+ "alla sajter" aggregate) */
.siteswitch { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.siteswitch .label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--soft); flex-wrap: wrap; }
.segmented a { font-size: 0.88rem; text-decoration: none; color: var(--muted); padding: 0.4rem 1rem; border-radius: 999px; display: inline-flex; align-items: center; gap: 0.5rem; }
.segmented a .leafdot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); opacity: 0.35; }
.segmented a[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.segmented a[aria-selected="true"] .leafdot { opacity: 1; }
.segmented a .cnt { font-variant-numeric: tabular-nums; opacity: 0.7; font-size: 0.8rem; }

.inboxmeta { color: var(--muted); font-size: 0.85rem; margin: 0 0 1rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.chip.new { background: var(--accent); color: #fff; }
.inboxmeta .chip.new { font-size: 0.68rem; }
.panel-head .see-all { color: var(--accent); text-decoration: none; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.5rem; }

/* inbox rows */
.msg { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 0.7rem; overflow: hidden; background: #fff; transition: border-color 0.15s; }
.msg.open { border-color: #d5e8dc; }
.msg-head { display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.95rem 1.15rem; text-decoration: none; color: var(--ink); }
.msg-head:hover { background: var(--soft); }
.msg-head .avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: #eef6f0; color: var(--accent); display: grid; place-items: center; font-size: 0.8rem; font-weight: 600; flex: none; margin-top: 0.1rem; }
.msg-head .body { min-width: 0; flex: 1; }
.msg-head .toprow { display: flex; align-items: baseline; gap: 0.6rem; }
.msg-head .name { font-size: 0.95rem; }
.msg.unread .msg-head .name { font-weight: 700; }
.msg-head .when { color: var(--muted); font-size: 0.78rem; white-space: nowrap; margin-left: auto; font-variant-numeric: tabular-nums; flex: none; }
.msg-head .snippet { color: var(--muted); font-size: 0.88rem; margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.msg.unread .msg-head .snippet { color: var(--ink); }
.msg-head .tags { margin-top: 0.45rem; display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.unread-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); flex: none; }
.sitebadge { font-size: 0.7rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.35rem; }
.sitebadge .leafdot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--accent); opacity: 0.55; }

.msg-body { padding: 0 1.15rem 1.25rem 4rem; }
@media (max-width: 40rem) { .msg-body { padding-left: 1.15rem; } .msg-head .when { display: none; } }
.msg-card { border: 1px solid var(--line); border-left: 3px solid #d5e8dc; border-radius: 4px; background: var(--soft); padding: 1.05rem 1.2rem; }
.msg-from { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.1rem; }
.msg-from .fname { font-weight: 600; font-size: 1rem; }
.msg-from a.email { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.msg-from a.email:hover { text-decoration: underline; }
.msg-arrived { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.95rem; }
.msg-text { font-size: 0.96rem; white-space: pre-line; margin: 0 0 1.2rem; }
.reply-row { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.reply-row .hint { color: var(--muted); font-size: 0.82rem; }

/* warm empty state */
.empty { text-align: center; border: 1px dashed var(--line); border-radius: 6px; padding: 3rem 1.5rem; background: var(--soft); color: var(--muted); }
.empty .icn { font-size: 2rem; display: block; margin-bottom: 0.6rem; opacity: 0.8; }
.empty strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 0.35rem; font-weight: 600; }
.empty p { margin: 0.2rem auto 0; max-width: 30rem; font-size: 0.9rem; }

/* ── onboarding "skapa sajt" ─────────────────────────────────────────────
   Ported from the approved onboarding mockup, scoped under .gho- prefixes so the
   miniature style previews never leak into the rest of the app. Uses greenhouse's
   own tokens (--accent/--muted/--line/--soft); each thumb carries its own colours
   via --tb/--tk/--ta inline vars. */
.crumb { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.4rem; }
.lede { max-width: 42rem; margin: 0 0 1.6rem; }
.gho-onboard { max-width: 56rem; }
.gho-inline-alert { border: 1px solid #e8c9c9; margin: 0 0 1.3rem; }

.gho-step { border: 1px solid var(--line); background: #fff; margin-bottom: 1.1rem; }
.gho-step > h2 { font-size: 0.95rem; margin: 0; padding: 0.85rem 1.2rem; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 0.6rem; }
.gho-step > h2 .n { font: 600 0.72rem/1 ui-monospace, monospace; color: var(--accent); }
.gho-step > h2 .opt { margin-left: auto; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: none; font-weight: 400; }
.gho-step-body { padding: 1.1rem 1.2rem; }

.fl { display: block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.35rem; }
.gho-inp { width: 100%; padding: 0.55rem 0.7rem; border: 1px solid #d4d4d4; background: #fff; color: var(--ink); font: inherit; box-sizing: border-box; }
.gho-onboard .hint { font-size: 0.78rem; margin: 0.45rem 0 0; }

.gho-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 0.9rem; }
.gho-seg span { padding: 0.35rem 0.9rem; font-size: 0.82rem; cursor: pointer; color: var(--muted); }
.gho-seg span.on { background: var(--soft); color: var(--accent); font-weight: 600; }

.gho-preview { margin-top: 0.7rem; padding: 0.6rem 0.75rem; background: var(--soft); border-left: 3px solid var(--accent); font-size: 0.82rem; }
.gho-preview .k { margin-right: 0.2rem; }

/* style picker */
.gho-style-group { margin-bottom: 1.3rem; }
.gho-style-group:last-child { margin-bottom: 0; }
.gho-style-group > h3 { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 0.6rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); }
.gho-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.6rem; }
.gho-style { border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem; cursor: pointer; background: #fff; position: relative; display: block; }
.gho-style:hover { border-color: var(--muted); }
.gho-style:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.gho-style-radio { position: absolute; opacity: 0; pointer-events: none; }
.gho-check { position: absolute; top: 0.55rem; right: 0.55rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.72rem; display: none; align-items: center; justify-content: center; z-index: 2; }
.gho-style:has(input:checked) .gho-check { display: flex; }
.gho-meta { padding: 0.4rem 0.3rem 0.15rem; }
.gho-meta .nm { font-weight: 600; font-size: 0.85rem; }
.gho-meta .ch { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }

/* the miniature "site" preview */
.gho-thumb { height: 5.4rem; border-radius: 4px; overflow: hidden; position: relative; background: var(--tb); color: var(--tk); font-family: ui-sans-serif, system-ui, sans-serif; display: flex; flex-direction: column; }
.gho-thumb .nav { height: 0.95rem; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 0.4rem; background: var(--tnav, transparent); border-bottom: 1px solid rgba(128,128,128,0.18); }
.gho-thumb .nav b { font-size: 0.4rem; font-weight: 800; color: var(--tlogo, var(--tk)); letter-spacing: 0.02em; }
.gho-thumb .nav i { font-style: normal; font-size: 0.34rem; color: var(--tnavlink, var(--tk)); opacity: 0.6; }
.gho-thumb .nav .cta { margin-left: auto; font-size: 0.34rem; background: var(--ta); color: var(--tbtnk, #fff); padding: 1px 4px; border-radius: 2px; opacity: 0.95; }
.gho-thumb .body { flex: 1; padding: 0.35rem 0.5rem; display: flex; flex-direction: column; justify-content: center; }
.gho-thumb .h { font-size: 0.66rem; line-height: 1.02; font-weight: 700; color: var(--th, var(--tk)); max-width: 92%; }
.gho-thumb .sub { height: 2px; background: currentColor; opacity: 0.22; margin-top: 4px; width: 80%; border-radius: 1px; }
.gho-thumb .sub.s2 { width: 62%; margin-top: 2px; }
.gho-thumb .btn { align-self: flex-start; margin-top: 5px; font-size: 0.36rem; background: var(--ta); color: var(--tbtnk, #fff); padding: 1.5px 6px; border-radius: var(--tbtnr, 2px); font-weight: 700; cursor: default; border: 0; }
/* character modifiers */
.gho-thumb.up .h { text-transform: uppercase; letter-spacing: 0.01em; }
.gho-thumb.it .h { font-style: italic; }
.gho-thumb.heavy .h { font-weight: 900; }
.gho-thumb.center, .gho-thumb .nav.center, .gho-thumb .body.center { text-align: center; align-items: center; justify-content: center; }
.gho-thumb .body.center .sub { align-self: center; }
.gho-thumb.f-cond { font-family: "Arial Narrow", "Helvetica Neue", sans-serif; }
.gho-thumb.f-serif { font-family: Georgia, "Times New Roman", serif; }
.gho-thumb.f-round { font-family: ui-rounded, "Avenir Next", "Trebuchet MS", sans-serif; }
.gho-thumb.f-grot { font-family: "Helvetica Neue", Arial, sans-serif; }
.gho-thumb.f-mono { font-family: ui-monospace, Menlo, monospace; }
.gho-thumb.f-script .h { font-family: "Snell Roundhand", "Brush Script MT", cursive; font-weight: 400; font-size: 0.82rem; }
.gho-thumb.f-hum { font-family: Verdana, sans-serif; }
.gho-thumb.grid-bg { background-image: linear-gradient(rgba(125,205,255,0.14) 1px, transparent 1px), linear-gradient(90deg, rgba(125,205,255,0.14) 1px, transparent 1px); background-size: 8px 8px; }

/* starter (default) — a wide primary card above the themes accordion */
.gho-starter { display: grid; grid-template-columns: 8rem 1fr; gap: 0.9rem; align-items: center; max-width: 30rem; padding: 0.7rem; }
.gho-starter .gho-thumb { height: 4.2rem; }
.gho-starter .gho-meta { padding: 0; }
.gho-starter .gho-meta .nm { font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; }
.gho-starter .gho-meta .ch { font-size: 0.78rem; margin-top: 0.15rem; }
.gho-tag { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-wash); border: 1px solid #cfe6d8; border-radius: 999px; padding: 0.05rem 0.4rem; }

/* themes accordion */
.gho-acc { margin-top: 1rem; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.gho-acc-head { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.65rem 0.9rem; background: var(--soft); font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.gho-acc-head::-webkit-details-marker { display: none; }
.gho-acc-head .chev { color: var(--muted); transition: transform 0.18s ease; }
.gho-acc[open] .gho-acc-head .chev { transform: rotate(180deg); }
.gho-acc[open] .gho-acc-head { border-bottom: 1px solid var(--line); }
.gho-acc-body { padding: 0.9rem; }
@media (prefers-reduced-motion: reduce) { .gho-acc-head .chev { transition: none; } }

/* async-action: reusable "run in background, confirm inline" spinner → ✓, on any
   link (.async-link) or button (.async-btn) driven by the async-action controller */
.is-busy { pointer-events: none; opacity: 0.85; }
.aa-spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: prov-rot 0.7s linear infinite; vertical-align: -1px; }
.aa-done { color: var(--accent); font-weight: 700; }
/* filled (non-ghost) buttons need a light spinner/check; ghost + link keep green */
.btn.async-btn:not(.ghost) .aa-spin { border-color: rgba(255,255,255,0.5); border-top-color: #fff; }
.btn.async-btn:not(.ghost) .aa-done { color: #fff; }
@media (prefers-reduced-motion: reduce) { .aa-spin { animation: none; } }

/* ── inline go-live / revert transition banner (site page) ── */
.site-transition { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 1.3rem; padding: 0.75rem 0.95rem; border: 1px solid var(--accent-line); background: var(--accent-wash); border-radius: 9px; font-size: 0.9rem; }
.site-transition.failed { border-color: #f0cfcb; background: var(--crit-wash); }
.site-transition .st-body { display: flex; flex-direction: column; flex: 1; }
.site-transition .st-note { font-size: 0.8rem; color: var(--muted); }
.site-transition .st-ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.site-transition .st-ic.ok { background: var(--accent); }
.site-transition .st-ic.bad { background: var(--crit); }
.site-transition .st-act { margin-left: auto; }

/* ── async onboarding status modal ── */
.prov-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1.5rem; background: rgba(26,26,26,0.32); }
.prov-modal { width: 100%; max-width: 30rem; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; box-shadow: 0 18px 46px rgba(0,0,0,0.20); }
.prov-head { padding: 1.05rem 1.25rem 0.8rem; border-bottom: 1px solid var(--line); }
.prov-head h2 { margin: 0 0 0.15rem; font-size: 1.1rem; }
.prov-sub { font-size: 0.85rem; color: var(--muted); }
.prov-steps { list-style: none; margin: 0; padding: 0.5rem 0.55rem; }
.prov-step { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.45rem 0.65rem; border-radius: 8px; }
.prov-step.running { background: var(--accent-wash); }
.prov-ic { flex: none; width: 20px; height: 20px; margin-top: 1px; display: grid; place-items: center; }
.prov-txt { flex: 1; min-width: 0; }
.prov-txt .nm { font-size: 0.92rem; font-weight: 560; }
.prov-txt .st { font-size: 0.78rem; color: var(--muted); }
.prov-step.pending .nm { color: #9a9a9a; }
.prov-step.failed .nm { color: var(--crit); }
.prov-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #d6d6d6; }
.prov-check { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.prov-dash { width: 20px; height: 20px; border-radius: 50%; border: 1.5px dashed #c9c9c9; color: #a5a5a5; display: grid; place-items: center; font-size: 12px; }
.prov-cross { width: 20px; height: 20px; border-radius: 50%; background: var(--crit); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.prov-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #cfe6d8; border-top-color: var(--accent); animation: prov-rot 0.8s linear infinite; }
@keyframes prov-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .prov-spin { animation: none; } }
.prov-errnote { margin: 0.15rem 0.75rem 0.35rem 2.85rem; background: var(--crit-wash, #fdf0ef); border: 1px solid #f0cfcb; border-radius: 7px; padding: 0.5rem 0.65rem; font-size: 0.8rem; color: #7f1d1d; display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.prov-donebanner { margin: 0.3rem 0.95rem; background: var(--accent-wash); border: 1px solid #cfe6d8; border-radius: 8px; padding: 0.7rem 0.85rem; display: flex; align-items: center; gap: 0.6rem; font-size: 0.86rem; }
.prov-foot { padding: 0.55rem 1.25rem 1.1rem; }
.prov-bar { height: 6px; border-radius: 999px; background: #eee; overflow: hidden; margin-bottom: 0.65rem; }
.prov-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.prov-footrow { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.prov-cnt { font-size: 0.82rem; color: var(--muted); }
.prov-actions { display: flex; gap: 0.5rem; }

.gho-note { padding: 0.7rem 0.8rem; background: var(--soft); font-size: 0.83rem; color: var(--muted); margin: 0; }
.gho-note strong { color: var(--ink); font-weight: 600; }

.gho-create { border: 1px solid var(--line); background: #fff; margin: 1.6rem 0; }
.gho-create h2 { font-size: 0.95rem; margin: 0; padding: 0.85rem 1.2rem; border-bottom: 1px solid var(--line); }
.gho-create ol { margin: 0; padding: 0.9rem 1.2rem 0.9rem 2.6rem; }
.gho-create li { font-size: 0.86rem; margin: 0.3rem 0; }
.gho-create .after { padding: 0.7rem 1.2rem; border-top: 1px solid var(--line); font-size: 0.82rem; }

.gho-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gho-actions .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.gho-actions .muted { font-size: 0.82rem; }

/* --- motor-uppdateringar & diff (/updates) + ingångs-strippen på sajtvyn --- */
/* Statusbanner: verdictet på en rad, färgad vänsterkant efter allvar. */
.status { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; margin: 1.4rem 0 1.6rem; border: 1px solid var(--line); border-left: 4px solid var(--muted); background: var(--soft); }
.status.ok { border-left-color: var(--accent); background: #eef6f0; }
.status.warn { border-left-color: var(--warn); background: #fbf3e8; }
.status .ico { font-size: 1.5rem; line-height: 1; }
.status .txt { flex: 1; }
.status .txt strong { display: block; font-size: 1.02rem; }
.status .txt span { font-size: 0.85rem; color: var(--muted); }
.status.warn .txt span { color: #8a5a2b; }
.status .act { display: flex; gap: 0.5rem; flex-shrink: 0; }
.status .act form { display: inline; }

/* Egen layout för /updates — 1fr + bekväm aside (inte den smala .cols 2fr). */
.updates-cols { display: grid; grid-template-columns: 1fr 20rem; gap: 1.6rem; align-items: start; }
@media (max-width: 52rem) { .updates-cols { grid-template-columns: 1fr; } }
.updates-cols aside .panel { background: var(--soft); }

/* A/B-resultatet som ett riktigt block med tydlig CTA (inte en naken länk). */
.ab { margin-top: 1.1rem; border: 1px solid var(--line); border-left: 3px solid var(--warn); background: var(--soft); padding: 0.85rem 1rem; }
.ab.ok { border-left-color: var(--accent); }
.ab .abhead { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ab .abhead b { font-size: 0.95rem; }
.ab .when { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.ab p { margin: 0.5rem 0 0.75rem; font-size: 0.83rem; color: var(--muted); }
.ab .btn { text-decoration: none; }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid #f0f0f0; }
.actions form { display: inline; }
.actions .btn { text-decoration: none; }

/* drift-lista */
.drift .drow { padding: 0.7rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.drift .drow:last-child { border-bottom: 0; }
.drift .fld { font-weight: 600; }
.drift .rename { font-size: 0.83rem; margin-top: 0.2rem; }
.drift .rename .mono { background: var(--soft); padding: 0.05rem 0.3rem; }
.drift .dhint { color: var(--muted); font-size: 0.83rem; margin-top: 0.25rem; }
.drift .dfile { color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }

/* "så fungerar det" aside — läsbar, inte ord-per-rad */
.how { list-style: none; margin: 0; padding: 0; }
.how li { padding: 0.65rem 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; line-height: 1.5; }
.how li:last-child { border-bottom: 0; }
.how b { display: block; margin-bottom: 0.15rem; }
.how .g { color: var(--accent); }
.how .w { color: var(--warn); }

/* Ingångs-strip på sajtvyns motorpanel — statusbärande, läser som klickbar. */
.entry { display: flex; align-items: center; gap: 0.75rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 0.7rem 0.9rem; text-decoration: none; color: var(--ink); background: #fff; }
.entry:hover { background: var(--soft); }
.entry.warn { border-left-color: var(--warn); }
.entry.crit { border-left-color: var(--crit); }
.entry.still { border-left-color: var(--muted); }
.entry .btn, .entry .chip { flex: none; margin-left: auto; }
.entry .elbl { flex: 1; font-size: 0.9rem; font-weight: 500; }
.entry .elbl small { display: block; font-weight: 400; color: var(--muted); font-size: 0.78rem; margin-top: 0.1rem; }
.entry .earr { color: var(--muted); font-size: 1.1rem; }

/* motorsida — piffat statuskort (i fas) + brytande/efter-läge (warn-ton) */
.enginelink { text-decoration: none; }
.enginelink .arr { color: var(--muted); font-size: 0.85em; }
.motorcard { display: flex; gap: 1rem; align-items: flex-start; border: 1px solid #d5e8dc; background: #f3f9f5; border-radius: 10px; padding: 1.15rem 1.3rem; margin: 1.2rem 0 0.9rem; }
.motorcard.behind { border-color: #f0dcc0; background: #fdf6ee; }
.motorcard.still { border-color: var(--line); background: var(--soft); }
.motorbadge { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; font-size: 1.1rem; }
.motorcard.behind .motorbadge { background: var(--warn); }
.motorcard.still .motorbadge { background: #94a3b8; }
.motorcard .body { flex: 1; min-width: 0; }
.motorcard .title { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; }
.motorcard .desc { color: #4b6b58; font-size: 0.9rem; margin-top: 0.15rem; }
.motorcard.behind .desc { color: #8a5a2b; }
.motorcard.still .desc { color: var(--muted); }
.motorcard .desc .mono { color: var(--ink); }
.metarow { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; margin-top: 0.85rem; font-size: 0.82rem; color: var(--muted); }
.metarow .sep { opacity: 0.4; }
.vtag { display: inline-flex; align-items: center; gap: 0.4rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 0.15rem 0.5rem; }
.vtag .k { font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.vtag .mono { font-size: 0.8rem; color: var(--ink); }
.fresh { display: inline-flex; align-items: center; gap: 0.35rem; }
.fresh a { color: var(--accent); text-decoration: none; }
.cardacts { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.4rem; }
/* Inne i statuskortet behöver knappraden luft mot desc/pend-listan ovanför. */
.motorcard .cardacts { margin-top: 0.85rem; margin-bottom: 0; }
/* Pågår-puls: badgen andas medan ett workflow kör (promote/temacheck). */
@keyframes motorpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.motorbadge.pulse { animation: motorpulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .motorbadge.pulse { animation: none; } }
/* Samma puls på chip:en (flott- och temarader) medan DERAS check kör (CiRun). */
.chip.pulse { animation: motorpulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .chip.pulse { animation: none; } }
.btn[disabled] { opacity: 0.45; cursor: default; }
/* motor-fliken: väntande commits på main + canary-gate-noten under promote-knappen */
.pend { list-style: none; margin: 0.9rem 0 0; padding: 0; border-top: 1px solid var(--accent-line); }
.motorcard.behind .pend { border-color: #f0dcc0; }
.pend li { display: flex; gap: 0.7rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px dashed rgba(0,0,0,0.07); font-size: 0.88rem; }
.pend li:last-child { border-bottom: 0; }
.pend .sha { font-family: ui-monospace, monospace; font-size: 0.78rem; color: var(--muted); flex: none; }
.gatenote { font-size: 0.8rem; color: var(--muted); margin-top: 0.6rem; }
.time { font-family: ui-monospace, monospace; font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.decide { font-size: 0.9rem; font-weight: 600; margin: 0.2rem 0 0.6rem; }
/* Senaste A/B-checkens utfall på motorsidan — tyst not, grön vid identisk, röd vid krasch. */
.lastcheck { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; font-size: 0.85rem; border-radius: 8px; padding: 0.55rem 0.8rem; margin: 0.2rem 0 0.9rem; border: 1px solid var(--line); background: var(--soft); color: var(--muted); }
.lastcheck.ok { border-color: #cfe8d8; background: #f2f9f5; color: #235c3a; }
.lastcheck.crit { border-color: #f0c9c0; background: #fdf1ee; color: #a12b2b; }
.lastcheck .lc-time { font-family: ui-monospace, monospace; font-size: 0.76rem; opacity: 0.8; }
.ba2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin: 1.1rem 0; }
.ba2 .cell { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.ba2 .cap { font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.45rem 0.65rem; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.ba2 .before .cap b { color: #a12b2b; }
.ba2 .after .cap b { color: #235c3a; }
.ba2 .shot { height: 6.5rem; background: repeating-linear-gradient(45deg,#f2f2f2,#f2f2f2 9px,#fafafa 9px,#fafafa 18px); display: grid; place-items: center; color: #bbb; font-size: 0.72rem; }
.ba2 .after .shot { background: repeating-linear-gradient(45deg,#eef6f0,#eef6f0 9px,#f6fbf8 9px,#f6fbf8 18px); }
/* Riktiga diff-bilder (temacheckens egen sida): kapas i höjd så en tema-rad inte blir
   oändligt lång — scrolla inuti cellen, klicka för att öppna full bild i ny flik. */
.ba2 .cell .shotlink { display: block; max-height: 20rem; overflow: auto; }
.ba2 .cell img.diffshot { display: block; width: 100%; height: auto; background: #fff; }

/* operator inbox — email-style rows (prefixed to avoid the portal's .msg design) */
.head-note .uh { font-weight: 600; font-variant-numeric: tabular-nums; }
.head-note .uh.on { color: var(--warn); }
.inbox { border-top: 1px solid var(--line); margin-top: 1.3rem; }
.inbox-row { display: flex; gap: 0.85rem; align-items: flex-start; padding: 0.85rem 0.6rem 0.85rem 0.7rem; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; text-decoration: none; color: inherit; }
.inbox-row:hover { background: var(--soft); }
.inbox-row.unread { border-left-color: var(--accent); background: #f3f9f5; }
.inbox-row.unread:hover { background: #eaf4ee; }
.inbox-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 0.5rem; background: transparent; border: 1.5px solid #c7c7c7; }
.inbox-row.unread .inbox-dot { background: var(--accent); border-color: var(--accent); }
.inbox-body { flex: 1; min-width: 0; }
.inbox-top { display: flex; align-items: baseline; gap: 0.75rem; }
.inbox-from { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row.unread .inbox-from { font-weight: 600; }
.inbox-row.done .inbox-from, .inbox-row.done .inbox-prev { color: var(--muted); }
.inbox-meta { margin-left: auto; display: flex; align-items: baseline; gap: 0.7rem; flex: none; }
.inbox-site { font-size: 0.8rem; color: #26663f; background: #f3f9f5; border: 1px solid #d5e8dc; border-radius: 4px; padding: 0.05rem 0.4rem; }
.inbox-row.done .inbox-site { color: var(--muted); background: var(--soft); border-color: var(--line); }
.inbox-time { font-family: ui-monospace, monospace; font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.inbox-prev { margin-top: 0.15rem; font-size: 0.9rem; color: #555; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.inbox-avatar { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: #eef6f0; color: #26663f; display: grid; place-items: center; font-size: 0.72rem; font-weight: 600; margin-top: 0.05rem; }
/* source badge — formulär / mejl / portal, on inbox rows and the customer konversationer panel */
.src { font-size: 0.66rem; padding: 0.05rem 0.4rem; border-radius: 4px; white-space: nowrap; border: 1px solid; }
.src.form { color: #26663f; background: var(--accent-wash); border-color: var(--accent-line); }
.src.mail { color: #3b5b8c; background: #eef2f8; border-color: #d3ddec; }
.src.portal { color: #7a5b1e; background: #f7f0e2; border-color: #e8dcc0; }

/* settings hub — sidebar + section content */
.settings-title { font-weight: 600; text-transform: lowercase; font-size: 1.55rem; letter-spacing: -0.01em; margin: 0 0 1.3rem; }
.settings { display: grid; grid-template-columns: 12.5rem 1fr; gap: 2.2rem; align-items: start; }
@media (max-width: 44rem) { .settings { grid-template-columns: 1fr; } }
.side { list-style: none; margin: 0; padding: 0; position: sticky; top: 1rem; }
.side .grp { font-size: 0.62rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); padding: 0.9rem 0.7rem 0.3rem; }
.side a { display: block; padding: 0.5rem 0.7rem; border-radius: 7px; color: var(--ink); font-size: 0.92rem; text-decoration: none; }
.side a:hover { background: var(--soft); }
.side a[aria-current="true"] { background: var(--accent-wash); color: #26663f; font-weight: 600; }
.sec-head h2 { font-weight: 600; text-transform: lowercase; font-size: 1.2rem; margin: 0; }
.sec-lede { color: var(--muted); font-size: 0.9rem; margin: 0.15rem 0 1.2rem; }
.setcard { border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; margin-bottom: 1rem; }
.setpad { padding: 1.1rem 1.15rem; }
.setrow { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 1.05rem; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow .who { flex: 1; min-width: 0; }
.setrow .who .n { font-weight: 600; font-size: 0.95rem; }
.setrow .who .d { color: var(--muted); font-size: 0.82rem; }
.setrow .meta { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.setdisc { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.85rem; }
.setdisc > summary { cursor: pointer; color: var(--accent); font-size: 0.88rem; list-style: none; }
.setdisc > summary::-webkit-details-marker { display: none; }
.setdisc > summary::before { content: "▸ "; color: var(--muted); }
.setdisc[open] > summary::before { content: "▾ "; }
.setdisc .fgrid { margin-top: 0.85rem; }
.setdisc input { padding: 0.5rem 0.6rem; border: 1px solid #d4d4d4; border-radius: 5px; font: inherit; }
.setrow .ico { width: 2rem; height: 2rem; border-radius: 7px; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.src-env { font-size: 0.66rem; font-family: ui-monospace, monospace; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: 0.05rem 0.35rem; }
.setrow-link { text-decoration: none; color: var(--ink); }
.setrow-link:hover { background: var(--soft); }
.setrow .chev { color: var(--muted); }
.dsub { font-weight: 600; text-transform: lowercase; font-size: 0.72rem; letter-spacing: 0.13em; color: var(--muted); margin: 1.3rem 0 0.5rem; }

/* dashboard — attention queue + fleet rows */
.att { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 1.05rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.att:last-child { border-bottom: 0; }
.att:hover { background: var(--soft); }
.att .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none; }
.att .dot.warn { background: var(--warn); }
.att .dot.crit { background: var(--crit); }
.att .dot.info { background: var(--accent); }
.att .txt { flex: 1; min-width: 0; }
.att .txt .n { font-weight: 600; font-size: 0.92rem; }
.att .cnt { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.05rem; }
.att .chev { color: var(--muted); }
.calm { padding: 1.6rem; text-align: center; color: var(--muted); font-size: 0.9rem; margin: 0; }
.flrow { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.flrow:last-child { border-bottom: 0; }
.flrow .h { flex: 1; min-width: 0; }
/* system & drift — expandable rows */
.sysrow { border-bottom: 1px solid var(--line); }
.sysrow:last-child { border-bottom: 0; }
.sysrow > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.9rem; padding: 0.82rem 1.1rem; }
.sysrow > summary::-webkit-details-marker { display: none; }
.sysrow > summary .who { flex: 1; min-width: 0; }
.sysrow > summary .who .n { font-weight: 600; font-size: 0.95rem; }
.sysrow > summary .who .d { color: var(--muted); font-size: 0.82rem; margin-left: 0; display: block; }
.sysrow > summary .meta { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.sysrow[open] > summary { background: var(--soft); }
.sysrow .chev { color: var(--muted); font-size: 0.8rem; }
.sysrow[open] .chev { transform: rotate(180deg); display: inline-block; }
.sysdet { padding: 0.4rem 1.1rem 1rem; }
.sysdet .kv { grid-template-columns: 10rem 1fr; font-size: 0.86rem; }
.sysdet .kv dd { text-align: left; }

/* operator submission detail — one readable column */
.subm-back { display: inline-block; font-size: 0.85rem; color: var(--muted); text-decoration: none; margin-bottom: 1.1rem; }
.subm-back:hover { color: #26663f; }
.subm-meta { border: 1px solid var(--line); border-radius: 6px; background: var(--soft); padding: 0.2rem 1.1rem; margin: 1.2rem 0 1.4rem; max-width: 40rem; }
.subm-meta .r { display: flex; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.subm-meta .r:last-child { border-bottom: 0; }
.subm-meta .k { flex: none; width: 6.5rem; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 0.15rem; }
.subm-meta .v { color: var(--ink); }
.subm-meta .v a { color: #26663f; }
.subm-msg { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 1rem 1.2rem; background: #fff; margin-bottom: 1.5rem; max-width: 40rem; }
.subm-msg .lbl { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.subm-msg p { margin: 0 0 0.6rem; font-size: 1rem; }
.subm-msg p:last-child { margin-bottom: 0; }
.subm-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #26663f; }

/* content links — one colour everywhere (no browser blue / visited purple); nav,
   buttons and .segmented keep their own colour via higher specificity */
/* content links: one colour everywhere, no browser blue/visited purple. No broad
   :hover rule — a `main a:hover` outranks .btn (0,1,2 > 0,1,0) and turned button
   text green-on-green. Buttons/tabs keep their own colour + their own bg-hover. */
main a { color: var(--accent); text-decoration: none; }
main a:visited { color: var(--accent); }
/* buttons + tabs own their text colour in EVERY state, incl. :visited — a
   `main a:visited` (0,1,2) outranks a single-class rule like .btn (0,1,0), so a
   VISITED accent button would go green-on-green. Two class-levels win it back. */
.btn, .btn:visited, .btn:hover, .btn:active { color: #fff; }
.btn.ghost, .btn.ghost:visited, .btn.ghost:hover, .btn.ghost:active { color: var(--ink); }
.segmented a:visited { color: var(--muted); }
.segmented a[aria-selected="true"], .segmented a[aria-selected="true"]:visited { color: var(--ink); }

/* tab header — segmented tabs stand in for the page title */
.tabhead { align-items: center; margin-bottom: 0.4rem; }
.lede2 { color: var(--muted); font-size: 0.9rem; margin: 0.7rem 0 0; }

/* operator cards (kunder / prospekt / grönare) — equal height per row via grid stretch */
.oc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1rem; align-items: stretch; margin-top: 1.2rem; }
.oc-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.oc-card .sp { margin-left: auto; }
.oc-head { display: flex; align-items: center; gap: 0.55rem; padding: 0.8rem 1.05rem; border-bottom: 1px solid var(--line); }
.oc-head .name { font-weight: 600; font-size: 1.02rem; }
.oc-body { flex: 1; padding: 0.8rem 1.05rem; display: flex; flex-direction: column; gap: 0.8rem; }
.oc-sites { display: flex; flex-direction: column; gap: 0.32rem; }
.oc-site { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.oc-site .role { margin-left: auto; font-size: 0.72rem; color: var(--muted); }
.sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.sdot.live { background: var(--accent); }
.sdot.demo { background: #c2c2c2; }
.oc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.oc-stat { background: var(--soft); padding: 0.55rem 0.7rem; min-width: 0; }
.oc-stat .l { font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.oc-stat .v { font-size: 0.9rem; margin-top: 0.2rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.oc-stat .v b { font-weight: 600; font-variant-numeric: tabular-nums; }
.oc-foot { padding: 0.6rem 1.05rem; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); background: var(--soft); display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
.oc-foot .sp { margin-left: auto; }
.oc-card.dim { opacity: 0.72; }
.emptybox { margin-top: 0.9rem; border: 1px dashed #d9d9d9; border-radius: 8px; padding: 1.5rem; text-align: center; color: var(--muted); font-size: 0.9rem; background: var(--soft); }
.emptybox b { display: block; margin-bottom: 0.2rem; color: var(--ink); font-weight: 600; }

/* go-live Cloudflare pre-check banner */
.cfcheck { margin-bottom: 1.2rem; padding: 0.75rem 0.9rem; border-radius: 8px; border: 1px solid var(--line); font-size: 0.9rem; }
.cfcheck b { font-weight: 600; }
.cfcheck .mono { margin-left: 0.4rem; }
.cfcheck.ok { background: var(--accent-wash); border-color: #cfe6d8; }
.cfcheck.warn { background: #fdf6ec; border-color: #f0dcc0; }

/* ── gå-live form ── */
.gl-form { max-width: 34rem; }
.gl-fld { margin-bottom: 1.5rem; }
.gl-form label.fl { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
.gl-inp { width: 100%; font: inherit; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.gl-inp:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.gl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin-bottom: 0.55rem; }
.gl-seg span { padding: 0.32rem 0.8rem; font-size: 0.83rem; cursor: pointer; color: var(--muted); background: #fff; }
.gl-seg span.on { background: var(--accent); color: #fff; }
.gl-seg span + span { border-left: 1px solid var(--line); }
.gl-cname { margin-top: 0.55rem; background: var(--soft); border: 1px solid var(--line); border-radius: 7px; padding: 0.5rem 0.7rem; font-size: 0.82rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.gl-cname .lbl { color: var(--muted); }
.gl-cname .arr { color: var(--muted); }
.gl-subprefix { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.55rem; }
.gl-subprefix .gl-inp { max-width: 12rem; }
.gl-subprefix .dom { font-size: 0.9rem; color: var(--muted); }

/* verification panel (turbo-frame content) */
.gl-verify { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.gl-vhead { padding: 0.55rem 0.8rem; background: var(--soft); font-size: 0.85rem; font-weight: 600; }
.gl-verify.good { border-color: #cfe6d8; } .gl-verify.good .gl-vhead { background: var(--accent-wash); color: var(--accent-ink); }
.gl-verify.attn .gl-vhead { background: var(--warn-wash); color: var(--warn); }
.gl-verify.bad { border-color: #f0cfcb; } .gl-verify.bad .gl-vhead { background: var(--crit-wash); color: var(--crit); }
.gl-vrow { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0.8rem; border-top: 1px solid var(--line); font-size: 0.86rem; }
.gl-ic { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-top: 1px; color: #fff; }
.gl-ic.ok { background: var(--accent); } .gl-ic.warn { background: var(--warn); } .gl-ic.bad { background: var(--crit); }
.gl-vrow .vt { display: flex; flex-direction: column; }
.gl-vrow .vt .n { font-weight: 560; }
.gl-vrow .vt .d { font-size: 0.79rem; color: var(--muted); }

/* subscription mode segments + panes */
.gl-subseg { display: flex; gap: 0.5rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.gl-subseg label { flex: 1; min-width: 8.5rem; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.1rem; }
.gl-subseg label.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-wash); }
.gl-subseg label.gl-disabled { opacity: 0.5; cursor: not-allowed; }
.gl-subseg .t { font-weight: 600; font-size: 0.86rem; }
.gl-subseg .s { font-size: 0.75rem; color: var(--muted); }
.gl-hidden-radio { position: absolute; opacity: 0; pointer-events: none; }
.gl-subgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.gl-subgrid .gl-full { grid-column: 1 / -1; }
.gl-price { display: flex; align-items: baseline; gap: 0.4rem; }
.gl-price .gl-inp { max-width: 8rem; }
.gl-price .kr { font-size: 0.85rem; color: var(--muted); }
@media (max-width: 640px) { .gl-subgrid { grid-template-columns: 1fr; } }

/* prospect card — sales/pipeline view: demos as reference links (ops live on sajter) */
.demolist .dll { font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.demolist .dl { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; padding: 0.12rem 0; }
.demolist .dl .host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demolist .dl .openlink { margin-left: auto; font-size: 0.78rem; white-space: nowrap; }

/* Tillbakapil på titelraden (← titel · chips · knappar). Större muted glyf, generös
   klickyta, mörknar vid hover. Baseline-justerad så titeln landar på samma höjd oavsett
   om pilen finns eller ej. */
.backarrow { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.9rem; height: 1.9rem; margin-left: -0.4rem; font-size: 1.5rem; line-height: 1; color: var(--muted); text-decoration: none; border-radius: 6px; }
.backarrow:hover { color: var(--accent-ink); background: var(--soft); }
.backarrow:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; color: var(--accent-ink); }

/* customer edit — Hotwire modal (dialog) + full-page fallback */
.gh-modal { border: 0; border-radius: 12px; padding: 0; width: min(34rem, 92vw); background: #fff; color: var(--ink); box-shadow: 0 10px 40px rgba(0,0,0,0.28); }
.gh-modal::backdrop { background: rgba(15,20,17,0.42); }
.mhead { display: flex; align-items: center; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); }
.mhead h2 { font-weight: 600; text-transform: lowercase; font-size: 1.15rem; margin: 0; }
.mhead .mx { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0; }
.mhead .mx:hover { color: var(--ink); }
.mbody { padding: 1.2rem 1.3rem; }
.mfoot { display: flex; align-items: center; gap: 0.6rem; padding: 1rem 1.3rem; border-top: 1px solid var(--line); background: var(--soft); }
.editcard { max-width: 34rem; }
.editcard .btn { margin-top: 1rem; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; }
.fgrid .field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.fgrid .field.full { grid-column: 1 / -1; }
.fgrid label { font-size: 0.64rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.fgrid input, .fgrid select, .fgrid textarea { width: 100%; box-sizing: border-box; padding: 0.5rem 0.6rem; border: 1px solid #d4d4d4; border-radius: 5px; font: inherit; background: #fff; }
.fgrid textarea { min-height: 5rem; resize: vertical; }
.fgrid input:focus, .fgrid select:focus, .fgrid textarea:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); outline-offset: 0; }

/* ── Tidsloggning ──────────────────────────────────────────────────────── */
.time-entry-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.8rem; }
.time-entry-form input, .time-entry-form select { padding: 0.4rem; border: 1px solid #d4d4d4; font: inherit; font-size: 0.85rem; border-radius: 5px; background: #fff; }
.time-entry-form .te-desc { flex: 1; min-width: 8rem; }
.time-entry-form .te-min { width: 5.5rem; }
.time-entry-form .te-date { width: 9rem; }
.time-entry-form .te-bill { all: unset; display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
table.te-list { width: 100%; font-size: 0.85rem; border-collapse: collapse; }
table.te-list td { padding: 0.35rem 0.5rem; vertical-align: top; border-top: 1px solid var(--line); }
table.te-list tr:first-child td { border-top: 0; }
table.te-list .te-d { white-space: nowrap; color: var(--muted); }
table.te-list .te-act { white-space: nowrap; text-align: right; }
table.te-list .te-act .linklike { color: #a33; }
.te-sums { margin-top: 0.5rem; }
.att.att-total { font-weight: 600; }

/* ── Fakturarader & månadskörningens granskning ────────────────────────── */
.draft-review .draft-inv { border-top: 1px solid var(--line); padding-top: 0.85rem; margin-top: 0.85rem; }
.draft-review .draft-inv:first-of-type { border-top: 0; padding-top: 0.3rem; }
.draft-head { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.draft-head .draft-sum { margin-left: auto; font-weight: 600; }
table.line-list { width: 100%; font-size: 0.85rem; border-collapse: collapse; margin-top: 0.4rem; }
table.line-list td, table.line-list th { padding: 0.3rem 0.5rem; vertical-align: top; border-top: 1px solid var(--line); text-align: left; }
table.line-list thead th { border-top: 0; color: var(--muted); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
table.line-list .num { text-align: right; white-space: nowrap; }
.ll-edit { display: flex; gap: 0.4rem; align-items: center; }
.ll-input { flex: 1; min-width: 8rem; padding: 0.3rem 0.4rem; border: 1px solid #d4d4d4; border-radius: 4px; font: inherit; font-size: 0.85rem; }
.ll-act { text-align: right; white-space: nowrap; }
.ll-act .linklike, table.line-list .ll-act .linklike { color: #a33; }
.draft-foot { display: flex; gap: 0.5rem; margin-top: 0.55rem; }

/* ── Attribueringsvarning & aktiveringserbjudande ──────────────────────── */
.warn-row { background: #fff7e6; border: 1px solid #f0d68a; color: #7a5a10; padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.85rem; margin: 0.5rem 0; }
.flash.activation-offer { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; justify-content: space-between; background: #fff7e6; color: #7a5a10; }
.activation-offer .ao-actions { display: inline-flex; align-items: center; gap: 0.6rem; }
