/* ============================================================================
   Go Public Tender — design system (v4 "Med färg", 29 sep; mockups in the canvas
   "Go Public Tender – nytt UI"). Geist for text and headings, Geist Mono for numbers and
   codes; a navy sidebar, one clear blue for actions, and colours that mean something:
   teal = done/good, amber = watch out, rose = critical. Flat white panels on a cool grey
   ground, 8–12 px radii, no glow shadows, labels in normal case.
   Token names are unchanged from v3 (--accent, --ok, --r, --labelSize …) and the older
   names stay as var() aliases, so markup and JS keep working. Dark mode: data-theme="dark"
   on <html> or <body>.
   ============================================================================ */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap");

:root {
  /* ---- canonical (light) ---- */
  --bg: #f3f5f9;
  --surface: #ffffff;
  --subtle: #f5f7fb;
  --border: #e3e7ef;
  --border2: #d5dbe6;
  --text: #111827;
  --muted: #4b5563;
  --soft: #6b7280;
  --accent: #2458d3;
  --accentH: #1a43a6;
  --accentSoft: #e3ebfc;
  --onAccent: #ffffff;
  --ok: #0b7a6e;
  --okSoft: #ddf2ee;
  --err: #b91c3c;
  --errSoft: #fde8ec;
  --warn: #8a4b00;
  --warnSoft: #fef3da;
  --info: #2458d3;
  --infoSoft: #e3ebfc;
  --ring: rgb(36 88 211 / 0.25);
  --shadowCard: 0 1px 2px rgb(17 24 39 / 0.04);

  /* the sidebar (navy in both themes) */
  --nav-bg: #13233b;
  --nav-hover: #1c3050;
  --nav-line: #24385a;
  --nav-text: #c9d3e3;
  --nav-muted: #8594ae;
  --nav-strong: #ffffff;
  --nav-brand: #2f6feb;
  --attention: #fbbf24;
  --onAttention: #3b2a00;

  /* tints (stat tiles, chips) */
  --t1: #2458d3; --t1s: #e3ebfc;   /* blue  */
  --t2: #0b7a6e; --t2s: #ddf2ee;   /* teal  */
  --t3: #8a4b00; --t3s: #fef3da;   /* amber */
  --t4: #b91c3c; --t4s: #fde8ec;   /* rose  */
  --t1b: #c7d5f6; --t2b: #b5e0d8; --t3b: #f7dfa6; --t4b: #f3c6ce;   /* their borders */

  /* shape */
  --r: 12px;
  --rs: 8px;
  --pill: 999px;
  --sbw: 248px;
  --h1: 28px;
  --gap: 20px;
  --labelSize: 12.5px;
  --labelTransform: none;
  --labelSpacing: 0;

  /* shadows */
  --shadow-sm: 0 1px 2px rgb(17 24 39 / 0.04);
  --shadow-md: 0 16px 40px -12px rgb(17 24 39 / 0.22), 0 2px 6px -2px rgb(17 24 39 / 0.08);

  /* ---- backward-compat aliases (old name -> canonical). They resolve via var() at
     computed-value time on <html>, so they follow the dark overrides automatically. ---- */
  --card: var(--surface);
  --bg-subtle: var(--subtle);
  --text-muted: var(--muted);
  --text-soft: var(--soft);
  --border-strong: var(--border2);
  --accent-hover: var(--accentH);
  --accent-soft: var(--accentSoft);
  --on-accent: var(--onAccent);
  --success: var(--ok);
  --success-soft: var(--okSoft);
  --error: var(--err);
  --error-soft: var(--errSoft);
  --warn-soft: var(--warnSoft);
  --info-soft: var(--infoSoft);
  --radius: var(--r);
  --radius-sm: var(--rs);
  --shadow-card: var(--shadowCard);
  --label-size: var(--labelSize);
  --label-transform: var(--labelTransform);
  --label-spacing: var(--labelSpacing);
  --sidebar-w: var(--sbw);
}

