/* Translator viewer - three-column layout.
 *   topbar
 *   workspace = grid: [tables sidebar | splitter | center inspector | splitter | task pane]
 *   floating env-questions panel docked in bottom-right corner
 */

:root {
  /* Blueprint palette — warm ivory + #5567D8, borders only, readable ink. */
  --bg:           #F2F1EC;   /* warm ivory background */
  --bg-2:         #F8F7F4;   /* surface / cards */
  --bg-3:         #EEECEA;   /* muted surface */
  --ink:          #1A1B26;   /* primary text */
  --ink-2:        #2C2D38;   /* secondary text — readable, not grey */
  --ink-3:        #4B4C58;   /* muted text — still readable */
  --ink-4:        #7C7D88;   /* faint / de-emphasis — not pale */
  --rule:         #D4D3CC;   /* border / divider */
  --rule-2:       #E4E2DB;   /* light divider */
  --accent:       #5567D8;   /* primary blue */
  --accent-soft:  #E9EBF9;   /* blue tint fill */
  --accent-panel: #F1F2FB;   /* faint blue panel */
  --accent-rule:  #C8CEF1;   /* blue border tint */
  --support-blue: #5567D8;
  --support-blue-soft: #E9EBF9;
  --support-teal: #5567D8;
  --support-teal-soft: #E9EBF9;
  --support-warm: #8B9FE8;   /* secondary blue accent */
  --support-warm-soft: #ECEFFB;
  --support-rose: #9A5F67;   /* destructive only — kept readable, non-grey */
  --support-rose-soft: #F1E4E5;
  --good:         #5567D8;
  --note-bg:      #E9EBF9;
  --note-border:  #C8CEF1;
  --andromede-blue: #5567D8;
  --andromede-blue-2: #8B9FE8;
  --andromede-blue-soft: #E9EBF9;
  --andromede-blue-panel: #F1F2FB;
  --andromede-blue-rule: #C8CEF1;
  --andromede-grid: rgba(85, 103, 216, 0.055);
  --andromede-ink: #1A1B26;
  --andromede-hairline: #D4D3CC;

  --font-text: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --font-meta: "DM Sans", ui-sans-serif, -apple-system, "SF Pro Text", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* shadows for depth */
  --shadow-xs:   0 1px 2px rgba(20,22,40,0.05);
  --shadow-sm:   0 1px 3px rgba(20,22,40,0.06), 0 1px 2px rgba(20,22,40,0.04);
  --shadow-md:   0 4px 12px rgba(20,22,40,0.08), 0 2px 4px rgba(20,22,40,0.04);
  --shadow-lg:   0 12px 32px rgba(20,22,40,0.12), 0 4px 8px rgba(20,22,40,0.06);
  --shadow-brand:0 4px 16px rgba(47,111,79,0.18), 0 2px 6px rgba(47,111,79,0.10);

  /* ── Type scale ───────────────────────────────────────────────
     Two tiers. "Reading" sizes are for prose the reviewer must read
     and answer (questions, prompts, choices, notes). "Data" sizes
     stay compact for tables / schema graph. Snap to these - don't
     invent in-between values. */
  --text-eyebrow: 11.5px;  /* section labels, uppercase tags        */
  --text-caption: 13px;    /* helper / anchor / secondary prose     */
  --text-body:    15px;    /* reading-tier body - questions, choices */
  --text-lede:    16px;    /* task instruction, lead paragraph      */
  --text-h3:      17px;    /* sub-headings                          */
  --text-h2:      20px;    /* panel + section titles                */
  --text-data:    13px;    /* data tier (tables) - unchanged        */

  /* ── Spacing scale (8-pt rhythm) ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* ── Corner radius (three steps only) ── */
  --radius-sm: 6px;        /* inputs, chips, small buttons */
  --radius-md: 10px;       /* cards, fields, panels        */
  --radius-pill: 999px;    /* badges, counts               */
}

* { box-sizing: border-box; }
.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;
}
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 85% 110%, rgba(47,111,79,0.04), transparent 60%),
    radial-gradient(900px 500px at 0% -10%, rgba(255,255,255,0.65), transparent 55%),
    linear-gradient(180deg, #fbfbf7 0%, var(--bg) 60%, #eef0ea 100%);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

/* ───────── env header (lives at top of left sidebar) ───────── */
.col-head.env-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  padding: 12px 14px 10px;
}
.env-head-label {
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.env-name {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.2;
}
.env-desc {
  font-family: var(--font-meta);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-3);
  line-height: 1.4;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.env-head-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.env-action-btn {
  font-family: var(--font-meta);
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all .15s ease;
  white-space: nowrap;
}
.env-action-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
#notes-count-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-size: 9.5px;
  padding: 1px 5px;
  margin-left: 3px;
  font-weight: 700;
}
#notes-count-badge.zero { display: none; }

/* ───────── workspace grid ───────── */
.workspace {
  --col-tables-w: 300px;
  display: grid;
  grid-template-columns:
    var(--col-tables-w) 6px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, #ffffff 0%, #fcfaf3 100%);
  box-shadow: 0 1px 0 rgba(20,22,40,0.02);
  gap: 8px;
  flex-shrink: 0;
}
.col-head-title {
  font-family: var(--font-meta);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.col-head-sub {
  font-family: var(--font-meta);
  font-size: 12.5px;
  color: var(--ink-3);
  font-style: italic;
  margin-left: 8px;
}
.col-body {
  overflow-y: auto;
  padding: 12px 14px 20px;
  flex: 1;
}

.splitter-vert {
  background: transparent;
  cursor: col-resize;
  position: relative;
}
.splitter-vert::after {
  content: "";
  position: absolute;
  inset: 0 2px;
  background: var(--rule);
  opacity: 0.5;
}
.splitter-vert:hover::after, .splitter-vert.dragging::after {
  background: var(--accent);
  opacity: 1;
}

/* ───────── LEFT: tables sidebar ───────── */
.col-tables {
  background: var(--bg-2);
  border-right: 1px solid var(--rule);
}
.tables-nav {
  padding: 8px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ───────── LEFT sidebar tab strip ───────── */
.env-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, #fff 0%, #f8f9ff 100%);
  padding: 0 10px;
  flex-shrink: 0;
}
.env-tab {
  flex: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-meta);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: none;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-2);
  padding: 12px 6px 11px;
  border-bottom: 2px solid transparent;
  transition: color .12s, background .12s, border-color .12s;
}
.env-tab:hover {
  color: var(--andromede-blue);
  background: var(--andromede-blue-soft);
}
.env-tab.active {
  color: var(--andromede-blue);
  border-bottom-color: var(--andromede-blue);
  background: var(--bg-2);
}
.env-tab[hidden] { display: none; }
.tab-panes {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 0;
}
.tab-pane { display: none; flex: 1; overflow-y: auto; padding: 8px 12px 14px; }
.tab-pane.active { display: flex; flex-direction: column; }

/* Schema graph button (replaces the sidebar subtitle) */
.schema-graph-btn {
  font-family: var(--font-meta);
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all .15s ease;
  margin-left: 8px;
}
.schema-graph-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* cluster section in the sidebar */
.cluster {
  border: none;
  border-top: 1px solid var(--rule-2);
  border-radius: 0;
  padding: 10px 2px 2px;
  background: transparent;
}
.cluster[data-cluster-color="1"],
.cluster[data-cluster-color="5"] { background: transparent; border-color: var(--rule-2); }
.cluster[data-cluster-color="2"],
.cluster[data-cluster-color="6"] { background: transparent; border-color: var(--rule-2); }
.cluster[data-cluster-color="3"],
.cluster[data-cluster-color="7"] { background: transparent; border-color: var(--rule-2); }
.cluster[data-cluster-color="4"] { background: transparent; border-color: var(--rule-2); }
.cluster[data-cluster-color="8"] { background: transparent; border-color: var(--rule-2); }
.cluster-head { margin: 0 2px 7px; }
.cluster-name {
  font-family: var(--font-meta);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--andromede-blue);
  text-transform: uppercase;
}
.cluster-tables { display: flex; flex-direction: column; gap: 6px; }

/* "Basic tools" section in the Environment tools tab - neutral background and
 * a smaller subhead per basic_category (Read/Write/Navigate/Paginate). */
.basic-tools-wrap { background: var(--bg-2); margin-top: 10px; }
.basic-tools-section { background: transparent; padding-top: 2px; padding-bottom: 4px; }
.basic-tools-section + .basic-tools-section { margin-top: 2px; }
.cluster-subhead {
  font-family: var(--font-meta);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  margin: var(--space-2) var(--space-1);
}

/* ───────── table card (sidebar item) ───────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--andromede-hairline);
  border-radius: 5px;
  padding: 7px 8px;
  position: relative;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.card-clickable { cursor: pointer; }
.card:hover {
  border-color: var(--andromede-blue-rule);
  box-shadow: inset 2px 0 0 rgba(63,99,238,0.2);
}
.card.active {
  border-color: var(--andromede-blue-rule);
  box-shadow: inset 2px 0 0 var(--andromede-blue);
  background: var(--bg-2);
}
.card-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
/* Little type-of-table sign next to each table, like the tools section. */
.card-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--andromede-blue);
}
.card-icon svg { width: 13px; height: 13px; display: block; }
.card-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
/* Table name reads as a real title (humanized text), not a mono code token. */
.card-name {
  font-family: var(--font-text);
  font-size: 12.25px;
  font-weight: 650;
  color: var(--andromede-ink);
  cursor: pointer;
  min-width: 0;
  line-height: 1.2;
}
.card-name:hover { color: var(--andromede-blue); }
.card-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  margin-top: 0;
  flex-shrink: 0;
}
.card-actions .pencil:not(.has-note) { display: none; }
.card:hover .card-actions .pencil { display: inline-flex; }
.card-desc {
  font-family: var(--font-text);
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 0;
  line-height: 1.28;
  display: block;
}
.tool-row {
  font-family: var(--font-meta);
  font-size: 11px;
  padding: 2px 0;
  line-height: 1.4;
}
.tool-row .tool-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
}
.tool-row .tool-desc { color: var(--ink-2); }
.tool-row.write .tool-name::before { content: "↺ "; color: var(--accent); }
.edge-out {
  font-family: var(--font-meta);
  font-size: 11px;
  color: var(--ink-2);
  padding: 1px 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.edge-out .edge-target { font-family: var(--font-mono); color: var(--accent); }
.edge-out .edge-card { color: var(--ink-3); margin-left: auto; }

.def-hint {
  color: var(--ink-3);
  font-style: italic;
  font-size: 12px;
  margin: 0;
}

/* ───────── CENTER: inspector ───────── */
.col-center {
  background: var(--bg);
}
.inspector-head {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
  height: 36px;
  flex-shrink: 0;
}
.tabstrip {
  display: flex;
  align-items: stretch;
  flex: 1;
  overflow-x: auto;
}
.tab {
  font-family: var(--font-meta);
  font-size: 12px;
  padding: 8px 12px 8px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
  border-right: 1px solid var(--rule-2);
}
.tab.tab-instructions {
  border-left: 28px solid var(--andromede-blue);
  border-right: 14px solid var(--andromede-blue);
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 700;
  margin-right: 6px;
}
.tab.tab-instructions .tab-ic {
  display: none;
}
.tab.active {
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}
.tab.tab-instructions.active {
  background: var(--bg);
  font-weight: 700;
}
.tab .x { color: var(--ink-3); padding: 0 5px; border-radius: 4px; }
.tab .x:hover { background: var(--rule-2); color: var(--ink); }

.inspector-controls {
  display: flex;
  align-items: center;
  border-left: 1px solid var(--rule);
}
.iconbtn {
  width: 36px; height: 36px;
  border: none; background: transparent;
  cursor: pointer; color: var(--ink-2);
  font-size: 16px;
}
.iconbtn:hover { background: var(--bg); color: var(--ink); }

.inspector-body {
  flex: 1;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}
.inspector-body .pane {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.inspector-body .pane-content {
  overflow: auto;
  padding: 18px 22px 24px;
  flex: 1;
}
.inspector-body .pane.empty .pane-content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-3);
  font-family: var(--font-meta);
  font-size: 13px;
  flex-direction: column;
  gap: 6px;
}
.center-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  position: relative;
  background:
    linear-gradient(var(--andromede-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--andromede-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}
.center-empty::before,
.center-empty::after {
  content: "";
  position: absolute;
  width: 76px;
  height: 36px;
  pointer-events: none;
  opacity: 0.55;
}
.center-empty::before {
  top: 34px;
  left: 42px;
  border-top: 1px solid var(--andromede-blue-2);
  border-left: 1px solid var(--andromede-blue-2);
}
.center-empty::after {
  right: 42px;
  bottom: 34px;
  border-right: 1px solid var(--andromede-blue-2);
  border-bottom: 1px solid var(--andromede-blue-2);
}
.center-empty-card {
  position: relative;
  text-align: center;
  max-width: 460px;
  padding: 78px 42px 34px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(194, 206, 255, 0.75);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(20,22,40,0.06);
}
.center-empty-card::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 50%;
  width: 44px;
  height: 30px;
  transform: translateX(-50%);
  opacity: 0.95;
  background:
    linear-gradient(var(--andromede-blue) 0 0) 0 0 / 100% 1px,
    linear-gradient(var(--andromede-blue) 0 0) 0 50% / 100% 1px,
    linear-gradient(var(--andromede-blue) 0 0) 0 100% / 100% 1px,
    linear-gradient(90deg, var(--andromede-blue) 0 0) 0 0 / 1px 100%,
    linear-gradient(90deg, var(--andromede-blue) 0 0) 33% 0 / 1px 100%,
    linear-gradient(90deg, var(--andromede-blue) 0 0) 66% 0 / 1px 100%,
    linear-gradient(90deg, var(--andromede-blue) 0 0) 100% 0 / 1px 100%;
  background-repeat: no-repeat;
}
.center-empty-card::after {
  content: "+";
  position: absolute;
  top: 47px;
  left: calc(50% + 42px);
  color: var(--andromede-blue);
  font-family: var(--font-mono);
  font-size: 26px;
  line-height: 1;
}
.center-empty-title {
  font-family: var(--font-meta);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.center-empty-sub {
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.center-empty kbd {
  background: var(--andromede-blue-soft);
  border: 1px solid var(--andromede-blue-rule);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}

/* table inspector content (spreadsheet) */
.tt-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.tt-name {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.tt-rowcount {
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink-3);
}
.tt-desc {
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 12px;
  max-width: 90ch;
}
.sheet-wrap {
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: auto;
  background: var(--bg-2);
  max-height: calc(100% - 100px);
}
.sheet {
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  width: max-content;
  min-width: 100%;
}
.sheet thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule-2);
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  z-index: 1;
}
.sheet thead th.col-pk { color: var(--accent); }
.sheet thead th.col-fk {
  color: #226557;
  background: #f6fbf8;
}
.sheet .sheet-col-label {
  display: inline-block;
  vertical-align: middle;
}
.sheet .fk-link-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 17px;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid #9fcbbb;
  border-radius: 3px;
  background: #e8f5ef;
  color: #226557;
  font-family: var(--font-meta);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  vertical-align: middle;
  cursor: help;
}
.sheet .fk-info-icon {
  display: inline-grid;
  place-items: center;
  width: 11px;
  height: 11px;
  border: 1px solid #72ad99;
  border-radius: 50%;
  color: #226557;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}
.sheet .fk-info-icon::before {
  content: "i";
}
.sheet tbody tr:nth-child(even) td { background: var(--bg-3); }
.sheet tbody tr:hover td { background: var(--accent-soft); }
.sheet td {
  border-bottom: 1px solid var(--rule-2);
  border-right: 1px solid var(--rule-2);
  padding: 4px 10px;
  vertical-align: top;
  color: var(--ink);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet td.null { color: var(--ink-3); font-style: italic; }
.sheet tbody td.fk-cell {
  background: #fbfdf9;
  box-shadow: inset 2px 0 0 #9fcbbb;
}
.sheet tbody tr:nth-child(even) td.fk-cell {
  background: #f2faf5;
}
.sheet tbody tr:hover td.fk-cell {
  background: #e9f6ef;
}
.sheet .fk-cell-value {
  text-decoration: underline dotted #3f8f77;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  cursor: help;
}
.fk-floating-tooltip {
  position: fixed;
  z-index: 220;
  max-width: 360px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #15191f;
  color: #fff;
  box-shadow: var(--shadow-md);
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transition: opacity .08s ease;
}
.fk-floating-tooltip.is-visible {
  opacity: 1;
}
.sheet .row-num {
  font-family: var(--font-meta);
  background: var(--bg);
  color: var(--ink-3);
  text-align: right;
  font-size: 10px;
  font-weight: 400;
  position: sticky;
  left: 0;
  z-index: 2;
}

/* ───────── task pane content (inside the floating task panel) ───────── */
.task-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink-2);
}
.task-nav .navbtn {
  width: 24px; height: 24px;
  border: 1px solid var(--support-blue);
  background: var(--bg-2);
  border-radius: 6px;
  cursor: pointer;
  color: var(--support-blue);
  font-weight: 700;
}
.task-nav .navbtn:hover { color: white; background: var(--support-blue); }
.task-nav .progress { color: var(--support-blue); font-size: 11px; font-weight: 600; }

