/* Shared dashboard palette, type and controls; loaded first by shell.html.
   Edit these tokens for theme changes; page layouts live in the other files. */
:root {
  color-scheme: dark;
  --canvas: #090f13;
  --surface: rgba(16, 26, 32, .5);
  --surface-raised: #101a20;
  --card: #18272f;
  --chip-surface: #263b46;
  --chrome: rgba(7, 13, 17, .45);
  --sidebar-glass: rgba(18, 30, 37, .72);
  --sidebar-edge: rgba(149, 182, 200, .22);
  --sidebar-shadow: 0 16px 44px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .045);
  --input: rgba(7, 14, 19, .35);
  --line: #2d424d;
  --line-soft: rgba(133, 172, 192, .15);
  --text: #f0f5f7;
  --text-secondary: #bdced9;
  --muted: #8ba4b5;
  --accent: #49e4a9;
  --accent-strong: #0b855c;
  --accent-hover: #0a7251;
  --accent-wash: rgba(26, 173, 119, .1);
  --selection-border: var(--accent);
  --selection-bg: rgba(19, 110, 79, .23);
  --on-accent: #fff;
  --amber: #e7bc75;
  --amber-bg: rgba(190, 133, 43, .15);
  --danger: #ffaba4;
  --positive: #83cfa0;
  --positive-bg: rgba(69, 144, 94, .08);
  --neutral: #bdced9;
  --neutral-bg: rgba(133, 172, 192, .06);
  --negative-bg: rgba(213, 94, 88, .07);
  --negative: #e99c96;
  --score-text: #bad0ec;
  --score-bg: #243548;
  --score-high-text: #b7f5d1;
  --score-high-bg: #214e3c;
  --score-medium-text: #ffe1a3;
  --score-medium-bg: #534122;
  --score-low-text: #ffd0cb;
  --score-low-bg: #4d2a2f;
  --search-highlight-bg: #594629;
  --search-highlight-text: #fff0ce;
  --shadow: 0 12px 32px rgba(0, 0, 0, .18);
  --ambient: rgba(34, 75, 63, .13);
  --ambient-secondary: rgba(30, 51, 62, .12);
  --control-radius: 6px;
  --control-height: 42px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--canvas);
}
/* theme.js sets data-theme; light mode overrides colors, not component rules. */
:root[data-theme='light'] {
  color-scheme: light;
  --canvas: #e5ecef;
  --surface: rgba(255, 255, 255, .3);
  --surface-raised: #f0f4f6;
  --card: #fff;
  --chip-surface: #d8e5eb;
  --chrome: rgba(212, 224, 229, .25);
  --sidebar-glass: rgba(248, 252, 253, .68);
  --sidebar-edge: rgba(255, 255, 255, .85);
  --sidebar-shadow: 0 12px 36px rgba(40, 71, 88, .14), inset 0 1px 0 rgba(255, 255, 255, .8);
  --input: rgba(255, 255, 255, .35);
  --line: #a6b9c3;
  --line-soft: rgba(79, 115, 133, .17);
  --text: #182d3b;
  --text-secondary: #36566b;
  --muted: #557181;
  --accent: #08714f;
  --accent-strong: #137b58;
  --accent-hover: #106549;
  --accent-wash: rgba(22, 150, 106, .07);
  --selection-bg: rgba(30, 158, 113, .09);
  --amber: #85570d;
  --amber-bg: rgba(190, 133, 43, .12);
  --danger: #b13732;
  --positive: #286b52;
  --positive-bg: rgba(63, 158, 123, .07);
  --neutral: #486071;
  --neutral-bg: rgba(79, 115, 133, .04);
  --negative-bg: rgba(213, 94, 88, .05);
  --negative: #a5443e;
  --score-text: #355779;
  --score-bg: #e1eaf4;
  --score-high-text: #155338;
  --score-high-bg: #d2ebdf;
  --score-medium-text: #614110;
  --score-medium-bg: #f0dfba;
  --score-low-text: #842c31;
  --score-low-bg: #f5d9d7;
  --search-highlight-bg: #f2d89b;
  --search-highlight-text: #49300c;
  --shadow: 0 10px 35px rgba(47, 88, 107, .055);
  --ambient: rgba(100, 143, 134, .06);
  --ambient-secondary: rgba(91, 122, 145, .05);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 80% 0, var(--ambient), transparent 65%), radial-gradient(ellipse at 15% 100%, var(--ambient-secondary), transparent 60%), var(--canvas); background-attachment: fixed; }