:root[data-theme="dark"],
[data-theme="dark"] {
  --bg: #0d1422;
  --surface: #152034;
  --subtle: #1b2940;
  --border: #243552;
  --border2: #33476a;
  --text: #eef2f8;
  --muted: #b4bfd1;
  --soft: #8d9ab0;
  --accent: #6d9bff;
  --accentH: #9dbcff;
  --accentSoft: rgb(109 155 255 / 0.16);
  --onAccent: #0a1426;
  --ok: #4fd1bd;
  --okSoft: rgb(79 209 189 / 0.14);
  --err: #ff8fa3;
  --errSoft: rgb(255 143 163 / 0.14);
  --warn: #fcc85a;
  --warnSoft: rgb(252 200 90 / 0.14);
  --info: #6d9bff;
  --infoSoft: rgb(109 155 255 / 0.16);
  --ring: rgb(109 155 255 / 0.35);
  --shadowCard: none;

  --nav-bg: #0a1220;
  --nav-hover: #15223a;
  --nav-line: #1d2d49;
  --nav-brand: #3d7bf0;

  --t1: #6d9bff; --t1s: rgb(109 155 255 / 0.16);
  --t2: #4fd1bd; --t2s: rgb(79 209 189 / 0.14);
  --t3: #fcc85a; --t3s: rgb(252 200 90 / 0.14);
  --t4: #ff8fa3; --t4s: rgb(255 143 163 / 0.14);
  --t1b: rgb(109 155 255 / 0.35); --t2b: rgb(79 209 189 / 0.3); --t3b: rgb(252 200 90 / 0.3); --t4b: rgb(255 143 163 / 0.3);

  --shadow-sm: none;
  --shadow-md: 0 18px 50px rgb(0 0 0 / 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Headings and the wordmark: Geist at 600, slightly tightened. */
.page-header h1,
.company-head h2,
.modal-card h3,
.brand,
.sidebar-brand,
.auth-card h1 {
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Top bar ---- */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 13px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
}
.brand-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  background: var(--accent);
  border-radius: 3px;
  margin-right: 10px;
  vertical-align: middle;
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  font-size: 13.5px;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav a:hover { color: var(--text); background: var(--subtle); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 28px 90px;
  flex: 1;
}

/* ---- Page header (with optional kicker eyebrow) ---- */
.page-header { margin-bottom: 24px; }
.page-header .kicker,
.kicker {
  display: block;
  width: fit-content;
  max-width: 100%;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-header h1 {
  margin: 0 0 8px;
  font-size: var(--h1);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-header .subtitle { font-size: 16px; }
.page-header .subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 640px;
  line-height: 1.55;
}

.section { margin-bottom: 26px; }
.section-label,
.promptBlock h2 {
  margin: 0 0 8px;
  font-size: var(--label-size);
  font-weight: 500;
  text-transform: var(--label-transform);
  letter-spacing: var(--label-spacing);
  color: var(--muted);
}
.promptBlock { margin-bottom: 26px; }

/* ---- Inputs ---- */
textarea {
  width: 100%;
  min-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.row { display: grid; grid-template-columns: 1fr; gap: 14px; }
.row.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .row.two-col { grid-template-columns: 1fr; } }

.inline-input,
.field input {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.inline-input { min-width: 220px; }
.inline-input:focus,
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

/* ---- Model/effort picker (shared widget, see public/modelPicker.js) ---- */
.model-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 14px;
}
.model-picker .mp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.model-picker .mp-label {
  font-size: var(--label-size);
  font-weight: 500;
  text-transform: var(--label-transform);
  letter-spacing: var(--label-spacing);
  color: var(--muted);
}
.model-picker select {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 34px 9px 12px;
  min-width: 170px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.model-picker select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

/* ---- Drop zones ---- */
.drop {
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 118px;
  justify-content: center;
}
.drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.drop.ok { border-color: var(--success); background: var(--success-soft); }
.drop .title { font-weight: 600; font-size: 14.5px; color: var(--text); margin: 0; }
.drop .sub { color: var(--muted); font-size: 13px; margin: 0; }
.drop .meta {
  font-size: 12px;
  color: var(--soft);
  font-family: "Geist Mono", ui-monospace, monospace;
  margin-top: 3px;
  word-break: break-word;
}
.drop.ok .meta { color: var(--success); }

/* ---- Buttons ---- */
.actions { margin-top: 26px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: var(--subtle);
  color: var(--soft);
  cursor: not-allowed;
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s, filter 0.15s, transform 0.12s;
}
/* default enabled = primary (accent pill) */
button.enabled {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--onAccent);
  cursor: pointer;
  opacity: 1;
  box-shadow: none;
}
button.enabled:hover { background: var(--accentH); border-color: var(--accentH); }
/* secondary / "blue" (legacy name) = light bordered */
button.enabled.secondary,
button.enabled.blue {
  background: var(--surface);
  border-color: var(--border2);
  color: var(--text);
  box-shadow: none;
}
button.enabled.secondary:hover,
button.enabled.blue:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
/* success = green */
button.enabled.success { background: var(--ok); border-color: var(--ok); color: var(--onAccent); box-shadow: none; }
button.enabled.success:hover { filter: brightness(0.94); background: var(--ok); border-color: var(--ok); }
/* ghost / link */
button.enabled.link-btn {
  background: transparent;
  border-color: var(--border2);
  color: var(--muted);
  font-weight: 500;
  padding: 8px 14px;
  box-shadow: none;
}
button.enabled.link-btn:hover { border-color: var(--border2); color: var(--text); background: transparent; }

a > button { font-family: inherit; }

/* ---- Feedback ---- */
.error { color: var(--error); font-size: 14px; }
.error:not(:empty) {
  background: var(--error-soft);
  border: 1px solid var(--t4b);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  line-height: 1.5;
}
.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--t3b);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-top: 12px;
  line-height: 1.5;
}
.step-note, .muted { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.session-list .muted { font-family: inherit; }

.hidden { display: none !important; }

.loader {
  margin-top: 20px;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: none;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

code {
  background: var(--subtle);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.92em;
  color: var(--text);
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Fixed-height document preview: content scrolls inside instead of growing the page. */
.doc-preview {
  height: 340px;
  overflow: auto;
}
/* In-place editor: swapped in over the preview with the same footprint. */
.doc-preview-editor {
  display: block;
  width: 100%;
  height: 340px;
  box-sizing: border-box;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.results-list li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--text);
}
.results-list li:last-child { border-bottom: none; }

.result-block { margin-top: 24px; }
.result-block h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ---- Tool page zones: separate "saved from last run" from "run again" inputs ---- */
.tool-zone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 0 20px;
  box-shadow: var(--shadow-card);
}
/* The panel's title: a plain heading (it was an uppercase pill in v3). */
.tool-zone > .zone-title {
  display: block;
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ---- The erbjudande's material and what the watch reads (public/offeringDoc.js) ---- */
.material-files { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.material-files th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.material-files td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.material-files select { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: var(--rs); border: 1px solid var(--border2); background: var(--surface); color: var(--text); max-width: 100%; }
.material-files .file { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; word-break: break-word; }
.material-files tr.unused .file { color: var(--soft); }
.material-files .reason { color: var(--muted); font-size: 12.5px; }
.material-files .tl-chip { margin-left: 6px; }
@media (max-width: 640px) {
  .material-files thead { display: none; }
  .material-files tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .material-files td { display: block; border: 0; padding: 3px 0; }
  .material-files select { width: 100%; }
}
.reading-summary { margin: 0 0 10px; line-height: 1.55; }
.reading-field { margin: 4px 0 0; font-size: 13.5px; color: var(--text); }
.reading-field strong { font-weight: 500; color: var(--muted); }

/* ---- Guided journey wizard (/resa) ---- */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 30px;
}
.step-item { display: flex; align-items: center; gap: 9px; padding: 2px 0; }
.step-label { font-size: 13px; color: var(--soft); white-space: nowrap; font-weight: 500; }
.step-number {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--soft);
  font-weight: 600;
  font-size: 13px;
  border: 1.5px solid var(--border-strong);
  transition: all 0.15s ease;
  flex-shrink: 0;
  cursor: pointer;
}
.step-number:hover { border-color: var(--accent); color: var(--text); }
.step-number.active { background: var(--accent); color: var(--onAccent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accentSoft); }
.step-number.completed { background: var(--ok); color: var(--onAccent); border-color: var(--ok); }
.step-item:has(.step-number.active) .step-label { color: var(--accent); font-weight: 600; }
.step-item:has(.step-number.completed) .step-label { color: var(--ok); font-weight: 500; }
.step-line { width: 28px; height: 2px; min-width: 14px; background: var(--border-strong); flex-shrink: 0; margin: 0 8px; align-self: center; border-radius: 1px; }
.step-line.completed { background: var(--ok); }
.wizard-step { animation: fadeIn 280ms ease; }
.wizard-step.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Accounts / dashboard / login ---- */
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.user-chip .user-email { font-weight: 500; color: var(--text); }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-md);
}