/* A section is a labelled group of fields - no box of its own; the
   fields (questions) are the cards. */
.section {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 14px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 0 6px;
  margin: 0 0 9px;
  border-bottom: 1px solid var(--rule);
}
/* Accent tick before each section title - quiet document cue. */
.section-head::before {
  content: "";
  width: 2px;
  align-self: stretch;
  min-height: 14px;
  border-radius: var(--radius-pill);
  background: var(--andromede-blue);
  flex: none;
}
.section-title {
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.25;
  flex: 1;
}
.section-head .ph-slot { margin-left: auto; }

/* All three review sections share one calm document look; the accent
   tick + title carry the meaning, not full-panel tints. */
.section-task,
.section-rubric,
.section-review {
  background: var(--bg-2);
  border-color: var(--rule);
}
.section-review .section-title { color: var(--ink); }
.section-task .section-title,
.section-rubric .section-title { color: var(--ink-2); }
.section-task .section-head::before,
.section-rubric .section-head::before { background: var(--andromede-blue); }
/* Rubric = reference material ("how it's graded"). Mark it BLUE so it
   reads as separate from the green evaluation questions. */
.section-rubric .section-title { color: var(--ink-2); }
.section-rubric .section-head::before { background: var(--andromede-blue); }
.section-task .task-instruction {
  background: #f6f8ff;
  border: 1px solid var(--andromede-blue-rule);
  border-left: 4px solid var(--andromede-blue);
  box-shadow: inset 0 0 0 1px rgba(85, 103, 216, 0.06);
}
.task-source-index {
  flex: none;
  font-family: var(--font-meta);
  font-size: 10.5px;
  font-weight: 650;
  color: var(--andromede-blue);
  background: var(--bg-2);
  border: 1px solid var(--andromede-blue-rule);
  border-radius: var(--radius-pill);
  padding: 2px 7px;
}
.task-id-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--bg-3);
  border: 1px solid var(--rule-2);
  padding: 2px 7px;
  margin-left: var(--space-2);
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.task-instruction {
  font-family: var(--font-text);
  font-size: 13.5px;
  line-height: 1.52;
  color: var(--ink);
  background: var(--bg-3);
  border: 1px solid var(--rule-2);
  border-radius: 5px;
  padding: 10px;
}

/* ── Grading rubric (reference material) - blue, so "how it's graded"
      reads as separate from the green evaluation questions. ── */
.rubric-source {
  background: #f6f8ff;
  border: 1px solid var(--andromede-blue-rule);
  border-left: 4px solid var(--andromede-blue);
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px rgba(85, 103, 216, 0.06);
}
.rubric-intro {
  font-family: var(--font-text);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
  margin: 0 0 9px;
}
.rubric-intro strong { color: var(--ink); font-weight: 650; }

.expected-entity {
  background: #ffffff;
  border: 1px solid var(--andromede-blue-rule);
  border-radius: 4px;
  padding: 9px 10px;
  margin-bottom: 7px;
}
.expected-entity:last-child { margin-bottom: 0; }
.expected-entity-head {
  font-family: var(--font-text);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.38;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.expected-entity-head > .pencil { margin-left: auto; }
.expected-entity-head .e-state {
  font-family: var(--font-meta);
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Plain-language requirement checklist (replaces the old spec table). */
.rubric-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rubric-check {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 7px;
  align-items: start;
}
.rubric-check-mark {
  width: 4px;
  height: 4px;
  margin-top: 7px;
  border-radius: var(--radius-pill);
  background: var(--andromede-blue);
  justify-self: center;
}
.rubric-check-text {
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}
.rubric-check-field { font-weight: 700; color: var(--ink); }
.rubric-check-req { color: var(--ink-2); }
.rubric-val { font-weight: 600; color: var(--ink); }
.rubric-any { color: var(--ink-3); font-style: italic; font-weight: 400; }
.expected-prop-id { font-family: var(--font-mono); color: var(--ink-3); font-size: 11.5px; }

.constraint {
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  margin-top: 7px;
  padding: 9px 10px;
  border: 1px solid var(--andromede-blue-rule);
  border-left: 3px solid var(--andromede-blue);
  background: #ffffff;
  border-radius: 4px;
}
.constraint-title {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.constraint-expected {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.constraint-expected-label {
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.llm-expected-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  overflow: hidden;
}
.llm-expected-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: top;
}
.llm-expected-table tr:last-child td { border-bottom: none; }
.llm-expected-table td:first-child {
  width: 60%;
  font-weight: 600;
  color: var(--ink);
}
.constraint-criteria {
  margin: 4px 0 0;
  padding-left: 20px;
}
.constraint-criteria li {
  margin: 2px 0;
}
.constraint-criteria code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink);
}

/* Group heading - a quiet "Section A" cue inside a form. */
.qgroup-head {
  font-family: var(--font-meta);
  font-size: var(--text-eyebrow);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: var(--space-6) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--rule);
}
.qgroup-head:first-child { margin-top: 0; }

/* Each question is a discrete form-field card / checklist item that
   visibly fills in when answered. */
.question {
  background: var(--bg-2);
  border: 1px solid var(--andromede-hairline);
  border-radius: 5px;
  padding: 10px;
  margin: 0 0 7px;
  position: relative;
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.question:last-child { margin-bottom: 0; }
.question.answered {
  background: var(--bg-2);
  border-color: var(--andromede-blue-rule);
  box-shadow: inset 1px 0 0 var(--andromede-blue);
}

.question .qtitle {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 7px;
  color: var(--ink);
  line-height: 1.45;
  display: grid;
  grid-template-columns: 19px 1fr;
  gap: 7px;
  align-items: start;
}
/* Numbered checklist marker - checks off when answered. */
.question .qnum {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--andromede-blue-rule);
  color: var(--andromede-blue);
  font-family: var(--font-meta);
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1;
  transition: background .14s ease, color .14s ease;
}
.question.answered .qnum {
  background: var(--bg-2);
  border-color: var(--andromede-blue-rule);
  color: transparent;
}
.question.answered .qnum::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--andromede-blue);
  font-size: 10px;
  font-weight: 650;
}
.question .qtitle-text { padding-top: 0; }

.question .qhelp {
  font-family: var(--font-text);
  font-size: var(--text-caption);
  font-weight: 400;
  font-style: normal;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 7px 0;
  padding: 6px 8px;
  border-left: 1px solid var(--andromede-blue-rule);
  background: var(--bg-2);
  border-radius: 0 5px 5px 0;
}
.question .qpreface { margin-bottom: var(--space-3); }
.question .qanchors {
  font-family: var(--font-text);
  font-size: var(--text-caption);
  color: var(--ink-3);
  margin: 0 0 var(--space-2) 0;
  font-style: normal;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-3);
  border-left: 2px solid var(--rule);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* Inputs align under the question text, past the marker column. */
.question .qrate,
.question .qchoices,
.question .text-editor,
.question .qrate-comment { margin-left: 0; }
.question .qrate + .text-editor,
.question .qchoices + .text-editor,
.question .qchoice-instruction + .text-editor { margin-top: var(--space-2); }
.question textarea {
  width: 100%;
  min-height: 116px;
  border: 1px solid var(--andromede-hairline);
  border-radius: 5px;
  padding: 10px;
  font-family: var(--font-text);
  font-size: var(--text-body);
  background: var(--bg-2);
  resize: vertical;
  color: var(--ink);
  line-height: 1.5;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.question textarea:focus-visible {
  outline: none;
  border-color: var(--andromede-blue);
  box-shadow: 0 0 0 2px var(--andromede-blue-soft);
}
.question textarea::placeholder { color: var(--ink-4); }
.question textarea.qrate-comment {
  min-height: 64px;
}
.question .text-editor-surface.qrate-comment { min-height: 64px; }
.question.question-long > .text-editor .text-editor-surface:not(.qrate-comment) { min-height: 232px; }
.review-rail[data-width="wide"] .question.question-long > .text-editor .text-editor-surface:not(.qrate-comment),
.review-rail[data-width="custom"] .question.question-long > .text-editor .text-editor-surface:not(.qrate-comment) { min-height: 280px; }

.supporting-resources {
  background: var(--bg-2);
  border: 1px solid var(--andromede-hairline);
  border-radius: 5px;
  padding: 10px;
}
.supporting-resources-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.supporting-resources-copy {
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
}
.supporting-resource-add,
.supporting-resource-remove {
  flex: none;
  border: 1px solid var(--andromede-blue-rule);
  background: var(--bg-2);
  color: var(--andromede-blue);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.supporting-resource-add:hover,
.supporting-resource-remove:hover {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue);
}
.supporting-resource-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 10px;
}
.supporting-resource-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  background: var(--bg-3);
  padding: 10px;
}
.supporting-resource-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.supporting-resource-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.supporting-resource-field-wide { grid-column: 1 / -1; }
.supporting-resource-field span {
  font-family: var(--font-meta);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.supporting-resource-field input,
.supporting-resource-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--andromede-hairline);
  border-radius: 5px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.35;
  padding: 8px 9px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.supporting-resource-field textarea {
  min-height: 76px;
  resize: vertical;
}
.supporting-resource-field input:focus-visible,
.supporting-resource-field textarea:focus-visible {
  outline: none;
  border-color: var(--andromede-blue);
  box-shadow: 0 0 0 2px var(--andromede-blue-soft);
}
.supporting-resource-remove {
  color: var(--ink-3);
  border-color: var(--rule-2);
  padding: 6px 9px;
}
.supporting-resource-remove:hover {
  color: var(--andromede-blue);
}
.supporting-resource-empty {
  margin-top: 9px;
  border: 1px dashed var(--andromede-blue-rule);
  border-radius: 5px;
  padding: 10px;
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink-3);
  background: var(--bg-3);
}

@media (max-width: 760px) {
  .supporting-resources-head {
    flex-direction: column;
    align-items: stretch;
  }
  .supporting-resource-card {
    grid-template-columns: 1fr;
  }
  .supporting-resource-fields {
    grid-template-columns: 1fr;
  }
}

/* clickable ordinal scale */
.qrate { margin: var(--space-2) 0 var(--space-1); }
.qrate-scale {
  display: flex;
  gap: 4px;
  align-items: stretch;
}
.qrate-btn {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--andromede-hairline);
  background: var(--bg-2);
  border-radius: 4px;
  font-family: var(--font-meta);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .06s ease;
  box-shadow: none;
}
.qrate-btn:hover {
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
  background: var(--bg-2);
}
.qrate-btn:focus-visible {
  outline: none;
  border-color: var(--andromede-blue);
  box-shadow: 0 0 0 2px var(--andromede-blue-soft);
}
.qrate-btn:active { transform: translateY(1px); }
.qrate-btn.selected {
  background: var(--bg-2);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
  box-shadow: inset 0 -1px 0 var(--andromede-blue);
}
.qrate-number { display: inline-block; }
.qrate-optout {
  flex: none;
  width: auto;
  height: auto;
  min-height: 0;
  margin-top: var(--space-2);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  color: var(--ink-3);
  font-family: var(--font-text);
  font-size: 12px;
  font-style: italic;
  font-weight: 500;
}
.qrate-optout:hover,
.qrate-optout:focus-visible {
  background: transparent;
  color: var(--support-rose);
  border-color: transparent;
  box-shadow: none;
}
.qrate-optout.selected {
  background: transparent;
  border-color: transparent;
  color: var(--support-rose);
  box-shadow: none;
}
.qrate-optout.selected .qrate-optout-text {
  color: var(--support-rose);
}
.qrate-optout-box {
  width: 15px;
  height: 15px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg-2);
  display: inline-grid;
  place-items: center;
  flex: none;
  color: transparent;
  font-family: var(--font-meta);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}
.qrate-optout.selected .qrate-optout-box {
  background: var(--support-rose);
  border-color: var(--support-rose);
  color: #fff;
}
.qrate-vertical .qrate-scale {
  flex-direction: column;
  gap: var(--space-2);
}
.qrate-vertical-btn {
  flex: none;
  min-height: 48px;
  height: auto;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: var(--space-3);
  text-align: left;
  padding: var(--space-3);
}
.qrate-vertical-btn .qrate-number {
  font-family: var(--font-meta);
  font-size: var(--text-h3);
  font-weight: 700;
  text-align: center;
}
.qrate-vertical-label {
  font-family: var(--font-text);
  font-size: var(--text-caption);
  font-weight: 500;
  line-height: 1.4;
  color: inherit;
}
.qrate-anchors {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-family: var(--font-text);
  font-size: var(--text-caption);
  color: var(--ink-2);
  font-style: normal;
  font-weight: 500;
}
.qrate-anchor-low  { text-align: left;  }
.qrate-anchor-high { text-align: right; }
/* Labels-per-button variant: each anchor sits under its own scale button. */
.qrate-anchors-all {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--space-2);
  font-style: normal;
}
.qrate-anchors-all .qrate-anchor-cell {
  text-align: center;
  line-height: 1.3;
  padding: 0 2px;
  hyphens: auto;
  overflow-wrap: anywhere;
}
.qscale-lines {
  font-family: var(--font-text);
  font-size: var(--text-caption);
  font-weight: 400;
  font-style: normal;
  color: var(--ink-2);
  line-height: 1.5;
  margin-top: var(--space-2);
}

.qchoices {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 7px;
}
.qchoice-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--andromede-hairline);
  background: var(--bg-2);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-text);
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .06s ease;
  box-shadow: none;
}
.qchoice-btn:hover {
  border-color: var(--andromede-blue-rule);
  background: var(--bg-2);
}
.qchoice-btn:focus-visible {
  outline: none;
  border-color: var(--andromede-blue);
  box-shadow: 0 0 0 2px var(--andromede-blue-soft);
}
.qchoice-btn:active { transform: translateY(1px); }
.qchoice-btn.selected {
  border-color: var(--andromede-blue-rule);
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: inset 1px 0 0 var(--andromede-blue);
}
.qchoice-label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
}
.qchoice-desc {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--font-text);
  font-size: var(--text-caption);
  color: var(--ink-2);
  line-height: 1.5;
}
.qchoice-instruction {
  margin: var(--space-3) 0 0 38px;
  font-family: var(--font-text);
  font-size: var(--text-caption);
  font-weight: 400;
  font-style: normal;
  color: var(--ink-2);
}

