/* Svets – ljust / mörkt tema (växel)
   Responsiv: mobil · padda · PC/Mac fullskärm */

/* —— Ljust (standard) —— */
:root,
html[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
  --dim: #94a3b8;
  --amber: #d97706;
  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --sky: #0284c7;
  --orange: #ea580c;
  --violet: #7c3aed;
  --rose: #e11d48;
  --nav-bg: #ffffff;
  --side-bg: #0f172a;
  --side-text: #cbd5e1;
  --side-muted: #94a3b8;
  --side-active-bg: rgba(16, 185, 129, 0.15);
  --side-active: #34d399;
  --input-bg: #ffffff;
  --list-bg: #f8fafc;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --welcome-grad: linear-gradient(135deg, #ecfdf5 0%, #fff 55%, #f0f9ff 100%);
  --welcome-border: #a7f3d0;
  --welcome-title: #065f46;
  --topbar-bg: rgba(255, 255, 255, 0.96);
  --modal-bg: #ffffff;
  --toast-bg: #0f172a;
  --toast-text: #f8fafc;
  --backdrop: rgba(15, 23, 42, 0.4);
  --score-good-bg: #ecfdf5;
  --score-mid-bg: #fffbeb;
  --score-bad-bg: #fff1f2;
  --badge-warn-bg: #fffbeb;
  --badge-warn-border: #fde68a;
  --badge-warn-text: #b45309;
  --badge-crit-bg: #fff1f2;
  --badge-crit-border: #fecdd3;
  --badge-info-bg: #f0f9ff;
  --badge-info-border: #bae6fd;
  --issue-crit-bg: #fff1f2;
  --issue-warn-bg: #fffbeb;
  --issue-info-bg: #f0f9ff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --nav-h: 58px;
  --side-w: 248px;
  --top-h: 56px;
  --content-max: 1400px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --radius-lg: 16px;
  /* Typografi – något större för läsbarhet (desktop höjs mer i media queries) */
  --fs-base: 16px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-title: 22px;
  --lh: 1.5;
  /* Scrollbar (webb / desktop) */
  --scroll-size: 12px;
  --scroll-track: #e2e8f0;
  --scroll-thumb: #94a3b8;
  --scroll-thumb-hover: #64748b;
  --scroll-thumb-active: #059669;
}

/* —— Mörkt —— */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b14;
  --bg-elevated: #0f172a;
  --card: #0f172a;
  --border: #1e293b;
  --border-strong: #334155;
  --scroll-track: #0f172a;
  --scroll-thumb: #475569;
  --scroll-thumb-hover: #64748b;
  --scroll-thumb-active: #34d399;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --dim: #64748b;
  --amber: #fbbf24;
  --emerald: #34d399;
  --emerald-soft: rgba(16, 185, 129, 0.12);
  --sky: #38bdf8;
  --orange: #fb923c;
  --violet: #a78bfa;
  --rose: #fb7185;
  --nav-bg: rgba(15, 23, 42, 0.98);
  --side-bg: #05080f;
  --side-text: #cbd5e1;
  --side-muted: #64748b;
  --side-active-bg: rgba(52, 211, 153, 0.12);
  --side-active: #34d399;
  --input-bg: #0b1220;
  --list-bg: #0b1220;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --welcome-grad: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, #0f172a 55%, rgba(56, 189, 248, 0.08) 100%);
  --welcome-border: rgba(52, 211, 153, 0.35);
  --welcome-title: #6ee7b7;
  --topbar-bg: rgba(7, 11, 20, 0.96);
  --modal-bg: #0f172a;
  --toast-bg: #1e293b;
  --toast-text: #e2e8f0;
  --backdrop: rgba(0, 0, 0, 0.55);
  --score-good-bg: rgba(16, 185, 129, 0.12);
  --score-mid-bg: rgba(251, 191, 36, 0.1);
  --score-bad-bg: rgba(251, 113, 133, 0.1);
  --badge-warn-bg: rgba(251, 191, 36, 0.12);
  --badge-warn-border: rgba(251, 191, 36, 0.35);
  --badge-warn-text: #fbbf24;
  --badge-crit-bg: rgba(251, 113, 133, 0.12);
  --badge-crit-border: rgba(251, 113, 133, 0.35);
  --badge-info-bg: rgba(56, 189, 248, 0.12);
  --badge-info-border: rgba(56, 189, 248, 0.35);
  --issue-crit-bg: rgba(251, 113, 133, 0.08);
  --issue-warn-bg: rgba(251, 191, 36, 0.08);
  --issue-info-bg: rgba(56, 189, 248, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}
html[data-theme="dark"] { color-scheme: dark; }
html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

button, input, select, textarea {
  font: inherit; color: var(--text);
  background-color: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
/* appearance:none bara på textfält/knappar – annars försvinner bocken i checkboxar */
button, input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  -webkit-appearance: none;
  appearance: none;
}
button { cursor: pointer; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  background-color: var(--input-bg) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--emerald);
  width: 100%;
  padding: 11px 12px;
}
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Synliga, klickbara kryssrutor (kontrollanthjälp, ta bort logga, personal m.m.) */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  min-height: 22px;
  max-width: 22px;
  padding: 0 !important;
  margin: 0;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: var(--card) !important;
  background-color: var(--card) !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  vertical-align: middle;
  display: inline-grid;
  place-content: center;
  box-shadow: none !important;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
input[type="radio"] {
  border-radius: 50%;
}
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--emerald);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid rgba(5, 150, 105, 0.55);
  outline-offset: 2px;
  box-shadow: none !important;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--emerald) !important;
  background-color: var(--emerald) !important;
  border-color: var(--emerald);
}
/* Bockmarkering */
input[type="checkbox"]:checked::after {
  content: "";
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}
/* Radio-prick */
input[type="radio"]:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  display: block;
}
html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] {
  background: var(--bg-elevated) !important;
  background-color: var(--bg-elevated) !important;
}
html[data-theme="dark"] input[type="checkbox"]:checked,
html[data-theme="dark"] input[type="radio"]:checked {
  background: var(--emerald) !important;
  background-color: var(--emerald) !important;
}
label { display: block; font-size: var(--fs-sm); color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.field { margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 520px) {
  .row2, .row3 { grid-template-columns: 1fr; }
}

/* —— Topbar —— */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  min-height: var(--top-h);
  padding: calc(8px + var(--safe-top)) 14px 8px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px !important;
  min-height: 36px;
  background: var(--list-bg) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
  font-weight: 600;
  box-shadow: none !important;
}
.theme-toggle .theme-ico { font-size: 17px; line-height: 1; }
/* Ljust läge: visa måne (växla till mörkt). Mörkt: visa sol */
html[data-theme="light"] .theme-ico-sun { display: none; }
html[data-theme="dark"] .theme-ico-moon { display: none; }
.theme-label { font-size: var(--fs-sm); }
@media (max-width: 420px) {
  .theme-label { display: none; }
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #f59e0b, #ea580c);
  font-size: 19px; flex-shrink: 0;
  color: #fff;
}
.brand-title { font-weight: 700; letter-spacing: 0.01em; color: var(--text); }
.brand-sub { font-size: var(--fs-xs); color: var(--dim); }
.topbar-desktop { display: none; flex: 1; min-width: 0; align-items: center; gap: 16px; }
.topbar-page { margin: 0; font-size: var(--fs-xl); font-weight: 700; color: var(--text); }
.topbar-meta { font-size: var(--fs-sm); color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn-nav-back {
  flex-shrink: 0;
  font-weight: 700;
  white-space: nowrap;
  background: var(--list-bg) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  order: -1; /* längst till vänster i topbar */
}
.btn-nav-back:hover {
  border-color: #6ee7b7 !important;
  color: var(--emerald) !important;
}
.btn-nav-back[hidden] { display: none !important; }
@media (max-width: 420px) {
  .btn-nav-back {
    padding: 8px 10px !important;
    font-size: 13px;
  }
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--list-bg); border: 1px solid var(--border);
  color: var(--text); font-size: 19px;
}

.main {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px 14px calc(24px + var(--nav-h) + var(--safe-bot));
}

/* —— Bottom nav (mobil) —— */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}
.bottom-nav:not([hidden]) {
  display: grid;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: 0; border-radius: 0; background: transparent;
  color: var(--dim); font-size: 13px; padding: 6px 2px;
}
.nav-item span { font-size: 19px; line-height: 1; }
.nav-item em { font-style: normal; }
.nav-item.active { color: var(--emerald); font-weight: 600; }