button, input, select, textarea, .button { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea, .button { border: 1px solid var(--line); border-radius: var(--control-radius); }
input, select, textarea { color: var(--text); background-color: var(--input); padding: .65rem .8rem; min-width: 0; }
/* A fixed border-box height avoids native select/date sizing differences. */
input:not([type='checkbox']):not([type='radio']), select, .button { height: var(--control-height); line-height: 1.2; }
/* Every native select shares the same closed control, including unwrapped
   profile/settings fields. The browser still owns the menu and keyboard use. */
select { -webkit-appearance: none; appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23bdced9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 18px; cursor: pointer; }
:root[data-theme='light'] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2336566b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
button, .button { color: var(--text-secondary); background-color: var(--surface); }
:where(button, .button):hover:not(:disabled) { background-color: var(--surface-raised); border-color: var(--muted); }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* main and signal-title receive focus after navigation/results updates;
   these content targets should not look like selected form controls. */
main:focus-visible, .signal-title:focus-visible { outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--selection-border);
  outline-color: var(--selection-border);
  outline-offset: 0;
  background-color: var(--selection-bg);
}
input[type='checkbox']:where(:not(.toggle)) { width: 17px; height: 17px; accent-color: var(--accent-strong); cursor: pointer; margin: 0; }
/* toggle: Sources row/config enabled switches. Keep native checkbox keyboard
   behavior; the pseudo-element is only the centered on/off thumb. */
input.toggle { appearance: none; -webkit-appearance: none; display: inline-block; position: relative; flex: 0 0 34px; width: 34px; height: 20px; margin: 0; padding: 0; border-radius: 20px; border-color: var(--muted); background: var(--line); cursor: pointer; }
input.toggle::after { content: ''; position: absolute; top: 50%; left: 3px; width: 12px; height: 12px; transform: translateY(-50%); border-radius: 50%; background: var(--text-secondary); }
input.toggle:checked { border-color: var(--accent-strong); background: var(--accent-strong); }
input.toggle:checked::after { transform: translate(14px, -50%); background: var(--on-accent); }
input.toggle:disabled { opacity: .5; cursor: not-allowed; }
[hidden] { display: none !important; }
/* icon: shared SVGs from research/icons.html; icon-button: accessible icon-only
   actions such as theme, close, edit and retire across the Signals shell. */
.icon { flex: 0 0 auto; vertical-align: middle; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; width: 36px; height: 36px; }
/* Compact dismiss actions align with inline headings, keeping shared focus/hover. */
.icon-button-small { flex-shrink: 0; width: 24px; height: 24px; padding: 2px; }
.icon-button-small .icon { width: 16px; height: 16px; }
/* button: common appearance for action buttons, links and sort selects. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .7rem 1rem; font-size: .85rem; font-weight: 600; white-space: nowrap; }
/* tab-nav: local page views and report steps share native links/buttons.
   aria-current retains each navigation's page/step semantics. */
.tab-nav { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab-nav > :is(a, button) { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-height); margin-bottom: -1px; padding: 8px 16px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; line-height: 1.2; text-decoration: none; }
.tab-nav > :is(a, button):hover { background: var(--accent-wash); text-decoration: none; }
.tab-nav > :is([aria-current='page'], [aria-current='step']) { border-bottom-color: var(--selection-border); background: var(--selection-bg); color: var(--text); }
@media (max-width: 680px) {
  .tab-nav > :is(a, button) { padding-inline: 10px; }
}
.button:hover { text-decoration: none; }
.button .icon { width: 18px; height: 18px; }
/* positive/neutral/negative: Match review decisions; negative also marks source
   retirement. aria-pressed adds a non-color cue to the selected decision. */