/* ───────── pencil / sticky-note ───────── */
.pencil {
  border: 1px solid var(--accent-soft);
  background: var(--bg-2);
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 600;
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: opacity .12s ease, transform .12s ease, background .12s, color .12s, border-color .12s;
}
.pencil:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.pencil.has-note {
  background: var(--note-bg);
  border-color: var(--note-border);
  color: var(--accent);
}
/* Pencils retired — annotate by highlighting text. No pencil renders, and none
   are created (Notes.attach no longer builds a button), so they stay hidden. */
.pencil .pencil-icon { font-size: 13px; line-height: 1; }
.pencil .pencil-label { font-size: 10.5px; }
.pencil.icon-only {
  width: 26px;
  height: 26px;
  padding: 0;
  justify-content: center;
}
.pencil.icon-only .pencil-label { display: none; }
.pencil .note-count {
  font-size: 9.5px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 0 5px;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  text-align: center;
  font-weight: 700;
  margin-left: 1px;
}

#note-popovers { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.note {
  position: absolute;
  pointer-events: auto;
  width: 360px;
  /* Never taller than the viewport, so the Save/Delete row stays on-screen.
     Body scrolls internally; head and actions stay pinned. */
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  border-radius: 8px;
  padding: 10px 12px 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.16);
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--ink);
}
.note .note-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
/* Editor is the flex body: it takes the leftover height and scrolls its
   content rather than growing the whole popover past the viewport. */
.note .text-editor {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.note .text-editor-toolbar { flex: 0 0 auto; }
.note .text-editor-surface { flex: 1 1 auto; overflow-y: auto; }
.note .note-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.note .note-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-3);
  padding: 0 4px;
  font-size: 18px;
  line-height: 1;
}
.note textarea {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--note-border);
  border-radius: 5px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.7);
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--ink);
  resize: vertical;
  line-height: 1.5;
}
.note .note-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  gap: 6px;
}
.note .note-actions button {
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--note-border);
  background: var(--bg-2);
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
}
.note .note-actions .save { background: var(--accent); color: white; border-color: var(--accent); }
.note .note-actions .save:hover { filter: brightness(1.05); }
.note .note-actions .delete:hover { background: var(--accent-soft); color: var(--accent); }

.annot-target-open {
  outline: 2px solid var(--note-border);
  outline-offset: 2px;
  border-radius: 6px;
}
@keyframes jumpFlash {
  0% { background-color: var(--note-bg); }
  100% { background-color: transparent; }
}
.jump-flash { animation: jumpFlash 1.6s ease-out; }

/* ───────── notes overview modal ───────── */
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(29,29,27,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 64px;
  overflow-y: auto;
}
.modal {
  width: min(720px, 92vw);
  background: var(--bg-2);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.32);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 100px);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--rule);
  background: var(--bg-3);
}
.modal-head h2 { margin: 0; font-family: var(--font-text); font-size: 18px; }
.modal-body {
  overflow-y: auto; padding: 18px 22px 28px;
  font-family: var(--font-meta);
}

/* ───────── orientation modal (extends .modal) ───────── */
.modal.orientation-modal {
  width: min(760px, 94vw);
  border-top: 3px solid var(--accent);
}
.orientation-body {
  padding: 6px 28px 22px;
  font-family: var(--font-text);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
}
.orient-section {
  padding: 18px 0 4px;
  border-bottom: 1px solid var(--rule-2);
}
.orient-section:last-of-type { border-bottom: none; }
.orient-h {
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.orient-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  min-width: 30px;
  justify-content: center;
}
.orientation-body p {
  margin: 0 0 12px;
  color: var(--ink-2);
}
.orient-example {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
  padding: 10px 14px 11px;
  margin: 4px 0 14px;
  font-family: var(--font-text);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}
.orient-example-tag {
  display: inline-block;
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
  vertical-align: 1px;
}
.orientation-body p strong { color: var(--ink); font-weight: 600; }
.orientation-body em { font-style: italic; color: var(--ink); }
.orient-judge-lede { margin-top: 4px !important; }
.orient-judge-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.orient-judge-list li {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
}
.orient-judge-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.orient-judge-list li strong { color: var(--ink); font-weight: 600; }

/* icon-prefixed list (used in "What you will judge") */
.orient-icon-list li {
  padding-left: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.orient-icon-list li::before { display: none; }
.orient-item-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  border: 1px solid var(--rule-2);
  background: var(--bg-3);
  margin-top: 1px;
}
.orient-item-icon[data-kind="tables"]  { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.orient-item-icon[data-kind="files"]   { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.orient-item-icon[data-kind="tools"]   { background: #F1F2FB; border-color: #C8CEF1; color: #5567D8; }
.orient-item-icon[data-kind="schema"]  { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.orient-item-icon[data-kind="tasks"]   { background: var(--accent-panel); border-color: var(--accent-rule); color: var(--accent); }
.orient-item-icon[data-kind="outputs"] { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.orient-item-icon[data-kind="grading"] { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.sketch-icon {
  width: 100%;
  height: 100%;
  display: block;
}
.orient-item-icon {
  width: 34px;
  height: 34px;
  padding: 4px;
}
.orient-item-body {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.orient-item-body strong { color: var(--ink); font-weight: 600; }
.orient-inline-tool {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #5567D8;
  font-weight: 600;
  white-space: nowrap;
}
.orient-inline-tool-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(2px);
}
.orient-inline-tool-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}
.orient-table-caption {
  margin: 14px 0 6px !important;
  font-size: 13.5px;
  color: var(--ink-2);
}
.orient-mini-table {
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin: 0 0 12px;
  min-width: 280px;
}
.orient-mini-table th,
.orient-mini-table td {
  padding: 5px 12px;
  text-align: left;
  border-bottom: 1px solid var(--rule-2);
  border-right: 1px solid var(--rule-2);
}
.orient-mini-table th {
  background: var(--bg-3);
  color: var(--ink);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.orient-mini-table tr:last-child td { border-bottom: none; }
.orient-mini-table th:last-child,
.orient-mini-table td:last-child { border-right: none; }
.orientation-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-3);
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--ink);
}
.orient-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.orient-actions-meta {
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink-3);
}
.orient-actions-meta strong { color: var(--ink-2); font-weight: 600; }
.orient-primary {
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: transform .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.orient-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79,96,200,0.30), 0 2px 6px rgba(79,96,200,0.16);
}

/* ── orientation: customer-support example scene (section 01) ── */
.orient-example-scene {
  padding: 12px 16px 14px;
}
.orient-scene-title {
  font-family: var(--font-text);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0 12px;
}
.orient-scene-resources {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.orient-scene-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  text-align: center;
}
.orient-scene-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--rule-2);
  background: var(--bg-3);
  padding: 6px;
  flex-shrink: 0;
}
.orient-scene-icon[data-kind="tables"]  { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.orient-scene-icon[data-kind="files"]   { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.orient-scene-icon[data-kind="tools"]   { background: #F1F2FB; border-color: #C8CEF1; color: #5567D8; }
.orient-scene-icon[data-kind="tasks"]   { background: var(--accent-panel); border-color: var(--accent-rule); color: var(--accent); }
.orient-scene-icon-lg {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  padding: 7px;
}
.orient-scene-label {
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.orient-scene-task {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 12px;
}
.orient-scene-task-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.orient-scene-task-head .orient-scene-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.orient-scene-task-text {
  flex: 1;
  font-family: var(--font-text);
  font-size: 13.5px;
  line-height: 1.55;
  font-style: italic;
  color: var(--ink);
  padding-top: 4px;
}
.orient-scene-tools-intro {
  margin: 0 0 10px !important;
  font-size: 13.5px !important;
  color: var(--ink) !important;
}
.orient-scene-tools-intro strong { color: var(--ink); font-weight: 600; }
.orient-scene-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  padding: 11px 12px;
}
.orient-scene-tool-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
.orient-scene-tool-btn {
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 600;
  color: #5567D8;
  background: #F1F2FB;
  border: 1px solid #C8CEF1;
  border-radius: 6px;
  padding: 6px 10px;
  white-space: nowrap;
}
.note-card {
  border: 1px solid var(--note-border);
  background: var(--note-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.note-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.note-card-label {
  font-family: var(--font-meta);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.note-card-actions { display: flex; gap: 6px; }
.note-card-actions button {
  font-family: var(--font-meta);
  font-size: 11px;
  border: 1px solid var(--note-border);
  background: var(--bg-2);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
}
.note-card-actions button:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.note-card-text {
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--ink);
}
.note-card-ts {
  font-family: var(--font-meta);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ───────── notes tab ───────── */
.notes-pane {
  min-height: 100%;
  background: #e7e5df;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.notes-doc {
  max-width: 920px;
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 12px 34px rgba(20,22,40,0.12);
  padding: 34px 42px 44px;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.notes-doc-head {
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 18px;
  margin-bottom: 18px;
}
.notes-doc-kicker {
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.notes-doc-title {
  font-family: var(--font-text);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-top: 4px;
}
.notes-doc-sub {
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 6px;
}
.journal-composer {
  background: #fbfaf7;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: min(680px, 62vh);
}
.journal-context {
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.journal-composer .text-editor { flex: 1; display: flex; flex-direction: column; }
.journal-composer .text-editor-surface {
  flex: 1;
  min-height: 420px;
  padding: 20px 24px;
  font-size: 16px;
  line-height: 1.7;
}
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}
.notes-pane .note-card {
  margin-bottom: 0;
  background: var(--bg-2);
}

/* ── annotations report (center "My annotations" tab) — document style ── */
.report-pane { background: #e7e5df; }
.report-doc { padding: 50px 58px 64px; max-width: 880px; }

/* document title block */
.report-doc-head {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: 30px;
}
.report-doc-kicker {
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--andromede-blue);
}
.report-doc-title {
  font-family: var(--font-text);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin: 8px 0 0;
}
.report-doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 13px;
  font-family: var(--font-meta);
  font-size: 12.5px;
  color: var(--ink-3);
}
.report-doc-meta span + span::before {
  content: "·";
  margin-right: 14px;
  color: var(--rule);
}

/* reviewer summary — a quiet document block, not a giant input */
.report-summary { margin-bottom: 36px; }
.report-summary-box {
  flex: 0 0 auto;
  background: #fbfaf7;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 4px 8px;
  min-height: 120px;
  margin: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.report-summary-box .text-editor { flex: 1; display: flex; flex-direction: column; }
.report-summary-box .text-editor-surface {
  flex: 1;
  min-height: 92px;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.6;
}

/* section heading: "Data tables", "Tools", … */
.report-section { margin-bottom: 32px; }
.report-section-h {
  font-family: var(--font-text);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 17px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule);
}

/* numbered item: "1. Auth Clinical Criteria" / "1. Get Bottleneck Analysis" */
.report-item { margin: 0 0 22px; }
.report-item:last-child { margin-bottom: 0; }
.report-item-h {
  font-family: var(--font-text);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 9px;
}
.report-item-num { color: var(--ink-3); margin-right: 5px; }

/* field subheading: "Table-level", "criteria_id" */
.report-field { margin: 0 0 13px; }
.report-field:last-child { margin-bottom: 0; }
.report-field-h {
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 0 0 5px;
}
.report-field-h.report-field-col {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--andromede-blue);
}

/* finding prose */
.report-finding {
  position: relative;
  padding: 1px 110px 1px 14px;
  margin: 0 0 7px;
  border-left: 2px solid var(--rule-2);
}
.report-finding:last-child { margin-bottom: 0; }
.report-finding:hover { border-left-color: var(--andromede-blue-rule); }
.report-finding-text {
  font-family: var(--font-text);
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink);
  margin: 0;
}
.report-finding-cx { font-weight: 700; color: var(--ink-2); }
.report-finding-link {
  margin: 2px 0 0;
  font-family: var(--font-meta);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}
.report-link-icon {
  color: var(--andromede-blue);
  font-weight: 700;
  margin-right: 2px;
}
.report-link-to { font-weight: 600; color: var(--ink-2); }
.report-finding-tools {
  position: absolute;
  top: 2px;
  right: 0;
  display: inline-flex;
  gap: 10px;
  opacity: 0;
  transition: opacity .12s ease;
}
.report-finding:hover .report-finding-tools { opacity: 1; }
.report-finding-tools button {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-meta);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
}
.report-finding-tools button:hover { color: var(--andromede-blue); text-decoration: underline; }
.report-finding-tools .delete:hover { color: #c4453f; }
.report-empty { margin-top: 8px; }

/* ───────── annotations (always on — no mode) ───────── */
[data-highlight-root] {
  cursor: text;
}
/* Per-column annotation pencil tucked into the header's top-right corner.
   (the sticky <th> is its own containing block, so absolute positions to it) */
.sheet thead th .pencil {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0;
}
.sheet thead th .pencil .pencil-icon { font-size: 11px; }
.sheet thead th .pencil .note-count { display: none; }
.sheet thead th[data-annot-key]:hover { padding-right: 30px; }
.sheet thead th:has(.pencil.has-note) { padding-right: 30px; }
.annot-highlight {
  background: #FCE0E0;
  border-bottom: 1px solid #E5484D;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  cursor: pointer;
}
.annot-highlight:hover {
  background: #F9C9C9;
  border-bottom-color: #C62A2F;
}
.annot-highlight-linked {
  box-shadow: 0 0 0 1px rgba(229,72,77,0.45);
}
.annot-highlight-pending-link {
  outline: 2px solid rgba(229,72,77,0.75);
  outline-offset: 1px;
}
.annot-linked-target {
  outline: 2px solid rgba(229,72,77,0.72);
  outline-offset: -2px;
  background: #FCE0E0 !important;
}
.sheet tr.annot-linked-target > td {
  background: #FCE0E0 !important;
  box-shadow: inset 0 -1px 0 #E5484D, inset 0 1px 0 rgba(229,72,77,0.35);
}
.annotation-connectors {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 145;
  pointer-events: none;
  overflow: visible;
}
.annotation-connectors line {
  stroke: #E5484D;
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Floating annotation menu shown above a fresh text selection. */
.selection-annot-menu {
  position: fixed;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--andromede-blue-rule);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  animation: scb-pop .1s ease;
}
.selection-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px 7px 8px;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-2);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.selection-comment-btn + .selection-comment-btn { border-left: 1px solid var(--andromede-blue-rule); }
.selection-comment-btn:hover {
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
}
.selection-comment-btn .scb-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1px solid var(--andromede-blue-rule);
  border-radius: 6px;
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
}
.selection-comment-btn .scb-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.annotation-link-banner {
  position: fixed;
  left: 50%;
  top: 62px;
  z-index: 205;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-2);
  border: 1px solid rgba(229,72,77,0.35);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}
.annotation-link-banner button {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  padding: 3px 7px;
  cursor: pointer;
}
body.annotation-linking [data-annot-key],
body.annotation-linking [data-highlight-root] {
  cursor: crosshair;
}
@keyframes scb-pop { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ───────── file card variant ───────── */
.file-card .card-name {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
}
.file-card .file-original {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ───────── inline PDF viewer ───────── */
.pdf-canvas-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-3);
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: auto;
  max-height: calc(100% - 60px);
}
.pdf-page {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  background: var(--bg-2);
}

.tool-card .tool-long-desc {
  font-family: var(--font-text);
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 4px;
  line-height: 1.5;
}

/* ───────── tools catalog ───────── */
.tools-pane {
  padding: 0;
  gap: 0;
}
.tools-nav {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}
.tools-main-catalog {
  height: 100%;
  min-height: 620px;
  border: 1px solid #9fbdc9;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #f7fbfc 0%, #ffffff 220px);
  box-shadow: 0 8px 24px rgba(73,109,134,0.10), var(--shadow-sm);
}
.tools-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #9fbdc9;
  background:
    linear-gradient(90deg, rgba(73,109,134,0.12) 0 4px, transparent 4px),
    linear-gradient(180deg, #f7fbfc 0%, #e8eef2 100%);
  flex-shrink: 0;
}
.tools-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tools-catalog-title {
  font-family: var(--font-text);
  font-size: 26px;
  line-height: 1.05;
  font-weight: 800;
  color: var(--ink);
}
.tools-catalog-count {
  font-family: var(--font-meta);
  font-size: 11.5px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--support-blue);
}
.tools-catalog-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #b9c9cf;
  border-radius: 8px;
  background: rgba(255,255,255,0.78);
}
.tools-catalog-tab {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-meta);
  font-size: 11.5px;
  line-height: 1;
  font-weight: 800;
  padding: 7px 10px;
  cursor: pointer;
}
.tools-catalog-tab:hover {
  color: var(--ink);
  background: var(--accent-soft);
}
.tools-catalog-tab.active {
  color: #fff;
  background: var(--support-blue);
  box-shadow: 0 1px 2px rgba(45,74,96,0.18);
}
.tools-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid #c9d8de;
  background: #f3f7f8;
  flex-shrink: 0;
}
.tools-main-catalog .tools-filters {
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 0.85fr) minmax(140px, 190px) minmax(150px, 190px) minmax(180px, 0.85fr);
  align-items: center;
}
.tools-search,
.tools-multi-select,
.tools-filter {
  width: 100%;
  min-height: 30px;
}
.tools-search {
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-meta);
  font-size: 12px;
  padding: 6px 8px;
}
.tools-multi-select {
  position: relative;
  font-family: var(--font-meta);
  font-size: 12px;
}
.tools-multi-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--ink);
  padding: 6px 8px;
  cursor: pointer;
  list-style: none;
}
.tools-multi-select summary::-webkit-details-marker {
  display: none;
}
.tools-multi-select[open] summary {
  border-color: var(--accent-rule);
  box-shadow: 0 0 0 2px rgba(47,111,79,0.08);
}
.tools-multi-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tools-multi-caret {
  color: var(--ink-3);
  font-size: 11px;
  flex-shrink: 0;
}
.tools-multi-menu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 5px);
  left: 0;
  width: min(420px, 80vw);
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--accent-rule);
  border-radius: 8px;
  background: var(--bg-2);
  box-shadow: var(--shadow-md);
  padding: 6px;
}
.tools-multi-options {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 4px;
  border-top: 1px solid var(--rule-2);
}
.tools-multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border-radius: 6px;
  padding: 5px 7px;
  color: var(--ink-2);
  cursor: pointer;
}
.tools-multi-option:hover {
  background: var(--accent-soft);
  color: var(--ink);
}
.tools-multi-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.tools-multi-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tools-multi-all {
  font-weight: 800;
  color: var(--ink);
}
.tools-filter {
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-meta);
  font-size: 12px;
  padding: 6px 8px;
}
.tools-view-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 12px 14px 16px;
}
.tools-main-catalog .tools-view-body {
  padding: 16px 18px 20px;
}
.tools-table-wrap {
  overflow: auto;
  border: 1px solid #9fbdc9;
  border-radius: 7px;
  background: var(--bg-2);
  box-shadow: 0 1px 0 rgba(73,109,134,0.10), var(--shadow-xs);
}
.tools-data-table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-family: var(--font-meta);
  font-size: 11.5px;
  line-height: 1.28;
}
.tools-data-table th,
.tools-data-table td {
  position: relative;
  min-width: 0;
  max-width: none;
  padding: 0;
  border-bottom: 1px solid var(--rule-2);
  border-right: 1px solid var(--rule-2);
  vertical-align: top;
  text-align: left;
  background: var(--bg-2);
}
.tools-data-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #dce8ed;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 800;
  user-select: none;
}
.tools-data-table th:first-child {
  left: 0;
  z-index: 6;
}
.tools-data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-2);
}
.tools-data-table tbody tr:nth-child(even) td,
.tools-data-table tbody tr:nth-child(even) td:first-child { background: #f8fbfc; }
.tools-data-table tbody tr:hover td,
.tools-data-table tbody tr:hover td:first-child { background: var(--accent-soft); }
.tools-data-table th button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.tools-data-table tr:last-child td { border-bottom: 0; }
.tools-th-inner,
.tools-cell-clip {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tools-th-inner {
  position: relative;
  min-height: 34px;
  padding: 7px 20px 7px 8px;
  white-space: nowrap;
}
.tools-cell-clip {
  height: var(--tools-row-h, 48px);
  max-height: var(--tools-row-h, 48px);
  padding: 6px 8px;
}
.tools-col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 7px;
  cursor: col-resize;
  z-index: 8;
}
.tools-col-resizer::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 3px;
  width: 2px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  opacity: 0;
  transition: opacity .12s ease;
}
.tools-col-resizer:hover::after,
.tools-col-resizer.dragging::after { opacity: 1; }
.tools-row-resizer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 7px;
  cursor: row-resize;
  z-index: 5;
}
.tools-row-resizer::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  opacity: 0;
  transition: opacity .12s ease;
}
.tools-row-resizer:hover::after,
.tools-row-resizer.dragging::after { opacity: 1; }
body.resizing-tools-grid {
  cursor: col-resize;
  user-select: none;
}
body.resizing-tools-grid-y {
  cursor: row-resize;
  user-select: none;
}
.tools-table-tool {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 150px;
}
.tool-row-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.tool-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--support-blue);
}
.tool-definition-cell {
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
}
.tool-result-cell {
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}
.tools-note-host {
  display: inline-flex;
  flex-shrink: 0;
}
.tool-muted,
.tools-empty {
  color: var(--ink-3);
  font-style: italic;
}

