:root {
  --bg: #f6f7f2;
  --sidebar: #123d31;
  --sidebar-strong: #0b3028;
  --sidebar-text: #c7d8cd;
  --text: #17352c;
  --muted: #70837a;
  --border: #dfe8e1;
  --primary: #18724f;
  --primary-dark: #0e5139;
  --success: #23845b;
  --warning: #a96e24;
  --danger: #bd4d43;
  --card-bg: #ffffff;
  --accent: #e2b86d;
  --surface-muted: #f6f7f2;
  --text-muted: #52685e;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(23, 53, 44, .035);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

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

.muted { color: var(--muted); font-size: 13px; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
  align-self: stretch;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 0 8px;
}

.sidebar nav { flex: 1; }
.sidebar-nav { flex: 1; }
.nav-group-label { margin: 0 12px 8px; color: #66738a; font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.admin-nav-section { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 8px; }
.admin-pill { padding: 2px 5px; border: 1px solid rgba(216,156,69,.35); border-radius: 4px; color: #ddb16e; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.admin-nav-link { padding-left: 22px; font-size: 13px; }

.nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--sidebar-text);
  margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }

.nav-section {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8a91a3;
  margin: 18px 10px 6px;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 14px;
  position: sticky;
  bottom: 0;
  background: var(--sidebar);
}
.user-chip { padding: 0 10px 10px; }

.main { flex: 1; padding: 28px 32px; max-width: 1280px; }

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { width: 380px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand h1 { margin: 0; font-size: 26px; }
.auth-brand p { margin-top: 4px; }

/* Forms */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.form-check { align-items: center; border-bottom: 1px solid var(--border); display: flex; gap: 10px; padding: 12px 2px; }
.form-check input { accent-color: var(--primary); height: 18px; width: 18px; }
.form-check label { cursor: pointer; }
.form-actions { margin-top: 18px; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  width: 100%;
}
textarea { min-height: 80px; }
.rules-editor { min-height: 65vh; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.btn:hover { text-decoration: none; background: #f1f2f5; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash-notice { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.flash-alert { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card h2, .card h3 { margin-top: 0; }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .sidebar { width: 200px; }
}

/* Stat cards */
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-help { position: relative; flex: 0 0 auto; }
.tooltip-trigger { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--primary-dark); font: inherit; font-weight: 700; cursor: help; }
.tooltip-content { position: absolute; z-index: 20; top: 100%; right: 0; width: min(320px, calc(100vw - 80px)); margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text); box-shadow: 0 6px 20px rgba(23, 53, 44, .15); font-size: 13px; line-height: 1.55; }
.tooltip-content[hidden] { display: none; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.table tr:hover td { background: #fafbfc; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: #ecfdf5; color: var(--success); }
.badge-warning { background: #fef3c7; color: var(--warning); }
.badge-danger { background: #fef2f2; color: var(--danger); }
.badge-info { background: #e6f1e9; color: var(--primary-dark); }
.badge-muted { background: #f3f4f6; color: var(--muted); }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 72%; padding: 10px 14px; border-radius: 14px; font-size: 14px; }
.bubble .meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
/* The message renderer supplies paragraphs and line breaks; do not double them. */
.bubble .body { white-space: normal; word-break: break-word; }
.bubble-customer { align-self: flex-start; background: #eef1f5; border-bottom-left-radius: 4px; }
.bubble-trusted_expert { align-self: flex-end; background: #dcefe4; border-bottom-right-radius: 4px; }
.bubble-other_teammate { align-self: flex-end; background: #f5ead5; border-bottom-right-radius: 4px; }
.bubble-system { align-self: center; background: #f3f4f6; color: var(--muted); font-size: 12px; }
.bubble-context { opacity: 0.5; }
.segment-divider { text-align: center; margin: 18px 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; position: relative; }
.segment-divider::before, .segment-divider::after { content: ""; position: absolute; top: 50%; width: 30%; height: 1px; background: var(--border); }
.segment-divider::before { left: 0; } .segment-divider::after { right: 0; }

/* Topic tree */
.topic-tree { margin: 0; padding: 0; list-style: none; }
.topic-tree ul { list-style: none; padding-left: 22px; }
.topic-node { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin: 6px 0; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topic-node:hover { border-color: var(--primary); }
.topic-search { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 0 0 24px; }
.topic-search .field { flex: 1 1 260px; min-width: 0; }

/* Misc */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.page-header h1 { margin: 0; font-size: 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { width: 180px; }
.seg-tag { display: inline-block; background: #e6f1e9; color: var(--primary-dark); border-radius: 4px; padding: 1px 6px; font-size: 12px; margin-right: 4px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.danger-zone { border-color: #efb7b2; }
.quality-average { display: flex; flex-direction: column; align-items: flex-end; }
.quality-average strong { font-size: 30px; }
.quality-average span { color: var(--muted); font-size: 12px; }
.quality-report-grid { margin-top: 24px; }
.quality-summary-grid { margin-bottom: 22px; }
.quality-errors { margin: 0; padding-left: 22px; }
.quality-errors li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.page-header.segment-analysis-header { align-items: stretch; display: grid; justify-content: stretch; }
.page-header > .segment-analysis-heading { display: block; min-width: 0; width: 100%; }
.segment-analysis-prompt { margin: 8px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.page-header > .segment-analysis-actions { align-items: stretch; justify-content: flex-start; width: 100%; }
.segment-analysis-actions > a, .segment-analysis-actions > form { display: flex; flex: 0 0 150px; }
.segment-analysis-actions .btn { align-items: center; display: inline-flex; justify-content: center; min-height: 40px; white-space: nowrap; width: 100%; }
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .11em; margin: 0 0 3px; text-transform: uppercase; }
.learning-directory { margin-top: 22px; }
.learning-directory-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 10px; }
.learning-directory-heading h2 { font-size: 20px; letter-spacing: -.02em; margin: 0; }
.learning-topic-list { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.learning-topic-row { align-items: center; color: inherit; display: grid; gap: 16px; grid-template-columns: 38px minmax(0, 1fr) auto 18px; padding: 14px 18px; transition: background .15s ease, border-color .15s ease; }
.learning-topic-row + .learning-topic-row { border-top: 1px solid var(--border); }
.learning-topic-row:hover { background: #f5faf6; text-decoration: none; }
.learning-topic-index { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.learning-topic-copy { min-width: 0; }
.learning-topic-copy strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learning-topic-copy small { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learning-topic-meta { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 12px; white-space: nowrap; }
.learning-topic-progress { background: var(--border); border-radius: 99px; display: block; height: 5px; overflow: hidden; width: 76px; }
.learning-topic-progress > span { background: var(--primary); border-radius: inherit; display: block; height: 100%; }
.learning-topic-read { color: var(--text); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.learning-topic-arrow { color: var(--primary); font-size: 18px; line-height: 1; }
.search-workspace { max-width: none; width: 100%; }
.search-split-layout { align-items: start; display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.search-left-pane, .search-right-pane { min-width: 0; }
.search-right-pane { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - 110px); min-height: 420px; overflow: auto; position: sticky; top: 24px; }
.search-right-pane > turbo-frame { display: block; min-height: inherit; }
.search-preview-empty { padding: 42px 30px; text-align: center; }
.search-preview-empty h2 { margin: 4px 0 7px; }
.search-preview-header { align-items: flex-start; border-bottom: 1px solid var(--border); display: flex; gap: 16px; justify-content: space-between; padding: 22px; }
.search-preview-header h2 { font-size: 20px; line-height: 1.35; margin: 3px 0 5px; }
.search-preview-header p { margin-bottom: 0; }
.search-preview-summary { background: #f6f8f5; border-bottom: 1px solid var(--border); margin: 0; padding: 16px 22px; }
.search-preview-chat { gap: 20px; padding: 20px; }
.search-preview-chat .bubble { max-width: 90%; }
.search-message-group { min-width: 0; padding: 16px; border: 1px solid var(--border); border-inline-start: 3px solid var(--primary); border-radius: 10px; background: #fff; }
.search-message-group-title { margin: 0 0 14px; color: var(--primary-dark); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.search-message-group-context { background: #faf4e8; border-color: #e4d2ad; border-inline-start-color: #a96e24; }
.search-message-group-context .search-message-group-title { color: #74551f; }
.search-message-group-context .bubble-context { background: rgba(255, 255, 255, .8); border-color: #dbc9a6; }
.search-page-header { align-items: flex-end; margin-bottom: 18px; }
.search-page-header p:last-child { font-size: 14px; line-height: 1.55; margin: 6px 0 0; }
.search-form-card { border-top: 3px solid var(--primary); padding: 24px; }
.search-submit-row { align-items: center; display: flex; gap: 16px; justify-content: space-between; }
.search-loading-status { align-items: center; color: var(--muted); display: flex; font-size: 13px; gap: 9px; }
.search-loading-status[hidden] { display: none; }
.search-spinner { animation: search-spin .8s linear infinite; border: 2px solid var(--border); border-radius: 50%; border-top-color: var(--primary); display: inline-block; flex: 0 0 auto; height: 17px; width: 17px; }
@keyframes search-spin { to { transform: rotate(360deg); } }
.search-question-input { font-size: 16px; line-height: 1.55; min-height: 150px; resize: vertical; }
.search-status { align-items: center; border: 1px solid; border-radius: 10px; display: flex; gap: 10px; margin: 2px 0 20px; padding: 12px 15px; }
.search-status-dot { border-radius: 50%; height: 11px; width: 11px; }
.search-status-green { background: #edf9f1; border-color: #9fd5b2; color: #16653f; }
.search-status-green .search-status-dot { background: #23845b; box-shadow: 0 0 0 4px rgba(35,132,91,.12); }
.search-status-yellow { background: #fff8e8; border-color: #e5c57c; color: #805317; }
.search-status-yellow .search-status-dot { background: #c58a29; box-shadow: 0 0 0 4px rgba(197,138,41,.12); }
.search-status-red { background: #fff1ef; border-color: #e5aaa4; color: #963c34; }
.search-status-red .search-status-dot { background: #bd4d43; box-shadow: 0 0 0 4px rgba(189,77,67,.12); }
.search-assistant-grid { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); }
.search-answer-card h2 { margin: 0 0 18px; }
.search-answer-card blockquote { border-left: 3px solid var(--primary); margin: 0 0 16px; padding: 2px 0 2px 17px; }
.search-answer-card blockquote p { margin: 0 0 6px; white-space: normal; }
.search-answer-card cite { font-size: 12px; font-style: normal; }
.search-guidance-card h3 { margin-bottom: 14px; }
.search-guidance-card ul { margin: 0; padding-left: 20px; }
.search-guidance-card li { margin-bottom: 9px; }
.search-guidance-card li:last-child { margin-bottom: 0; }
.search-synthesis-unavailable { align-items: baseline; display: flex; gap: 10px; }
.search-results { margin-top: 24px; }
.search-result-list { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.search-result-row { align-items: start; color: inherit; display: grid; gap: 15px; grid-template-columns: 32px minmax(0, 1fr) 82px; padding: 16px 17px; }
.search-result-row + .search-result-row { border-top: 1px solid var(--border); }
.search-result-row:hover { background: #f5faf6; text-decoration: none; }
.search-result-copy { min-width: 0; }
.search-result-row > .learning-topic-index { line-height: 1.4; padding-top: 2px; }
.search-result-copy strong { display: block; font-size: 15px; line-height: 1.4; }
.search-result-copy small { color: var(--muted); display: -webkit-box; line-height: 1.45; margin: 4px 0 6px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.search-result-copy > span { color: var(--primary); display: block; font-size: 12px; line-height: 1.35; }
.search-similarity { align-self: start; border-radius: 99px; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 800; min-width: 76px; padding: 5px 8px; text-align: center; }
.search-similarity.is-green { background: #e3f5e9; color: #16653f; }
.search-similarity.is-yellow { background: #fff1c9; color: #805317; }
.search-similarity.is-red { background: #fde6e3; color: #963c34; }
.learning-message-role { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; margin: 8px 0 2px; text-transform: uppercase; }
.quiz-question { font-size: 18px; }
.learning-case-actions { display: flow-root; overflow-anchor: none; }
.quiz-options { border: 0; display: grid; gap: 10px; margin: 18px 0; padding: 0; }
.quiz-options label { align-items: flex-start; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; display: flex; gap: 10px; padding: 12px; }
.quiz-options input { margin-top: 4px; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }
.progress-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--primary); }
.card-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-heading-row h3 { margin-bottom: 3px; }
.card-heading-row p { margin: 0; }
.progress-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 22px; }
.progress-summary strong { font-size: 22px; }
.progress-summary span, .progress-percentage { color: var(--muted); font-size: 12px; }
.corpus-progress { height: 11px; margin-top: 10px; }
.corpus-progress > span { background: linear-gradient(90deg, var(--primary-dark), #4b9f6b); transition: width .3s ease; }
.progress-percentage { margin-top: 6px; text-align: right; }
.corpus-progress-stats { margin-top: 20px; margin-bottom: 0; }
.corpus-progress-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 9px; background: #f7f9fb; }
.corpus-progress-stats strong { font-size: 21px; }
.worker-monitor { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.worker-monitor-heading, .worker-jobs-heading, .worker-process-row, .worker-job-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.worker-monitor-heading h4 { margin: 0 0 3px; font-size: 15px; }
.worker-monitor-heading p { margin: 0; }
.worker-process-list, .worker-job-list { display: grid; gap: 7px; margin-top: 13px; }
.worker-process-row, .worker-job-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fbfcfa; }
.worker-process-row strong { display: block; }
.worker-process-row .muted { display: block; margin-top: 2px; }
.worker-jobs { margin-top: 20px; }
.worker-job-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 12px; }
.worker-job-failed { color: var(--danger); font-weight: 700; }
.pagy { margin-top: 16px; display: flex; gap: 6px; }
.pagy a, .pagy span { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.pagy .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Shared presentation for the archive, learning and administration. */
body { background: var(--bg); color: var(--text); letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
.app-shell { min-height: 100vh; }
.sidebar { width: 272px; padding: 30px 18px 18px; background: var(--sidebar); position: sticky; top: 0; height: 100dvh; min-height: 0; overflow: hidden; }
.sidebar-nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--primary) var(--sidebar); }
.sidebar > .brand, .brand-caption, .sidebar-footer { flex-shrink: 0; }
.brand { margin-bottom: 0; padding: 0 10px; }
.brand-logo { display: block; width: 100%; max-width: 196px; height: auto; padding: 9px 14px; border-radius: 4px; background: var(--bg); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; font-size: 14px; color: var(--sidebar-text); transition: background .15s ease, color .15s ease; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.is-active { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 var(--accent); }
.nav-section { margin: 28px 12px 8px; font-size: 10px; font-weight: 700; }
.sidebar-footer { padding: 20px 6px 0; margin-top: 28px; position: static; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.user-chip { padding: 0; color: #fff; display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.user-chip .muted { display: block; color: var(--sidebar-text); font-size: 11px; }
.main { width: 100%; min-width: 0; max-width: 1740px; margin: 0 auto; padding: 44px clamp(24px, 3.5vw, 64px) 64px; }
.page-header { margin-bottom: 30px; align-items: flex-end; border-bottom: 1px solid var(--border); padding-bottom: 26px; }
.page-header h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(32px, 3vw, 44px); letter-spacing: -.045em; line-height: 1.12; overflow-wrap: anywhere; }
.card, .stat-card { border-color: var(--border); box-shadow: var(--shadow); }
.card { padding: 26px; margin-bottom: 24px; }
.card pre { max-width: 100%; max-height: 560px; margin: 0; padding: 16px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; font-size: 12px; line-height: 1.55; }
.grid > * { min-width: 0; }
.card h2, .card h3 { letter-spacing: -.025em; }
.stat-card { padding: 23px; border-radius: 12px; border-top: 3px solid var(--border); }
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.stat-value { margin-top: 10px; font-size: 36px; font-weight: 500; letter-spacing: -.055em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.channel-list { display: grid; gap: 7px; margin-top: 11px; }
.channel-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 7px; background: var(--bg); color: var(--text); font-size: 13px; }
.channel-item strong { color: var(--primary); font-size: 14px; }
.section-note { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.grid { gap: 18px; }
.grid-4 { margin-bottom: 18px; }
.table-wrap { overflow-x: auto; max-width: 100%; scrollbar-width: thin; border: 1px solid var(--border); border-radius: 10px; }
.table { width: 100%; min-width: 680px; }
.card > .table { display: table; overflow: visible; }
.page-header > .page-heading { display: block; min-width: 0; flex: 1 1 auto; align-self: stretch; }
form { margin: 0; }
.inline-form { display: inline-flex; width: auto; }
.table-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; white-space: nowrap; }
.action-cell { min-width: 150px; }
.alias-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.table th { padding: 14px 16px; font-size: 11px; letter-spacing: .03em; color: var(--text-muted); background: var(--bg); border-bottom-width: 1px; }
.table td { padding: 16px; }
.table tr:last-child td { border-bottom: 0; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 44px; padding: 10px 17px; border-radius: 8px; font-weight: 600; line-height: 1.4; text-align: center; transition: background .15s ease, border-color .15s ease; }
.btn:hover { background: var(--bg); border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.filters { padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 12px; gap: 14px; }
.filters .field { width: 170px; }
.field label { color: var(--text); font-size: 13px; letter-spacing: 0; text-transform: none; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, textarea { border-radius: 8px; border-color: var(--border); min-height: 46px; padding: 11px 12px; color: var(--text); }
.flash { border-radius: 9px; box-shadow: var(--shadow); }
.badge { line-height: 1.6; }
.topic-node { padding: 18px 20px; border-color: var(--border); box-shadow: none; flex-wrap: wrap; min-width: 0; }
.topic-node > div { min-width: 0; overflow-wrap: anywhere; }
.topic-node:hover { border-color: var(--primary); background: var(--bg); }
.bubble { max-width: min(720px, 78%); padding: 13px 16px; box-shadow: 0 3px 12px rgba(23,32,51,.04); }
.bubble .body p { margin: 0 0 4px; }
.bubble .body p:last-child { margin-bottom: 0; }
.bubble .body ul, .bubble .body ol, .search-quote-body ul, .search-quote-body ol { margin: 4px 0; padding-inline-start: 22px; }
.bubble .body li + li, .search-quote-body li + li { margin-top: 2px; }
.bubble .body > :first-child { margin-top: 0; }
.bubble .body > :last-child { margin-bottom: 0; }
.segment-divider { color: var(--primary); font-weight: 700; }
.segment-divider::before, .segment-divider::after { background: #c8d6dc; }
.empty { padding: 48px 24px; border: 1px dashed var(--border); border-radius: 12px; background: var(--bg); }
.auth-body { background: var(--bg); }
.auth-card { border: 0; box-shadow: none; }
.auth-logo { display: block; width: 100%; height: auto; margin: 0 auto 10px; }
.auth-brand p { margin-bottom: 0; }

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; min-height: auto; max-height: none; overflow: visible; padding: 16px 14px 12px; }
  .brand { margin-bottom: 14px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .sidebar-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .nav-group-label, .admin-nav-section { display: none; }
  .nav-link { white-space: nowrap; padding: 9px 11px; }
  .nav-section { display: none; }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 0; }
  .user-chip { padding: 0; }
  .main { padding: 24px 16px 40px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-header h1 { font-size: 26px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 17px; }
  .card-heading-row, .progress-summary { align-items: flex-start; flex-direction: column; }
  .filters { align-items: stretch; }
  .filters .field { width: 100%; }
  .bubble { max-width: 92%; }
  .auth-card { width: calc(100% - 28px); padding: 24px; }
  .card > .table { display: block; overflow-x: auto; }
  .learning-directory-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .learning-topic-row { gap: 10px; grid-template-columns: 25px minmax(0, 1fr) 18px; padding: 13px 12px; }
  .learning-topic-meta { gap: 7px; }
  .learning-topic-meta > span:first-child { display: none; }
  .learning-topic-progress { width: 58px; }
  .search-assistant-grid { grid-template-columns: 1fr; }
  .search-split-layout { grid-template-columns: 1fr; }
  .search-right-pane { max-height: none; min-height: 320px; position: static; }
  .search-form-card { padding: 18px; }
  .search-submit-row { align-items: stretch; flex-direction: column; }
  .search-form-card .btn { width: 100%; }
  .search-synthesis-unavailable { align-items: flex-start; flex-direction: column; }
  .search-result-row { gap: 9px; grid-template-columns: 24px minmax(0, 1fr); padding: 14px 12px; }
  .search-similarity { grid-column: 2; grid-row: 2; margin-top: 2px; }
}
.pipeline-progress {
  margin-bottom: 1.25rem;
}

.pipeline-progress-header,
.pipeline-stage-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.pipeline-stages {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 1rem;
}

.pipeline-stage {
  background: var(--surface-muted, #f5f6f4);
  border: 1px solid var(--border, #dfe3de);
  border-radius: 0.65rem;
  padding: 0.8rem;
}

.pipeline-conversation-count {
  font-size: 0.75rem;
  white-space: nowrap;
}

.pipeline-conversation-count strong {
  font-size: 1.15rem;
}

.pipeline-stage-track {
  background: var(--border, #dfe3de);
  border-radius: 999px;
  height: 0.45rem;
  margin: 0.65rem 0 0.35rem;
  overflow: hidden;
}

.pipeline-stage-track span {
  background: var(--accent, #42745b);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.35s ease;
}

.pipeline-stage-jobs {
  border-top: 1px solid var(--border, #dfe3de);
  display: flex;
  font-size: 0.75rem;
  gap: 0.65rem;
  justify-content: space-between;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
}

.pipeline-work-items {
  color: var(--text-muted, #59645d);
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 0.55rem;
}

.ai-activity-list {
  margin-top: 1rem;
  max-height: 18rem;
  overflow-y: auto;
}

.ai-activity-row {
  align-items: center;
  border-top: 1px solid var(--border, #dfe3de);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 6rem 1fr 1fr auto;
  padding: 0.65rem 0;
}

.ai-activity-status {
  font-size: 0.8rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .segment-analysis-actions > a, .segment-analysis-actions > form { flex: 1 1 150px; }
  .pipeline-stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .pipeline-stages {
    grid-template-columns: 1fr;
  }

  .ai-activity-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Prose fills its layout container; keep width constraints on components, not
   explanatory text. Authored messages/prompts retain their meaningful breaks. */
h2 { font-size: 23px; line-height: 1.3; }
h3 { font-size: 18px; line-height: 1.35; }
p { overflow-wrap: anywhere; }
.muted, .section-note { color: var(--text-muted); }
.eyebrow { color: var(--primary); font-size: 10px; font-weight: 750; letter-spacing: .13em; margin: 0 0 10px; }
.page-description { color: var(--text-muted); font-size: 15px; line-height: 1.65; margin: 12px 0 0; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.section-heading { margin-bottom: 22px; }
.section-heading h2, .section-heading h3 { margin: 0 0 7px; }
.section-heading p:not(.eyebrow) { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0; }
.dashboard-section-heading { margin-top: 38px; }
.guide-note { background: #eef3eb; border-left: 3px solid var(--accent); padding: 18px 22px; border-radius: 0 10px 10px 0; margin: 0 0 26px; }
.guide-note strong { font-size: 14px; }
.guide-note p { font-size: 14px; line-height: 1.65; color: var(--text-muted); margin: 5px 0 0; }
.learning-topic-guide { margin-top: 24px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 18px; color: var(--text-muted); }
.empty-state h2 { color: var(--text); font-size: 22px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; margin: 0 0 12px; }
.empty-state p { margin: 0 0 18px; font-size: 14px; line-height: 1.7; }
.empty-state .btn { margin-top: 5px; }
.ui-icon { width: 21px; height: 21px; flex: 0 0 21px; }
.brand-caption { color: var(--sidebar-text); font-size: 11px; padding: 0 10px; margin: 15px 0 38px; }
.nav-group-label { color: var(--sidebar-text); opacity: .8; font-size: 9px; letter-spacing: .13em; margin: 0 12px 10px; }
.admin-navigation { border-top: 1px solid rgba(255,255,255,.15); margin-top: 30px; padding-top: 16px; }
.admin-navigation summary { font-size: 12px; color: var(--sidebar-text); cursor: pointer; padding: 12px; }
.admin-navigation .admin-pill { margin-left: 5px; color: var(--accent); }
.admin-navigation-links { padding-top: 10px; }
.admin-navigation-links .nav-link { padding: 9px 12px; font-size: 12px; min-height: 38px; }
.admin-navigation-links .nav-group-label { margin-top: 20px; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; background: rgba(226,184,109,.16); color: var(--accent); border-radius: 50%; font-size: 13px; }
.sidebar-logout { border-color: rgba(255,255,255,.2); background: transparent; color: #fff; font-size: 12px; min-height: 38px; padding: 8px 10px; }
.sidebar-logout:hover { color: var(--text); }
.welcome-panel { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; background: var(--sidebar); color: #fff; padding: clamp(28px, 3vw, 48px); border-radius: 18px; overflow: hidden; }
.welcome-panel::before { content: ""; position: absolute; right: -130px; top: -240px; width: 520px; height: 520px; border: 1px solid rgba(226,184,109,.15); border-radius: 50%; pointer-events: none; }
.welcome-panel .eyebrow { color: var(--accent); }
.welcome-copy { position: relative; }
.welcome-copy h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.17; font-weight: 400; letter-spacing: -.035em; margin: 0 0 18px; }
.welcome-copy > p:not(.eyebrow) { color: var(--sidebar-text); font-size: 14px; line-height: 1.7; margin: 0 0 25px; }
.btn-gold { color: var(--sidebar-strong); background: var(--accent); border-color: var(--accent); }
.btn-gold:hover { background: var(--bg); border-color: var(--bg); }
.welcome-paths { align-self: center; position: relative; }
.welcome-path { display: flex; gap: 16px; align-items: center; color: #fff; padding: 22px 0; border-bottom: 1px solid rgba(255,255,255,.17); }
.welcome-path:first-child { padding-top: 0; }
.welcome-path:hover { color: var(--accent); text-decoration: none; }
.welcome-path > .ui-icon:first-child { color: var(--accent); width: 25px; height: 25px; flex-basis: 25px; }
.welcome-path > .ui-icon:last-child { margin-left: auto; width: 17px; flex-basis: 17px; }
.welcome-path strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.welcome-path span { display: block; color: var(--sidebar-text); font-size: 13px; line-height: 1.6; }
.welcome-paths > p { font-size: 12px; color: var(--sidebar-text); line-height: 1.7; margin: 20px 0 0; }
.stat-value-text { font-size: 22px; letter-spacing: -.025em; margin-top: 18px; }
.stat-card .muted { display: inline-block; margin-top: 10px; font-size: 12px; }
.btn-primary:hover { color: #fff; }
.btn-danger:hover { color: var(--danger); background: #fef2f2; border-color: var(--danger); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 36px; font-size: 12px; padding: 7px 11px; }
.table tr:hover td { background: #f8faf6; }
.table td a:not(.btn) { font-weight: 600; }
.table caption { padding: 12px; text-align: left; color: var(--text-muted); font-size: 13px; }
.table-actions { flex-wrap: wrap; }
.form-stack { gap: 20px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field > small { line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: .85; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.detail-list { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; gap: 0; margin: 0; font-size: 14px; }
.detail-list dt, .detail-list dd { padding: 13px 0; border-bottom: 1px solid var(--border); margin: 0; overflow-wrap: anywhere; }
.detail-list dt { color: var(--text-muted); padding-right: 20px; }
.detail-list dd { font-weight: 500; }
details:not(.admin-navigation) { margin: 18px 0; }
details:not(.admin-navigation) > summary { padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
details:not(.admin-navigation)[open] > summary { margin-bottom: 16px; }
.step-list { list-style: none; counter-reset: steps; display: grid; gap: 0; margin: 0; padding: 0; }
.step-list li { counter-increment: steps; position: relative; padding: 17px 0 17px 46px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.step-list li:last-child { border-bottom: 0; }
.step-list li::before { content: counter(steps, decimal-leading-zero); position: absolute; left: 0; color: var(--primary); font-size: 12px; font-weight: 700; padding-top: 2px; }
.step-list strong { color: var(--text); }
.learning-topic-row { padding: 22px 24px; grid-template-columns: 38px minmax(0, 1fr) auto 18px; }
.learning-topic-copy strong { font-size: 16px; }
.learning-topic-copy small { margin-top: 5px; }
.learning-topic-index { color: var(--primary); }
.learning-topic-meta { gap: 16px; }
.learning-topic-arrow { font-size: 22px; }
.learning-directory-heading { margin-bottom: 18px; }
.topic-tree ul { border-left: 1px solid var(--border); margin-left: 16px; }
.search-form-card { border-top: 3px solid var(--accent); }
.search-question-input { min-height: 170px; }
.search-assistant-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.search-right-pane { top: 24px; border-top: 3px solid var(--primary); }
.search-preview-empty { display: flex; flex-direction: column; justify-content: center; min-height: 420px; background: linear-gradient(160deg, #fff, var(--bg)); }
.search-preview-empty::before { content: ""; display: block; width: 50px; height: 62px; border: 1px solid var(--border); border-bottom: 3px solid var(--accent); border-radius: 6px; margin: 0 auto 26px; background: repeating-linear-gradient(to bottom, transparent 0 12px, var(--border) 12px 13px) center / 26px 40px no-repeat; }
.search-preview-header { flex-wrap: wrap; }
.search-result-row { padding: 22px 18px; }
.search-result-copy strong { font-weight: 600; }
.bubble { line-height: 1.65; }
.bubble-customer { background: var(--bg); border: 1px solid var(--border); }
.bubble .meta { color: var(--text-muted); margin-bottom: 8px; font-size: 12px; }
.bubble-context { opacity: 1; border: 1px dashed var(--border); background: var(--bg); }
.learning-message-role { color: var(--text-muted); }
.quiz-options label { padding: 18px; background: #fff; line-height: 1.6; }
.quiz-options label:has(input:checked) { border-color: var(--primary); background: #eef3eb; box-shadow: inset 3px 0 var(--primary); }
.quiz-options label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.pipeline-stages { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.pipeline-stage-heading, .pipeline-progress-header, .pipeline-stage-jobs { flex-wrap: wrap; }
.pipeline-stage-heading { gap: 8px; }
.pipeline-stage { padding: 18px; }
.pipeline-stage-heading > strong { font-size: 14px; }
.pipeline-conversation-count { white-space: normal; }
.pipeline-stage-jobs { gap: 8px; }
.worker-monitor-heading, .worker-jobs-heading, .worker-process-row, .worker-job-row { flex-wrap: wrap; }
.ai-activity-row > * { min-width: 0; overflow-wrap: anywhere; }
.quality-errors li { flex-wrap: wrap; }
.progress-bar, .pipeline-stage-track { background: var(--border); }
.pagy { flex-wrap: wrap; }
.pagy a, .pagy span { min-width: 38px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; background: #fff; }

/* The access page introduces the product before asking for credentials. */
.auth-layout { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 100dvh; width: 100%; }
.auth-story { position: relative; display: flex; flex-direction: column; padding: clamp(32px, 5vw, 80px); background: var(--sidebar); color: #fff; overflow: hidden; }
.auth-story::after { content: ""; width: 560px; height: 560px; border: 1px solid rgba(226,184,109,.16); border-radius: 50%; position: absolute; bottom: -410px; right: -240px; pointer-events: none; }
.auth-story-logo { width: 185px; height: auto; background: var(--bg); padding: 10px 15px; border-radius: 4px; }
.auth-story-copy { margin: auto 0; padding: 64px 0; }
.auth-story .eyebrow { color: var(--accent); }
.auth-story h2 { font: 400 clamp(34px, 3.5vw, 54px)/1.15 Georgia, "Times New Roman", serif; letter-spacing: -.04em; margin: 0 0 24px; }
.auth-story-copy > p:not(.eyebrow) { color: var(--sidebar-text); line-height: 1.8; }
.auth-benefits { list-style: none; padding: 0; margin: 35px 0 0; display: grid; gap: 24px; }
.auth-benefits li { display: flex; gap: 19px; }
.auth-benefits li > span { color: var(--accent); font-size: 12px; font-weight: 600; padding-top: 3px; }
.auth-benefits strong { font-size: 14px; font-weight: 600; }
.auth-benefits p { color: var(--sidebar-text); font-size: 13px; margin: 4px 0 0; }
.auth-story-footer { font-size: 12px; color: var(--sidebar-text); margin: 0; }
.auth-card { width: auto; max-width: 460px; align-self: center; justify-self: center; padding: 40px; margin: 40px 24px; background: transparent; border-radius: 0; }
.auth-brand { text-align: left; margin-bottom: 34px; }
.auth-brand h1 { font: 400 36px/1.15 Georgia, "Times New Roman", serif; letter-spacing: -.04em; }
.auth-brand > p:last-child { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-top: 16px; }
.auth-card .btn { margin-top: 8px; min-height: 48px; }
.auth-help { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 30px; color: var(--text-muted); font-size: 13px; line-height: 1.7; }

/* Keyboard access and reduced motion apply to all screens. */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.sidebar :focus-visible, .welcome-panel :focus-visible, .auth-story :focus-visible { outline-color: var(--accent); }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; transform: translateY(-180%); padding: 12px 20px; color: #fff; background: var(--primary-dark); border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
#main-content:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (min-width: 761px) and (max-width: 1150px) {
  .sidebar { width: 228px; padding: 24px 12px; }
  .nav-link { font-size: 12px; gap: 8px; }
  .main { padding: 32px 24px 48px; }
  .welcome-panel { gap: 28px; grid-template-columns: 1fr; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-split-layout { grid-template-columns: minmax(0, 1fr); }
  .search-right-pane { position: static; max-height: none; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 20px; }
  .learning-topic-row { grid-template-columns: 28px minmax(0, 1fr) 18px; gap: 12px; }
  .learning-topic-meta { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .learning-topic-arrow { grid-column: 3; grid-row: 1; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 20px 16px 16px; overflow: visible; }
  .brand { padding: 0; margin: 0; }
  .brand-logo { max-width: 140px; padding: 6px 10px; }
  .brand-caption { padding: 0; margin: 10px 0 20px; }
  .sidebar nav.sidebar-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: visible; padding: 0; }
  .nav-link { white-space: normal; font-size: 12px; padding: 12px 10px; min-height: 44px; }
  .nav-link .ui-icon { width: 18px; height: 18px; flex-basis: 18px; }
  .admin-navigation { grid-column: 1 / -1; margin-top: 10px; padding-top: 8px; }
  .admin-navigation summary { padding: 10px; }
  .admin-navigation-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; max-height: 240px; overflow-y: auto; scrollbar-width: thin; }
  .admin-navigation-links .nav-group-label { display: block; grid-column: 1 / -1; margin: 14px 10px 6px; }
  .admin-navigation-links .nav-link { min-height: 44px; }
  .sidebar-footer { margin-top: 16px; padding-top: 16px; }
  .main { padding: 28px 18px 44px; }
  .page-header { padding-bottom: 22px; margin-bottom: 24px; }
  .page-header h1 { font-size: 34px; }
  .page-actions { width: 100%; flex-shrink: 1; }
  .page-actions > .btn, .page-actions > form { flex: 1 1 auto; }
  .page-actions form .btn { width: 100%; }
  .page-description { font-size: 14px; }
  .card { padding: 20px; border-radius: 12px; }
  .welcome-panel { grid-template-columns: 1fr; gap: 30px; padding: 26px; border-radius: 12px; }
  .welcome-copy h2 { font-size: 32px; }
  .welcome-path { gap: 12px; }
  .welcome-path strong { font-size: 14px; }
  .welcome-path > .ui-icon:last-child { display: none; }
  .dashboard-section-heading { margin-top: 30px; }
  .guide-note { padding: 16px 18px; }
  .topic-tree ul { margin-left: 5px; padding-left: 10px; }
  .topic-node { padding: 14px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stat-card { padding: 20px; }
  .stat-value { font-size: 32px; }
  .stat-value-text { font-size: 22px; }
  .table-wrap .table { display: table; min-width: 620px; }
  .learning-topic-row { padding: 18px 16px; grid-template-columns: 25px minmax(0, 1fr) 18px; gap: 10px; }
  .learning-topic-copy strong, .learning-topic-copy small { white-space: normal; }
  .learning-topic-meta { grid-column: 2; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
  .learning-topic-meta > span:first-child { display: inline; }
  .learning-topic-arrow { grid-column: 3; grid-row: 1; }
  .search-preview-empty { min-height: 280px; padding: 28px 20px; }
  .search-preview-header { padding: 18px; }
  .search-result-row { grid-template-columns: 22px minmax(0, 1fr); }
  .search-similarity { grid-column: 2; grid-row: 2; justify-self: start; }
  .search-preview-chat { padding: 14px; }
  .search-message-group { padding: 12px; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list dt { padding-bottom: 2px; border: 0; }
  .detail-list dd { padding-top: 2px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { padding: 28px; }
  .auth-story-logo { width: 140px; }
  .auth-story-copy { padding: 30px 0 0; }
  .auth-story h2 { font-size: 32px; }
  .auth-story-copy > p:not(.eyebrow) { font-size: 14px; margin-bottom: 0; }
  .auth-benefits, .auth-story-footer { display: none; }
  .auth-card { margin: 0; padding: 36px 28px; max-width: 480px; width: 100%; }
  .auth-brand h1 { font-size: 32px; }
  input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, textarea { font-size: 16px; }
}