/* —— Side nav (desktop: mörk accent, innehåll ljust) —— */
.side-nav {
  display: none;
  flex-direction: column;
  width: var(--side-w);
  flex-shrink: 0;
  background: var(--side-bg);
  border-right: 1px solid #1e293b;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow: hidden;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.side-brand .brand-title { color: #f8fafc; }
.side-brand .brand-sub { color: var(--side-muted); }
.side-links {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 14px 10px 6px;
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--side-text);
  font-size: 15px;
  font-weight: 500;
}
.side-item span { font-size: 17px; width: 1.4em; text-align: center; }
.side-item:hover { background: rgba(255,255,255,0.06); color: #f8fafc; }
.side-item.active {
  background: var(--side-active-bg);
  color: var(--side-active);
}
.side-foot {
  padding: 12px 14px;
  border-top: 1px solid #1e293b;
  font-size: 14px;
  color: var(--side-muted);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-foot-user { font-size: 13px; line-height: 1.35; }
.side-foot-user strong { color: var(--side-text); font-weight: 600; }
.side-logout {
  width: 100%;
  background: rgba(251, 113, 133, 0.12) !important;
  border-color: rgba(251, 113, 133, 0.35) !important;
  color: #fda4af !important;
}
.side-logout:hover {
  background: rgba(251, 113, 133, 0.22) !important;
}
.btn-logout {
  border-color: rgba(225, 29, 72, 0.35);
  color: var(--rose);
  background: var(--badge-crit-bg, #fff1f2);
}
.btn-logout:hover {
  border-color: var(--rose);
  background: rgba(225, 29, 72, 0.12);
}
html[data-theme="dark"] .btn-logout {
  background: rgba(251, 113, 133, 0.12);
  color: #fb7185;
}
#btnLogoutTop {
  white-space: nowrap;
}
body.is-logged-out #btnLogoutTop { display: none !important; }

/* —— Cards & lists —— */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.muted { color: var(--muted); font-size: 15px; }
.dim { color: var(--dim); font-size: 14px; }

.score-wrap {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 8px;
}
.score-ring {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 24px;
  border: 3px solid var(--border);
  flex-shrink: 0;
  background: var(--list-bg);
}
.score-ring.good { border-color: var(--emerald); color: var(--emerald); background: var(--score-good-bg); }
.score-ring.mid { border-color: var(--amber); color: var(--amber); background: var(--score-mid-bg); }
.score-ring.bad { border-color: var(--rose); color: var(--rose); background: var(--score-bad-bg); }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--list-bg); color: var(--muted);
}
.badge.ok { background: var(--emerald-soft); border-color: rgba(16, 185, 129, 0.35); color: var(--emerald); }
.badge.warn { color: var(--badge-warn-text); background: var(--badge-warn-bg); border-color: var(--badge-warn-border); }
.badge.crit { color: var(--rose); background: var(--badge-crit-bg); border-color: var(--badge-crit-border); }
.badge.info { color: var(--sky); background: var(--badge-info-bg); border-color: var(--badge-info-border); }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--list-bg); border: 1px solid var(--border);
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.list-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: var(--card);
}
.list-body { flex: 1; min-width: 0; text-align: left; }

.photo-upload {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--list-bg);
}
.photo-preview {
  width: 88px; height: 88px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--card);
}
.photo-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.photo-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 13px;
  color: var(--dim);
  text-align: center;
  padding: 8px;
}
.photo-fields { flex: 1; min-width: 0; }
.photo-fields .field { margin-bottom: 6px; }
@media (max-width: 420px) {
  .photo-upload { flex-direction: column; align-items: center; }
  .photo-fields { width: 100%; }
}