/* ───────── tool logic cards ───────── */
.tool-logic-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.tool-logic-card {
  border: 1px solid #b9c9cf;
  border-radius: 8px;
  background: var(--bg-2);
  box-shadow: 0 1px 0 rgba(73,109,134,0.08), var(--shadow-xs);
  overflow: hidden;
}
.tool-logic-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 16px;
  border-bottom: 1px solid #d7e2e6;
  background: #f6fafb;
}
.tool-logic-title-block {
  min-width: 0;
  flex: 1 1 auto;
}
.tool-logic-eyebrow {
  font-family: var(--font-meta);
  font-size: 9.5px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--support-blue);
  text-transform: uppercase;
}
.tool-logic-card h2 {
  margin: 0 0 2px;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: 0;
}
.tool-logic-code-name {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}
.tool-logic-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tool-logic-touch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--rule-2);
  background: #fbfdfe;
}
.tool-logic-table-chip,
.tool-logic-output-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #c9d8de;
  border-radius: 5px;
  background: #f7fbfc;
  color: var(--support-blue);
  font-family: var(--font-meta);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
}
.tool-logic-grid {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
}

/* ── Per-tool flowchart (replaces the 6-section Tool Logic grid) ── */
.tool-flow-meta {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  max-width: 1060px;
}
.tool-flow-meta-row {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.45;
}
.tool-flow-meta-label {
  color: var(--support-blue);
  font-family: var(--font-meta);
  font-size: 10px;
  line-height: 1.35;
  font-weight: 900;
  text-transform: uppercase;
}
.tool-flow-meta-value {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.tool-inline-token {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 700;
  color: #28305f;
}
.tool-flow-details {
  border-top: 1px solid var(--andromede-blue-rule);
  background: #f5f8ff;
}
.tool-flow-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 9px 14px 9px 12px;
  border-left: 4px solid var(--andromede-blue);
  background: linear-gradient(180deg, #f5f7ff 0%, #eef3ff 100%);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 900;
}
.tool-flow-summary:hover {
  background: linear-gradient(180deg, #f0f4ff 0%, #e8efff 100%);
}
.tool-flow-summary:focus-visible {
  outline: 2px solid rgba(63,99,238,0.34);
  outline-offset: -2px;
}
.tool-flow-summary::-webkit-details-marker {
  display: none;
}
.tool-flow-summary-left,
.tool-flow-summary-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tool-flow-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid rgba(63,99,238,0.24);
  border-radius: 6px;
  background: rgba(63,99,238,0.08);
  color: var(--andromede-blue);
}
.tool-flow-summary-icon svg {
  width: 16px;
  height: 16px;
}
.tool-flow-summary-meta {
  color: var(--andromede-blue);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.tool-flow-summary-caret {
  color: var(--andromede-blue);
  transition: transform .14s ease;
}
.tool-flow-details[open] .tool-flow-summary {
  border-bottom: 1px solid var(--andromede-blue-rule);
}
.tool-flow-details[open] .tool-flow-summary-caret {
  transform: rotate(180deg);
}
.tool-flow-wrap {
  padding: 16px 18px 22px;
  background: var(--bg-2);
  overflow-x: auto;
}
.tool-flow-mermaid {
  margin: 0;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  min-height: 80px;
}
/* Mermaid renders SVG inside the pre - make sure it doesn't get clipped. */
.tool-flow-mermaid svg {
  max-width: 100%;
  height: auto;
}
.tool-logic-section {
  display: grid;
  grid-template-columns: minmax(155px, 0.23fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  background: var(--bg-2);
  padding: 8px 12px;
  border-top: 1px solid var(--rule-2);
}
.tool-logic-section-head {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 0;
  font-family: var(--font-meta);
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 900;
  color: var(--ink);
}
.tool-logic-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--support-blue);
  color: #fff;
  font-size: 9.5px;
  flex: 0 0 18px;
}
.tool-logic-section-body {
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 1.38;
  color: var(--ink-2);
}
.tool-logic-section-body p {
  margin: 0;
}
.tool-logic-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tool-logic-input {
  min-width: 170px;
  flex: 1 1 190px;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 6px 7px;
}
.tool-logic-input-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.tool-logic-input-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}
.tool-logic-input-req {
  border-radius: 999px;
  background: #eef5f8;
  color: var(--support-blue);
  font-family: var(--font-meta);
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tool-logic-input-type,
.tool-logic-input-default {
  margin-top: 4px;
  font-family: var(--font-meta);
  font-size: 10px;
  color: var(--ink-3);
}
.tool-logic-input-desc {
  margin-top: 4px;
  color: var(--ink-2);
}
.tool-logic-dataset {
  display: grid;
  gap: 4px;
}
.tool-logic-dataset-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.tool-logic-dataset-label,
.tool-logic-writeout-label {
  color: var(--ink-3);
  font-family: var(--font-meta);
  font-size: 9.5px;
  line-height: 1.3;
  font-weight: 900;
  text-transform: uppercase;
}
.tool-logic-column-groups {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}
.tool-logic-column-group {
  display: grid;
  grid-template-columns: minmax(88px, 0.2fr) minmax(0, 1fr);
  gap: 6px;
  border: 1px solid var(--rule-2);
  border-radius: 5px;
  background: #fbfcfd;
  padding: 4px 6px;
}
.tool-logic-column-table {
  color: var(--support-blue);
  font-family: var(--font-meta);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 900;
}
.tool-logic-column-fields {
  color: var(--ink-3);
  font-family: var(--font-meta);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tool-logic-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 17px;
}
.tool-logic-steps li {
  padding-left: 2px;
}
.tool-logic-step-title {
  margin-bottom: 2px;
  color: var(--ink);
  font-family: var(--font-meta);
  font-size: 11.5px;
  font-weight: 900;
}
.tool-logic-formula {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding: 5px 7px;
  border: 1px solid #d8e3e6;
  border-radius: 6px;
  background: #f7fafb;
}
.tool-logic-formula code {
  color: #1f4f5f;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.28;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tool-logic-bullets {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 17px;
}
.tool-logic-output-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.tool-logic-writeout {
  margin-top: 7px;
  border-top: 1px solid var(--rule-2);
  padding-top: 6px;
}
.tool-logic-muted,
.tool-logic-empty {
  color: var(--ink-3);
  font-style: italic;
}

@media (max-width: 960px) {
  .tools-catalog-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .tools-main-catalog .tools-filters {
    grid-template-columns: 1fr;
  }
  .tool-logic-grid {
    display: flex;
  }
  .tool-logic-section {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .tool-flow-meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .tool-logic-column-group,
  .tool-logic-dataset-row {
    grid-template-columns: 1fr;
  }
}

/* Schema graph */
.schema-graph-root {
  height: 100%;
  display: flex;
  flex-direction: row;
  gap: 12px;
  min-height: 0;
}
.schema-graph-rail {
  width: 240px;
  flex: 0 0 240px;
  overflow-y: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-3);
  padding: 10px 10px 14px;
}
.schema-graph-stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.schema-graph-definition {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--andromede-blue-rule);
  border-left: 4px solid var(--andromede-blue);
  border-radius: 6px;
  background: #f6f8ff;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 13.5px;
  line-height: 1.45;
}
.tool-rail-head {
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 10px;
}
.tool-rail-title {
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tool-rail-title-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.tool-rail-title-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.tool-rail-sub {
  font-family: var(--font-text);
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 4px;
  line-height: 1.35;
}
.tool-rail-section {
  margin-bottom: 12px;
}
.tool-rail-section-head {
  font-family: var(--font-meta);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 4px 4px 6px;
}
.tool-rail-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* Tool card + its annotation pencil sit on one row (pencil is a sibling, since
   a <button> pencil cannot nest inside the <button> tool card). */
.tool-rail-row { display: flex; align-items: center; gap: 4px; }
.tool-rail-row .tool-rail-card { flex: 1; min-width: 0; }
.tool-rail-row .pencil { flex-shrink: 0; }
.tool-rail-card {
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 7px 9px;
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.tool-rail-card:hover {
  border-color: var(--accent);
}
.tool-rail-card.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.tool-rail-name {
  display: block;
}
.tool-rail-desc {
  display: block;
  margin-top: 3px;
  font-family: var(--font-text);
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink-2);
}
.tool-rail-basic {
  border-top: 1px solid var(--rule);
  margin-top: 12px;
  padding-top: 12px;
}
.tool-rail-basic-title {
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0 4px 8px;
}
.tool-rail-card-basic {
  background: var(--bg-2);
}
.cy-container {
  flex: 1;
  width: 100%;
  position: relative;     /* needed for absolute-positioned overlays added in later tasks */
  background: var(--bg-3);
  border: 1px solid var(--rule);
  border-radius: 6px;
  /* Clip absolute-positioned overlays (table cards, edge labels) so they
     can't bleed into the surrounding tool rail / evaluation rail when the
     graph layout is wider than the viewport. */
  overflow: hidden;
  min-width: 0;
}
.graph-tool-card {
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: min(320px, calc(100% - 24px));
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 10px 30px 10px 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  z-index: 50;
  pointer-events: auto;
}
.graph-tool-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 4px;
}
.graph-tool-card-title-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.graph-tool-card-title-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.graph-tool-card-name {
  min-width: 0;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.graph-tool-card-sentence {
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}
.graph-tool-card-returns {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-text);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
.graph-tool-card-returns-label {
  font-family: var(--font-meta);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 4px;
}
.graph-tool-card-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: transparent;
  border: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.graph-tool-card-close:hover {
  background: var(--bg-3);
  color: var(--ink);
}
.graph-overlay-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
/* Per-table card content (title + description + icon) drawn over the
   Cytoscape node. Pointer-events stay off so the underlying node still
   captures hover/click for highlights and the column-expand interaction. */
.graph-table-card-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.graph-table-card {
  position: absolute;
  /* Natural size (matches the Cytoscape node bounds at zoom 1.0).
     renderTableCards() positions by center and applies transform-scale to
     track zoom-in; below zoom 1.0 the card stays at this size so the
     title/description remain readable when the user zooms out. */
  width: 220px;
  height: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 12px 10px;
  box-sizing: border-box;
  text-align: center;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  transform-origin: center center;
  transition: opacity 120ms ease;
}
.graph-table-card-title {
  font-family: var(--font-text, "DM Sans", "Inter", sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 6px;
  /* Title can wrap to two lines without pushing the icon out of frame. */
  max-height: 2.4em;
  overflow: hidden;
}
.graph-table-card-desc {
  font-family: var(--font-text, "Inter", sans-serif);
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-2);
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.graph-table-card-icon {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  opacity: 0.85;
}
.graph-table-card-icon svg {
  width: 34px;
  height: 34px;
  display: block;
}
.graph-table-card.is-dimmed {
  opacity: 0.18;
}
.graph-table-card.is-focused {
  border-color: #4f60c8;
  box-shadow: 0 0 0 1px #4f60c8, 0 6px 18px rgba(79, 96, 200, 0.18);
}
.graph-table-card.is-touched-read {
  border-color: var(--support-blue);
  box-shadow: 0 0 0 1.5px var(--support-blue), 0 0 22px rgba(83, 103, 255, 0.34);
}
.graph-table-card.is-touched-write {
  border-color: #d7651f;
  box-shadow: 0 0 0 1.5px #d7651f, 0 0 22px rgba(255, 138, 42, 0.34);
}
.graph-table-card.is-touched-both {
  border-color: #a35f8b;
  box-shadow: 0 0 0 1.5px #a35f8b, 0 0 22px rgba(139, 101, 217, 0.32);
}
.graph-table-card.is-touched-other {
  border-color: #2f8f7b;
  box-shadow: 0 0 0 1.5px #2f8f7b, 0 0 20px rgba(47, 143, 123, 0.28);
}
.graph-tool-outline-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.graph-dual-outline {
  position: absolute;
  pointer-events: none;
  --graph-tool-outline-width: 2.5px;
  --graph-tool-outline-radius: 9px;
  --graph-tool-glow-strong: 7px;
  --graph-tool-glow-soft: 16px;
  border-radius: var(--graph-tool-outline-radius);
  background: linear-gradient(90deg, var(--support-blue) 0%, var(--support-teal) 52%, var(--accent) 100%);
  filter:
    drop-shadow(0 0 var(--graph-tool-glow-strong) rgba(73,109,134,0.28))
    drop-shadow(0 0 var(--graph-tool-glow-soft) rgba(47,111,79,0.22));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: var(--graph-tool-outline-width);
}
.graph-dual-outline-half {
  display: none;
}
.graph-er-box {
  position: absolute;
  pointer-events: auto;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  font-family: var(--font-mono);
  font-size: 12px;
  z-index: 5;
  cursor: pointer;
}
.graph-er-name {
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid var(--rule);
  border-radius: 6px 6px 0 0;
}
.graph-er-cols { padding: 4px 0; }
.graph-er-col {
  padding: 2px 10px;
}
.graph-er-col.is-pk { color: var(--accent); font-weight: 600; }
.graph-edge-popover {
  position: absolute;
  transform: none;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink);
  pointer-events: auto;
  z-index: 30;
  max-width: 320px;
}
.graph-edge-tooltip {
  position: absolute;
  max-width: min(360px, calc(100% - 24px));
  padding: 8px 10px;
  background: var(--support-warm-soft);
  border: 1px solid #d4c8ae;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.16);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  z-index: 40;
}
.graph-edge-label-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 45;
}
.graph-edge-inline-label {
  position: absolute;
  max-width: min(320px, calc(100% - 24px));
  padding: 7px 9px;
  background: var(--support-warm-soft);
  border: 1px solid #d4c8ae;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.15);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 12.5px;
  line-height: 1.32;
}
.graph-edge-prose {
  font-family: var(--font-text);
  font-size: 13px;
  margin-bottom: 4px;
}
.graph-edge-detail {
  font-size: 11px;
  color: var(--ink-2);
}
.graph-edge-detail code {
  font-family: var(--font-mono);
  background: var(--bg-3);
  padding: 1px 4px;
  border-radius: 3px;
}
.graph-edge-card {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.graph-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  align-items: center;
}
.graph-search {
  flex: 1;
  font-family: var(--font-meta);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--ink);
}
.graph-search:focus {
  outline: none;
  border-color: var(--accent);
}
.graph-fit-btn {
  font-family: var(--font-meta);
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  cursor: pointer;
}
.graph-fit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.graph-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 8px;
}