.button.positive { --decision-color: var(--positive); --decision-bg: var(--positive-bg); }
.button.neutral { --decision-color: var(--neutral); --decision-bg: var(--neutral-bg); }
.button.negative { --decision-color: var(--negative); --decision-bg: var(--negative-bg); }
.button:is(.positive, .neutral, .negative) { color: var(--decision-color); background: var(--decision-bg); border-color: color-mix(in srgb, var(--decision-color) 55%, var(--line)); }
.button:is(.positive, .neutral, .negative):hover { box-shadow: inset 0 0 0 1px var(--decision-color); }
.button:is(.positive, .neutral, .negative)[aria-pressed='true'] { border-color: var(--decision-color); background: color-mix(in srgb, var(--decision-color) 15%, var(--input)); box-shadow: inset 0 0 0 1px var(--decision-color); text-decoration: underline; text-underline-offset: 4px; }
/* primary: a form's main submit action, such as matching, analysis or saving. */
.button.primary { background: linear-gradient(145deg, var(--accent-strong), var(--accent-hover)); border-color: transparent; color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.13); }
.button.primary:hover:not(:disabled) { filter: brightness(1.1); }
/* Legacy filter/active button variant; current Signals templates do not use it. */
.button.filter.active { color: var(--text); border-color: var(--selection-border); background: var(--selection-bg); }
/* workspace-toolbar/toolbar-search: Research results and Sources filters.
   browse-toolbar/browse-search: Browse text, tags and sort controls. Search
   expands into remaining space while the adjacent controls keep their size. */
.workspace-toolbar, .browse-toolbar { display: flex; flex: 0 0 auto; gap: 10px; padding-bottom: 18px; }
.toolbar-search, .browse-search { display: flex; flex: 1; min-width: 0; gap: 10px; }
.toolbar-search input, .browse-search input { flex: 1; width: 100%; }
/* select-control sizes Match clients/shared sorting; sort-control reserves
   space for its leading icon. The select itself owns the shared chevron. */
.select-control { position: relative; min-width: 0; }
.sort-control { width: max-content; min-width: 0; flex-shrink: 0; }
.select-control select { -webkit-appearance: none; appearance: none; width: 100%; padding-right: 44px; cursor: pointer; text-align: left; font-size: .85rem; }
.sort-control select { padding-left: 44px; }
.select-control > .icon { position: absolute; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; pointer-events: none; color: var(--text-secondary); }
.sort-icon { left: 16px; }
/* research/controls.html: list-pagination groups page-range with page-actions
   (Previous/Next); previous-icon reuses the arrow SVG facing backwards.
   page-actions also groups actions in the shared page header. */