/* ---- Login page (no shell; card centred with brand + theme toggle) ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}
.login-theme { position: absolute; top: 20px; right: 24px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-brand .logo {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
}
.login-brand .logo-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--onAccent); }
.login-brand .login-word {
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: var(--text);
}
.login-page .auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { margin: 0; font-size: 25px; }
.auth-card .auth-sub { margin: 8px 0 22px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.field input { width: 100%; }
.company-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}
.company-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.company-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.company-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.company-actions .inline-input { min-width: 180px; font-size: 13px; padding: 9px 12px; }

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: inherit !important;
  background: var(--surface);
  padding: 14px 16px !important;
}
.session-meta { display: flex; flex-direction: column; line-height: 1.4; }
.session-name { font-weight: 500; font-size: 14.5px; color: var(--text); }
.session-sub { font-size: 12.5px; color: var(--muted); }
.session-btns { display: flex; gap: 8px; }

.session-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--t1b);
  border-radius: var(--radius);
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 22px;
}
.session-banner a { font-weight: 600; white-space: nowrap; }

/* ---- Daily-relevance top list (dashboard) ---- */
.toplist {
  margin: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* When the session row + toplist render as sibling <li> in a results-list, give the
   group a card frame and drop the list chrome. */
.session-list { background: transparent; border: none; box-shadow: none; overflow: visible; display: flex; flex-direction: column; gap: 16px; }
.session-list > li { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; padding: 0; }
.session-list > li:has(.toplist) { border: none; }
.toplist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.toplist-head .title { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.toplist-head .meta { font-size: 12px; color: var(--soft); }
.toplist-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.toplist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s;
}
/* Tender rows are content, not code: override the mono inherited from `.results-list li`
   (specificity 0,0,2,0 beats that rule) so titles/subtitles use the body font. */
.toplist-items .toplist-item { font-family: "Geist", ui-sans-serif, system-ui, sans-serif; }
.toplist-item:hover { border-color: var(--border-strong); }
/* Closed procurements stay readable but visibly de-emphasised, and are never pre-selected. */
.toplist-item.expired { opacity: 0.62; }
.toplist-item.expired .ti-sub { color: var(--err, #b91c1c); }
/* Keyboard users need to see which row is focused — the rows are role="button". */
.toplist-item:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; border-color: var(--border-strong); }
.toplist-item .ti-main { flex: 1; min-width: 0; line-height: 1.35; }
.toplist-item .ti-title { font-weight: 600; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toplist-item .ti-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.relevance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  border: 1px solid transparent;
}
/* Colour carries the band, lightness too (blue/teal fills vs. pale fills), so it reads without hue. */
.relevance-badge.high { background: var(--ok); color: var(--onAccent); }
.relevance-badge.medium { background: var(--accentSoft); color: var(--accent); }
.relevance-badge.low { background: var(--subtle); color: var(--muted); border-color: var(--border); }

/* ---- Detail modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 560px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  padding: 26px;
}
.modal-card .modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-card h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; flex: 1; }
.modal-card .kv { display: grid; grid-template-columns: 160px 1fr; gap: 0 16px; font-size: 13px; margin: 12px 0; }
.modal-card .kv dt { color: var(--muted); padding: 10px 0; border-bottom: 1px solid var(--border); }
.modal-card .kv dd { margin: 0; color: var(--text); font-weight: 500; padding: 10px 0; border-bottom: 1px solid var(--border); text-align: right; }
.modal-card .why {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 18px;
}
.modal-card .desc { font-size: 13px; color: var(--text); white-space: pre-wrap; max-height: 220px; overflow: auto; }

/* ---- Dela åtkomst (shareDialog.js) ---- */
.share-card .share-intro { margin: 0 0 14px; }
.share-card .share-company-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.share-card .share-form { display: flex; gap: 8px; flex-wrap: wrap; }
.share-card .share-form .share-email { flex: 1; min-width: 220px; }
.share-card .share-roles { flex-basis: 100%; border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; font-size: 13px; min-width: 0; }
.share-card .share-roles legend { padding: 0; margin: 0 0 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.share-card .share-roles label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.45; }
.share-card .share-roles input { accent-color: var(--accent); margin: 3px 0 0; flex-shrink: 0; }
.share-card .share-roles .muted { margin: 0; font-size: 12.5px; }
.share-card .share-msg:empty { display: none; }
.share-card .share-msg { margin: 12px 0 0; }
.share-card .ok-note { color: var(--ok); background: var(--okSoft); border: 1px solid var(--ok); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.share-card .share-linkrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.share-card .share-linkrow .share-link { flex: 1; min-width: 220px; }
.share-card .share-label { display: block; margin: 20px 0 6px; }
.share-card .share-list { list-style: none; margin: 0; padding: 0; }
.share-card .share-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.share-card .share-who { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.share-card .share-role { color: var(--muted); font-size: 12.5px; }
.share-card .share-list .linkish-btn { margin: 0; }

/* ============================================================================
   App shell — left sidebar + header (injected by shell.js on authed pages).
   ============================================================================ */
.shell { display: flex; min-height: 100vh; align-items: stretch; }
/* The navy column runs the full height even when the page is taller than the sticky sidebar. */
@media (min-width: 761px) {
  .shell { background: linear-gradient(to right, var(--nav-bg) var(--sidebar-w), var(--bg) var(--sidebar-w)); }
}
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 14px 16px;
  background: var(--nav-bg);
  color: var(--nav-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.sidebar::-webkit-scrollbar-thumb { background: var(--nav-line); }
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  color: var(--nav-strong);
}
.sidebar-brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--nav-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.sidebar-brand .logo-dot { width: 10px; height: 10px; border-radius: 50%; background: transparent; box-shadow: 0 0 0 2.5px #ffffff; }
.sidebar-brand .brand-word {
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--nav-strong);
}
/* legacy single-dot brand (kept for the pre-JS topbar flash) */
.sidebar-brand .brand-dot { width: 11px; height: 11px; border-radius: 3px; margin: 0; }
.nav-group {
  font-size: 12px;
  font-weight: 500;
  color: var(--nav-muted);
  padding: 16px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--nav-text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--nav-hover); color: var(--nav-strong); text-decoration: none; }
.nav-item.active { background: var(--accent); color: #ffffff; font-weight: 600; }
[data-theme="dark"] .nav-item.active { background: #2458d3; }
.nav-item.active:hover { background: var(--accentH); color: #ffffff; }
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:focus-visible, .sidebar-invite:focus-visible { outline: 2px solid var(--nav-strong); outline-offset: 1px; }
.sidebar-spacer { flex: 1; min-height: 12px; }

/* "Bjud in kollegor": a quiet row that opens Dela åtkomst (shareDialog.js). */
.sidebar-invite {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--nav-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.sidebar-invite:hover { background: var(--nav-hover); color: var(--nav-strong); text-decoration: none; }
.sidebar-invite svg { width: 17px; height: 17px; flex: none; }

.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid var(--nav-line); margin-top: 8px; }
.sidebar-foot .avatar {
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--nav-brand); color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex: none;
}
.sidebar-foot .who { flex: 1; min-width: 0; line-height: 1.3; }
.sidebar-foot .who .em { display: block; font-size: 13px; font-weight: 500; color: var(--nav-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who .st { display: block; font-size: 11.5px; color: var(--nav-muted); }
/* The signed-in row is the link to Kontoinställningar (8 okt). The rule above the row stays, and the
   hover sits inside it, as on the menu's links. */
a.sidebar-foot { position: relative; padding: 14px 10px 10px; text-decoration: none; color: var(--nav-text); cursor: pointer; }
a.sidebar-foot::before { content: ""; position: absolute; inset: 5px 0 0; border-radius: var(--radius-sm); background: transparent; transition: background 0.15s; z-index: 0; }
a.sidebar-foot > * { position: relative; z-index: 1; }
a.sidebar-foot:hover { text-decoration: none; }
a.sidebar-foot:hover::before, a.sidebar-foot.active::before { background: var(--nav-hover); }
a.sidebar-foot > svg { width: 16px; height: 16px; flex: none; color: var(--nav-muted); transition: color 0.15s, transform 0.3s; }
a.sidebar-foot:hover > svg, a.sidebar-foot.active > svg { color: var(--nav-strong); }
a.sidebar-foot:hover > svg { transform: rotate(30deg); }
a.sidebar-foot.active .who .st { color: var(--nav-text); }
a.sidebar-foot:focus-visible { outline: none; }
a.sidebar-foot:focus-visible::before { outline: 2px solid var(--nav-strong); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { a.sidebar-foot > svg { transition: none; } a.sidebar-foot:hover > svg { transform: none; } }
.sidebar .sidebar-logout,
.sidebar button.enabled.link-btn.sidebar-logout {
  width: 100%; margin-top: 6px; justify-content: center;
  background: transparent; border-color: var(--nav-line); color: var(--nav-text); min-height: 36px;
}
.sidebar button.enabled.link-btn.sidebar-logout:hover { background: var(--nav-hover); color: var(--nav-strong); border-color: var(--nav-line); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}
.crumb { font-size: 13px; color: var(--muted); letter-spacing: 0; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; min-height: 32px; font-size: 12.5px; font-weight: 500;
  border-radius: var(--radius-sm); border: 1px solid var(--border2);
  background: var(--surface); color: var(--text); cursor: pointer; opacity: 1;
  font-family: inherit; transition: border-color 0.15s;
}
.theme-btn:hover { border-color: var(--accent); }
.theme-btn svg { width: 15px; height: 15px; }

/* The page's own .wrap loses its top sticky chrome; the header provides separation. */
.main-col > .wrap { padding-top: 28px; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav-group, .sidebar-spacer, .sidebar-invite { display: none; }
  .sidebar-foot { border-top: none; margin: 0; }
  .sidebar-logout { width: auto; }
}

/* The erbjudande's links under a thin line (shell.js; its name is in .nav-context). */
.nav-group-session { margin-top: 8px; padding: 0; border-top: 1px solid var(--nav-line); }

/* The company and the erbjudande the page is under, always at the top of the menu (30 sep). */
.nav-context {
  display: flex; flex-direction: column; gap: 8px;
  margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid var(--nav-line); border-radius: var(--rs); background: var(--nav-hover);
}
.nav-context-row { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-context .nav-scope-cap { font-size: 11.5px; font-weight: 500; color: var(--nav-muted); }
.nav-context .nav-company-name {
  font-size: 13.5px; font-weight: 600; color: var(--nav-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.nav-context a.nav-company-name:hover { text-decoration: underline; }
.nav-context .nav-session-name {
  font-size: 13px; font-weight: 500; color: #8fb2ff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.nav-context .nav-session-none { font-size: 13px; color: var(--nav-muted); text-decoration: none; }
.nav-context .nav-session-none:hover { color: var(--nav-strong); text-decoration: underline; }
.nav-company-switch summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; min-width: 0; }
.nav-company-switch summary::-webkit-details-marker { display: none; }
.nav-company-switch summary svg { flex: none; color: var(--nav-muted); transition: transform 0.15s; }
.nav-company-switch summary:hover svg { color: var(--nav-strong); }
.nav-company-switch[open] summary svg { transform: rotate(180deg); }
.nav-company-switch summary:focus-visible { outline: 2px solid var(--nav-strong); outline-offset: 2px; border-radius: 4px; }
.nav-company-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--nav-line); }
.nav-company-list .nav-scope-cap { margin-bottom: 2px; }
.nav-company-list a {
  font-size: 13px; color: var(--nav-text); padding: 5px 6px; border-radius: 6px; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-company-list a:hover { background: var(--nav-bg); color: var(--nav-strong); }
@media (max-width: 760px) {
  .nav-context { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; gap: 6px 20px; margin: 6px 0; }
}

/* ============================================================================
   Dashboard — two-column layout with a colorful right rail (v3).
   ============================================================================ */
.wrap-wide { max-width: 1180px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 26px;
  align-items: start;
}
.dash-main { min-width: 0; }
.dash-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }

.stat-tiles { display: flex; flex-direction: column; gap: 12px; }
.stat-tile {
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-tile .stat-n {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-tile .stat-label { font-size: 13.5px; font-weight: 500; color: var(--text); line-height: 1.3; }
.stat-tile.t1 { background: var(--t1s); border-color: var(--t1b); } .stat-tile.t1 .stat-n { color: var(--t1); }
.stat-tile.t2 { background: var(--t2s); border-color: var(--t2b); } .stat-tile.t2 .stat-n { color: var(--t2); }
.stat-tile.t3 { background: var(--t3s); border-color: var(--t3b); } .stat-tile.t3 .stat-n { color: var(--t3); }

.dash-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadowCard);
  padding: 24px;
}
.dash-cta .cta-title { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; color: var(--text); margin-bottom: 6px; }
.dash-cta .cta-sub { font-size: 14.5px; color: var(--muted); line-height: 1.5; margin-bottom: 18px; }
.dash-cta button { width: 100%; }

.dash-lastscan { background: var(--accent-soft); border-radius: var(--r); padding: 22px; }
.dash-lastscan .ls-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.dash-lastscan .ls-sub { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 4px; }
.dash-lastscan .ls-time { font-family: "Geist Mono", ui-monospace, monospace; font-size: 13.5px; font-weight: 500; color: var(--accent); }

.dash-welcome { margin-bottom: 28px; }
.dash-welcome h1 { margin: 0; }

@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-rail { position: static; }
}

/* Kravanalys "run against" metadata block (which company-doc version + which upphandlingar). */
.krav-meta {
  font-size: 12.5px; color: var(--muted);
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin: 0 0 12px;
  display: grid; gap: 4px;
}
.krav-meta strong { color: var(--text); font-weight: 600; }
.krav-meta:empty { display: none; }

/* Inline "text button" for rename / edit-name affordances (dashboard). */
.linkish-btn {
  background: none; border: none; padding: 0; margin: 0 0 0 8px; min-height: 0;
  color: var(--accent); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.linkish-btn:hover { color: var(--accentH); text-decoration: underline; }
.company-title { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.company-title h2 { overflow: hidden; text-overflow: ellipsis; }

/* Dashboard collapse/expand + company card chevron. */
.collapse-company {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 15px; line-height: 1; padding: 2px 4px; margin-right: 2px;
  transition: transform 0.15s;
}
.company-card.collapsed .collapse-company { transform: rotate(-90deg); }
.company-card.collapsed .session-list,
.company-card.collapsed .invite-msg { display: none; }

/* Company-doc version picker (resa step 1). */
.doc-versions .section-label { display: block; margin-bottom: 6px; }
.doc-versions select {
  min-width: 240px; max-width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}

/* CPV codes as toggle chips + copy (public/cpvChips.js). "on" = the code is in the search field. */
.cpv-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cpv-chip {
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px;
  padding: 4px 10px; min-height: 0; border-radius: var(--pill); cursor: pointer; font-weight: 500;
  border: 1px solid var(--border2); background: var(--surface); color: var(--muted);
}
.cpv-chip:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.cpv-chip.on { background: var(--accent); border-color: var(--accent); color: var(--onAccent); }
.cpv-chip:disabled { cursor: default; }
.cpv-chip:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.cpv-chips .cpv-hint { margin-top: 6px; }
.cpv-chips .cpv-copy { margin-left: 4px; }

/* ---- Shared tender list (public/tenderList.js) ---- */
.tender-list .toplist-items { margin-top: 8px; }
.tl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.tl-toolbar .tl-count { font-size: 13px; font-weight: 600; color: var(--text); }
.tl-toolbar .linkish-btn { margin: 0; }
.tl-toolbar .linkish-btn:disabled { color: var(--soft); cursor: default; text-decoration: none; }
.tl-toolbar .tl-zip { margin-left: auto; }
.tl-msg:empty { display: none; }
.toplist-item .tl-check { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.toplist-item.selected { border-color: var(--accent); background: var(--accentSoft); }
.relevance-badge.none { background: var(--subtle); color: var(--soft); border-color: var(--border2); }
/* A list row's number and its word ("relevans" / "matchning"), as on the watch page. */
.tl-score { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; width: 60px; }
.tl-score-cap { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: lowercase; }
/* The dashboard's list sits in a results-list row whose text is mono; the hint reads like the rows. */
.tl-hint { margin: 0 0 10px; font-family: "Geist", ui-sans-serif, system-ui, sans-serif; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; flex-shrink: 0; max-width: 40%; }
.tl-chips:empty { display: none; }
/* Chips: a soft fill and its own ink, no outline. The margin/line-height reset keeps the
   banner rule .warn from leaking into .tl-chip.warn (and the page's .pf-badge.warn). */
.tl-chip { font-size: 12px; font-weight: 500; padding: 2px 9px; line-height: 1.5; margin: 0; border-radius: var(--pill); white-space: nowrap; border: 1px solid transparent; }
.tl-chip.ok { background: var(--okSoft); color: var(--ok); }
.tl-chip.warn { background: var(--warnSoft); color: var(--warn); border-color: transparent; }
.tl-chip.err { background: var(--errSoft); color: var(--err); }
.tl-chip.info { background: var(--infoSoft); color: var(--info); }
.tl-chip.neutral { background: var(--subtle); color: var(--muted); border-color: var(--border); }
a.tl-chip { text-decoration: none; }
/* Etapp 4 (K15): earlier outcomes at the same buyer, in a tender's detail view. */
.tl-history { margin: 0 0 14px; }
.tl-history-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.tl-history-list li { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; }
.tl-history-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.tl-history-meta { color: var(--muted); }
.modal-card .desc { margin: 0 0 12px; }
.modal-card .tl-docs, .modal-card .tl-krav { margin: 14px 0 0; }
.modal-card .section-label { font-size: var(--labelSize); color: var(--muted); font-weight: 500; }
.tl-files { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.tl-files a { word-break: break-all; }
.mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; }
.cancel-run { margin-left: 12px; }
.loader .cancel-run { font-size: 13px; }
.stale-banner { margin: 12px 0 0; }
.stale-banner .linkish-btn { margin-left: 6px; }
@media (max-width: 640px) {
  .tl-chips { display: none; }
  .tl-toolbar .tl-zip { margin-left: 0; }
}

/* --- Upphandlingsrapport (/rapport) --------------------------------------------------- */
.rp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rp-score-wrap { text-align: right; }
.rp-verdict { font-size: 22px; font-weight: 600; margin-top: 4px; }
.rp-verdict.ok { color: var(--ok); }
.rp-verdict.warn { color: var(--warn); }
.rp-verdict.err { color: var(--err); }
.rp-reasons { margin: 12px 0 0; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 18px; }
.rp-table th, .rp-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.rp-table thead th { color: var(--muted); font-size: 12px; font-weight: 500; }
.rp-table tbody th { font-weight: 500; color: var(--text); width: 30%; }
.rp-table .rp-src { color: var(--muted); font-size: 12px; word-break: break-all; }
/* A critical ska-krav can disqualify the bid, so it must be visible without reading the column. */
.rp-table tr.rp-critical { background: var(--errSoft); }
.rp-table tr.rp-critical > th { color: var(--err); font-weight: 600; }
.rp-missing { color: var(--soft); font-style: italic; }
.rp-list { margin: 6px 0 14px; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
#sections h3 { font-size: 14px; margin: 14px 0 2px; }

/* v4: the standalone tools sit smaller, under "Verktyg". */
.nav-item.nav-tool { min-height: 32px; font-size: 13px; color: var(--nav-muted); }
.nav-item.nav-tool svg { width: 15px; height: 15px; opacity: 0.85; }
.nav-item.nav-tool:hover { color: var(--nav-strong); }
.nav-item.nav-tool.active { color: #ffffff; }
.nav-group-tools { padding-top: 18px; }

/* v4 report head: the verdict and the match score as two tinted tiles. */
.rp-head { gap: 12px; }
.rp-head > div { flex: 1 1 200px; padding: 14px 18px; border-radius: var(--r); background: var(--subtle); border: 1px solid var(--border); }
.rp-head > div:has(.rp-verdict.ok) { background: var(--okSoft); border-color: var(--t2b); }
.rp-head > div:has(.rp-verdict.warn) { background: var(--warnSoft); border-color: var(--t3b); }
.rp-head > div:has(.rp-verdict.err) { background: var(--errSoft); border-color: var(--t4b); }
.rp-head .section-label { margin-bottom: 4px; }
.rp-score-wrap { text-align: left; }
.rp-source { font-size: 13.5px; font-weight: 500; }
.rp-lack { margin: 4px 0 18px; font-size: 13px; }
.rp-lack > summary { cursor: pointer; color: var(--muted); width: fit-content; }
.rp-lack > summary:hover { color: var(--text); }
.rp-lack[open] > summary { margin-bottom: 6px; }
#sections h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 28px 0 10px; padding-top: 22px; border-top: 1px solid var(--border); }
#sections h2:first-child { border-top: 0; padding-top: 0; margin-top: 12px; }
/* The verdict carries ok/warn/err for its colour only: keep the global .warn banner box off it. */
.rp-verdict.warn, .rp-verdict.ok, .rp-verdict.err { background: none; border: 0; padding: 0; margin: 4px 0 0; font-size: 22px; }
[data-theme="dark"] .sidebar { border-right: 1px solid var(--nav-line); }