/* ════════════════════════════════════════════════════════════ */
/*  Topbar · Icon rail · Drawer · Combined Task/Evaluation panel */
/* ════════════════════════════════════════════════════════════ */

/* ───────── Topbar ───────── */
.app-topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 16px 0 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--andromede-hairline);
  box-shadow: none;
  flex-shrink: 0;
  z-index: 120;
}
.topbar-env {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}
.topbar-env-label {
  font-family: var(--font-meta);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--andromede-ink);
  font-weight: 700;
  flex-shrink: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.andromede-wordmark {
  font-weight: 700;
  letter-spacing: 0;
}
.topbar-title-sep {
  color: var(--ink-4);
  font-weight: 500;
}
.topbar-title-product {
  color: var(--ink-2);
  font-weight: 500;
}
.topbar-env-name {
  font-family: var(--font-meta);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.topbar-env-desc {
  font-family: var(--font-meta);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.topbar-env-selector {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.topbar-env-selector[hidden] { display: none; }
.topbar-env-selector-label {
  font-family: var(--font-meta);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 650;
}
.env-selector {
  height: 34px;
  max-width: 260px;
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--andromede-hairline);
  border-radius: 8px;
  padding: 0 30px 0 12px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.env-selector:hover { border-color: var(--andromede-blue-rule); }
.env-selector:focus-visible { outline: 1px solid var(--andromede-blue); outline-offset: 1px; }
.env-selector:disabled { opacity: 0.6; cursor: progress; }
body.env-loading { cursor: progress; }

.topbar-spacer { flex: 1; }
.annotate-toggle {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--andromede-hairline);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  padding: 0 13px;
  font-family: var(--font-meta);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: none;
  flex-shrink: 0;
}
.annotate-toggle:hover {
  border-color: var(--andromede-blue-rule);
  background: var(--bg-2);
  color: var(--andromede-blue);
}
.annotate-toggle[aria-pressed="true"] {
  background: var(--bg-2);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
  box-shadow: inset 0 -1px 0 var(--andromede-blue);
}
.instructions-toggle {
  letter-spacing: 0.04em;
}
.report-bug-toggle {
  letter-spacing: 0.04em;
}
/* "My annotations" topbar button — echoes the My Evaluation rail spine:
   a standing blue outline, blue text, a pencil chip, and a live count badge. */
.annotations-toggle {
  letter-spacing: 0.04em;
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
  padding-left: 7px;
}
.annotations-toggle:hover {
  border-color: var(--andromede-blue);
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
}
.annotations-toggle-ic {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--andromede-blue-soft);
  border: 1px solid var(--andromede-blue-rule);
  color: var(--andromede-blue);
}
.annotations-toggle-count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--andromede-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
/* Admin console entry — lives in the topbar next to the env selector, admins only. */
.topbar-admin-btn {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border: 1px solid var(--accent-rule);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 12px;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.topbar-admin-btn[hidden] { display: none; }
.topbar-admin-btn:hover { background: #dfe3f7; border-color: var(--andromede-blue-2); }
.topbar-admin-btn:focus-visible { outline: 1px solid var(--andromede-blue); outline-offset: 1px; }
.topbar-admin-btn svg { flex-shrink: 0; }
.profile-menu {
  position: relative;
  flex-shrink: 0;
}
.profile-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #c6d4dd;
  border-radius: 50%;
  background: var(--support-blue);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.profile-btn:hover,
.profile-menu.open .profile-btn {
  background: #365a73;
}
.profile-avatar {
  font-family: var(--font-meta);
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
}
.profile-popover {
  position: fixed;
  top: 64px;
  right: 18px;
  width: 260px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg-2);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 160;
}
.profile-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--rule-2);
  margin-bottom: 6px;
}
.profile-card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--support-blue);
  color: #fff;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 800;
}
.profile-card-name {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.profile-card-meta {
  font-family: var(--font-meta);
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.3;
  margin-top: 2px;
}
.profile-menu-item {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.profile-menu-item:hover {
  background: var(--support-blue-soft);
  color: var(--support-blue);
}
.profile-note-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 0 5px;
}
#notes-count-badge.profile-note-badge {
  display: inline-flex;
  margin-left: 0;
}
#notes-count-badge.profile-note-badge.zero { display: none; }
.helper-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.helper-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.helper-btn svg { display: block; }

/* ───────── Icon rail (always-visible left strip) ───────── */
.icon-rail {
  width: 56px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 8px;
  flex-shrink: 0;
  z-index: 22;
  position: relative;
}
.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid transparent;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  position: relative;
  padding: 0;
}
.rail-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 170;
  opacity: 0;
  pointer-events: none;
  background: #15191f;
  color: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  transition: opacity .12s ease;
}
.rail-btn::before {
  content: "";
  position: absolute;
  left: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 170;
  opacity: 0;
  pointer-events: none;
  border: 5px solid transparent;
  border-right-color: #15191f;
  transition: opacity .12s ease;
}
.rail-btn:hover {
  background: var(--support-blue-soft);
  border-color: #c6d4dd;
  color: var(--support-blue);
}
.rail-btn:hover::after,
.rail-btn:hover::before {
  opacity: 1;
}
.rail-btn.active {
  background: var(--support-blue);
  color: white;
  border-color: var(--support-blue);
  box-shadow: 0 4px 12px rgba(73,109,134,0.24);
}
.rail-btn svg { display: block; }
/* ───────── Drawer panes (one per rail icon) ───────── */
/* Drawer takes the place of the old .col-tables column in the grid.
   Only the pane matching col-tables[data-pane="…"] is shown. */
.env-drawer .drawer-pane {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.drawer-env-summary {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  flex-shrink: 0;
}
.drawer-env-label {
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  margin-bottom: 4px;
}
.drawer-env-name {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
}
.drawer-env-desc {
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
  margin-top: 5px;
}
.env-drawer[data-pane="env"]    .drawer-pane[data-pane="env"],
.env-drawer[data-pane="viz"]    .drawer-pane[data-pane="viz"],
.env-drawer[data-pane="notes"]  .drawer-pane[data-pane="notes"],
.env-drawer[data-pane="orient"] .drawer-pane[data-pane="orient"] {
  display: flex;
}
.drawer-pane-list {
  padding: 14px 14px 18px;
  gap: 8px;
}
.drawer-pane-head {
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin: 0 2px 4px;
}
.drawer-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: var(--font-meta);
  font-size: 12.5px;
  color: var(--ink);
  transition: border-color .12s, background .12s;
}
.drawer-list-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.drawer-list-row-name { font-weight: 600; }

.env-drawer .drawer-pane[data-pane="notes"],
.env-drawer .drawer-pane[data-pane="orient"] {
  padding: 0;
  gap: 0;
}
.drawer-notes-body,
.drawer-orientation-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg-2);
}

/* ───────── "More": a prominent door pinned to the drawer bottom. Resting = one
   bold button with presence; clicking reveals the three structure/tool views
   above it. Blue accent sets it apart from the (green) artifact list above. ──── */
.drawer-more {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  background: var(--bg-3);
  padding: 10px 12px 12px;
}
.drawer-more-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  transition: border-color .12s, background .12s, color .12s, box-shadow .12s;
}
.drawer-more-btn:hover,
.drawer-more-btn[aria-expanded="true"] {
  border-color: var(--support-blue);
  background: var(--support-blue-soft);
  color: var(--support-blue);
  box-shadow: 0 1px 3px rgba(20,30,40,0.07);
}
.drawer-more-btn-ic {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--support-blue-soft);
  color: var(--support-blue);
  flex-shrink: 0;
}
.drawer-more-btn:hover .drawer-more-btn-ic,
.drawer-more-btn[aria-expanded="true"] .drawer-more-btn-ic { background: var(--bg-2); }
.drawer-more-btn-ic svg { width: 16px; height: 16px; display: block; }
.drawer-more-btn-label { flex: 1; text-align: left; }
.drawer-more-chev { flex-shrink: 0; transition: transform .15s ease; }
.drawer-more-btn[aria-expanded="true"] .drawer-more-chev { transform: rotate(180deg); }

/* Revealed views — hidden until "More" is clicked. */
.drawer-more-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.drawer-more-items[hidden] { display: none; }
.drawer-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 9px;
  padding: 10px 11px;
  cursor: pointer;
  font-family: var(--font-meta);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color .12s, background .12s, color .12s, box-shadow .12s;
}
.drawer-more-item:hover {
  border-color: var(--support-blue);
  background: var(--support-blue-soft);
  color: var(--support-blue);
  box-shadow: 0 1px 3px rgba(20,30,40,0.07);
}
.drawer-more-ic {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--support-blue-soft);
  color: var(--support-blue);
  flex-shrink: 0;
  transition: background .12s;
}
.drawer-more-item:hover .drawer-more-ic { background: var(--bg-2); }
.drawer-more-ic svg { width: 16px; height: 16px; display: block; }

/* Back affordance in the notes pane (returns to the artifacts/tables view) */
.notes-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color .12s;
}
.notes-back:hover { color: var(--accent); }
.drawer-notes-body .notes-pane {
  min-height: auto;
  background: var(--bg-2);
  padding: 0;
}
.drawer-notes-body .notes-doc {
  max-width: none;
  min-height: auto;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 14px;
}
.drawer-notes-body .notes-doc-head {
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.drawer-notes-body .notes-doc-title {
  font-size: 19px;
}
.drawer-notes-body .notes-doc-sub {
  font-size: 12px;
}
.drawer-notes-body .journal-composer {
  padding: 10px;
  margin-bottom: 14px;
}
.drawer-notes-body .journal-composer textarea {
  min-height: 120px;
  font-size: 13px;
  padding: 9px 10px;
}
.drawer-notes-body .note-card {
  padding: 9px 10px;
}
.drawer-notes-body .note-card-head {
  align-items: flex-start;
  gap: 8px;
}
.drawer-notes-body .note-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.drawer-orientation-body .orientation-body {
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.drawer-orientation-body .orient-section {
  padding: 14px 0 4px;
}
.drawer-orientation-body .orient-h {
  font-size: 15px;
  align-items: flex-start;
}
.drawer-orientation-body .orient-mini-table {
  min-width: 0;
  width: 100%;
}

/* ───────── Right-edge Evaluation rail ─────────
 * Resting: labeled spine on the right edge (--rail-spine-w wide).
 * Pinned:  click the spine to open; Esc / × closes it.
 */
:root {
  --rail-spine-w: 0px;
  --rail-popout-min-w: 380px;
  --rail-popout-w: 680px;
  --rail-popout-wide-w: min(1040px, calc(100vw - var(--rail-spine-w) - 24px));
}

.review-rail {
  position: fixed;
  top: 64px;            /* below the topbar */
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  align-items: stretch;
  pointer-events: none; /* children re-enable */
}

/* Floating evaluation trigger. Keep it horizontal and out of the content path. */
.rail-spine {
  pointer-events: auto;
  position: absolute;
  top: auto;
  right: 18px;
  bottom: 18px;
  width: auto;
  min-width: 172px;
  height: 42px;
  border: 1px solid var(--andromede-blue-rule);
  background: var(--bg-2);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-family: var(--font-meta);
  color: var(--andromede-blue);
  box-shadow: 0 8px 22px rgba(70,103,242,0.13), var(--shadow-sm);
  border-radius: var(--radius-pill);
  transition: background .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.rail-spine:hover {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue);
  box-shadow: 0 10px 26px rgba(70,103,242,0.16), var(--shadow-sm);
  transform: translateY(-1px);
}
.review-rail[data-state="pinned"] .rail-spine {
  opacity: 0;
  pointer-events: none;
}
.spine-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--andromede-blue-soft);
  border: 1px solid var(--andromede-blue-rule);
  color: var(--andromede-blue);
  display: inline-grid;
  place-items: center;
  flex: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.spine-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
  text-align: center;
  color: inherit;
  padding: 0;
  white-space: nowrap;
}