.list-pagination { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 0; }
.page-range { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.page-actions { display: flex; gap: 8px; margin-left: auto; }
.list-pagination .button { padding-inline: 10px; gap: 4px; }
.previous-icon { transform: rotate(180deg); }
/* score: Match ranking badges. high/medium/low are presentation bands supplied
   by match.html, deliberately distinct from the green selection treatment. */
.score { display: inline-grid; place-items: center; min-width: 30px; height: 20px; padding: 0 5px; border: 0; border-radius: 4px; background: var(--score-bg); color: var(--score-text); font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.score.high { color: var(--score-high-text); background: var(--score-high-bg); }
.score.medium { color: var(--score-medium-text); background: var(--score-medium-bg); }
.score.low { color: var(--score-low-text); background: var(--score-low-bg); }
/* data-table: shared baseline for Signal evidence and Sources tables. Page
   files handle their column widths; headers and row dividers stay consistent. */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.data-table th, .data-table td { padding: 8px 10px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.data-table th { background: var(--line-soft); color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.data-table td { border-bottom: 1px solid var(--line-soft); }
.data-table td:first-child { color: var(--text); }
.data-table td.muted { color: var(--muted); }
/* empty_state.html: one neutral heading/body treatment for empty collections,
   initial instructions and unselected panes on every dashboard page. */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; padding: 56px 24px; text-align: center; color: var(--muted); }
.empty-state > h2 { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.4; color: var(--text-secondary); }
.empty-state > p { max-width: 340px; margin: 0; font-size: 12px; line-height: 1.7; }
/* badge: inline profile version/edit metadata, inheriting the heading's 12px
   text. state: recorded Research, Sources and Jobs outcomes. complete is successful,
   partial needs attention, empty is a neutral no-results outcome, failed is an
   error. These badges describe outcomes, never the current selection. */
.state, .badge { display: inline-flex; align-items: center; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-secondary); white-space: nowrap; }
.badge { border-color: transparent; background: var(--chip-surface); }
.state { font-size: 10px; }
.state.complete, .badge.version { color: var(--positive); background: var(--positive-bg); }
.badge.version { border-color: transparent; background: color-mix(in srgb, var(--positive) 22%, var(--surface-raised)); }
.state.partial, .badge.unsaved { color: var(--amber); background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
.badge.unsaved { border-color: transparent; background: color-mix(in srgb, var(--amber) 20%, var(--surface-raised)); }
.state.empty { color: var(--neutral); background: var(--neutral-bg); border-color: color-mix(in srgb, var(--neutral) 55%, var(--line)); }
.state.failed { color: var(--danger); background: var(--negative-bg); }
/* eyebrow: page/run category kicker; nav-label: sidebar category. Shared
   typography keeps these labels subordinate to page and navigation titles. */
.eyebrow, .nav-label { text-transform: uppercase; letter-spacing: .14em; font-size: .65rem; font-weight: 600; color: var(--muted); }
.eyebrow { margin: 0 0 .5rem; }
/* muted: secondary metadata or unavailable values, including evidence cells. */
.muted { color: var(--muted); }
/* tag: one subject-tag chip; tags: wrapping group in Signal details. Browse
   also uses tag chips to show applied filters above the results. */
.tag { display: inline-flex; align-items: center; padding: .25rem .5rem; border: 1px solid var(--line); border-radius: 5px; background: var(--input); color: var(--text-secondary); font-size: .7rem; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
/* search-match: server-rendered marks around literal Browse search matches;
   preserve highlight continuity when the matched text wraps onto two lines. */
.search-match { background: var(--search-highlight-bg); color: var(--search-highlight-text); border-radius: 2px; padding: 0 .06em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
/* sr-only: labels and live announcements for assistive technology. skip-link:
   shell keyboard shortcut to main, visible when it receives focus. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 10; top: -60px; left: 12px; padding: 12px; background: var(--surface-raised); }
.skip-link:focus { top: 8px; }
/* shell.html: logo-light/logo-dark select the matching logo asset; theme-moon
   and theme-sun show the theme the switch will activate, not the current one. */
.logo-light, .theme-moon { display: none; }
[data-theme='light'] .logo-dark, [data-theme='light'] .theme-sun { display: none; }
[data-theme='light'] .logo-light, [data-theme='light'] .theme-moon { display: block; }
/* Narrow screens: keep search full-width and allow adjacent controls to wrap. */
@media (max-width: 680px) {
  .workspace-toolbar, .browse-toolbar { flex-wrap: wrap; }
  .toolbar-search, .browse-search { flex-basis: 100%; }
  .sort-control { flex: 1; }
  .data-table { font-size: 11px; }
  .data-table th, .data-table td { padding: 8px 6px; }
}
/* Border feedback is optional; respect the user's reduced-motion setting. */
@media (prefers-reduced-motion: no-preference) {
  button, a, input, select { transition: border-color 140ms ease; }
}
