:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c2330;
  --muted: #5d6675;
  --border: #dde1e7;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --warn-bg: #fff6e0;
  --warn-border: #e8b84a;
  --error: #b42318;
  --hidden-row: #f1f2f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --card: #1b2029;
    --text: #e6e9ee;
    --muted: #9aa3b2;
    --border: #2d3441;
    --accent: #6c8cff;
    --accent-text: #0d1117;
    --warn-bg: #3a2f12;
    --warn-border: #a17c27;
    --error: #ff8a80;
    --hidden-row: #161a21;
  }
}

* { box-sizing: border-box; }

/* Native scrollbars and form controls follow the theme; scrollbars are thin
   and blend into the background. */
:root { color-scheme: light; --scroll-thumb: #c9ced6; --scroll-thumb-hover: #a8afba; }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --scroll-thumb: #2d3441; --scroll-thumb-hover: #454e5e; }
}
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
*:hover { scrollbar-color: var(--scroll-thumb-hover) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.lead { margin: 0 0 20px; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 18px; display: flex; align-items: center; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field.grow { flex: 1; min-width: 220px; }
.field.narrow { width: 70px; }
.file-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
/* Where files are dropped or picked; the whole page takes drops. */
.drop-zone { position: relative; flex: 1 1 320px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 120px; padding: 16px; text-align: center; border: 2px dashed var(--border); border-radius: 10px;
  transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone:focus-within { border-color: var(--accent); }
.drop-zone.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.drop-zone.over { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.drop-zone .file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-zone .drop-icon { width: 28px; height: 28px; color: var(--accent); }
.drop-zone .drop-title { margin: 0; font-weight: 600; font-size: 15px; }
.drop-zone .hint { margin: 0; }
.drop-zone .drop-pick { color: var(--accent); text-decoration: underline; cursor: pointer; }
.add-results { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.add-results li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.add-results .mark { width: 1.2em; font-weight: 700; }
.add-results li.ok .mark { color: var(--success, #2e9d5b); }
.add-results li.failed .mark, .add-results li.failed strong { color: var(--error); }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  width: 100%;
}
textarea { resize: vertical; }
input[type="file"] { font: inherit; color: var(--text); }

button {
  font: inherit;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.local-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.status { margin: 8px 0 0; font-size: 14px; }
.status.error, .problems { color: var(--error); }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.table-wrap { overflow-x: auto; }
table.cols { width: 100%; border-collapse: collapse; min-width: 720px; }
.cols th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.cols td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cols td.orig { font-family: ui-monospace, Consolas, monospace; font-size: 13px; padding-top: 12px; word-break: break-word; max-width: 180px; }
.cols td.examples { color: var(--muted); font-size: 13px; padding-top: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.cols td.center { padding-top: 12px; }
.cols tr.is-hidden { background: var(--hidden-row); }
.cols tr:has(+ tr.date-row:not([hidden])) td { border-bottom: none; }
.cols tr.date-row td { padding-top: 0; }
.date-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.date-choice.needs-choice { color: var(--text); background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; padding: 8px 10px; }
.date-choice select { width: auto; max-width: 100%; }
.cols tr.is-hidden td:not(.center) { opacity: 0.45; }

.ask-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ask-row .hint { margin: 0; }
.problems { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.problems:empty { display: none; }

pre { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 12px; overflow-x: auto; font-size: 13px; }

dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 560px;
  width: calc(100% - 32px);
  background: var(--card);
  color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog h2 { margin: 0 0 12px; font-size: 20px; }
dialog h3 { margin: 16px 0 6px; font-size: 14px; color: var(--muted); }
.warning { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; padding: 12px; font-size: 14px; }
.warning strong { display: block; margin-bottom: 4px; }
.quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--border); white-space: pre-wrap; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0; font-size: 14px; }
.check input { margin-top: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

a.button {
  display: inline-block; text-decoration: none;
  font: inherit; padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--border); color: var(--text);
}
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.muted { color: var(--muted); font-size: 13px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head h2 { margin-bottom: 12px; }
.actions-end { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.actions-end .hint { margin: 0; text-align: right; flex: 1 1 260px; }

/* Upload page file list */
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.file-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-head strong { word-break: break-word; }
.file-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-controls select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }

/* Analysis page, one block per file/table */
.table-block { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.table-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.table-head .source { padding-bottom: 8px; }
.check.inline { margin: 0; padding-bottom: 8px; }
.table-block.is-excluded .table-wrap, .table-block.is-excluded .field { opacity: 0.4; }
.consent-tables .preview-table + .preview-table { margin-top: 16px; }
.consent-tables h4 { margin: 10px 0 4px; font-size: 14px; }

/* Conversations page */
.earlier { margin: 12px 0 0; }
.earlier a, .back, .hint a { color: var(--accent); text-decoration: none; }
.back { display: inline-block; margin-bottom: 6px; font-size: 14px; }
input[type="search"] {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
  width: 100%; margin-bottom: 12px;
}
.conversation-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.conversation-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px; padding: 12px;
}
.conversation-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.conversation-title { color: var(--text); text-decoration: none; font-weight: 600; word-break: break-word; }
.conversation-title:hover { color: var(--accent); }
.conversation-item .button { flex-shrink: 0; }
.actions-center { display: flex; justify-content: center; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); }
.badge.done { border-color: #3a9d5d; color: #3a9d5d; }
.badge.pending { border-color: var(--warn-border); color: var(--warn-border); }
.badge.error { border-color: var(--error); color: var(--error); }

.conv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.conv-title { min-width: 0; }
.conv-title h2 { margin: 0; word-break: break-word; }

.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.turn { display: flex; flex-direction: column; gap: 8px; }
.bubble.user {
  align-self: flex-end; max-width: min(640px, 90%);
  background: var(--accent); color: var(--accent-text);
  border-radius: 12px 12px 2px 12px; padding: 10px 14px;
}
.bubble.user p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.bubble.user .muted { color: inherit; opacity: 0.8; }
.bubble.user .badge { border-color: currentColor; color: inherit; }
.bubble.assistant { margin: 0; }
.answer { display: flex; flex-direction: column; gap: 12px; }
.answer > button { align-self: flex-start; }
.sent { margin-top: 12px; font-size: 13px; }
.sent summary { cursor: pointer; color: var(--muted); }
.sent ul { margin: 6px 0; padding-left: 20px; color: var(--muted); }

/* Result blocks */
.block-text { margin: 0; white-space: pre-wrap; }
.block-number { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; padding: 12px; align-self: flex-start; min-width: 160px; }
.block-number .label { color: var(--muted); font-size: 13px; }
.block-number .value { font-size: 28px; font-weight: 600; }
.block-table-wrap h4 { margin: 0 0 6px; font-size: 14px; }
.block-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.block-table th, .block-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.block-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

/* Autosave status */
.save-state {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.save-state .icon { width: 16px; height: 16px; flex-shrink: 0; display: none; }
.save-state[data-state="saved"] { color: #3a9d5d; }
.save-state[data-state="saved"] .icon-saved,
.save-state[data-state="saving"] .icon-saving,
.save-state[data-state="error"] .icon-error { display: block; }
.save-state[data-state="error"] { color: var(--error); white-space: normal; }
.icon-saving { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon-saving { animation: none; } }
#ctx-note { margin: 4px 0 0; }

/* Renaming a conversation */
.rename-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.rename-form input { flex: 1; min-width: 200px; font-size: 18px; font-weight: 600; }
#d-title { cursor: text; }

/* Charts (rendered locally with Vega-Lite) */
.block-chart { width: 100%; }
.chart-target { width: 100%; }
.chart-target svg { max-width: 100%; height: auto; }
/* Our own tooltip style, since the CSP blocks the library's injected styles. */
#vg-tooltip-element {
  position: fixed; z-index: 1000; pointer-events: none; visibility: hidden;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; font-size: 13px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
#vg-tooltip-element.visible { visibility: visible; }
#vg-tooltip-element table { border-collapse: collapse; }
#vg-tooltip-element td.key { color: var(--muted); padding-right: 8px; }

/* Interpretation, explanations and locally computed tables */
.block-note { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; }
.block-note h4 { margin: 0 0 4px; font-size: 14px; }
.block-note h5 { margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.block-note p { margin: 0 0 4px; }
.block-note ul { margin: 4px 0 0; padding-left: 20px; }
.block-note li { margin-bottom: 4px; }
.block-table th.num, .block-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.block-table tr.hl td { background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 600; }
.findings { margin: 8px 0 0; font-size: 14px; }
.block-chart h4 { margin: 0 0 2px; font-size: 14px; }
.chart-subtitle { margin: 0 0 6px; }

/* Wide tables on the Filer page */
.shape-picker { border: 0; padding: 0; margin: 10px 0 0; }
.shape-picker legend { font-size: 14px; margin-bottom: 6px; padding: 0; }
.shape-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.shape-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--card); }
.shape-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.shape-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.shape-card input { position: absolute; opacity: 0; pointer-events: none; }
.shape-card svg { width: 89px; height: 57px; }
.shape-card .cat { fill: var(--accent); }
.shape-card .val { fill: var(--bg); stroke: var(--border); }
.shape-card .hint { font-size: 12px; margin: 0; }
.shape-panel { margin-top: 10px; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; }
.shape-panel h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.shape-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.shape-grid .field { margin-bottom: 8px; }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow-y: auto; }
.check-list .check.inline { margin: 0; padding: 0; gap: 6px; font-size: 14px; }
.shape-problems:empty { display: none; }
.shape-warning { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.shape-warning p { margin: 0; flex: 1 1 320px; }
.row-list { margin: 10px 0; font-size: 14px; }
.row-list summary { cursor: pointer; }
.block-table.preview { font-size: 13px; }
.chips-label { margin: 10px 0 0; }

/* Info tips ("?" with an explanation on hover/focus) */
.info-tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; vertical-align: middle;
  border: 1px solid var(--muted); border-radius: 50%;
  font-size: 11px; font-weight: 600; line-height: 1; color: var(--muted);
  cursor: help; text-transform: none; letter-spacing: 0;
}
.info-tip:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.tip-bubble {
  display: none; position: fixed; z-index: 50; top: 0; left: 0;
  width: max-content; max-width: min(280px, calc(100vw - 16px));
  padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  font-size: 13px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal;
}
.info-tip.open .tip-bubble { display: block; }
.privacy-notice { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--warn-border); background: var(--warn-bg); border-radius: 6px; font-size: 14px; }
.privacy-notice strong { display: block; margin-bottom: 4px; font-size: 15px; }
.privacy-notice p { margin: 0; }
.privacy-short { color: var(--text); font-weight: 600; }

/* Spinners while waiting for an answer or for local computation */
.waiting { display: flex; align-items: center; gap: 10px; }
.waiting::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.badge.pending::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: -1px;
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .waiting::before, .badge.pending::before { animation-duration: 2.5s; }
}

/* ---------- App shell: menu on the left, page on the right ---------- */
body.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.app-main { flex: 1; min-width: 0; overflow-y: auto; }
.sidebar {
  flex: none; width: 240px; display: flex; flex-direction: column; gap: 12px;
  padding: 14px 12px; background: var(--card); border-right: 1px solid var(--border);
  overflow-y: auto; transition: margin-left 0.2s ease, visibility 0.2s;
}
body.sidebar-closed .sidebar { margin-left: -240px; visibility: hidden; }
.side-head { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; }
.icon-btn { padding: 2px 9px; font-size: 16px; line-height: 1.4; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .recent {
  display: block; padding: 7px 10px; border-radius: 6px;
  color: var(--text); text-decoration: none; font-size: 14px;
}
.side-nav a:hover, .recent:hover { background: var(--bg); }
.side-nav a.active { background: var(--bg); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.new-conversation { text-align: center; }
.side-label { margin: 6px 0 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.recent-list { display: flex; flex-direction: column; gap: 1px; min-height: 0; overflow-y: auto; }
.recent { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.recent.active { background: var(--bg); color: var(--text); }
.side-account {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px;
}
/* Contact link just above the account row, at the bottom of the menu. */
.side-contact { margin-top: auto; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); text-decoration: none; }
.side-contact:hover { background: var(--bg); color: var(--text); }
.side-contact + .side-account { margin-top: 4px; }
.account-email { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn { flex: none; padding: 2px 6px; background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }

/* Sign-in page */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth-card .field { display: flex; flex-direction: column; gap: 4px; }
.auth-card .field input { width: 100%; }
.auth-switch { margin-top: 14px; font-size: 14px; text-align: center; }
.sidebar-open { display: none; position: fixed; top: 10px; left: 10px; z-index: 30; }
body.sidebar-closed .sidebar-open { display: inline-block; }
body.sidebar-closed .app-main { padding-left: 44px; }
.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3); }
  body.sidebar-closed .sidebar { margin-left: -260px; }
  body:not(.sidebar-closed) .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.4); }
}

/* ---------- Conversation view: chat in the middle, Underlag on the right ---------- */
/* A column: a notice on top (e.g. a paused account) takes its own height and
   the conversation fills the rest, so the question box stays in view. */
body.conversation-open .app-main { overflow: hidden; display: flex; flex-direction: column; }
/* Full width whatever the content: centred by its margins, it would shrink to
   the content (narrow while waiting for the first answer). */
body.conversation-open main { max-width: none; width: 100%; margin: 0; flex: 1; min-height: 0; padding: 0; }
.chat-layout { display: flex; height: 100%; }
.chat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px 20px 16px; }
.chat-header {
  flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
}
.chat-header h2 { margin: 0; font-size: 18px; word-break: break-word; }
.chat-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chat-actions button { padding: 5px 10px; font-size: 13px; }
#toggle-details[aria-expanded="true"] { border-color: var(--accent); }
.chat-col .thread {
  flex: 1; min-height: 160px; overflow-y: auto; overscroll-behavior: contain;
  list-style: none; margin-top: 0; margin-bottom: 12px; padding: 0 6px 4px 0;
}
.chat-col .composer { flex: none; border-top: 1px solid var(--border); padding-top: 12px; }
.chat-col .composer textarea { width: 100%; }
.chat-col .composer .ask-row { margin-top: 8px; }
.bubble.assistant { background: var(--card); border: 1px solid var(--border); border-radius: 2px 12px 12px 12px; padding: 14px; }

.details-panel {
  flex: none; width: 300px; overflow-y: auto; padding: 14px 16px;
  background: var(--card); border-left: 1px solid var(--border);
}
.chat-layout.details-closed .details-panel { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.section-label { margin: 12px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.used-tables { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.used-table h5 { margin: 0 0 4px; font-size: 14px; }
.used-table ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.used-table li > .muted { display: block; font-size: 12px; }
.used-values summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.used-values .muted { font-size: 12px; }
.pseudonym-map { border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.pseudonym-map td { padding: 2px 10px 2px 0; border-bottom: 1px solid var(--border); }
.pseudonym-map td:first-child { color: var(--muted); white-space: nowrap; }
.details-backdrop { display: none; }
@media (max-width: 1100px) {
  .details-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 38; box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3); }
  .chat-layout:not(.details-closed) .details-backdrop { display: block; position: fixed; inset: 0; z-index: 36; background: rgba(0, 0, 0, 0.4); }
}
@media (max-width: 600px) {
  .chat-col { padding: 8px 10px 10px; }
  .chat-header { flex-direction: column; align-items: stretch; gap: 6px; }
  .chat-header h2 { font-size: 16px; }
  .chat-actions { justify-content: flex-start; flex-wrap: nowrap; }
  .chat-col .composer .ask-row .hint { display: none; }
  .chat-col .composer .ask-row { justify-content: flex-end; }
}
.row-warning { margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--error); border-radius: 6px; font-size: 13px; line-height: 1.5; }
.row-warning > strong { color: var(--error); }
.row-warning > p { margin: 4px 0; }
.row-warning.resolved { border-color: #3a9d5d; }
.row-warning.resolved > strong { color: #3a9d5d; }
.row-fixes summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.fix-row { border-top: 1px solid var(--border); padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.fix-fields .chip { white-space: nowrap; }
.fix-options { display: flex; flex-direction: column; gap: 6px; }
.fix-option { display: flex; gap: 8px; align-items: flex-start; }
.fix-option > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fix-option input { margin-top: 3px; }
.block-table td.merged { background: color-mix(in srgb, var(--accent) 22%, transparent); font-weight: 600; }
.fix-row > button { align-self: flex-start; font-size: 13px; padding: 4px 10px; }
.more-options { display: flex; flex-direction: column; gap: 6px; margin-left: 2px; }
.more-options > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.more-options[open] > summary { margin-bottom: 6px; }
.more-options .fix-option + .fix-option { margin-top: 6px; }
.fix-score { font-size: 12px; }

/* ---------- Export ---------- */
.export-bar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 8px; font-size: 12px; }
.export-bar button { padding: 2px 9px; font-size: 12px; }
.print-only { display: none; }
.block-warning { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--warn-border); background: var(--warn-bg); border-radius: 6px; font-size: 14px; }

/* PDF export (the browser's "Spara som PDF"): only the conversation and its
   Underlag, in light colours, as one long flowing document. */
@media print {
  :root {
    color-scheme: light;
    --bg: #ffffff; --card: #ffffff; --text: #1c2330; --muted: #5d6675; --border: #dde1e7;
    --accent: #2f5bd3; --error: #b42318;
  }
  body, body.app { display: block; height: auto; overflow: visible; background: #ffffff; color: #1c2330; }
  .app-main, body.conversation-open .app-main, body.conversation-open main,
  .chat-layout, .chat-col { display: block; height: auto; overflow: visible; padding: 0; max-width: none; }
  .chat-col .thread { overflow: visible; padding: 0; }
  .sidebar, .sidebar-open, .sidebar-backdrop, .details-backdrop, #list-view, .composer, .chat-actions,
  .rename-form, .export-bar, .panel-head button, .bubble button { display: none !important; }
  .chat-layout.details-closed .details-panel,
  .details-panel { display: block; position: static; width: auto; box-shadow: none; border: none; border-top: 1px solid #dde1e7; margin-top: 16px; padding: 12px 0 0; }
  .print-only { display: block; margin: 4px 0 0; font-size: 12px; }
  .chat-header { display: block; }
  .bubble.assistant { border-color: #dde1e7; }
  /* Printers drop backgrounds, which would leave the questions white on white. */
  .bubble.user { background: #eef2fb !important; color: #1c2330 !important; border: 1px solid #c9d4ef;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bubble.user p { font-weight: 600; }
  .turn, .block-chart, .block-table-wrap, .block-note { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  /* Charts were drawn with the page theme; force readable text and lines. */
  .chart-target svg .role-axis-label text, .chart-target svg .role-axis-title text,
  .chart-target svg .role-legend-label text, .chart-target svg .role-legend-title text,
  .chart-target svg .role-title text { fill: #1c2330 !important; }
  .chart-target svg .role-axis-grid line { stroke: #e3e6eb !important; }
  .chart-target svg .role-axis-domain line, .chart-target svg .role-axis-tick line { stroke: #c9ced6 !important; }
}

/* Projects */
.project-link { font-size: 13px; color: var(--muted); }
.project-link:hover { color: var(--accent); }

/* Preview of what the AI sees (Datakontroll) */
.preview-table + .preview-table { margin-top: 16px; }
.preview-table h4 { margin: 0 0 6px; font-size: 14px; }
.preview-table th { vertical-align: bottom; }
.mode-note { display: block; font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.mode-note.mode-values, .mode-note.mode-aliases { color: var(--accent); }
.masked { color: var(--muted); letter-spacing: 2px; user-select: none; }
.preview-table .row-count { font-weight: 400; }
.preview-table .preview-more { margin: 6px 0 0; }

/* Analysis guide (project page) */
.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.analysis-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); cursor: pointer; white-space: normal; height: auto; }
.analysis-btn:hover:not(:disabled) { border-color: var(--accent); }
.analysis-btn strong { font-size: 15px; }
.analysis-btn span { font-size: 13px; color: var(--muted); font-weight: 400; }
.guide-section { margin-top: 8px; }
.guide-section summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.locked-list { margin: 8px 0; padding-left: 18px; font-size: 14px; }
.locked-list li { margin-bottom: 6px; }
.role-table { margin: 10px 0; }
.role-table h5 { margin: 0 0 6px; font-size: 14px; }
.role-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr); gap: 8px; align-items: center; margin-bottom: 4px; font-size: 14px; }
.analysis-btn .analysis-tables { font-size: 12px; color: var(--accent); }
.guide-industry { flex-direction: row; align-items: center; gap: 8px; margin: 0 0 4px; }
.guide-industry select { width: auto; }

/* Links between tables (Datakontroll) */
.links-list { margin: 0 0 10px; padding-left: 18px; font-size: 14px; }
.links-list li { margin-bottom: 4px; }
.link-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; }
.link-form .field { margin: 0; }

/* A file being read again (Filer) */
.file-item.busy { opacity: 0.75; }
.file-busy { font-size: 13px; }

/* Column headings in the preview of what the AI sees */
.preview-table th .col-meta { display: block; font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.preview-table th .col-description { max-width: 220px; white-space: normal; }
.preview-table th .value-mode { display: block; margin-top: 4px; width: auto; font-size: 12px; padding: 2px 4px; text-transform: none; letter-spacing: 0; }
dialog.consent-dialog { max-width: min(960px, calc(100vw - 32px)); width: 100%; }

/* "Nästa steg" after an analysis */
.next-steps h4 { margin: 12px 0 4px; font-size: 14px; }

/* Projects with their conversations in the menu */
.side-project { display: flex; flex-direction: column; }
.side-project-head { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.side-project-head a { flex: 1; min-width: 0; padding: 6px 6px 6px 2px; color: var(--text); font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-project-head:hover, .side-project-head.active { background: var(--bg); }
.side-toggle { flex: none; width: 22px; height: 22px; padding: 0; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.side-project-list { display: flex; flex-direction: column; gap: 1px; padding-left: 18px; margin-bottom: 4px; }
.side-project-list .recent.more { font-size: 13px; color: var(--accent); }
.side-empty { margin: 2px 8px 6px; font-size: 13px; }

/* Analyses already run in the project (project page) */
.analysis-cell { display: flex; flex-direction: column; gap: 4px; }
.analysis-cell .analysis-btn { flex: 1; }
.analysis-btn.used { opacity: 0.85; }
.analysis-done { margin-left: 8px; font-size: 12px; font-weight: 600; color: #3a9d5d; }
.analysis-open { font-size: 13px; padding-left: 4px; }

/* Things to check in a file before adding it (Filer) */
.upload-notice { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--warn-border); background: var(--warn-bg); border-radius: 6px; font-size: 14px; }
.upload-notice ul { margin: 6px 0 0; padding-left: 18px; }
.upload-notice li + li { margin-top: 6px; }

/* ---------- Accounts: blocked notice, profile, admin ---------- */
input[type="number"] {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; width: 100%;
}
.notice-blocked {
  margin: 16px auto 0; max-width: 1068px; padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--warn-border); background: var(--warn-bg); border-radius: 8px;
}
.card .notice-blocked { margin: 12px 0; max-width: none; }
body.conversation-open .app-main > .notice-blocked { margin: 8px 16px 0; }
a.account-email { text-decoration: none; }
a.account-email:hover, a.account-email[aria-current] { color: var(--text); text-decoration: underline; }
.small { font-size: 12px; }
.actions-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

.profile-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; }
.usage-bar { height: 8px; margin-top: 6px; max-width: 320px; border-radius: 4px; background: var(--border); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--accent); }
.usage-bar span.full { background: var(--error); }

.admin-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.field.narrow-num { width: 150px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
.admin-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table td input[type="number"] { width: 110px; }
.admin-table tr.inactive td { background: var(--hidden-row); color: var(--muted); }
.admin-table .badge { margin-left: 6px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions button, .row-actions a.button { padding: 4px 10px; font-size: 13px; }
.over-limit { color: var(--error); font-weight: 600; }
.card h3 { font-size: 14px; color: var(--muted); margin: 16px 0 6px; }
.report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.report { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.report.done { opacity: 0.7; }
.report-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.report-head button { margin-left: auto; padding: 4px 10px; font-size: 13px; }
.report-text { margin: 8px 0 4px; white-space: pre-wrap; }
.report-shot img { display: block; max-width: 100%; margin-top: 8px; border: 1px solid var(--border); border-radius: 6px; }

/* ---------- Rapportera problem ---------- */
.report-buttons { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; gap: 6px; }
.report-buttons button {
  padding: 7px 14px; font-size: 13px; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
dialog.report-dialog { max-width: min(640px, calc(100vw - 32px)); width: 100%; }
.report-dialog .check { margin: 12px 0 8px; }
.report-preview-wrap { margin: 0 0 8px 24px; }
.report-preview { display: block; max-width: 100%; max-height: 260px; border: 1px solid var(--border); border-radius: 6px; }
.report-preview-wrap p { margin: 4px 0 0; }
.report-preview-box { max-height: 260px; overflow: auto; border-radius: 6px; }
.report-preview.long { max-height: none; width: 100%; }
.report-scope { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; }
.report-scope .check { margin: 0; }
@media print { .report-buttons, .notice-blocked { display: none !important; } }
/* Room under the chat's send button and the Underlag panel, so the floating
   button never covers them. */
.chat-col .composer { padding-bottom: 40px; }
.details-panel { padding-bottom: 56px; }

/* ---------- Admin: views and one account ---------- */
.back-link { display: inline-block; margin-bottom: 10px; font-size: 14px; }
.admin-table tr.clickable { cursor: pointer; }
.admin-table tr.clickable:hover td { background: var(--bg); }
.admin-items { display: flex; flex-direction: column; gap: 12px; }
.admin-project { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.admin-project.removed, .admin-conv.removed { background: var(--hidden-row); }
.admin-project-head, .admin-conv > summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.admin-project-head button, .admin-conv > summary button { padding: 3px 10px; font-size: 13px; }
.admin-item-title { font-weight: 600; }
.admin-sub { margin: 6px 0; font-size: 13px; }
.admin-sub > summary { cursor: pointer; color: var(--muted); }
.admin-conv { border-top: 1px solid var(--border); padding: 6px 0 6px 4px; margin-top: 6px; }
.admin-conv > summary { cursor: pointer; }
.admin-conv-body { padding: 6px 0 4px 18px; }
.approved-tables { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0 14px; }
.approved-tables ul { margin: 2px 0 0; padding-left: 18px; }
.admin-turns { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.turn-q { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.turn-a { margin: 4px 0 0; white-space: pre-wrap; color: var(--text); }

/* ---------- Hjälp ---------- */
.help { max-width: 820px; }
.help .card { scroll-margin-top: 16px; }
.help-steps { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.help-toc { font-size: 14px; color: var(--muted); }
.help details { border-top: 1px solid var(--border); padding: 10px 0; }
.help details:last-of-type { border-bottom: 1px solid var(--border); }
.help summary { cursor: pointer; font-weight: 600; }
.help details p, .help details ul { margin: 8px 0 0; }
.help details ul { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.help-analyses { margin: 0 0 12px; display: grid; grid-template-columns: 250px 1fr; gap: 6px 18px; font-size: 14px; }
.help-analyses dt { font-weight: 600; }
.help-analyses dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .help-analyses { grid-template-columns: 1fr; } .help-analyses dd { margin-bottom: 6px; } }
/* A new problem report: highlighted, without the spinner of .badge.pending. */
.badge.new { border-color: var(--accent); color: var(--accent); }
.report-filter { display: flex; gap: 6px; margin-bottom: 12px; }
.report-filter button { padding: 4px 12px; font-size: 13px; border-radius: 999px; }
.report-filter button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
/* Account view: projects clearly above their conversations. */
.admin-kind { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.card h3.admin-project-name { margin: 0; font-size: 17px; color: var(--text); }
.admin-conv-list { margin: 10px 0 2px 6px; padding-left: 14px; border-left: 2px solid var(--border); }
.card .admin-conv-list h4 { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.admin-conv:first-of-type { border-top: none; margin-top: 0; }
.admin-conv > summary { list-style: none; }
.admin-conv > summary::-webkit-details-marker { display: none; }
.admin-conv > summary::before { content: "▸"; color: var(--muted); width: 10px; }
.admin-conv[open] > summary::before { content: "▾"; }
.admin-conv .admin-item-title { font-weight: 500; }
.report-bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.report-bulk .check.inline { padding: 0; }
.report-bulk button { padding: 4px 12px; font-size: 13px; }
button.danger { border-color: var(--error); color: var(--error); }
button.danger:not(:disabled):hover { background: var(--error); color: var(--card); }
.report-head input[type="checkbox"] { margin: 0; }
/* Checkboxes on the right, "Markera alla" lined up above them. */
.report-pick { margin-left: auto; display: flex; }
.report-bulk .check.inline.report-all { margin-left: auto; padding: 0 13px 0 0; align-items: center; }
.report-bulk .report-all input { margin: 0; }
.report-priority { display: inline-flex; }
.report-head .report-priority button { margin-left: 0; padding: 3px 10px; font-size: 12px; border-radius: 0; }
.report-priority button + button { border-left-width: 0; }
.report-priority button:first-child { border-radius: 999px 0 0 999px; }
.report-priority button:last-child { border-radius: 0 999px 999px 0; }
.report-priority button[aria-pressed="true"] { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.report-priority button.priority-1[aria-pressed="true"] { background: #d9534f; border-color: #d9534f; color: #fff; }
.report-priority button.priority-2[aria-pressed="true"] { background: var(--warn-border); border-color: var(--warn-border); color: #fff; }
.report-priority button.priority-3[aria-pressed="true"] { background: #3a9d5d; border-color: #3a9d5d; color: #fff; }
.badge.kind-praise { border-color: #3a9d5d; color: #3a9d5d; }
.badge.kind-problem { border-color: var(--warn-border); color: var(--warn-border); }
#a-paused { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#a-paused button { padding: 4px 12px; font-size: 13px; }
.answer-time { margin: 10px 0 0; font-size: 12px; }
.password-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.password-form .actions-row { justify-content: flex-start; margin-top: 4px; }
.report.flag:not(.counts) { opacity: 0.75; }
.report.flag.counts { border-color: var(--error); }
.flag-age { font-size: 14px; }

/* ---------- Steps of a pipeline and follow-up questions ---------- */
.block-group { border-left: 3px solid var(--border); padding-left: 14px; margin: 14px 0; }
.block-group .group-title { margin: 0 0 6px; font-size: 15px; }
/* Which series of a chart are shown. */
.series-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 13px; }
.series-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.series-toggle .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.series-toggle[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }
.series-toggle[aria-pressed="false"] .dot { background: transparent !important; border: 1px solid currentColor; }

/* An intermediate step, folded so the answer stands out. */
details.block-group.supporting { border-left-style: dashed; }
details.block-group.supporting > summary { cursor: pointer; font-size: 14px; }
details.block-group.supporting > summary .group-title { font-weight: 600; }
details.block-group.supporting > .block-group { border-left: none; padding-left: 0; margin-top: 8px; }

/* Definitions of sums and key figures, set like formulas. */
.block-definitions { display: grid; grid-template-columns: max-content 1fr; gap: 10px 14px; align-items: center;
  margin: 10px 0 14px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Cambria, "Times New Roman", serif; font-size: 15px; }
.block-definitions .def { display: contents; }
.block-definitions dt { font-style: italic; text-align: right; }
.block-definitions dd { margin: 0; display: flex; align-items: center; gap: 10px; }
.block-definitions .expr { min-width: 0; }
.block-definitions .eq { color: var(--muted); }
.block-definitions .sigma { font-size: 1.15em; }
.block-definitions .where { font-family: inherit; font-size: 13px; color: var(--muted); font-style: italic; }
.block-definitions .frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; }
.block-definitions .frac .num { padding: 0 6px 2px; border-bottom: 1px solid currentColor; }
.block-definitions .frac .den { padding: 2px 6px 0; }
@media (max-width: 600px) {
  .block-definitions { grid-template-columns: 1fr; gap: 2px; }
  .block-definitions dt { text-align: left; margin-top: 8px; }
}
.condition-note { font-size: 13px; color: var(--muted); font-style: italic; margin: 0 0 8px; }
.block-clarify { border: 1px solid var(--accent); border-radius: 8px; padding: 12px 14px; }
.block-clarify h4 { margin: 0 0 6px; font-size: 14px; }
.block-clarify p { margin: 0 0 8px; }
.clarify-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.clarify-options button { padding: 6px 12px; }

/* "⋯" menu on projects and conversations in the left menu */
.side-row { position: relative; display: flex; align-items: center; border-radius: 6px; }
.side-row .recent { flex: 1; min-width: 0; }
.side-row:hover, .side-row.active { background: var(--bg); }
.side-row .recent:hover { background: none; }
.side-project-head { position: relative; }
.side-more { flex: none; visibility: hidden; padding: 0 7px; border: none; background: none; color: var(--muted);
  font-size: 16px; line-height: 1.6; cursor: pointer; border-radius: 6px; }
.side-more:hover { color: var(--text); background: var(--border); }
.side-row:hover .side-more, .side-project-head:hover .side-more, .side-more:focus-visible,
.side-more[aria-expanded="true"] { visibility: visible; }
@media (hover: none) { .side-more { visibility: visible; } }
.side-menu { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 140px;
  padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.side-menu button { text-align: left; border: none; background: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; color: var(--text); }
.side-menu button:hover, .side-menu button:focus-visible { background: var(--bg); }
.side-menu button.danger { color: #d9534f; }
.side-rename { flex: 1; min-width: 0; font-size: 14px; padding: 5px 8px; }

/* Admin: what the questions are about */
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table td.warn { color: var(--warn-border); font-weight: 600; }
.analyses-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
#view-analyser table.admin-table { min-width: 0; }
.auth-forgot { margin: 0; text-align: center; font-size: 14px; }
.auth-card form .hint { margin: 0; }
.auth-contact { margin: 14px 0 0; font-size: 13px; text-align: center; }
.analyses-export { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }
.analyses-export .hint { margin: 0; }
.badge.kind-question { border-color: var(--accent); color: var(--accent); }
.report-kinds { margin: 4px 0 12px; }
/* Ids on the admin account page, for looking things up in the database */
.admin-id { display: inline-flex; align-items: baseline; gap: 2px; padding: 1px 6px; margin-left: 4px; font-size: 11px;
  border: 1px solid var(--border); border-radius: 4px; background: none; color: var(--muted); cursor: copy; }
.admin-id code { font-size: 11px; color: var(--text); user-select: all; }
.admin-id:hover { border-color: var(--accent); }
.admin-id.copied { border-color: #3a9d5d; }
.admin-id.copied::after { content: "Kopierat"; margin-left: 6px; color: #3a9d5d; }
.used-table li > .used-link { display: block; font-size: 12px; }
/* Column names in the Underlag panel in normal weight; only the table names stand out. */
.used-table li > strong { font-weight: 400; }
.guide-industry select.needs-choice { border-color: var(--warn-border); box-shadow: 0 0 0 1px var(--warn-border); }
.industry-note { margin: 0 0 10px; }