/* Popout: hidden at rest, slides leftward over the workspace when opened. */
.rail-popout {
  pointer-events: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--rail-popout-w);
  max-width: calc(100vw - var(--rail-spine-w) - 24px);
  background: var(--bg-2);
  border-left: 1px solid var(--rule);
  box-shadow: -12px 0 32px rgba(20,22,40,0.10);
  transform: translateX(100%);
  opacity: 0;
  transition: transform .18s ease, opacity .14s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.review-rail[data-width="wide"] {
  --rail-popout-w: var(--rail-popout-wide-w);
}
.review-rail[data-state="pinned"] .rail-popout {
  pointer-events: auto;
  transform: translateX(0);
  opacity: 1;
}
.rail-popout[aria-hidden="true"] { /* baseline; state overrides above */ }

.rail-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  width: 8px;
  cursor: col-resize;
  z-index: 2;
}
.rail-resize::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: var(--rule);
  opacity: 0;
  transition: opacity .12s ease, background .12s ease;
}
.rail-resize:hover::after,
.rail-resize.dragging::after {
  background: var(--accent);
  opacity: 1;
}
body.resizing-review-rail {
  cursor: col-resize;
  user-select: none;
}

.popout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--andromede-hairline);
  flex-shrink: 0;
}
.popout-title {
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
}
.popout-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.popout-icon-btn,
.popout-close {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  visibility: hidden;
}
.popout-close { font-size: 18px; }
.popout-icon-btn:hover,
.popout-close:hover { background: var(--rule-2); color: var(--ink); }
.review-rail[data-state="pinned"] .popout-icon-btn,
.review-rail[data-state="pinned"] .popout-close { visibility: visible; }