.ncr-photos {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 12px;
}
.ncr-thumb {
  width: 72px; height: 72px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--border);
  display: block; background: var(--list-bg);
}
.ncr-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.qual-method-block {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--card, #fff);
}
.qual-method-title {
  color: var(--accent, #0f766e);
  font-weight: 700;
}
.qual-tm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
@media (max-width: 560px) {
  .qual-tm-grid { grid-template-columns: 1fr; }
}
.qual-tm-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--list-bg, #f8fafc);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.3;
}
.qual-tm-check.is-on {
  border-color: var(--accent, #0f766e);
  background: color-mix(in srgb, var(--accent, #0f766e) 12%, transparent);
}
.qual-tm-check input { margin-top: 2px; flex-shrink: 0; }
.list-or-custom .loc-custom {
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed var(--border, #cbd5e1);
  background: var(--list-bg, #f8fafc);
}
.list-or-custom .loc-custom input {
  width: 100%;
}
.filler-product-block .filler-free-fields {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.faq-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 0.92rem;
}
.faq-table th {
  text-align: left;
  vertical-align: top;
  padding: 6px 10px 6px 0;
  width: 34%;
  color: var(--accent, #0f766e);
  font-weight: 700;
}
.faq-table td {
  padding: 6px 0;
  color: var(--text, #0f172a);
}
.faq-sec {
  margin-bottom: 8px;
}
/* WPS sök + verkstadsrader */
.wps-search-card { margin-bottom: 10px; }
.wps-search-wrap { position: relative; }
.wps-search-wrap input[type=search] {
  width: 100%;
  font-size: 1.05rem;
  padding: 12px 14px;
}
.wps-suggest {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 40;
  margin: 4px 0 0;
  padding: 6px 0;
  list-style: none;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow: auto;
}
.wps-suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.wps-suggest-item:hover,
.wps-suggest-item:focus {
  background: color-mix(in srgb, var(--accent, #0f766e) 12%, transparent);
}
.list-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: default;
}
.list-body-btn {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.list-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}
.eq-overdue-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  vertical-align: middle;
}
.eq-overdue-hint {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bad, #e11d48);
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  max-width: 11.5rem;
}
button.eq-overdue-hint:hover,
button.eq-overdue-hint:focus {
  color: var(--bad, #e11d48);
  opacity: 0.85;
}
.list-row-actions .right {
  text-align: right;
}
/* WPS parameterintervall */
.wps-param-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.wps-param-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 2fr;
  gap: 8px 12px;
  align-items: center;
}
@media (max-width: 560px) {
  .wps-param-row { grid-template-columns: 1fr; }
}
.wps-param-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}
.wps-param-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.wps-param-range input[type=text] {
  width: 88px;
  min-width: 72px;
  flex: 0 1 auto;
}
.wps-param-sep {
  color: var(--muted, #64748b);
  font-weight: 600;
}
.wps-param-unit {
  font-size: 0.85rem;
  color: var(--muted, #64748b);
  min-width: 2.5rem;
}
.wps-param-unit-sel {
  width: auto;
  min-width: 100px;
  font-size: 0.9rem;
}
.arc-search-wrap { position: relative; }
.arc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.arc-chip.is-on {
  background: color-mix(in srgb, var(--accent, #0f766e) 22%, transparent);
  border-color: var(--accent, #0f766e);
  font-weight: 700;
}
.arc-suggest {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 40;
  margin: 4px 0 0;
  padding: 6px 0;
  list-style: none;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  max-height: 240px;
  overflow: auto;
}
.base-mat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.base-mat-field { position: relative; }
.base-mat-suggest { z-index: 45; }
.wps-pass-block {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
}
.wps-pass-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.form-section {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted);
  margin: 14px 0 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.info-box {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--list-bg);
  margin-bottom: 14px;
}
.info-box strong { color: var(--text); }

.side-item.is-locked,
.nav-item.is-locked,
.menu-card.is-locked,
.quick-card.is-locked,
.btn.is-locked {
  pointer-events: auto;
}
.side-item.is-locked {
  color: #64748b;
  opacity: 0.46;
  cursor: not-allowed;
  filter: grayscale(1);
}
.side-item.is-locked:hover {
  background: transparent;
  color: #64748b;
}
.side-item.is-locked::after {
  content: 'Låst';
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .9;
}
.nav-item.is-locked {
  opacity: 0.38;
  filter: grayscale(1);
  cursor: not-allowed;
}
.nav-item.is-locked.active { color: var(--dim); }
.menu-card.is-locked,
.quick-card.is-locked {
  opacity: 0.48;
  filter: grayscale(1);
  cursor: not-allowed;
  box-shadow: none;
}
.menu-card.is-locked:hover,
.quick-card.is-locked:hover {
  transform: none;
  border-color: var(--border);
}
.btn.is-locked,
.btn.is-locked:disabled {
  opacity: 0.45;
  filter: grayscale(1);
  cursor: not-allowed;
}
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.lang-switch {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}
.lang-switch-lab {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.lang-switch-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lang-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn em { font-style: normal; font-weight: 600; color: var(--muted); margin-left: 4px; }
.lang-btn.is-on {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--welcome-title, #065f46);
}
.lang-std-note { margin: 8px 0 0; font-size: 12px; line-height: 1.45; }
.lang-mini { display: inline-flex; align-items: center; }
.lang-select {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.eq-scan-wrap {
  position: relative;
  background: #0f172a;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-height: 52vh;
}
.eq-scan-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eq-scan-frame {
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(16, 185, 129, .95);
  border-radius: 16px;
  box-shadow: 0 0 0 2000px rgba(15, 23, 42, .35);
  pointer-events: none;
}
.art-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.art-qr {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.art-qr img {
  width: 96px;
  height: 96px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.art-kpis .kpi .n { font-size: 1.15rem; }

/* Underhållslista – mallredigerare */
.maint-cols {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  margin: 0 0 12px;
}
.maint-col { font-size: 13px; }
.maint-toggles {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin: 0 0 12px;
}
.maint-line {
  display: flex; gap: 8px; align-items: center;
  margin: 0 0 6px;
}
.maint-line input {
  flex: 1; min-width: 0;
}
.maint-print-form .form-section { margin-top: 14px; }
.remind-add {
  display: flex; gap: 10px; align-items: center;
  margin: 0 0 12px;
}
.remind-add input[type="email"] {
  flex: 1; min-width: 0;
}
.remind-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.remind-addr {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--list-bg);
}
.remind-addr span { flex: 1; min-width: 0; word-break: break-all; }
.weldcalc-tip { margin: 10px 0 12px; }
.weldcalc-tip a { color: inherit; }
.weldplan-tip { margin-bottom: 12px; }
.weldplan-steps {
  margin: 0; padding: 0 0 0 1.2rem;
  color: var(--muted); font-size: 14px; line-height: 1.4;
}
.weldplan-steps li { margin: 0 0 8px; }
.weldplan-steps strong { color: var(--text); }
.weldplan-steps .muted { display: block; margin-top: 2px; }
.weldplan-tip a { color: inherit; }

/* Utrustning ISO 17662 */
.eq-std-box { border-color: color-mix(in srgb, var(--accent, #059669) 35%, var(--border)); }
.eq-hero { margin-bottom: 12px; }
.eq-hero-title { margin: 0 0 6px; font-size: 1.1rem; }
.eq-feature-list {
  margin: 0; padding: 0 0 0 1.15rem;
  color: var(--muted); font-size: 15px; line-height: 1.45;
}
.eq-feature-list li { margin-bottom: 8px; }
.eq-feature-list strong { color: var(--text); }
.eq-qr-box { margin-bottom: 14px; }
.eq-qr-row { display: flex; gap: 14px; align-items: flex-start; }
.eq-qr-img {
  width: 140px; height: 140px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; flex-shrink: 0;
}
.eq-history { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.eq-hist-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px;
  background: var(--list-bg); border: 1px solid var(--border);
  font-size: 15px;
}
.eq-hist-row .meta { margin-top: 2px; font-size: 14px; color: var(--muted); }
.eq-hist-row.is-current {
  border-color: color-mix(in srgb, var(--accent, #059669) 45%, var(--border));
  background: color-mix(in srgb, var(--accent, #059669) 8%, var(--list-bg));
}
.eq-hist-row.is-archived { opacity: 0.88; }
.eq-proto-card {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #059669) 40%, var(--border));
  background: color-mix(in srgb, var(--accent, #059669) 8%, var(--list-bg));
}
.eq-proto-empty {
  border-style: dashed;
  background: var(--list-bg);
}
.eq-proto-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.eq-proto-file {
  margin: 8px 0 0;
  font-weight: 700;
  font-size: 14px;
  word-break: break-word;
}
.eq-proto-actions { margin-top: 10px; }
.eq-archive {
  margin: 4px 0 14px;
  padding: 10px 12px 4px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--list-bg);
}
.eq-archive summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  padding: 4px 0 8px;
  list-style-position: outside;
}
.eq-archive summary:hover { color: var(--accent, #059669); }
.eq-archive .eq-history { margin-top: 6px; }
.eq-renew-banner {
  border-color: color-mix(in srgb, var(--accent, #059669) 50%, var(--border));
  background: color-mix(in srgb, var(--accent, #059669) 12%, var(--list-bg));
}
.eq-renew-row { margin: 10px 0 4px; }
.eq-renew-row .btn.is-active,
.js-eq-new-val.is-active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #059669) 45%, transparent);
}
.maint-card { margin-bottom: 12px; }
@media (max-width: 480px) {
  .eq-qr-row { flex-direction: column; align-items: center; text-align: center; }
}

/* Spårbarhet ISO 3834 */
.trace-plan-score {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 0; padding: 12px;
  border-radius: 12px; background: var(--list-bg); border: 1px solid var(--border);
}
.trace-score-pill {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px; color: #fff; flex-shrink: 0;
}
.trace-score-pill.good { background: linear-gradient(145deg, #10b981, #059669); }
.trace-score-pill.mid { background: linear-gradient(145deg, #f59e0b, #d97706); }
.trace-score-pill.bad { background: linear-gradient(145deg, #f43f5e, #e11d48); }
.weld-map-table-wrap { overflow-x: auto; margin: 0 -4px; }
.weld-map-table {
  width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px;
}
.weld-map-table th, .weld-map-table td {
  border: 1px solid var(--border); padding: 8px 8px; text-align: left; vertical-align: top;
}
.weld-map-table th {
  background: var(--list-bg); color: var(--muted); font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.weld-map-table tr.weld-map-row { cursor: pointer; }
.weld-map-table tr.weld-map-row:hover td { background: rgba(16, 185, 129, 0.06); }
.weld-map-table td.tm-ok { color: var(--text); }
.weld-map-table td.tm-gap {
  color: var(--rose); background: rgba(244, 63, 94, 0.04);
}
.crit-line { color: var(--rose) !important; }
.warn-line { color: #d97706 !important; }
.trace-level-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px;
}
@media (max-width: 700px) {
  .trace-level-grid { grid-template-columns: 1fr 1fr; }
}
.trace-level {
  padding: 10px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--list-bg); font-size: 14px;
}
.trace-level strong { display: block; margin-bottom: 2px; color: var(--text); }
.trace-level span { color: var(--muted); line-height: 1.3; display: block; }
.trace-level.is-active {
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--emerald-soft, rgba(16, 185, 129, 0.12));
}
.trace-compare-card { margin-bottom: 12px; }
.trace-compare-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 700px) {
  .trace-compare-grid { grid-template-columns: 1fr; }
}
.trace-compare-col {
  padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--list-bg);
}
.trace-compare-extra {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.trace-compare-h {
  margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--text);
}
.trace-gap-bars { display: flex; flex-direction: column; gap: 8px; }
.trace-gap-row {
  display: grid; grid-template-columns: minmax(140px, 1.2fr) 1fr 36px; gap: 8px; align-items: center;
  font-size: 14px;
}
.trace-gap-bar {
  height: 8px; border-radius: 999px; background: var(--border); overflow: hidden;
}
.trace-gap-bar i {
  display: block; height: 100%; background: var(--rose); border-radius: 999px;
}
.trace-help-card { margin-bottom: 12px; }
.trace-help-card .underlag-details { margin-bottom: 8px; }
.trace-help-card .underlag-details:last-child { margin-bottom: 0; }
.trace-help-body p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; color: var(--text); }
.trace-help-body p:last-child { margin-bottom: 0; }
.trace-help-body h4 { margin: 10px 0 4px; font-size: 13px; }

/* Begreppshjälp EXC / 3834 */
.term-help, .term-help-slot:empty { margin: 0 0 12px; }
.term-help-slot:not(:empty) { margin: 0 0 12px; }
.term-help {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: var(--emerald-soft, rgba(16, 185, 129, 0.1));
  font-size: 15px;
}
.term-help-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.term-help-head strong { color: var(--text); font-size: 15px; }
.term-pill {
  display: inline-flex; padding: 2px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
}
.term-pill.dim-pill { opacity: 0.9; }
.term-help-sum { margin: 0 0 4px; color: var(--text); line-height: 1.4; }
.term-help-use { margin: 4px 0; color: var(--muted); font-size: 14px; }
.term-help-note {
  margin: 6px 0 0; font-size: 14px; color: var(--muted);
  padding-top: 6px; border-top: 1px dashed var(--border);
}
.term-help-list {
  margin: 6px 0 0; padding-left: 1.15rem; color: var(--muted); font-size: 14px;
}
.term-help-list li { margin-bottom: 2px; }
.term-help-more { margin-top: 8px; }
.term-chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--list-bg);
  font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer;
  margin: 0 6px 4px 0;
}
.term-chip:hover { border-color: rgba(16, 185, 129, 0.45); }
.org-level-line { margin: 6px 0 !important; }
.linkish {
  background: none; border: none; padding: 0; color: var(--sky, #0284c7);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.gloss-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.gloss-card {
  padding: 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card);
  box-shadow: var(--shadow);
}
.gloss-card.is-focus {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.gloss-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.gloss-head h3 { margin: 0; font-size: 16px; }
.gloss-sum { margin: 0 0 6px; font-size: 15px; color: var(--text); line-height: 1.4; }
.gloss-pair {
  padding: 10px 12px; margin-bottom: 8px; border-radius: 10px;
  background: var(--list-bg); border: 1px solid var(--border); font-size: 15px;
}
.gloss-pair:last-child { margin-bottom: 0; }
.gloss-abbr {
  margin: 0 0 6px; font-size: 13.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.gloss-abbr span {
  display: inline-block; min-width: 2.6em; font-weight: 800; color: var(--text);
}
.rwc-abbr-card .eq-hero-title { margin-bottom: 4px; }
.abbr-table-wrap { overflow-x: auto; margin: 0 -2px; }
.abbr-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  background: var(--card);
}
.abbr-table th, .abbr-table td {
  text-align: left; vertical-align: top;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.abbr-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; background: var(--list-bg);
}
.abbr-table td:first-child { white-space: nowrap; width: 18%; }
.abbr-table tbody tr:last-child td { border-bottom: 0; }
.abbr-table tbody tr:hover td { background: var(--list-bg); }
@media (max-width: 640px) {
  .abbr-table { font-size: 12.5px; }
  .abbr-table th, .abbr-table td { padding: 7px 6px; }
}
.list-item:hover {
  border-color: #a7f3d0;
  background: #fff;
  box-shadow: var(--shadow);
}
.list-item .title { font-weight: 600; font-size: 16px; color: var(--text); }
.list-item .meta { font-size: 14px; color: var(--muted); margin-top: 3px; }
.list-item .right { text-align: right; flex-shrink: 0; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  font-weight: 600; font-size: 16px;
  box-shadow: var(--shadow);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(145deg, #10b981, #059669);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}
html[data-theme="dark"] .btn-primary {
  color: #042f2e;
}
html[data-theme="dark"] .list-item:hover {
  background: #111827;
  border-color: rgba(52, 211, 153, 0.4);
}
html[data-theme="dark"] .quick-card:hover {
  border-color: rgba(52, 211, 153, 0.45);
}
html[data-theme="dark"] .menu-card:hover {
  border-color: rgba(52, 211, 153, 0.4);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-danger {
  background: var(--badge-crit-bg);
  border-color: var(--badge-crit-border); color: var(--rose);
  box-shadow: none;
}
.btn-ghost { background: transparent; box-shadow: none; }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin: 12px 0 0;
}
.kpi {
  background: var(--list-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.kpi .n { font-size: 24px; font-weight: 800; color: var(--text); }
.kpi .l { font-size: 13px; color: var(--muted); margin-top: 2px; font-weight: 500; }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 15px; color: var(--text);
}
.check-list li:last-child { border-bottom: 0; }
.check-dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; flex-shrink: 0;
  font-weight: 700;
}
.check-dot.ok { background: var(--emerald-soft); color: var(--emerald); }
.check-dot.no { background: #fff1f2; color: var(--rose); }

.issue {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px; margin-bottom: 8px;
  border: 1px solid var(--border); background: var(--list-bg); font-size: 15px;
  color: var(--text);
}
.issue.critical { border-color: var(--badge-crit-border); background: var(--issue-crit-bg); }
.issue.warn { border-color: var(--badge-warn-border); background: var(--issue-warn-bg); }
.issue.info { border-color: var(--badge-info-border); background: var(--issue-info-bg); }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.kpi-n { font-size: 1.45rem; font-weight: 800; }
.kpi-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td {
  text-align: left; padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.acct-co { margin-top: 12px; }
.acct-co-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  align-items: flex-start;
}
.acct-co-name { font-size: 1.05rem; }
.acct-co-meta { text-align: right; }
.acct-members { display: flex; flex-direction: column; gap: 8px; }
.acct-member {
  padding: 8px 10px; border-radius: 10px;
  background: var(--list-bg); border: 1px solid var(--border);
}
@media (max-width: 720px) {
  .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr { display: block; }
  .data-table thead { display: none; }
  .data-table tr { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
  .data-table td { border: 0; padding: 3px 4px; }
}

.menu-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.menu-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 16px 14px; border-radius: var(--radius-lg); text-align: left;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); min-height: 96px;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.menu-card:hover {
  border-color: #a7f3d0;
  box-shadow: var(--shadow-md);
}
.menu-card span { font-size: 24px; }
.menu-card strong { font-size: 16px; }
.menu-card small { color: var(--muted); font-size: 13px; }

/* —— Inloggning med Svetslobbyn-varumärke —— */
.login-page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 4px 32px;
}
.login-brand-panel { display: none; }
.login-brand-mobile {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
  padding: 8px 10px 18px;
}
.login-brand-mobile img,
.seo-ssr .login-brand-mobile img {
  display: block;
  width: 180px;
  max-width: 48vw;
  height: auto;
  min-height: 150px;
  max-height: 260px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.10),
    0 10px 22px rgba(15, 23, 42, 0.14),
    0 22px 40px rgba(15, 23, 42, 0.12);
  background: #111;
  border: 0;
}
@media (max-width: 859px) {
  body.is-logged-out .login-brand-mobile,
  .login-brand-mobile {
    display: flex !important;
  }
}
html[data-theme="dark"] .login-brand-mobile img {
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35),
    0 12px 24px rgba(0, 0, 0, 0.42),
    0 24px 48px rgba(0, 0, 0, 0.38);
}
.login-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 4px;
}
.login-kicker {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--emerald);
}
.login-wrap h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--text);
  font-weight: 800;
}
.login-lead {
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}
.login-card {
  margin-bottom: 0;
}
.login-foot {
  margin: 14px 0 0;
  text-align: center;
}

@media (min-width: 860px) {
  .login-page {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 400px);
    gap: 36px 48px;
    align-items: center;
    min-height: min(78vh, 720px);
    max-width: 920px;
    margin: 4vh auto 0;
    padding: 12px 16px 40px;
  }
  .login-brand-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 420px;
    padding: 18px 22px 36px;
    overflow: visible;
  }
  .login-brand-glow {
    position: absolute;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 70%);
    filter: blur(8px);
    pointer-events: none;
  }
  .login-brand-img {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 8px), 320px);
    height: auto;
    max-height: min(72vh, 560px);
    object-fit: cover;
    border-radius: 24px;
    box-shadow:
      0 2px 6px rgba(15, 23, 42, 0.10),
      0 12px 28px rgba(15, 23, 42, 0.16),
      0 28px 52px rgba(15, 23, 42, 0.12);
    border: 0;
    background: #111;
  }
  html[data-theme="dark"] .login-brand-img {
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.35),
      0 14px 32px rgba(0, 0, 0, 0.42),
      0 32px 60px rgba(0, 0, 0, 0.4);
  }
  .login-brand-mobile { display: none; }
  .login-wrap {
    margin: 0;
    max-width: none;
    width: 100%;
  }
  .login-wrap h1 { font-size: 30px; }
}

@media (min-width: 1024px) {
  .login-page {
    margin-top: 6vh;
  }
  /* Dölj full-width main-begränsning på login */
  body.is-logged-out .main > .login-page {
    max-width: 920px;
  }
}

/* [hidden] MÅSTE vinna över display:flex – annars låses hela appen */
[hidden],
.modal[hidden],
.toast[hidden],
#sideNav[hidden],
#bottomNav[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-bot) + 16px);
  transform: translateX(-50%) translateY(8px);
  background: var(--toast-bg); color: var(--toast-text);
  padding: 11px 18px; border-radius: 999px;
  border: 0;
  font-size: 15px; font-weight: 600; z-index: 100; max-width: 92vw;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  display: none;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast:not([hidden]) {
  display: inline-flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  line-height: 1;
}
.toast-ok {
  background: #065f46;
  color: #ecfdf5;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.35);
}
.toast-ok .toast-ico {
  background: #10b981;
  color: #042f2e;
}
.toast-err {
  background: #9f1239;
  color: #fff1f2;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.3);
}
.toast-err .toast-ico {
  background: #fb7185;
  color: #4c0519;
}
html[data-theme="dark"] .toast-ok {
  background: #064e3b;
  color: #d1fae5;
}
html[data-theme="dark"] .toast-err {
  background: #881337;
  color: #ffe4e6;
}

/* Knapp-bekräftelse (grön bock efter lyckad åtgärd) */
.btn.btn-flash-ok {
  background: #059669 !important;
  border-color: #047857 !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35) !important;
  transform: scale(1.02);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn.btn-flash-err {
  background: #e11d48 !important;
  border-color: #be123c !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.3) !important;
  animation: btn-shake 0.35s ease;
}
@keyframes btn-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.modal {
  position: fixed; inset: 0; z-index: 80;
  align-items: flex-end; justify-content: center;
  /* display sätts bara när synlig – se :not([hidden]) */
  pointer-events: none;
}
.modal:not([hidden]) {
  display: flex;
  pointer-events: auto;
}
.modal-backdrop {
  position: absolute; inset: 0; background: var(--backdrop);
  cursor: pointer;
}
.modal-sheet {
  position: relative; width: 100%; max-width: 560px;
  max-height: min(90vh, 720px); overflow: auto;
  background: var(--modal-bg); border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(20px + var(--safe-bot));
  z-index: 1;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}
.form-readonly .field,
.form-readonly .joint-picker,
.form-readonly .form-section,
.form-readonly .check-inline,
.form-readonly .info-box {
  opacity: 0.62;
  filter: grayscale(0.45);
}
.form-readonly input,
.form-readonly select,
.form-readonly textarea {
  background: var(--list-bg);
  color: var(--muted);
  cursor: not-allowed;
}
.form-readonly .actions {
  opacity: 1;
  filter: none;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.modal-head h2 { margin: 0; font-size: 18px; color: var(--text); }

.empty { text-align: center; padding: 28px 12px; color: var(--dim); }
.form-section {
  font-size: 14px; font-weight: 700; color: var(--amber);
  text-transform: uppercase; letter-spacing: .04em;
  margin: 16px 0 8px;
}
.check-inline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 8px 0 12px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* label.check-inline (t.ex. Ta bort logga) – hela raden klickbar */
label.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  width: auto;
  max-width: 100%;
}
.check-inline label {
  display: flex; align-items: center; gap: 8px;
  margin: 0; font-size: 15px; color: var(--text); cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.loading { text-align: center; color: var(--dim); padding: 40px 12px; }
.nav-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  height: 2px; pointer-events: none; opacity: 0;
  background: transparent; overflow: hidden;
  transition: opacity .15s ease;
}
.nav-progress.is-on { opacity: 1; }
.nav-progress.is-on::after {
  content: ''; display: block; height: 100%; width: 40%;
  background: var(--emerald, #059669);
  animation: nav-progress-slide 1.05s ease-in-out infinite;
}
@keyframes nav-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

.info-box {
  background: var(--emerald-soft);
  border: 1px solid var(--welcome-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 15px;
}
.info-box strong { color: var(--welcome-title); }
.check-list.mini li { padding: 5px 0; font-size: 14px; color: var(--muted); }
.check-list.mini { margin-bottom: 8px; }

/* Outstanding dashboard */
.hero-audit {
  margin-bottom: 14px;
  background: linear-gradient(145deg, var(--card) 0%, var(--list-bg) 100%);
  border: 1px solid var(--border);
}
.hero-copy h2 { margin: 0 0 6px; font-size: 22px; }
.score-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
}
.score-ring .score-n { font-size: 28px; line-height: 1; font-weight: 800; }
.score-ring .score-g {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.04em;
}
.std-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.std-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--list-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.kpi-hero { margin-top: 14px; }
.kpi-btn {
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color .15s, transform .1s;
}
.kpi-btn:hover {
  border-color: var(--emerald);
  transform: translateY(-1px);
}
.kpi-alert {
  border-color: var(--badge-crit-border) !important;
  background: var(--badge-crit-bg) !important;
}
.kpi-alert .n { color: var(--rose); }

.issue-list { display: flex; flex-direction: column; gap: 8px; }
button.issue {
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 10px;
  align-items: center;
}
button.issue .issue-std {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  grid-column: 1 / -1;
}
button.issue .issue-msg { font-size: 15px; }
.ok-line { color: var(--emerald); font-weight: 600; padding: 8px 0; }

.check-list li.is-ok .check-body strong { color: var(--text); }
.check-list li.is-no .check-body strong { color: var(--rose); }
.check-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.std-tag {
  font-style: normal;
  font-size: 13px;
  color: var(--dim);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.filter-bar .tab {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.filter-bar .tab.active {
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--emerald-soft);
}

.audit-guide {
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.audit-guide li { margin-bottom: 8px; }
.audit-guide strong { color: var(--text); }

/* Fogväljare */
.joint-picker { margin-bottom: 14px; }
.joint-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.joint-tabs .tab {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.joint-tabs .tab.active {
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--emerald-soft);
}
.joint-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}
.joint-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 10px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--list-bg);
  cursor: pointer;
  text-align: center;
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.joint-card img {
  width: 100%;
  max-width: 120px;
  height: auto;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--border);
}
html[data-theme="dark"] .joint-card img {
  background: #0b1220;
  border-color: #334155;
}
.joint-card .joint-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.joint-card .joint-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(217, 119, 6, 0.15);
  color: var(--amber);
  border: 1px solid rgba(217, 119, 6, 0.35);
}
.joint-card:hover {
  border-color: rgba(16, 185, 129, 0.5);
}
.joint-card.is-selected {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  background: var(--emerald-soft);
}
.joint-hint { margin: 8px 0 0; }

/* Filer / projekt */
.file-list .file-row {
  cursor: default;
  align-items: center;
}
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.linked-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--list-bg);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.file-chip:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

/* Standardsök / autocomplete */
.std-search-field {
  position: relative;
  z-index: 5;
}
.std-search-field:focus-within {
  z-index: 40;
}
.std-search-wrap {
  position: relative;
}
.std-search-input {
  width: 100%;
}
.std-suggest {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.std-suggest-page {
  max-height: 280px;
}
.std-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
}
.std-item strong {
  font-size: 15px;
  color: var(--emerald);
}
.std-item span {
  font-size: 14px;
  color: var(--muted);
}
.std-item:hover,
.std-item.is-active {
  background: var(--emerald-soft);
}
.std-empty {
  padding: 12px 14px;
  color: var(--dim);
  font-size: 15px;
}
.std-search-hint {
  margin: 6px 0 0;
}
.std-results {
  margin-top: 14px;
}
.std-full-list,
.std-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
}
.std-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--list-bg);
  font-size: 15px;
}
.std-row strong {
  color: var(--text);
  word-break: break-word;
}
.std-row span {
  color: var(--muted);
}
.std-row.is-hit {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--emerald-soft);
}
.std-pkg {
  display: block;
  font-size: 12px;
  font-style: normal;
  color: var(--dim);
  margin-top: 2px;
}
.std-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.std-pill-sm {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--list-bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.std-pill-sm.dim-pill {
  font-weight: 500;
  opacity: 0.9;
}
@media (max-width: 520px) {
  .std-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (min-width: 640px) {
  .joint-grid { grid-template-columns: repeat(3, 1fr); max-height: 320px; }
}
@media (min-width: 900px) {
  .joint-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .kpi-hero { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 1024px) {
  .hero-audit { padding: 22px 24px; }
  .hero-copy h2 { font-size: 24px; }
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
.dash-span-2 { grid-column: auto; }

/* Välkomst + snabbvägar – tydligt att appen är aktiv */
.welcome-banner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--welcome-grad);
  border-color: var(--welcome-border);
}
.welcome-text strong {
  font-size: 17px;
  color: var(--welcome-title);
}
.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.quick-card:hover {
  border-color: #34d399;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.quick-card:active { transform: translateY(0); }
.quick-ico { font-size: 24px; line-height: 1; }
.quick-card strong { font-size: 16px; }
.quick-card em {
  font-style: normal;
  font-size: 14px;
  color: var(--muted);
}
.quick-cta {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--emerald);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.card-head h3 { margin: 0; }
.chev {
  display: inline-block;
  margin-left: 6px;
  color: var(--emerald);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.page-hint {
  margin: 2px 0 0;
  font-size: 14px;
}
.empty-state {
  text-align: center;
  padding: 36px 20px !important;
}
.empty-state h2 {
  margin: 8px 0 6px;
  font-size: 19px;
}
.empty-ico {
  width: 52px; height: 52px;
  margin: 0 auto;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 30px;
  font-weight: 300;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid #a7f3d0;
}
.list-item .right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tablet */
@media (min-width: 768px) {
  .main {
    padding: 20px 24px calc(28px + var(--nav-h) + var(--safe-bot));
  }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .welcome-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .welcome-actions { justify-content: flex-end; }
  .page-head h1 { font-size: 24px; }
  .card { padding: 18px; }
  .list-item { padding: 14px 16px; }
  .modal:not([hidden]) { align-items: center; padding: 24px; }
  .modal-sheet {
    border-radius: 16px;
    max-width: 640px;
    max-height: min(88vh, 800px);
    padding: 20px 22px;
  }
  .row3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* Desktop */
@media (min-width: 1024px) {
  :root {
    --fs-base: 17px;
    --fs-sm: 14px;
    --fs-xs: 13px;
    --fs-lg: 18px;
    --fs-xl: 21px;
    --fs-title: 24px;
    --lh: 1.52;
  }
  body {
    padding-bottom: 0;
    overflow: hidden;
  }
  .app-shell {
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .side-nav { display: flex; }
  body.is-logged-out .side-nav { display: none !important; }
  body.is-logged-in .side-nav { display: flex !important; }
  /* Inloggningssidan ska scrolla som en vanlig sida så bildskuggan inte klipps */
  body.is-logged-out {
    overflow: auto;
  }
  body.is-logged-out .app-shell,
  body.is-logged-out .app-body {
    overflow: visible;
    height: auto;
    min-height: 100dvh;
  }
  body.is-logged-out .main {
    overflow: visible;
  }
  .bottom-nav { display: none !important; }
  .brand-mobile { display: none; }
  .topbar-desktop { display: flex; }
  .topbar {
    padding: 12px 28px;
    background: var(--topbar-bg);
  }
  .app-body {
    flex: 1;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
  }
  .main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: none;
    width: 100%;
    padding: 24px 32px 40px;
  }
  .main > * { max-width: var(--content-max); }
  .dash-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 16px;
    align-items: start;
  }
  .dash-span-2 { grid-column: 1 / -1; }
  .score-ring { width: 88px; height: 88px; font-size: 30px; }
  .kpi .n { font-size: 28px; }
  .list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .list.list-single { grid-template-columns: 1fr; }
  .menu-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  .quick-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }
  .menu-card { min-height: 110px; padding: 18px 16px; }
  .menu-card:hover { transform: translateY(-1px); }
  .modal-sheet {
    max-width: 720px;
    width: min(720px, 92vw);
    max-height: min(90vh, 860px);
    border-radius: 16px;
    padding: 24px 28px;
  }
  .toast { bottom: 28px; }
  .page-head h1 { font-size: 26px; }
  /* Visa alltid sidtitel + knappar (tidigare font-size:0 dolde titel och kunde förvirra) */
  .page-head {
    min-height: 44px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .page-head .page-head-title {
    font-size: var(--fs-title, 22px);
    width: auto;
    overflow: visible;
    font-weight: 800;
  }
  .page-head .btn-primary {
    flex-shrink: 0;
  }
  .org-form { max-width: 720px; }
  .btn { padding: 10px 16px; }
  .btn-sm { padding: 8px 12px; }
}

@media (min-width: 1440px) {
  :root {
    --side-w: 268px;
    --content-max: 1520px;
    --fs-base: 17.5px;
    --fs-sm: 14.5px;
    --fs-xs: 13px;
    --fs-lg: 18.5px;
    --fs-xl: 22px;
    --fs-title: 25px;
  }
  .main { padding: 28px 40px 48px; }
  .dash-grid { gap: 20px; }
  .list.list-dense { grid-template-columns: 1fr 1fr 1fr; }
  .card { padding: 20px 22px; }
  .modal-sheet {
    max-width: 800px;
    width: min(800px, 90vw);
  }
}

@media (min-width: 1800px) {
  :root {
    --side-w: 280px;
    --content-max: 1680px;
  }
  .main { padding: 32px 48px 56px; }
  html { font-size: 18px; }
}

/* —— Scrollbars (synliga & snygga på webb/desktop) —— */
/* Gäller mus/trackpad (fine pointer) – lämnar mobil native */
@media (hover: hover) and (pointer: fine) {
  /* Firefox */
  .main,
  .side-links,
  .modal-sheet,
  .mx-wrap,
  .weld-map-table-wrap,
  .list,
  .underlag-body,
  textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  }

  /* Chromium / Safari / Edge */
  .main::-webkit-scrollbar,
  .side-links::-webkit-scrollbar,
  .modal-sheet::-webkit-scrollbar,
  .mx-wrap::-webkit-scrollbar,
  .weld-map-table-wrap::-webkit-scrollbar,
  textarea::-webkit-scrollbar {
    width: var(--scroll-size);
    height: var(--scroll-size);
  }
  .main::-webkit-scrollbar-track,
  .side-links::-webkit-scrollbar-track,
  .modal-sheet::-webkit-scrollbar-track,
  .mx-wrap::-webkit-scrollbar-track,
  .weld-map-table-wrap::-webkit-scrollbar-track,
  textarea::-webkit-scrollbar-track {
    background: var(--scroll-track);
    border-radius: 999px;
    margin: 4px 0;
  }
  .main::-webkit-scrollbar-thumb,
  .side-links::-webkit-scrollbar-thumb,
  .modal-sheet::-webkit-scrollbar-thumb,
  .mx-wrap::-webkit-scrollbar-thumb,
  .weld-map-table-wrap::-webkit-scrollbar-thumb,
  textarea::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
    border: 3px solid var(--scroll-track); /* “pill”-effekt, mer greppbar */
    background-clip: padding-box;
    min-height: 40px;
  }
  .main::-webkit-scrollbar-thumb:hover,
  .side-links::-webkit-scrollbar-thumb:hover,
  .modal-sheet::-webkit-scrollbar-thumb:hover,
  .mx-wrap::-webkit-scrollbar-thumb:hover,
  .weld-map-table-wrap::-webkit-scrollbar-thumb:hover,
  textarea::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
    border: 2px solid var(--scroll-track);
  }
  .main::-webkit-scrollbar-thumb:active,
  .side-links::-webkit-scrollbar-thumb:active,
  .modal-sheet::-webkit-scrollbar-thumb:active,
  .mx-wrap::-webkit-scrollbar-thumb:active,
  .weld-map-table-wrap::-webkit-scrollbar-thumb:active,
  textarea::-webkit-scrollbar-thumb:active {
    background: var(--scroll-thumb-active);
  }
  .main::-webkit-scrollbar-corner,
  .side-links::-webkit-scrollbar-corner,
  .modal-sheet::-webkit-scrollbar-corner {
    background: transparent;
  }

  /* Sidomeny: mörk track, ljusare grepp */
  .side-links {
    scrollbar-color: #64748b #0b1220;
  }
  .side-links::-webkit-scrollbar-track {
    background: #0b1220;
  }
  .side-links::-webkit-scrollbar-thumb {
    background: #64748b;
    border-color: #0b1220;
  }
  .side-links::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    border-color: #0b1220;
  }
  .side-links::-webkit-scrollbar-thumb:active {
    background: #34d399;
    border-color: #0b1220;
  }
}

/* Något bredare scrollbar på stora skärmar */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  :root {
    --scroll-size: 14px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .side-item:focus-visible,
  .nav-item:focus-visible,
  .btn:focus-visible {
    outline: 2px solid rgba(5, 150, 105, 0.45);
    outline-offset: 2px;
  }
}

/* Inputs – lättare att läsa och klicka */
input:not([type=checkbox]):not([type=radio]):not([type=file]),
select {
  min-height: 44px;
  font-size: 1em;
}
textarea {
  font-size: 1em;
  min-height: 96px;
  line-height: 1.5;
}

/* Företagslogga / omslag på översikt */
.hero-audit {
  position: relative;
  overflow: hidden;
}
.hero-audit.hero-has-cover {
  padding: 0;
}
.hero-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  pointer-events: none;
}
html[data-theme="dark"] .hero-cover { opacity: 0.28; }
.hero-inner {
  position: relative;
  z-index: 1;
  padding: inherit;
}
.hero-has-cover .hero-inner {
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88) 0%, var(--card) 55%);
}
html[data-theme="dark"] .hero-has-cover .hero-inner {
  background: linear-gradient(180deg, rgba(15,23,42,0.9) 0%, var(--card) 60%);
}
.hero-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.org-logo-hero {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 6px;
}
@media (max-width: 640px) {
  .hero-cover {
    min-height: 120px;
    opacity: 0.32;
  }
  .org-logo-hero {
    width: 72px;
    height: 72px;
  }
}
.brand-mark.has-logo {
  padding: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
}
.brand-mark-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
html[data-theme="dark"] .brand-mark.has-logo {
  background: #0b1220;
}
html[data-theme="dark"] .org-logo-hero {
  background: #0b1220;
}
.org-logo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: var(--list-bg);
  border: 1px dashed var(--border-strong);
  color: var(--dim);
}
.org-name-line {
  font-size: 1.05em;
  font-weight: 600;
  color: var(--text) !important;
}
.hero-logo-hint { margin: 8px 0 0; }
@media (min-width: 768px) {
  .hero-brand-block {
    flex-direction: column;
  }
  .org-logo-hero {
    width: 104px;
    height: 104px;
  }
}

/* Uppladdning i Företag */
.org-brand-upload {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.org-brand-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--list-bg);
}
.org-brand-fields { flex: 1; min-width: 0; }
.org-brand-fields strong { color: var(--text); }
.org-remove-img {
  margin-top: 10px !important;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  width: 100%;
  box-sizing: border-box;
}
.org-remove-img:has(input:checked) {
  border-color: #fca5a5;
  background: var(--issue-crit-bg, #fff1f2);
}
.org-logo-preview {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.org-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}
.org-logo-empty, .org-cover-empty {
  font-size: 12px;
  color: var(--dim);
  text-align: center;
  padding: 8px;
}
.org-cover-preview {
  width: 140px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}
.org-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 520px) {
  .org-brand-card { flex-direction: column; align-items: center; text-align: center; }
  .org-cover-preview { width: 100%; height: 100px; }
}
@media (min-width: 900px) {
  .org-brand-upload {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

/* Kalibreringsdekal (färg + månad + ID) */
.cal-sticker {
  --cal-bg: #16a34a;
  --cal-fg: #fff;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 6px;
  border-radius: 8px;
  background: var(--cal-bg);
  color: var(--cal-fg);
  font-weight: 800;
  line-height: 1.15;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  border: 2px solid rgba(0,0,0,.12);
  vertical-align: middle;
  text-align: center;
}
.cal-sticker-sm {
  min-width: 44px;
  padding: 3px 5px;
  font-size: 11px;
  border-radius: 6px;
}
.cal-sticker-lg {
  min-width: 100px;
  padding: 12px 14px;
  font-size: 18px;
  border-radius: 12px;
}
.cal-sticker-top {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.cal-sticker-month {
  font-size: 1.35em;
  letter-spacing: -0.02em;
}
.cal-sticker-year {
  font-size: 0.72em;
  font-weight: 700;
  opacity: 0.95;
}
.cal-sticker-color {
  font-size: 0.62em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
  margin-top: 1px;
}
.cal-sticker-id {
  font-size: 0.7em;
  font-weight: 700;
  margin-top: 3px;
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.95;
  border-top: 1px solid rgba(255,255,255,.35);
  padding-top: 2px;
  width: 100%;
}
.cal-sticker-empty {
  background: var(--list-bg);
  color: var(--dim);
  border: 1px dashed var(--border-strong);
  font-weight: 600;
  font-size: 11px;
  min-width: 72px;
}
.cal-sticker-preview-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--list-bg);
  border: 1px solid var(--border);
}
.cal-sticker-preview-text { flex: 1; min-width: 0; }
.cal-legend {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cal-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.cal-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.cal-legend-chip small {
  font-weight: 600;
  opacity: 0.9;
  font-size: 11px;
}
.list-item .right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* —— Kontrollanthjälp (prövning) —— */
.exam-helper {
  margin: 0 0 12px;
  padding: 0;
  overflow: hidden;
}
.exam-helper-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.exam-helper-ico {
  font-size: 22px;
  flex-shrink: 0;
}
.exam-helper-toggle strong {
  display: block;
  font-size: 16px;
}
.exam-helper-sub {
  display: block;
  font-size: 13px;
  margin-top: 2px;
}
.exam-helper-chev {
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
}
.exam-helper-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.exam-helper-intro {
  margin: 12px 0 14px;
  font-size: 14px;
}
.exam-timer-box {
  background: var(--list-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.exam-timer-display {
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text);
  text-align: center;
  line-height: 1.1;
  margin-bottom: 10px;
}
.exam-timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.exam-timer-note {
  margin: 10px 0 0;
  font-size: 12px;
  text-align: center;
}
.exam-laps {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}
.exam-laps li {
  padding: 4px 0;
  border-top: 1px dashed var(--border);
}
.exam-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (min-width: 720px) {
  .exam-grid { grid-template-columns: 1fr 1fr; }
}
.exam-col h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.exam-facts {
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}
.exam-facts li { margin-bottom: 4px; }
.exam-accept { margin-top: 4px; }
.exam-checklist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
@media (min-width: 720px) {
  .exam-checklist { grid-template-columns: 1fr 1fr; }
}
.exam-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--list-bg);
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  font-weight: 500;
}
.exam-check input[type="checkbox"] {
  margin-top: 1px;
}
.exam-check span {
  flex: 1;
  line-height: 1.4;
  padding-top: 1px;
}
.exam-check.is-on {
  border-color: #6ee7b7;
  background: var(--emerald-soft);
}
html[data-theme="dark"] .exam-check.is-on {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.45);
}

/* —— WPQR / WPS underlag —— */
.underlag-details {
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--list-bg);
  padding: 0;
  overflow: hidden;
}
.underlag-details summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  user-select: none;
}
.underlag-details summary::-webkit-details-marker { display: none; }
.underlag-details summary::before {
  content: "▶ ";
  font-size: 11px;
  color: var(--dim);
}
.underlag-details[open] summary::before { content: "▼ "; }
.underlag-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}
.underlag-body h4 {
  margin: 12px 0 6px;
  font-size: 14px;
  color: var(--text);
}
.wpqr-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.wpqr-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.wpqr-step-n {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
}
.wpqr-step .exam-facts { margin-bottom: 0; }

.u9606-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 16px;
}
@media (min-width: 800px) {
  .u9606-grid { grid-template-columns: 1fr 1fr; }
}
.u9606-block {
  margin-bottom: 8px;
  padding-bottom: 4px;
}
.u9606-block h4 {
  margin: 10px 0 4px;
  font-size: 14px;
  color: var(--text);
}
.u9606-block .exam-facts { margin-bottom: 4px; }

/* —— Kom igång som svetsansvarig —— */
.rwc-guide { margin-bottom: 14px; }
.rwc-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rwc-step {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--list-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.rwc-step:hover {
  border-color: #6ee7b7;
  box-shadow: var(--shadow);
}
.rwc-n {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rwc-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rwc-body strong { font-size: 15px; }
.rwc-body em {
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
html[data-theme="dark"] .rwc-step:hover {
  border-color: rgba(52, 211, 153, 0.45);
}

/* —— Kompetensmatris —— */
.mx-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 12px;
}
.mx-filter { margin: 0; min-width: 140px; }
.mx-filter select { margin-top: 4px; }
.mx-filter-check { margin: 0 0 4px !important; }
.mx-wrap {
  overflow: auto;
  padding: 0;
  max-height: min(70vh, 720px);
}
.mx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.mx-table th,
.mx-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
}
.mx-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  font-weight: 700;
  min-width: 72px;
}
.mx-table .mx-person {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--card);
  min-width: 160px;
  max-width: 220px;
}
.mx-table thead .mx-person { z-index: 3; }
.mx-person strong { display: block; font-size: 14px; }
.mx-person .dim { font-size: 12px; font-weight: 500; }
.mx-th-proc { display: block; font-size: 14px; }
.mx-th-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.mx-cell span { font-weight: 800; font-size: 12px; }
.mx-cell small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.mx-ok { background: var(--emerald-soft); color: #047857; }
.mx-cont { background: var(--badge-warn-bg); color: var(--badge-warn-text); }
.mx-exp, .mx-warn { background: var(--badge-crit-bg); color: #be123c; }
.mx-empty { color: var(--dim); background: var(--list-bg); }
html[data-theme="dark"] .mx-ok { color: #34d399; }
html[data-theme="dark"] .mx-exp, html[data-theme="dark"] .mx-warn { color: #fb7185; }

/* —— Onboarding wizard —— */
.onb-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.onb-bar {
  flex: 1;
  min-width: 120px;
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.onb-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #059669, #34d399);
  border-radius: 999px;
}
.onb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.onb-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow);
}
.onb-card:hover { border-color: #6ee7b7; }
.onb-card.is-ok { border-color: #a7f3d0; }
.onb-card.is-todo { border-left: 4px solid var(--amber); }
.onb-n {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--list-bg);
  color: var(--muted);
}
.onb-card.is-ok .onb-n {
  background: var(--emerald-soft);
  color: var(--emerald);
}
.onb-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.onb-main strong { font-size: 16px; }
.onb-main em { font-style: normal; font-size: 12px; }
.onb-hint {
  font-size: 13px;
  color: var(--amber);
  margin-top: 4px;
}
.onb-cta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--emerald);
  align-self: center;
}
@media print {
  .mx-filters, .rwc-guide .actions, .onb-cta { display: none !important; }
  .mx-wrap { max-height: none; overflow: visible; }
}

/* —— Landning / login + priser —— */
.land-page .land-wrap { max-width: 520px; }
.land-title {
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--text);
}
.land-platforms-block {
  margin: 18px 0 8px;
  padding: 14px 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(5, 150, 105, 0.22);
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.08), rgba(241, 245, 249, 0.5));
}
html[data-theme="dark"] .land-platforms-block {
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.4));
  border-color: rgba(52, 211, 153, 0.25);
}
.land-platforms-head {
  margin: 0 0 12px;
  text-align: center;
}
.land-platforms-head strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.land-platforms-head span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}
.land-platforms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 10px;
}
.land-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 12px 6px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.land-platform:hover {
  border-color: rgba(5, 150, 105, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.land-platform-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: #0f766e;
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.16), rgba(13, 148, 136, 0.08));
  margin-bottom: 4px;
}
html[data-theme="dark"] .land-platform-ico {
  color: #34d399;
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.2), rgba(16, 185, 129, 0.08));
}
.land-platform strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
}
.land-platform span {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.25;
}
.land-platform em {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
  color: #0f766e;
  line-height: 1.3;
  opacity: 0.9;
}
html[data-theme="dark"] .land-platform em {
  color: #6ee7b7;
}
.land-platforms-note {
  margin: 0;
  padding: 0 4px;
  font-size: 12.5px;
  text-align: center;
  color: var(--muted);
  line-height: 1.45;
}
.land-platforms-note strong {
  color: var(--text);
  font-weight: 700;
}
@media (max-width: 380px) {
  .land-platforms { gap: 6px; }
  .land-platform { padding: 10px 4px 8px; }
  .land-platform-ico { width: 44px; height: 44px; }
  .land-platform-ico svg { width: 32px; height: 32px; }
  .land-platform em { font-size: 10px; }
  .land-platforms-head strong { font-size: 14px; }
}
.land-auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}
.land-auth-tabs .tab {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}
.land-free {
  margin-top: 22px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid #6ee7b7;
  background: var(--emerald-soft, #ecfdf5);
}
html[data-theme="dark"] .land-free {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.12);
}
.land-free h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--welcome-title, #065f46);
}
.land-free p { margin: 0; line-height: 1.5; }
.land-sale {
  margin-top: 22px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
}
html[data-theme="dark"] .land-sale {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(245, 158, 11, 0.12);
}
.land-sale-kicker,
.sale-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #b45309;
}
html[data-theme="dark"] .land-sale-kicker,
html[data-theme="dark"] .sale-kicker { color: #fbbf24; }
.land-sale h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: #92400e;
}
html[data-theme="dark"] .land-sale h2 { color: #fde68a; }
.land-sale p { margin: 0; line-height: 1.5; }
.sale-note {
  margin: 18px 0 8px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
}
.sale-note h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: #92400e;
}
.sale-note p { margin: 0; line-height: 1.5; }
.land-pricing {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.land-pricing h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}
.land-seo-mods {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.land-seo-mods h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.land-seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 13px;
  font-weight: 650;
}
.land-seo-links a { text-decoration: none; }
.land-plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 560px) {
  .land-plan-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.land-plan {
  position: relative;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}
.land-plan.is-rec {
  border-color: #6ee7b7;
}
.land-plan h3 { margin: 0 0 6px; font-size: 1rem; }
.incl-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  margin: 8px 0 0;
  padding-left: 1.15em;
}
.land-plan .bill-price strong { font-size: 1.5rem; }
.land-plan .eq-feature-list { font-size: 13px; margin: 8px 0 10px; }
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
@media (min-width: 960px) {
  .land-page .land-wrap { max-width: 560px; }
}
.land-about {
  padding: 18px 16px 16px;
}
.land-about-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0f766e;
}
html[data-theme="dark"] .land-about-kicker { color: #34d399; }
.land-about-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--text);
}
.land-about-lead {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}
.land-about-body p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}
.land-about-body p strong { color: var(--text); }
.land-about-close {
  color: var(--text) !important;
  font-weight: 600;
}
.land-about-hobby {
  margin: 0 0 4px !important;
  font-size: 13.5px !important;
  line-height: 1.45;
}
.land-about-sign {
  margin-top: 16px !important;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text) !important;
  line-height: 1.5;
}
.land-about-sign a { color: #0f766e; font-weight: 600; }
.land-about-price-link a {
  color: #0f766e;
  font-weight: 600;
  text-decoration: none;
}
.land-about-price-link a:hover { text-decoration: underline; }
.land-footer-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.land-footer-btn:hover { text-decoration: underline; }
.land-footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.land-footer p { margin: 0 0 6px; }
.land-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}
.land-footer-links a {
  color: var(--emerald);
  font-weight: 600;
  text-decoration: none;
}
.land-footer-links a:hover { text-decoration: underline; }