.popout-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--andromede-hairline);
  background: var(--bg-2);
  padding: 6px 8px 0;
  flex-shrink: 0;
}
.popout-tab {
  flex: 1;
  border: 1px solid var(--andromede-hairline);
  border-bottom: none;
  background: var(--bg-2);
  min-height: 30px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 4px 4px 0 0;
  font-family: var(--font-meta);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.popout-tab:hover { color: var(--andromede-blue); background: var(--bg-2); }
.popout-tab.active {
  color: var(--andromede-blue);
  background: var(--support-blue-soft);
  border-color: var(--support-blue);
  box-shadow: 0 1px 3px rgba(20,30,40,0.07);
}
.popout-tab-count {
  font-family: var(--font-text);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  background: #f2f3f0;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}
.popout-tab.active .popout-tab-count {
  color: var(--andromede-blue);
  background: var(--bg-2);
  border: 1px solid var(--andromede-blue-rule);
}
/* Counter cleanup: keep ONLY the Tasks tab count. Hide the Environment
   tab count, the env "X / Y answered" line, and the per-group counts. */
#tab-count-env,
#env-pane-progress,
.env-group-count { display: none; }

.popout-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: none;
  flex-direction: column;
}
.popout-body.active { display: flex; }

/* Task pane head: the task counter nav (« 4/13 »). */
.task-pane-head {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule-2);
  background: var(--bg-3);
  flex-shrink: 0;
}
.task-pane-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.task-pane-nav .progress {
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.task-pane-nav .navbtn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink-2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-pane-nav .navbtn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.task-pane-body {
  padding: var(--space-3) var(--space-3) var(--space-6);
}

/* Environment-touchpoint chips inside the task pane. */
.task-touchpoints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 4px;
}
.task-touchpoints-label {
  font-family: var(--font-meta);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.task-touchpoints-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.touchpoint-chip {
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink-2);
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.touchpoint-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* "Finish task evaluation" CTA at bottom of the task tab. */
.task-cta-row {
  display: flex;
  justify-content: flex-end;
  padding: 18px 0 4px;
}
.task-cta {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: background .12s, transform .06s;
}
.task-cta:hover { background: #285f43; }
.task-cta:active { transform: translateY(1px); }

/* Env pane head + accordion. */
.env-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule-2);
  background: var(--bg-3);
  flex-shrink: 0;
}
.env-pane-progress {
  font-family: var(--font-meta);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.env-next-unanswered {
  margin-left: auto;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--accent);
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.env-next-unanswered:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.env-next-unanswered:disabled {
  color: var(--ink-4);
  cursor: default;
}
.env-next-unanswered:disabled:hover {
  background: var(--bg-2);
  border-color: var(--rule);
}

.env-accordion {
  padding: var(--space-2) var(--space-3) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.env-flat-section,
.env-optional-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.env-optional-section {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}
.env-optional-head {
  font-family: var(--font-meta);
  font-size: var(--text-eyebrow);
  font-weight: 800;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  margin: 0 0 var(--space-3);
}
.env-group {
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  overflow: hidden;
}
.env-group-head {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  cursor: pointer;
  font-family: var(--font-meta);
  font-size: var(--text-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: left;
  transition: background .12s ease;
}
.env-group-head:hover { background: var(--bg-3); }
.env-group-head-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.env-group-chev {
  font-size: 10px;
  color: var(--ink-3);
  width: 12px;
  display: inline-block;
  transition: transform .15s ease;
}
.env-group[data-open="true"] .env-group-chev { transform: rotate(90deg); }
.env-group-count {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  background: var(--rule-2);
  padding: 2px 8px;
  border-radius: 999px;
}
.env-group[data-complete="true"] .env-group-count {
  color: var(--good);
  background: #e6efde;
}
.env-group[data-open="true"] .env-group-count {
  color: var(--accent);
  background: var(--accent-soft);
}
.env-group-body {
  display: none;
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-top: 1px solid var(--rule-2);
}
.env-group[data-open="true"] .env-group-body { display: block; }

/* Inspector needs room for the spine. */
.workspace {
  padding-right: var(--rail-spine-w);
  transition: padding-right .18s ease;
}

/* ───────── Andromede color normalization ─────────
   Presentation-only color layer. It intentionally avoids Schema Graph
   selectors so the graph's existing styling remains untouched. */
:root {
  --andromede-blue-hover: #3456e8;
  --andromede-blue-line-strong: #bac6ff;
  --andromede-neutral-soft: #f7f8f4;
  --andromede-blue-shadow: 0 8px 22px rgba(63,99,238,0.13), 0 2px 6px rgba(63,99,238,0.08);
}

body {
  background:
    radial-gradient(1200px 600px at 85% 110%, rgba(63,99,238,0.035), transparent 60%),
    radial-gradient(900px 500px at 0% -10%, rgba(255,255,255,0.65), transparent 55%),
    linear-gradient(180deg, #fbfbf7 0%, var(--bg) 60%, #f1f2f7 100%);
}

.app-topbar,
.profile-menu,
.profile-popover,
.icon-rail,
.env-drawer,
.inspector-head,
.sheet-wrap,
.tt-head,
.review-rail,
.modal,
.note,
.note-card,
.notes-pane,
.drawer-notes-body,
.drawer-orientation-body,
.tools-main-catalog,
.drawer-more {
  --accent: var(--andromede-blue);
  --accent-soft: var(--andromede-blue-soft);
  --accent-panel: var(--andromede-blue-panel);
  --accent-rule: var(--andromede-blue-rule);
  --support-blue: var(--andromede-blue);
  --support-blue-soft: var(--andromede-blue-soft);
  --support-teal: var(--andromede-blue);
  --support-teal-soft: var(--andromede-blue-soft);
  --good: var(--andromede-blue);
  --note-bg: var(--andromede-blue-soft);
  --note-border: var(--andromede-blue-rule);
  --shadow-brand: var(--andromede-blue-shadow);
}

.col-head,
.drawer-env-summary,
.task-pane-head,
.env-pane-head {
  background: linear-gradient(180deg, #ffffff 0%, var(--andromede-neutral-soft) 100%);
}

.splitter-vert:hover::after,
.splitter-vert.dragging::after,
.rail-resize:hover::after,
.rail-resize.dragging::after {
  background: var(--andromede-blue);
}

.env-action-btn,
.helper-btn {
  color: var(--andromede-blue);
  border-color: var(--andromede-blue-rule);
}

.env-action-btn:hover,
.helper-btn:hover {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue);
}

.profile-btn,
.profile-card-avatar {
  background: var(--bg-2);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
}

.profile-btn:hover,
.profile-menu.open .profile-btn {
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
}

.profile-menu-item:hover {
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
}

.profile-note-badge,
#notes-count-badge {
  background: var(--andromede-blue);
}

.icon-rail {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
  border-right-color: var(--andromede-hairline);
}

.rail-btn:hover {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
}

.rail-btn.active {
  background: var(--bg-2);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
  box-shadow: inset 2px 0 0 var(--andromede-blue);
}

.drawer-list-row:hover,
.drawer-more-btn:hover,
.drawer-more-btn[aria-expanded="true"],
.drawer-more-item:hover {
  border-color: var(--andromede-blue-rule);
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
  box-shadow: 0 1px 3px rgba(20,30,40,0.06);
}

.drawer-more-btn-ic,
.drawer-more-ic {
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
}

.drawer-more-btn:hover .drawer-more-btn-ic,
.drawer-more-btn[aria-expanded="true"] .drawer-more-btn-ic,
.drawer-more-item:hover .drawer-more-ic {
  background: var(--bg-2);
}

.tab.active {
  border-bottom-color: var(--andromede-blue);
}

.sheet thead th.col-pk {
  color: var(--andromede-blue);
}

.sheet tbody tr:hover td {
  background: var(--andromede-blue-soft);
}

.env-drawer .pencil,
.sheet-wrap .pencil,
.review-rail .pencil,
.tools-main-catalog .pencil,
.modal .pencil {
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
}

.env-drawer .pencil:hover,
.sheet-wrap .pencil:hover,
.review-rail .pencil:hover,
.tools-main-catalog .pencil:hover,
.modal .pencil:hover,
.env-drawer .pencil.has-note,
.sheet-wrap .pencil.has-note,
.review-rail .pencil.has-note,
.tools-main-catalog .pencil.has-note,
.modal .pencil.has-note {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
}

.env-drawer .pencil .note-count,
.sheet-wrap .pencil .note-count,
.review-rail .pencil .note-count,
.tools-main-catalog .pencil .note-count,
.modal .pencil .note-count {
  background: var(--andromede-blue);
}

.note,
.note-card {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
}

.note .note-label,
.note-card-label,
.journal-context,
.notes-back:hover {
  color: var(--andromede-blue);
}

.note .note-actions .save {
  background: var(--andromede-blue);
  border-color: var(--andromede-blue);
}

.note .note-actions .delete:hover,
.note-card-actions button:hover {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
}

.notes-pane {
  background: #f0f2f8;
}

.notes-doc {
  background: var(--bg-2);
  border-color: var(--andromede-hairline);
  box-shadow: 0 12px 34px rgba(20,22,40,0.09);
}

.journal-composer {
  background: #fbfbf7;
  border-color: var(--andromede-hairline);
}

.modal.orientation-modal {
  border-top-color: var(--andromede-blue);
}

.orient-num,
.orient-example-tag {
  color: var(--andromede-blue);
}

.orient-num,
.orient-example,
.orient-mini-tool,
.orient-tool-chip {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
}

.orient-example {
  border-left-color: var(--andromede-blue);
}

.orient-judge-list li::before {
  background: var(--andromede-blue);
}

.orient-item-icon[data-kind],
.orient-scene-icon[data-kind] {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
}

.orient-inline-tool,
.orient-scene-tool-btn {
  color: var(--andromede-blue);
}

.orient-scene-tool-btn {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
}

.orient-primary,
.task-cta {
  background: var(--andromede-blue);
  border-color: var(--andromede-blue);
  box-shadow: var(--andromede-blue-shadow);
}

.orient-primary:hover,
.task-cta:hover {
  background: var(--andromede-blue-hover);
  box-shadow: var(--andromede-blue-shadow);
}

.tools-main-catalog {
  border-color: var(--andromede-hairline);
  background: linear-gradient(180deg, #fbfbff 0%, #ffffff 220px);
  box-shadow: 0 8px 24px rgba(63,99,238,0.08), var(--shadow-sm);
}

.tools-catalog-head {
  border-bottom-color: var(--andromede-blue-rule);
  background:
    linear-gradient(90deg, rgba(63,99,238,0.12) 0 3px, transparent 3px),
    linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.tools-catalog-count,
.tool-row-icon,
.tool-logic-eyebrow,
.tool-logic-column-table,
.tool-flow-meta-label,
.tools-empty strong {
  color: var(--andromede-blue);
}

.tools-catalog-tabs,
.tools-table-wrap,
.tool-logic-card,
.tool-logic-card-head,
.tool-logic-table-chip,
.tool-logic-output-chips span {
  border-color: var(--andromede-blue-rule);
}

.tools-catalog-tab:hover,
.tools-multi-option:hover {
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
}

.tools-catalog-tab.active {
  color: var(--andromede-blue);
  background: var(--bg-2);
  box-shadow: inset 0 -1px 0 var(--andromede-blue);
}

.tools-filters,
.tool-logic-card-head,
.tool-logic-touch-row,
.tool-logic-table-chip,
.tool-logic-output-chips span,
.tool-logic-input,
.tool-logic-formula {
  background: #fbfbff;
}

.tools-multi-select[open] summary {
  border-color: var(--andromede-blue-rule);
  box-shadow: 0 0 0 2px rgba(63,99,238,0.08);
}

.tools-multi-menu {
  border-color: var(--andromede-blue-rule);
}

.tools-multi-option input {
  accent-color: var(--andromede-blue);
}

.tools-table-wrap {
  box-shadow: 0 1px 0 rgba(63,99,238,0.08), var(--shadow-xs);
}

.tools-data-table th {
  background: #f0f3ff;
}

.tools-data-table tbody tr:nth-child(even) td,
.tools-data-table tbody tr:nth-child(even) td:first-child {
  background: #fbfbff;
}

.tools-data-table tbody tr:hover td,
.tools-data-table tbody tr:hover td:first-child,
.tools-data-table tbody tr:hover td:first-child {
  background: var(--andromede-blue-soft);
}

.tools-col-resizer::after,
.tools-row-resizer::after {
  background: var(--andromede-blue);
}

.tool-logic-input-req {
  background: var(--andromede-blue-soft);
  color: var(--andromede-blue);
}

.tool-logic-section-num {
  background: var(--andromede-blue);
}

.tool-logic-formula code {
  color: var(--andromede-blue);
}

.task-pane-nav .navbtn:hover,
.touchpoint-chip:hover,
.env-next-unanswered:hover {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
}

.env-next-unanswered {
  color: var(--andromede-blue);
}

.env-group[data-complete="true"] .env-group-count,
.env-group[data-open="true"] .env-group-count {
  color: var(--andromede-blue);
  background: var(--andromede-blue-soft);
}
/* ════════════════════════════════════════════════════════════
   Reviewer instructions — pinned center-viewer tab (mini-TOC + panes)
   All content classes are scoped under .instr to avoid leakage.
   ════════════════════════════════════════════════════════════ */

/* pinned tab gets a small leading info icon */
.tab .tab-ic { width: 13px; height: 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.tab .tab-ic svg { width: 100%; height: 100%; display: block; }
.tab.active .tab-ic { color: var(--accent); }

/* the instructions pane manages its own two-column scroll */
.pane.pane-instructions > .pane-content { padding: 0; overflow: hidden; }

.instr {
  height: 100%;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--bg);
}

/* ── left contents rail ── */
.instr-toc {
  border-right: 1px solid var(--rule);
  background: var(--bg-3);
  padding: 20px 14px 16px 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.instr-toc-title {
  font-family: var(--font-meta);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 12px;
}
.instr-toc-list { display: flex; flex-direction: column; gap: 2px; }
.instr-toc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  border-left: 2px solid transparent; color: var(--ink-2);
  font-size: 13px; font-weight: 500; line-height: 1.25;
  transition: background .12s ease, color .12s ease;
}
.instr-toc-item:hover { background: var(--rule-2); }
.instr-toc-item .n { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--ink-4); }
.instr-toc-item.on { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 700; }
.instr-toc-item.on .n { color: var(--accent); }
.instr-toc-foot { margin-top: auto; padding-top: 14px; }
.instr-prog { font-family: var(--font-meta); font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.instr-prog-bar { flex: 1; height: 4px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.instr-prog-bar i { display: block; height: 100%; width: 20%; background: var(--accent); border-radius: 999px; transition: width .2s ease; }

/* ── right scrolling content ── */
.instr-scroll { position: relative; overflow: auto; padding: 28px 36px 56px; }
.instr-hero { margin-bottom: 22px; }
.instr-hero .eyebrow { display: block; margin-bottom: 7px; }
.instr-title { font-size: 25px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); margin: 0; }
.instr-sec { padding: 24px 0; border-top: 1px solid var(--rule-2); scroll-margin-top: 12px; max-width: 760px; }
.instr-sec:first-of-type { border-top: none; padding-top: 2px; }
.instr-gap { height: 14px; }
.instr-foot {
  display: flex; align-items: center; gap: 10px; max-width: 760px;
  font-family: var(--font-meta); font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 24px;
}
.instr-foot strong { color: var(--ink-2); font-weight: 600; }

/* ── shared typography (scoped) ── */
.instr .eyebrow { font-family: var(--font-meta); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.instr .sec-h { display: flex; align-items: center; gap: 11px; margin: 0 0 13px; }
.instr .sec-num { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 8px; min-width: 30px; display: inline-flex; align-items: center; justify-content: center; }
.instr .sec-title { font-size: 18px; font-weight: 700; letter-spacing: -0.005em; color: var(--ink); }
.instr .prose { margin-bottom: 16px; }
.instr .prose p { margin: 0 0 11px; color: var(--ink-2); line-height: 1.6; font-size: 14.5px; }
.instr .prose p:last-child { margin-bottom: 0; }
.instr .prose strong { color: var(--ink); font-weight: 600; }
.instr .prose em { font-style: italic; color: var(--ink); }
.instr .lede { font-size: 15.5px; color: var(--ink); line-height: 1.55; }
.instr .instr-bullets {
  margin: 0 0 16px 20px;
  padding: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
}
.instr .instr-bullets li { margin-bottom: 7px; }

/* ── sketch icon chips (scoped) ── */
.instr .ic {
  flex-shrink: 0; width: 34px; height: 34px; padding: 4px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule-2); background: var(--bg-3); color: var(--ink-2);
}
.instr .ic.lg { width: 48px; height: 48px; border-radius: 11px; padding: 7px; }
.instr .ic.sm { width: 26px; height: 26px; border-radius: 6px; padding: 3px; }
.instr .ic[data-kind="tables"]   { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.instr .ic[data-kind="files"]    { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.instr .ic[data-kind="folder"]   { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.instr .ic[data-kind="tools"]    { background: #F1F2FB; border-color: #C8CEF1; color: #5567D8; }
.instr .ic[data-kind="schema"]   { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.instr .ic[data-kind="tasks"]    { background: var(--accent-panel); border-color: var(--accent-rule); color: var(--accent); }
.instr .ic[data-kind="outputs"]  { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.instr .ic[data-kind="grading"]  { background: #E9EBF9; border-color: #C8CEF1; color: #5567D8; }
.instr .ic[data-kind="realism"]  { background: var(--support-blue-soft); border-color: #cfdbe4; color: var(--support-blue); }
.instr .ic[data-kind="useful"]   { background: var(--accent-soft); border-color: var(--accent-rule); color: var(--accent); }
.instr .ic[data-kind="complete"] { background: var(--support-warm-soft); border-color: #e6dcc4; color: var(--support-warm); }

/* ── example scene ── */
.instr .scene { background: var(--accent-soft); border: 1px solid var(--accent-rule); border-radius: 12px; padding: 16px; margin: 0; }
.instr .scene-tag { font-family: var(--font-meta); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.instr .scene-title { font-size: 14.5px; font-weight: 700; color: var(--ink); margin: 4px 0 13px; }
.instr .scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.instr .scene-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; text-align: center; background: rgba(255,255,255,0.6); border: 1px solid var(--rule-2); border-radius: 9px; }
.instr .scene-label { font-family: var(--font-meta); font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.instr .scene-task { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,255,255,0.6); border: 1px solid var(--rule-2); border-radius: 9px; padding: 12px; }
.instr .scene-task-head { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.instr .scene-task-head .scene-label { font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.instr .scene-task-text { flex: 1; font-size: 13.5px; line-height: 1.55; font-style: italic; color: var(--ink); }
.instr .scene-tools-intro { flex: 1; font-size: 13px; color: var(--ink-2); margin: 0; line-height: 1.5; }
.instr .scene-tools-intro strong { color: var(--ink); }
.instr .scene-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.instr .scene-toolbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.instr .scene-toolbtn { font-family: var(--font-meta); font-size: 12px; font-weight: 600; color: var(--accent); background: rgba(255,255,255,0.75); border: 1px solid var(--accent-rule); border-radius: 999px; padding: 5px 12px; }

/* ── dimensions ── */
.instr .dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.instr .dim { background: var(--bg-2); border: 1px solid var(--rule); border-radius: 11px; padding: 14px; }
.instr .dim-b { min-width: 0; }
.instr .dim-term { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.instr .dim-def { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.instr .dim-note { grid-column: 1 / -1; margin-top: 4px; background: var(--bg-3); border: 1px dashed var(--rule); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.instr .dim-note strong { color: var(--ink); }

/* ── review checklist + notes ── */
.instr .rev-steps { display: grid; gap: 12px; }
.instr .rev-ordered,
.instr .rev-bullets {
  margin: 0 0 0 22px;
  padding: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
}
.instr .rev-ordered li,
.instr .rev-bullets li { margin-bottom: 7px; }
.instr .rev-ordered strong { color: var(--ink); font-weight: 700; }
.instr .rev-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; list-style: none; margin: 0; padding: 0; }
.instr .rev-item { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.instr .rev-item .tick { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; background: var(--support-rose-soft); color: var(--support-rose); font-size: 11px; font-weight: 800; }
.instr .rev-notes { display: grid; gap: 8px; }
.instr .rev-note { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 9px; padding: 11px 13px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.instr .rev-note strong { color: var(--ink); font-weight: 600; }
.instr .rev-note em { font-style: italic; color: var(--ink); }

/* ── how to conduct a quality review (guides + spec panel + footer) ── */
.instr .rev2 { display: grid; gap: 16px; }

.instr .rev2-guides { display: grid; gap: 10px; }
.instr .rev2-guide { display: flex; gap: 12px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 11px; padding: 13px 15px; }
.instr .rev2-guide-ic { flex-shrink: 0; width: 32px; height: 32px; padding: 5px; border-radius: 8px; border: 1px solid; display: inline-flex; align-items: center; justify-content: center; }
.instr .rev2-guide-b { min-width: 0; }
.instr .rev2-guide-head { font-size: 14.5px; font-weight: 700; letter-spacing: -0.005em; margin-bottom: 3px; }
.instr .rev2-guide-desc { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.instr .rev2-guide-desc strong { color: var(--ink); font-weight: 700; }
.instr .rev2-guide-desc em { font-style: italic; color: var(--ink); }

.instr .rev2-spec { background: var(--accent-soft); border: 1px solid var(--accent-rule); border-radius: 12px; padding: 15px 16px; }
.instr .rev2-spec-head { margin-bottom: 12px; }
.instr .rev2-spec-eyebrow { display: block; font-family: var(--font-meta); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.instr .rev2-spec-title { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.instr .rev2-spec-title em { font-style: italic; font-weight: 600; color: var(--accent); }
.instr .rev2-spec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.instr .rev2-spec-list li { display: flex; gap: 11px; align-items: flex-start; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--accent-rule); border-radius: 9px; padding: 10px 12px; }
.instr .rev2-spec-num { flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; background: var(--accent); color: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.instr .rev2-spec-txt { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.instr .rev2-spec-txt strong { color: var(--ink); font-weight: 700; }

.instr .rev2-foot { display: flex; gap: 12px; align-items: center; background: var(--bg-3); border: 1px dashed var(--rule); border-radius: 10px; padding: 12px 14px; }
.instr .rev2-foot-tag { flex-shrink: 0; font-family: var(--font-meta); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 800; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-rule); border-radius: 999px; padding: 4px 10px; }
.instr .rev2-foot-txt { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.instr .rev2-foot-txt strong { color: var(--ink); font-weight: 700; }
.instr .rev2-foot-txt em { font-style: italic; color: var(--ink); }

/* ── feedback (less / more) ── */
.instr .fb-examples { display: grid; gap: 12px; }
.instr .fb-example { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: stretch; }
.instr .fb-example-num { grid-column: 1 / -1; font-family: var(--font-meta); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.instr .fb-pair { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 10px; min-width: 0; }
.instr .fb-card { border-radius: 12px; padding: 13px; border: 1px solid; }
.instr .fb-less { background: var(--support-rose-soft); border-color: #e3cdcf; }
.instr .fb-more { background: var(--accent-soft); border-color: var(--accent-rule); }
.instr .fb-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-meta); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 9px; }
.instr .fb-less .fb-head { color: var(--support-rose); }
.instr .fb-more .fb-head { color: var(--accent); }
.instr .fb-mark { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; }
.instr .fb-less .fb-mark { background: var(--support-rose); }
.instr .fb-more .fb-mark { background: var(--accent); }
.instr .fb-quote { font-size: 14px; line-height: 1.55; color: var(--ink); }
.instr .fb-hl { background: rgba(47,111,79,0.14); border-radius: 3px; padding: 0 2px; }
.instr .fb-cover { background: var(--bg-3); border: 1px dashed var(--rule); border-radius: 12px; padding: 13px; }
.instr .fb-cover-title { font-family: var(--font-meta); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; }
.instr .fb-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.instr .fb-chip { font-family: var(--font-meta); font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; }

/* ── glossary ── */
.instr .gloss { display: grid; gap: 9px; }
.instr .gloss-row { display: flex; gap: 13px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 11px; padding: 12px 14px; }
.instr .gloss-b { min-width: 0; }
.instr .gloss-term { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 1px; }
.instr .gloss-def { font-size: 13px; line-height: 1.5; color: var(--ink-2); }

/* narrow center pane: collapse the checklist + feedback to a single column */
@media (max-width: 720px) {
  .instr { grid-template-columns: 1fr; }
  .instr-toc { display: none; }
  .instr .scene-grid,
  .instr .dims,
  .instr .fb-example,
  .instr .fb-pair,
  .instr .rev-list { grid-template-columns: 1fr; }
  .instr .scene-tools { align-items: flex-start; flex-wrap: wrap; }
}

/* ════════════════════════════════════════════════════════════
   Accounts: no-work state, overlay panels (profile / work / admin)
   ════════════════════════════════════════════════════════════ */
.profile-menu-item-danger { color: var(--support-rose); }
.profile-menu-item-danger:hover { background: var(--support-rose-soft); }

/* no review work assigned (full page) */
.nowork-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px; background: var(--bg); }
.nowork-card { max-width: 460px; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 30px; text-align: center; }
.nowork-eyebrow { font-family: var(--font-meta); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--accent); margin-bottom: 12px; }
.nowork-card h1 { font-size: 22px; margin: 0 0 10px; letter-spacing: -.01em; }
.nowork-card p { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; margin: 0 0 20px; }
.nowork-success { color: #1f9d57; font-weight: 600; font-size: 14px; margin: 0 0 8px; }
.nowork-actions { display: flex; gap: 10px; justify-content: center; }
.nowork-primary { font-family: var(--font-meta); font-weight: 700; font-size: 13.5px; color: #fff;
  background: var(--accent); border: 1px solid var(--accent); border-radius: 10px; padding: 9px 18px; cursor: pointer; }
.nowork-primary:hover { filter: brightness(1.06); }
.nowork-logout { font-family: var(--font-meta); font-weight: 600; font-size: 13.5px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-rule); border-radius: 10px; padding: 9px 18px; cursor: pointer; }

/* overlay */
.ov-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(20,22,30,.34); backdrop-filter: blur(1.5px);
  display: flex; align-items: flex-start; justify-content: center; padding: 7vh 20px 20px; overflow-y: auto; }
.ov-panel { width: min(620px, 96vw); background: var(--bg-2); border: 1px solid var(--rule); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden; }
.ov-panel.ov-wide { width: min(1040px, 97vw); }
.ov-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--rule); background: var(--bg-3); }
.ov-title { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.005em; }
.ov-close { width: 32px; height: 32px; border: none; background: transparent; font-size: 20px; color: var(--ink-3);
  cursor: pointer; border-radius: 8px; }
.ov-close:hover { background: var(--rule-2); color: var(--ink); }
.ov-body { padding: 20px; max-height: 76vh; overflow-y: auto; }

/* profile panel */
.acct-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.acct-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-meta); font-weight: 700; font-size: 18px;
  border: 1px solid var(--accent-rule); }
.acct-name { font-size: 18px; font-weight: 700; }
.acct-sub { font-size: 13px; color: var(--ink-3); font-family: var(--font-mono); }
.acct-rows { display: grid; gap: 1px; background: var(--rule-2); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.acct-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; background: var(--bg-2); padding: 11px 14px; }
.acct-k { font-family: var(--font-meta); font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.acct-v { font-size: 14px; color: var(--ink); }
.acct-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.acct-logout { font-family: var(--font-meta); font-weight: 600; font-size: 13.5px; color: var(--support-rose);
  background: var(--support-rose-soft); border: 1px solid #e3cdcf; border-radius: 10px; padding: 9px 16px; cursor: pointer; }

/* work view */
.work-lede { font-size: 15.5px; color: var(--ink); margin-bottom: 16px; }
.work-lede strong { color: var(--accent); }
.work-empty { color: var(--ink-3); font-size: 14.5px; text-align: center; padding: 28px 0; }
.work-list { display: flex; flex-direction: column; gap: 10px; }
.work-item { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--rule); border-radius: 12px; padding: 13px 15px; background: var(--bg-2); }
.work-item-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.work-item-name { font-weight: 600; font-size: 14.5px; }
.work-status { font-family: var(--font-meta); font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px; }
.st-assigned { background: var(--rule-2); color: var(--ink-2); }
.st-progress { background: var(--support-warm-soft); color: var(--support-warm); }
.st-submitted { background: var(--accent-soft); color: var(--accent); }
.work-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.work-open, .work-submit { font-family: var(--font-meta); font-weight: 600; font-size: 12.5px; cursor: pointer;
  border-radius: 9px; padding: 7px 13px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink-2); }
.work-open:hover { border-color: var(--accent-rule); color: var(--accent); }
.work-open:disabled { opacity: .5; cursor: default; }
.work-submit { background: var(--accent); color: #fff; border-color: var(--accent); }
.work-submit:hover { filter: brightness(1.06); }
.work-done { font-family: var(--font-meta); font-size: 12.5px; font-weight: 600; color: var(--accent); }

/* bug report modal */
.bug-report-form {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bug-report-help {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}
.bug-report-form .text-editor-surface {
  min-height: 180px;
}
.bug-report-status {
  min-height: 18px;
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink-3);
}
.bug-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.bug-report-back,
.bug-report-submit {
  height: 34px;
  border-radius: 8px;
  padding: 0 14px;
  font-family: var(--font-meta);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.bug-report-back {
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink-2);
}
.bug-report-submit {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.bug-report-back:hover { border-color: var(--accent-rule); color: var(--accent); }
.bug-report-submit:hover { filter: brightness(1.05); }
.bug-report-back:disabled,
.bug-report-submit:disabled {
  opacity: .55;
  cursor: progress;
}

/* admin console */
.admin-loading, .admin-empty { color: var(--ink-3); font-size: 14px; padding: 16px 4px; }
.admin-empty { font-size: 13px; padding: 8px 0; }
.admin-users { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-users th { text-align: left; font-family: var(--font-meta); font-size: 11px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.admin-users td { padding: 10px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.admin-badge { font-family: var(--font-meta); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.admin-badge.is-yes { background: var(--accent-soft); color: var(--accent); }
.admin-badge.is-no { background: var(--rule-2); color: var(--ink-2); }
.admin-badge.is-revoked { background: var(--support-rose-soft); color: var(--support-rose); }
.admin-manage { font-family: var(--font-meta); font-weight: 600; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink-2); border-radius: 8px; padding: 6px 12px; }
.admin-manage:hover { border-color: var(--accent-rule); color: var(--accent); }
.admin-detail > td { background: var(--bg-3); padding: 0; }
.admin-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 16px; }
@media (max-width: 800px) { .admin-detail-grid { grid-template-columns: 1fr; } }
.admin-block-h { font-family: var(--font-meta); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3); margin-bottom: 9px; }
.admin-action { font-family: var(--font-meta); font-weight: 600; font-size: 12.5px; cursor: pointer; border-radius: 9px;
  padding: 7px 13px; border: 1px solid var(--accent-rule); background: var(--accent-soft); color: var(--accent); }
.admin-action.danger { border-color: #e3cdcf; background: var(--support-rose-soft); color: var(--support-rose); }
.admin-asn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.admin-asn li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.admin-asn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-asn-status { font-family: var(--font-meta); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; flex-shrink: 0; }
.admin-asn-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.admin-view, .admin-unassign { font-family: var(--font-meta); font-size: 11.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--rule); background: var(--bg-2); border-radius: 8px; padding: 4px 9px; color: var(--ink-2); }
.admin-view:hover { border-color: var(--accent-rule); color: var(--accent); }
.admin-unassign:hover { border-color: #e3cdcf; color: var(--support-rose); background: var(--support-rose-soft); }
.admin-ans-scope { font-family: var(--font-meta); font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.admin-checks { display: flex; flex-direction: column; gap: 5px; max-height: 180px; overflow-y: auto; margin-bottom: 10px;
  font-size: 13px; }
.admin-checks label { display: flex; gap: 7px; align-items: center; cursor: pointer; }
.admin-checks label.is-assigned { color: var(--ink-3); cursor: default; }
.admin-check-tag { margin-left: auto; font-family: var(--font-meta); font-size: 10px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; }
.admin-review { margin: 0 16px 16px; border-top: 1px dashed var(--rule); padding-top: 12px; }
.admin-review-h { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.admin-review-sec { font-family: var(--font-meta); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3); margin: 12px 0 6px; }
.admin-ans { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-ans th, .admin-ans td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.admin-ans .mono, .admin-notes .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }
.admin-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }

/* ════════════════════════════════════════════════════════════
   Admin console — full-screen dashboard (takes over the viewport)
   ════════════════════════════════════════════════════════════ */
.admin-screen {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 85% 110%, rgba(47,111,79,0.04), transparent 60%),
    linear-gradient(180deg, #fbfbf7 0%, var(--bg) 60%, #eef0ea 100%);
  animation: admin-screen-in 0.16s ease-out;
}
@keyframes admin-screen-in { from { opacity: 0; } to { opacity: 1; } }
body.admin-screen-open { overflow: hidden; }
.admin-screen-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 22px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--andromede-hairline);
}
.admin-screen-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--andromede-hairline);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-family: var(--font-meta);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.admin-screen-back:hover { border-color: var(--accent-rule); color: var(--accent); }
.admin-screen-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.005em; color: var(--ink); }
.admin-screen-body { flex: 1; min-height: 0; overflow-y: auto; }
.admin-screen-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 28px 60px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Sections inside the dashboard */
.admin-section { display: flex; flex-direction: column; gap: 12px; }
.admin-section-h {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-meta);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.admin-section-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 8px;
}
.admin-users-host {
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  overflow: hidden;
}
.admin-users-host .admin-users { font-size: 13.5px; }
.admin-users-host .admin-users th { padding-left: 14px; padding-right: 14px; }
.admin-users-host .admin-users td { padding-left: 14px; padding-right: 14px; }

/* Environments overview — assignment data pivoted by environment */
.admin-envs-host {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.admin-env {
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-env-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.admin-env-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.admin-env-count {
  font-family: var(--font-meta);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  white-space: nowrap;
}
.admin-env-reviewers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.admin-env-reviewers li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--rule-2);
}
.admin-env-reviewers li:first-child { border-top: none; }
.admin-env-rname { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-env .admin-empty { padding: 4px 0 2px; }
.admin-env-reviewers li .admin-view { margin-left: 2px; flex-shrink: 0; }
.admin-bugs-host {
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  overflow: hidden;
}
.admin-bugs-list {
  display: flex;
  flex-direction: column;
}
.admin-bug-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule-2);
}
.admin-bug-card:last-child { border-bottom: none; }
.admin-bug-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.admin-bug-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.admin-bug-meta,
.admin-bug-url {
  margin-top: 2px;
  font-family: var(--font-meta);
  font-size: 11.5px;
  color: var(--ink-3);
}
.admin-bug-id {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--bg-3);
  border-radius: 999px;
  padding: 2px 8px;
}
.admin-bug-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.admin-bug-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   Submission report — full-screen, stacked above the admin console
   ════════════════════════════════════════════════════════════ */
.report-screen { z-index: 1200; }
.report-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-2);
}
.report-env { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.report-meta { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-meta); }
.report-reviewer { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.report-when { font-size: 12px; color: var(--ink-3); }

.report-group { display: flex; flex-direction: column; gap: 8px; }
.report-group-h {
  font-family: var(--font-meta);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.report-group .admin-ans {
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  overflow: hidden;
}
.report-group .admin-ans th {
  font-family: var(--font-meta);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-3);
  padding: 8px 12px;
}
.report-group .admin-ans td { padding: 9px 12px; font-size: 13px; color: var(--ink-2); }
.report-group .admin-ans td:nth-child(2) { font-weight: 600; color: var(--ink); white-space: nowrap; }
.report-group .admin-ans tr:last-child td { border-bottom: none; }
.report-resource {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 0;
  color: var(--ink);
}
.report-resource + .report-resource {
  border-top: 1px solid var(--rule-2);
}
.report-resource-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  word-break: break-all;
}
.report-resource-note {
  white-space: pre-wrap;
  color: var(--ink-2);
  line-height: 1.45;
}

.report-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.report-note {
  background: var(--bg-2);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-note-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.report-note-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  word-break: break-word;
}
.report-note-time { font-family: var(--font-meta); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.report-note-text { font-size: 13.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; }

/* ════════════════════════════════════════════════════════════
   Rail: Evaluation | My annotations mode toggle + autosave status
   ════════════════════════════════════════════════════════════ */
.popout-head { gap: 8px; }
.popout-modes { display: inline-flex; gap: 2px; background: var(--andromede-blue-soft); border-radius: 9px; padding: 2px; }
.popout-mode {
  font-family: var(--font-meta); font-size: 12px; font-weight: 600; color: var(--ink-3);
  background: transparent; border: none; border-radius: 7px; padding: 5px 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.popout-mode:hover { color: var(--andromede-blue); }
.popout-mode.active { background: var(--bg-2); color: var(--andromede-blue); box-shadow: var(--shadow-xs); }
.popout-mode-count {
  font-family: var(--font-meta); font-size: 10px; font-weight: 700; line-height: 1.5;
  background: var(--bg-2); color: var(--andromede-blue); border-radius: 999px; padding: 0 6px; min-width: 17px; text-align: center;
}
.popout-mode.active .popout-mode-count { background: var(--andromede-blue-soft); }

.save-status { margin-left: auto; font-family: var(--font-meta); font-size: 11.5px; font-weight: 600; white-space: nowrap; transition: opacity .15s ease; }
.save-status[data-state="saving"] { color: var(--ink-3); }
.save-status[data-state="saved"] { color: var(--good); }

/* ── My Evaluation — Tasks · Environment · Annotations all render as one
   clean document: a white sheet centered on a soft backdrop, matching the
   annotations report style. ── */
.popout-body-task,
.popout-body-env,
.popout-body-notes {
  background: #e7e5df;
}

/* Functional toolbars (task counter, env progress) ride above the sheet,
   sticky to the top of the scroll area on the soft backdrop. */
.popout-body-task .task-pane-head,
.popout-body-env .env-pane-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #e7e5df;
  border-bottom: 1px solid var(--rule);
}

/* The shared white document sheet. */
.popout-body-task .task-pane-body,
.popout-body-env .env-accordion,
.popout-body-notes .report-doc {
  width: min(820px, calc(100% - 40px));
  max-width: none;
  margin: 20px auto 32px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 12px 34px rgba(20,22,40,0.12);
  padding: 36px 44px 44px;
}

/* Env questions flow as a normal document (block), so group headers and
   question cards space themselves the same way as the Tasks tab. */
.popout-body-env .env-accordion {
  display: block;
  gap: 0;
}

/* Annotations tab keeps the report's own sheet; strip the grey wrapper padding
   so the centered-sheet rule above governs the layout. The pane grows with its
   content (the popout body scrolls), and the sheet must never shrink below its
   content inside the column flex — otherwise later findings spill out below it. */
.popout-body-notes .report-pane {
  min-height: 100%;
  background: #e7e5df;
  padding: 0;
}
.popout-body-notes .report-doc {
  min-height: 0;   /* override the base 100vh min so a short report hugs content */
  flex: none;      /* never shrink below content height inside the flex column */
}

/* Inline edit form for an annotation finding. */
.report-finding.editing { background: #f6f8ff; }
.report-finding-edit { margin-top: 8px; }
.report-finding-edit .text-editor-surface { min-height: 84px; }
.report-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.report-edit-actions button {
  font-family: var(--font-meta);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink-2);
  transition: background .12s, border-color .12s, color .12s;
}
.report-edit-cancel:hover { background: var(--rule-2); color: var(--ink); }
.report-edit-save {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.report-edit-save:hover { background: #285f43; }

/* ════════════════════════════════════════════════════════════
   Submit review (rail footer) + post-submit lock + confirm dialog
   ════════════════════════════════════════════════════════════ */
.rail-submit {
  flex-shrink: 0; border-top: 1px solid var(--rule);
  background: var(--bg-2); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
}
.rail-submit-hint { font-family: var(--font-meta); font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.rail-submit-btn {
  flex-shrink: 0; font-family: var(--font-meta); font-size: 13.5px; font-weight: 700; color: #fff;
  background: var(--andromede-blue); border: 1px solid var(--andromede-blue); border-radius: 10px; padding: 9px 18px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(63,99,238,.20); transition: transform .12s ease, filter .12s ease;
}
.rail-submit-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.rail-submit.is-submitted { justify-content: center; background: var(--andromede-blue-soft); border-top-color: var(--andromede-blue-rule); }
.rail-submit-done { font-family: var(--font-meta); font-size: 13px; font-weight: 700; color: var(--andromede-blue); }

/* a submitted review is read-only — disable the answer controls (nav still works) */
body.review-locked .question textarea,
body.review-locked .question input,
body.review-locked .question .qrate-btn,
body.review-locked .question .qchoice-btn { pointer-events: none; opacity: .55; }
body.review-locked .supporting-resources input,
body.review-locked .supporting-resources textarea,
body.review-locked .supporting-resources button { pointer-events: none; opacity: .55; }
body.review-locked .text-editor-surface,
body.review-locked .text-format-btn { pointer-events: none; opacity: .55; }
body.demo-readonly .selection-comment-btn,
body.demo-readonly .journal-composer,
body.demo-readonly .note-card-actions { display: none; }

/* Basic formatting toolbar for long-form text fields. */
.text-editor {
  width: 100%;
  border: 1px solid var(--andromede-hairline);
  border-radius: 6px;
  background: var(--bg-2);
  overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.text-editor:focus-within {
  border-color: var(--andromede-blue);
  box-shadow: 0 0 0 2px var(--andromede-blue-soft);
}
.text-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 31px;
  padding: 4px 5px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-3);
}
.text-format-btn {
  width: 26px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--font-meta);
  font-size: 12px;
  line-height: 1;
}
.text-format-btn:hover,
.text-format-btn:focus-visible {
  border-color: var(--rule);
  background: var(--bg-2);
  color: var(--ink);
  outline: none;
}
.text-format-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  font-size: 15px;
  line-height: 1;
}
.text-format-icon {
  width: 16px;
  height: 16px;
  display: block;
}
.text-format-btn.fmt-bold .text-format-letter { font-weight: 800; }
.text-format-btn.fmt-italic .text-format-letter {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
}
.text-format-btn.fmt-underline .text-format-letter { text-decoration: underline; text-underline-offset: 2px; }
.text-format-btn.fmt-strike .text-format-letter { text-decoration: line-through; }
.text-editor-surface,
.question .text-editor-surface,
.note .text-editor-surface,
.journal-composer .text-editor-surface {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  min-height: 116px;
  padding: 10px;
  font-family: var(--font-text);
  font-size: var(--text-body);
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
}
.text-editor-surface[data-empty="true"]::before {
  content: attr(data-placeholder);
  color: var(--ink-4);
  pointer-events: none;
}
.text-editor > textarea.rich-text-value {
  display: none !important;
}
.note .text-editor {
  border-color: var(--note-border);
  background: rgba(255,255,255,0.7);
}
.note .text-editor-surface { min-height: 140px; font-size: 14px; }

/* confirm dialog */
.confirm-back { position: fixed; inset: 0; z-index: 1100; background: rgba(20,22,30,.4);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.confirm-box { width: min(420px, 94vw); background: var(--bg-2); border: 1px solid var(--rule);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px 22px 18px; }
.confirm-title { font-size: 17px; font-weight: 700; letter-spacing: -.005em; margin-bottom: 8px; }
.confirm-body { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin-bottom: 18px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirm-cancel, .confirm-ok { font-family: var(--font-meta); font-size: 13.5px; font-weight: 600;
  border-radius: 10px; padding: 9px 16px; cursor: pointer; }
.confirm-cancel { background: var(--bg); border: 1px solid var(--rule); color: var(--ink-2); }
.confirm-cancel:hover { background: var(--rule-2); }
.confirm-ok { background: var(--andromede-blue); border: 1px solid var(--andromede-blue); color: #fff; font-weight: 700;
  box-shadow: 0 4px 14px rgba(63,99,238,.20); }
.confirm-ok:hover { filter: brightness(1.05); }

/* "More" button: persistent blue highlight (like an active item) so it's visible by default */
.drawer-more-btn {
  background: var(--andromede-blue-soft);
  border-color: var(--andromede-blue-rule);
  color: var(--andromede-blue);
}
.drawer-more-btn .drawer-more-btn-ic { background: var(--andromede-blue); color: #fff; }
.drawer-more-btn:hover,
.drawer-more-btn[aria-expanded="true"] {
  background: var(--andromede-blue);
  border-color: var(--andromede-blue);
  color: #fff;
  box-shadow: none;
}
.drawer-more-btn:hover .drawer-more-btn-ic,
.drawer-more-btn[aria-expanded="true"] .drawer-more-btn-ic { background: rgba(255,255,255,0.22); color: #fff; }