/* —— Billing —— */
.billing-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: var(--list-bg);
  font-size: 14px;
}
.billing-banner.is-trial {
  background: var(--emerald-soft);
  border-color: #a7f3d0;
}
.billing-banner.is-warn {
  background: var(--badge-warn-bg);
  border-color: var(--badge-warn-border);
}
.billing-banner.is-crit {
  background: var(--badge-crit-bg);
  border-color: var(--badge-crit-border);
}
.billing-banner.is-invoice {
  background: var(--badge-info-bg);
  border-color: var(--badge-info-border);
}
.trial-count {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-bottom: 14px;
  border-color: #a7f3d0;
  background: var(--emerald-soft, #ecfdf5);
}
.trial-count.is-urgent {
  border-color: var(--badge-warn-border, #fcd34d);
  background: var(--badge-warn-bg, #fffbeb);
}
.trial-count.is-gone {
  border-color: var(--badge-crit-border, #fecaca);
  background: var(--badge-crit-bg, #fef2f2);
}
.trial-count-num {
  min-width: 88px;
  text-align: center;
}
.trial-count-num strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--emerald, #0f766e);
}
.trial-count.is-urgent .trial-count-num strong { color: #b45309; }
.trial-count.is-gone .trial-count-num strong { color: #be123c; }
.trial-count-num span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.trial-count-body { flex: 1; min-width: 180px; }
.trial-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(15, 23, 42, .08);
  overflow: hidden;
}
.trial-bar i {
  display: block;
  height: 100%;
  background: var(--emerald, #0f766e);
  border-radius: 99px;
}
.trial-count.is-urgent .trial-bar i { background: #d97706; }
.trial-count.is-gone .trial-bar i { background: #e11d48; }
body.billing-locked .side-nav .side-item:not([data-route="billing"]),
body.billing-locked .bottom-nav .nav-item:not([data-route="billing"]) {
  opacity: .38;
  pointer-events: none;
}
.svets-paywall-hero {
  border: 1px solid #fecaca;
  background: #fef2f2;
  margin-bottom: 14px;
}
.svets-paywall-hero h2 { margin: 0 0 6px; color: #be123c; }
.svets-paywall-hero p { margin: 0; color: #7f1d1d; }
.bill-interval {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.bill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 800px) {
  .bill-grid { grid-template-columns: repeat(3, 1fr); }
}
.bill-plan {
  position: relative;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
.bill-plan.is-rec {
  border-color: #6ee7b7;
  box-shadow: var(--shadow-md);
}
.bill-plan.is-current {
  outline: 2px solid rgba(5, 150, 105, 0.35);
}
.bill-rec {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
}
.bill-plan h3 { margin: 0 0 8px; font-size: 1.15rem; }
.bill-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.bill-price strong {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}
.bill-price span { color: var(--muted); font-size: 14px; }
.extra-seat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.extra-seat-row strong {
  min-width: 1.6em;
  text-align: center;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.extra-seat-row .btn {
  min-width: 36px;
}

/* —— Projekt EN 1090 / 3834 —— */
.proj-phases {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 720px) {
  .proj-phases { grid-template-columns: 1fr 1fr 1fr; }
}
.proj-phase {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--list-bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.proj-phase.is-active {
  border-color: #6ee7b7;
  background: var(--emerald-soft);
}
.proj-phase.is-done {
  opacity: 0.85;
  border-color: #a7f3d0;
}
.proj-pack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (min-width: 700px) {
  .proj-pack-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
.proj-pack-item {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--list-bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.proj-pack-item.is-ok {
  border-color: #a7f3d0;
  background: var(--emerald-soft);
}
.proj-pack-item span { color: var(--muted); font-size: 12px; }
@media print {
  .page-head .actions, #btnBack, #btnSaveChecks, #btnUpload, #btnEditProj { display: none !important; }
  .proj-phase { break-inside: avoid; }
}

/* —— Lathund ISO 5817 —— */
.lathund-hero { margin-bottom: 12px; }
.lathund-levels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (min-width: 640px) {
  .lathund-levels { grid-template-columns: repeat(3, 1fr); }
}
.lathund-level {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
.lathund-level-code {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.lathund-level-B .lathund-level-code {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.lathund-level-C .lathund-level-code {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.lathund-level-D .lathund-level-code {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
html[data-theme="dark"] .lathund-level-B .lathund-level-code {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}
html[data-theme="dark"] .lathund-level-C .lathund-level-code {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.35);
}
html[data-theme="dark"] .lathund-level-D .lathund-level-code {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}
.lathund-never {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lathund-never-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--list-bg);
  border: 1px solid var(--border);
  font-size: 14px;
}
.lathund-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (min-width: 900px) {
  .lathund-grid { grid-template-columns: 1fr 1fr; }
}
.lathund-card { margin: 0; }
.lathund-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.lathund-card-head h3 {
  margin: 6px 0 0;
  font-size: 16px;
}
.lathund-svg {
  width: 120px;
  height: 60px;
  flex-shrink: 0;
  color: var(--muted);
  background: var(--list-bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 4px;
}
.lathund-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lathund-table th,
.lathund-table td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.lathund-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.lathund-table tr.lvl-b td:first-child { color: #047857; }
.lathund-table tr.lvl-c td:first-child { color: #1d4ed8; }
.lathund-table tr.lvl-d td:first-child { color: #b45309; }
html[data-theme="dark"] .lathund-table tr.lvl-b td:first-child { color: #34d399; }
html[data-theme="dark"] .lathund-table tr.lvl-c td:first-child { color: #93c5fd; }
html[data-theme="dark"] .lathund-table tr.lvl-d td:first-child { color: #fbbf24; }
.lathund-ex { margin: 8px 0 0; font-size: 12px; }
.lathund-syms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (min-width: 640px) {
  .lathund-syms { grid-template-columns: repeat(3, 1fr); }
}
.lathund-sym {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--list-bg);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.lathund-sym code {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}
@media print {
  .side-nav, .bottom-nav, .topbar, .exam-helper-toggle, #lathundPrint {
    display: none !important;
  }
  .lathund-card, .card {
    break-inside: avoid;
    box-shadow: none;
  }
  .lathund-grid { grid-template-columns: 1fr 1fr; }
}

.seat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .seat-grid { grid-template-columns: 1fr; } }
.seat-bar { height: 8px; background: var(--list-bg); border-radius: 99px; overflow: hidden; margin: 8px 0; border: 1px solid var(--border); }
.seat-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #ea580c); }
.team-row { align-items: center; }
.team-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.team-actions select { max-width: 160px; }
