/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V5
   Hallmark · genre: modern-minimal · macrostructure: Inverted field manual + right context rail · designed-as-app
   Hallmark · unmistakable in-place redesign · theme: existing Git-Up route ledger
   honest: pass (46) · chrome: pass (47) · tokens: pass (48) · icons: pass (30)
   responsive: pass (34, 49–57) · motion: pass (17–18, 36)
   contrast: pass (40–41) · accessibility: pass
   Visual fingerprint: a surveyor's route ledger — ruled paths, mileage markers,
   and stamped trust artifacts. Product structure and brand remain unchanged. */

:root {
  --bg: #0b1114;
  --bg-deep: #070c0f;
  --panel: #11191e;
  --panel-raised: #182329;
  --panel-soft: #0f171c;
  --ledger: #0d1418;
  --line: rgba(178, 197, 190, .13);
  --line-strong: rgba(178, 197, 190, .24);
  --route: #7fe0b2;
  --route-ink: var(--bg-deep);
  --route-bright: #a9f2cd;
  --route-dim: rgba(127, 224, 178, .12);
  --route-line: rgba(127, 224, 178, .34);
  --text: #eef4ef;
  --muted: #93a3a0;
  --muted-2: #7d8d89;
  --amber: #eec27a;
  --amber-dim: rgba(238, 194, 122, .12);
  --red: #ef9a94;
  --blue: #93b8ef;
  --stamp: #e5cf9b;
  --shadow: 0 6px 18px rgba(0, 0, 0, .18);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .2);
  --shadow-menu: 0 12px 28px rgba(0, 0, 0, .3);
  --shadow-modal: 0 20px 56px rgba(0, 0, 0, .34);
  --modal-overlay: rgba(3, 7, 8, .84);
  --dot: rgba(178, 197, 190, .16);
  --manual: #e8eee9;
  --manual-ink: #0a1511;
  --manual-muted: #43584f;
  --manual-line: rgba(10, 21, 17, .22);
  --manual-accent: #086343;
  --manual-control: #0b1513;
  --manual-control-text: #eef4ef;
  --manual-control-muted: #98aaa2;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Avenir Next', 'Trebuchet MS', ui-sans-serif, system-ui, sans-serif;
  --dur-instant: 120ms;
  --dur-normal: 220ms;
  --dur-major: 420ms;
  --stagger-step: 35ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --z-background: -1;
  --z-workspace: 0;
  --z-content: 1;
  --z-topbar: 20;
  --z-menu: 30;
  --z-oreo: 40;
  --z-oreo-panel: 41;
  --z-mobile-nav: 50;
  --z-modal: 60;
  --z-toast: 80;
  --z-skip-link: 100;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::after {
  content: '';
  position: fixed;
  z-index: var(--z-background);
  inset: 0;
  opacity: .05;
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(178, 197, 190, .5) 27px 28px);
  pointer-events: none;
}
button, input, select, textarea { font: inherit; }
.mono { font-family: var(--mono); }
button { border: 0; cursor: pointer; }
button:active:not(:disabled) { filter: brightness(.92); }
button:disabled,
input:disabled,
select:disabled,
textarea:disabled { cursor: not-allowed; opacity: .55; filter: saturate(.35); box-shadow: none; }
:focus-visible { outline: 2px solid var(--route); outline-offset: 3px; }
h1, h2, h3, h4 { min-width: 0; overflow-wrap: anywhere; font-style: normal; }
::selection { background: rgba(127, 224, 178, .28); color: var(--text); }
.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; }
/* Iconify/Tabler glyphs share one 24px grid and stroke weight. Keeping SVGs
   block-level inside their flex/grid wrappers removes baseline drift at every
   rendered size; interaction color continues to come from the parent. */
.ui-icon { display: block; flex: 0 0 auto; overflow: visible; pointer-events: none; shape-rendering: geometricPrecision; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
/* Mode-wise wordmark: 1254px transparent PNGs, downsized to the 70px topbar.
   No background or border — the sticker's own outer stroke defines the edge,
   so a drop-shadow (not a box-shadow) lifts it without boxing it in. */
.brand-logo { position: relative; display: grid; place-items: center; width: 56px; height: 56px; flex: none; transition: transform var(--dur-instant) var(--ease); }
.brand:hover .brand-logo { transform: translateY(-1px); }
.brand-img { grid-area: 1 / 1; width: 56px; height: 56px; object-fit: contain; object-position: center; image-rendering: auto; border-radius: 12px; filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .35)); }
.brand-img--light { display: none; }
[data-theme="light"] .brand-img--dark { display: none; }
[data-theme="light"] .brand-img--light { display: block; filter: drop-shadow(0 2px 8px rgba(20, 40, 32, .2)); }
.brand-word { font-family: var(--display); font-size: 17px; letter-spacing: -.03em; font-weight: 800; }
.brand-word em { color: var(--route); font-style: normal; }
.brand-sub { color: var(--muted-2); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; border-left: 1px solid var(--line); padding-left: 11px; }
.topbar-center { display: flex; align-items: center; gap: 9px; color: var(--muted-2); font-size: 12px; letter-spacing: .03em; }
.topbar-center .slash { color: var(--muted-2); }
.topbar-center strong { font-weight: 600; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 600; transition: color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease), background var(--dur-instant) var(--ease); }
.connection-pill:hover { color: var(--text); border-color: var(--line-strong); background: var(--panel-raised); }
.status-dot { flex: none; width: 7px; height: 7px; background: var(--muted-2); border-radius: 50%; }
.status-dot.online { background: var(--route); box-shadow: 0 0 0 4px rgba(127, 224, 178, .1); }
.status-dot.pending { background: var(--amber); box-shadow: 0 0 0 4px rgba(238, 194, 122, .1); }
.status-dot.warning { background: var(--red); box-shadow: 0 0 0 4px rgba(239, 154, 148, .1); }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; transition: background var(--dur-instant) var(--ease), color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease), transform var(--dur-instant) var(--ease); }
.icon-button:hover { color: var(--text); background: var(--panel-raised); border-color: var(--line); }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.sidebar { padding: 28px 16px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.sidebar-label { margin: 0 10px 11px; color: var(--muted-2); text-transform: uppercase; font-size: 10px; letter-spacing: .14em; font-weight: 800; }
.sidebar-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 9px; text-align: left; font-size: 12px; font-weight: 600; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-item.active { color: var(--route); background: var(--route-dim); border-color: rgba(127, 224, 178, .16); }
.nav-item .nav-icon { width: 16px; display: grid; place-items: center; }
.nav-count { margin-left: auto; color: var(--muted-2); font-family: var(--mono); font-size: 10px; }
.new-analysis { margin: 0 0 29px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px 12px; color: var(--route-ink); background: var(--route); border-radius: 9px; font-size: 12px; font-weight: 800; box-shadow: 0 10px 20px rgba(0,0,0,.16); transition: transform var(--dur-instant) var(--ease), background var(--dur-instant) var(--ease), box-shadow var(--dur-instant) var(--ease); }
.new-analysis:hover { background: var(--route-bright); }
.new-analysis:active { transform: scale(0.98); }
.history { margin-top: 34px; }
.history-list { display: grid; gap: 3px; }
.history-empty { padding: 12px 10px; color: var(--muted-2); font-size: 11px; line-height: 1.6; }
.history-entry { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; color: var(--muted); background: transparent; border-radius: 8px; text-align: left; font-size: 11px; overflow: hidden; }
.history-entry:hover { background: rgba(255,255,255,.03); color: var(--text); }
.history-entry .history-icon { color: var(--muted-2); flex: none; }
.history-entry span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot { margin-top: auto; padding: 14px 11px 0; }
.local-note { border-top: 1px solid var(--line); padding-top: 17px; color: var(--muted-2); font-size: 10px; line-height: 1.65; }
.local-note strong { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }

.main { width: 100%; max-width: 1420px; padding: 52px clamp(28px, 5vw, 76px) 80px; margin: 0 auto; }
.hero { max-width: 900px; margin-bottom: 37px; animation: rise var(--dur-major) var(--ease) both; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; color: var(--route); font-family: var(--mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow-line { width: 24px; height: 1px; background: var(--route); }
h1 { margin: 0; max-width: 780px; color: var(--text); font-family: var(--display); font-size: clamp(34px, 4.2vw, 58px); line-height: 1.04; letter-spacing: -.03em; font-weight: 800; }
h1 span { color: var(--muted); }
.hero-copy { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.repo-form { margin-top: 29px; max-width: 920px; padding: 6px; display: flex; align-items: center; gap: 7px; background: rgba(17, 25, 30, .92); border: 1px solid var(--line-strong); border-radius: 13px; box-shadow: var(--shadow); transition: border-color var(--dur-instant) var(--ease), box-shadow var(--dur-instant) var(--ease); }
.repo-form:focus-within { border-color: rgba(127, 224, 178, .55); box-shadow: 0 0 0 4px rgba(127, 224, 178, .07), var(--shadow); }
.repo-input-wrap { min-width: 0; flex: 1; display: flex; align-items: center; gap: 11px; padding: 0 11px; }
.repo-input-wrap svg { color: var(--muted-2); flex: none; }
.repo-input { min-width: 0; width: 100%; height: 44px; color: var(--text); background: transparent; border: 0; outline: 2px solid transparent; outline-offset: 1px; font-size: 13px; }
.repo-input::placeholder { color: var(--muted-2); }
.analyze-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 18px; color: var(--route-ink); white-space: nowrap; background: var(--route); border-radius: 9px; font-size: 12px; font-weight: 800; transition: background var(--dur-instant) var(--ease), transform var(--dur-instant) var(--ease), box-shadow var(--dur-instant) var(--ease); }
.analyze-button:hover { background: var(--route-bright); }
.analyze-button:active { transform: scale(0.98); }
.analyze-button.loading { pointer-events: none; }
.spinner { animation: spin 1s linear infinite; }
.form-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; margin: 12px 3px 0; color: var(--muted-2); font-size: 10px; }
.form-meta span { display: inline-flex; align-items: center; gap: 5px; }
.form-meta .shortcut { margin-left: auto; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; font-family: var(--mono); }

.initial-content { margin-top: 52px; animation: rise var(--dur-major) var(--ease) both; }
.section-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; color: var(--muted); font-size: 11px; font-weight: 700; }
.section-kicker::after { content: ''; display: block; width: 44px; height: 1px; background: var(--line-strong); }
.route-preview { list-style: none; margin: 0; padding: 0; max-width: 1000px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(17, 25, 30, .66); }
.route-stop { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: start; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.route-stop:last-child { border-bottom: 0; }
.route-stop:hover { background: rgba(127, 224, 178, .03); }
.route-mile { color: var(--route); font-family: var(--mono); font-size: 11px; border: 1px solid var(--route-line); border-radius: 7px; padding: 5px 0; text-align: center; background: rgba(127, 224, 178, .06); }
.route-stop h3 { margin: 2px 0 6px; font-size: 13px; letter-spacing: -.01em; }
.route-stop p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.example-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 19px; color: var(--muted-2); font-size: 10px; }
.example-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 7px; font-family: var(--mono); font-size: 10px; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.example-chip:hover { color: var(--route); border-color: rgba(127, 224, 178, .35); background: var(--route-dim); }

.error-banner { display: flex; align-items: flex-start; gap: 10px; max-width: 920px; margin-top: 16px; padding: 13px 15px; color: #f3b3af; background: rgba(239, 154, 148, .08); border: 1px solid rgba(239, 154, 148, .25); border-radius: 10px; font-size: 12px; line-height: 1.55; animation: rise var(--dur-normal) var(--ease) both; }
.error-banner svg { flex: none; margin-top: 1px; }
.error-banner strong { color: #f6c5c1; }
.error-banner em { color: var(--muted); font-style: normal; }

.analysis-view { margin-top: 34px; animation: rise var(--dur-major) var(--ease) both; }
.analysis-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.repo-identity { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.repo-avatar { display: grid; place-items: center; flex: none; width: 43px; height: 43px; color: var(--text); background: var(--panel-raised); border: 1px solid var(--line-strong); border-radius: 11px; }
.analysis-head h2 { margin: 0; font-family: var(--display); font-size: 23px; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.repo-url { display: flex; align-items: center; gap: 7px; margin-top: 6px; color: var(--muted-2); font-family: var(--mono); font-size: 10px; overflow-wrap: anywhere; }
.repo-description { max-width: 560px; margin: 9px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.analysis-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; flex: none; }
.secondary-button, .install-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 37px; padding: 8px 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; font-weight: 700; white-space: nowrap; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.secondary-button:hover { color: var(--text); background: var(--panel-raised); border-color: var(--line-strong); }
.install-button { color: var(--route-ink); background: var(--route); border-color: var(--route); }
.install-button:hover { background: var(--route-bright); }
.install-button:active { transform: scale(0.98); }
.analysis-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font-size: 10px; font-weight: 700; }
.tag.ai { color: var(--blue); background: rgba(147, 184, 239, .08); border-color: rgba(147, 184, 239, .18); }
.tag.scan { color: var(--amber); background: var(--amber-dim); border-color: rgba(238, 194, 122, .2); }
.tag .tag-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Route furniture: section nav + live status strip keep the six questions in order. */
.route-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.route-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; text-decoration: none; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.route-nav a:hover { color: var(--route-bright); border-color: var(--route-line); background: var(--route-dim); }
.route-status { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr); gap: 20px; align-items: center; margin: 0 0 18px; padding: 16px 20px; background: rgba(17, 25, 30, .78); border: 1px solid var(--line); border-top: 2px solid var(--route); border-radius: 0; }
.route-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--route); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.route-verdict { margin: 8px 0 0; color: var(--text); font-size: 12.5px; line-height: 1.6; }
.route-verdict.dim { color: var(--muted); }
.route-status-meter .progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--muted); font-size: 10px; }
.route-status-meter .progress-copy strong { color: var(--route); font-family: var(--mono); font-weight: 500; }
.progress-track { min-height: 4px; height: 4px; overflow: hidden; background: rgba(178, 197, 190, .12); border-radius: 999px; }
.progress-fill { height: 100%; background: var(--route); border-radius: inherit; }

/* Bento overview: the summary carries the most weight and anchors two rows;
   branch / language / files read as compact ledger stamps around it. */
.overview-strip { display: grid; grid-template-columns: 1.35fr .9fr .9fr; grid-template-areas: "summary branch language" "summary files files"; gap: 1px; margin-bottom: 23px; background: var(--line); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.overview-cell { min-height: 77px; padding: 15px 16px; background: rgba(17, 25, 30, .72); }
.overview-cell.summary { grid-area: summary; }
.overview-cell.branch { grid-area: branch; }
.overview-cell.language { grid-area: language; }
.overview-cell.files { grid-area: files; }
.overview-cell .cell-label { color: var(--muted-2); font-size: 10px; }
.overview-cell .cell-value { margin-top: 8px; color: var(--text); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.overview-cell .cell-value.mono { font-family: var(--mono); font-size: 11px; }
.overview-summary { color: var(--muted) !important; font-weight: 500 !important; line-height: 1.4; font-size: 11px !important; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(290px, .72fr); gap: 21px; align-items: start; }
.primary-stack { min-width: 0; }
.panel { background: rgba(17, 25, 30, .74); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.panel + .panel { margin-top: 17px; }
.panel.elevated { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 19px 20px 16px; border-bottom: 1px solid var(--line); }
.panel-title-wrap { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.panel-icon { display: grid; place-items: center; flex: none; width: 27px; height: 27px; color: var(--route); background: var(--route-dim); border-radius: 7px; }
.panel h3 { margin: 2px 0 0; font-size: 13px; letter-spacing: -.01em; }
.panel-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.panel-count { color: var(--muted-2); font-family: var(--mono); font-size: 10px; padding-top: 4px; text-align: right; }

/* The living route: ruled spine, mileage dots, and explicit non-color statuses. */
.install-list { padding: 6px 10px 10px; }
.step-row { position: relative; display: grid; grid-template-columns: 22px 27px minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 15px 10px; border-bottom: 1px solid rgba(178,197,190,.08); transition: background var(--dur-instant) var(--ease); }
.step-row:last-child { border-bottom: 0; }
.step-row:hover { background: rgba(255,255,255,.018); }
.step-row.is-done { opacity: .68; }
.step-row.is-done .step-title { text-decoration: line-through; text-decoration-color: var(--muted-2); }
.step-rail { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 100%; padding-top: 2px; }
.step-dot { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel-raised); color: var(--muted-2); flex: none; }
.step-line { width: 1px; flex: 1; min-height: 26px; margin-top: 5px; background: repeating-linear-gradient(180deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.step-row.is-done .step-line { background: var(--route-line); }
.step-dot.status-done { color: var(--route-ink); background: var(--route); border-color: var(--route); }
.step-dot.status-failed { color: #f7c7c3; background: rgba(239, 154, 148, .16); border-color: rgba(239, 154, 148, .5); }
.step-dot.status-revised { color: var(--route); border-color: var(--route-line); background: var(--route-dim); }
.step-dot.status-pending { color: var(--muted-2); }
.step-number { display: grid; place-items: center; min-width: 26px; height: 26px; color: var(--muted); background: var(--panel-raised); border: 1px solid var(--line-strong); border-radius: 7px; font-family: var(--mono); font-size: 10px; font-weight: 500; }
.step-row.is-done .step-number { color: var(--route-ink); background: var(--route); border-color: var(--route); }
.step-body { min-width: 0; }
.step-title { margin: 2px 0 4px; color: var(--text); font-size: 12px; font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.step-id { color: var(--muted-2); font-size: 9px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; background: var(--panel-soft); }
.step-state { margin: 0 0 8px; color: var(--muted-2); font-family: var(--mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.step-detail { margin: 0 0 9px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.command-block { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 9px 76px 9px 10px; color: #b8d7d1; background: #0a1114; border: 1px solid rgba(178,197,190,.1); border-radius: 6px; font-family: var(--mono); font-size: 10px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.command-block::before { content: '$'; color: var(--route); flex: none; }
.copy-mini { position: absolute; top: 5px; right: 5px; display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 7px; color: var(--muted-2); background: transparent; border-radius: 5px; font-size: 9px; font-weight: 700; }
.copy-mini:hover { color: var(--text); background: var(--panel-raised); }
.step-check { appearance: none; position: relative; min-width: 18px; width: 18px; height: 18px; margin: 1px 0 0; flex: none; border: 1px solid var(--line-strong); border-radius: 5px; background: transparent; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.step-check:hover { border-color: var(--route); }
.step-check:checked { background: var(--route); border-color: var(--route); }
.step-check:checked::after { content: ''; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid var(--bg-deep); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.step-check:focus-visible { outline: 2px solid var(--route); outline-offset: 2px; }

.install-progress { padding: 14px 20px 17px; background: rgba(127,224,178,.05); border-top: 1px solid rgba(127,224,178,.09); }
.install-progress .progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--muted); font-size: 10px; }
.install-progress .progress-copy strong { color: var(--route); font-family: var(--mono); font-weight: 500; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; margin-bottom: 17px; }
.info-panel { min-width: 0; }
.info-panel .panel-heading { padding: 16px 17px 13px; }
.info-panel .panel-icon { width: 24px; height: 24px; }
.info-panel .panel-heading h3 { font-size: 12px; }
.info-list { padding: 5px 17px 15px; }
.info-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; color: var(--muted); border-bottom: 1px solid rgba(178,197,190,.07); font-size: 10px; line-height: 1.5; }
.info-item:last-child { border-bottom: 0; }
.info-bullet { flex: none; width: 5px; height: 5px; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.info-item.dependency .info-bullet { background: var(--route); }
.dependency-meta { margin-left: auto; padding-left: 7px; color: var(--muted-2); font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.empty-list { padding: 13px 0; color: var(--muted-2); font-size: 10px; }

.sticky-column { min-width: 0; }
.sticky-column > .panel { position: sticky; top: 93px; }
.explanation-panel .panel-heading { padding-bottom: 15px; }
.explanation-select { width: 100%; min-height: 33px; height: 33px; margin-top: 13px; padding: 0 9px; color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 7px; outline: 2px solid transparent; outline-offset: 1px; font-size: 10px; }
.explanation-select:focus { border-color: var(--route); }
.explanation-content { padding: 18px 20px 21px; }
.explanation-step-label { display: flex; align-items: center; gap: 7px; color: var(--route); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.explanation-step-label::before { content: ''; width: 16px; height: 1px; background: var(--route); }
.explanation-content h4 { margin: 15px 0 8px; font-family: var(--display); font-size: 15px; letter-spacing: -.01em; }
.explanation-content p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.explanation-tip { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; padding: 11px; color: var(--muted); background: var(--amber-dim); border: 1px solid rgba(238,194,122,.14); border-radius: 8px; font-size: 10px; line-height: 1.55; }
.explanation-tip svg { color: var(--amber); flex: none; margin-top: 1px; }
.files-panel { margin-top: 17px !important; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 15px 17px 17px; }
.file-chip { max-width: 100%; padding: 5px 7px; color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 5px; font-family: var(--mono); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast { position: fixed; z-index: var(--z-toast); right: 23px; bottom: 22px; display: flex; align-items: center; gap: 9px; max-width: min(360px, calc(100vw - 30px)); padding: 12px 14px; color: var(--text); background: #182420; border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: var(--shadow); font-size: 11px; animation: toast-in var(--dur-normal) var(--ease) both; }
.toast.success svg { color: var(--route); }
.toast.error svg { color: var(--red); }

.modal-layer { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 24px; background: var(--modal-overlay); animation: fade var(--dur-instant) var(--ease) both; }
.modal { width: min(570px, 100%); max-height: min(720px, calc(100vh - 48px)); overflow: auto; background: #11191e; border: 1px solid var(--line-strong); border-radius: 15px; box-shadow: var(--shadow-modal); animation: modal-in var(--dur-normal) var(--ease) both; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px 24px 19px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.modal-body { padding: 21px 24px 24px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.form-field label span { color: var(--muted-2); font-family: var(--mono); font-size: 9px; font-weight: 400; }
.text-field, .select-field { width: 100%; min-height: 44px; height: 44px; padding: 0 11px; color: var(--text); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 7px; outline: 2px solid transparent; outline-offset: 1px; font-size: 11px; transition: border-color var(--dur-instant) var(--ease), box-shadow var(--dur-instant) var(--ease); }
.text-field:focus, .select-field:focus { border-color: rgba(127,224,178,.55); box-shadow: 0 0 0 3px rgba(127,224,178,.07), inset 0 0 0 1px rgba(127,224,178,.15); }
.text-field::placeholder { color: var(--muted-2); }
textarea.text-field { height: auto; }
.secret-field { position: relative; }
.secret-field .text-field { padding-right: 38px; }
.reveal-key { position: absolute; top: 7px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; color: var(--muted-2); background: transparent; border-radius: 5px; }
.reveal-key:hover { color: var(--text); background: var(--panel-raised); }
.field-hint { min-height: 1lh; margin: 7px 0 0; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.model-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.fetch-button { min-height: 44px; height: 44px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); background: var(--panel-raised); border: 1px solid var(--line); border-radius: 7px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.fetch-button:hover { color: var(--text); border-color: var(--line-strong); }
.settings-status { min-height: 17px; margin: 1px 0 15px; color: var(--muted-2); font-size: 10px; }
.settings-status.good { color: var(--route); }
.settings-status.bad { color: var(--red); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal .secondary-button, .modal .install-button { min-height: 37px; height: 37px; }

/* Additive AI provider selector. The existing Custom API fields keep their
   original controls; this layer only chooses which independent config is live. */
.ai-settings-modal { width: min(640px, 100%); }
.provider-picker { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.provider-picker legend { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.provider-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.provider-option { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 12px; color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; transition: color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease), background var(--dur-instant) var(--ease); }
.provider-option:hover { color: var(--text); border-color: var(--line-strong); }
.provider-option.selected { color: var(--text); background: var(--route-dim); border-color: var(--route-line); }
.provider-option input { flex: none; margin: 2px 0 0; accent-color: var(--route); }
.provider-option span { min-width: 0; display: grid; gap: 3px; }
.provider-option strong { font-size: 11px; }
.provider-option small { color: var(--muted-2); font-size: 9px; line-height: 1.45; }
.provider-option.selected small { color: var(--muted); }
.provider-panel { min-width: 0; }
.free-ai-cta { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 2px 0 16px; padding: 12px 13px; background: var(--route-dim); border: 1px solid rgba(127, 224, 178, .18); border-radius: 9px; }
.free-ai-cta strong { display: block; color: var(--text); font-size: 10.5px; }
.free-ai-cta p { margin: 3px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.free-ai-cta .secondary-button { flex: none; color: var(--route); background: transparent; border-color: var(--route-line); }
.free-ai-card { padding: 17px; background: var(--panel-soft); border: 1px solid var(--line-strong); border-radius: 11px; }
.free-ai-heading { display: flex; align-items: flex-start; gap: 11px; }
.free-ai-mark { flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: var(--route); background: var(--route-dim); border: 1px solid var(--route-line); border-radius: 9px; }
.free-ai-heading h3 { margin: 0; font-family: var(--display); font-size: 14px; }
.free-ai-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.free-ai-model { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding: 9px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.free-ai-model span { color: var(--muted-2); font-size: 9px; }
.free-ai-model strong { color: var(--muted); font-family: var(--mono); font-size: 9.5px; }
.free-ai-status { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0; min-height: 18px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.free-ai-status .status-dot { margin-top: 4px; }
.free-ai-status.good { color: var(--route); }
.free-ai-status.bad { color: var(--red); }
.free-ai-authorization { display: grid; gap: 7px; margin: -2px 0 13px; padding: 12px; background: var(--route-dim); border: 1px solid var(--route-line); border-radius: 9px; }
.free-ai-authorization > span { color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.free-ai-authorization .authorization-code { color: var(--route); font-family: var(--mono); font-size: 20px; letter-spacing: .12em; overflow-wrap: anywhere; }
.free-ai-authorization p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.55; }
.free-ai-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.free-ai-actions a { text-decoration: none; }
.danger-button { color: var(--red); }
.free-ai-credit { margin: 13px 0 0; padding-top: 11px; color: var(--muted-2); border-top: 1px solid var(--line); font-size: 9px; line-height: 1.55; }
.free-ai-credit a { color: var(--route); text-underline-offset: 2px; }

.script-modal .modal-body { padding-top: 15px; }
.script-copy-note { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.script-block { position: relative; max-height: 310px; overflow: auto; padding: 17px; color: #c0d8d3; background: #090f12; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 10px; line-height: 1.75; white-space: pre-wrap; }
.script-block .script-copy { position: absolute; top: 8px; right: 8px; }

.loading-view { padding: 33px 0; animation: rise var(--dur-normal) var(--ease) both; }
.loading-top { display: flex; align-items: center; gap: 13px; margin-bottom: 21px; }
.loading-orb { width: 39px; height: 39px; display: grid; place-items: center; color: var(--route); background: var(--route-dim); border: 1px solid rgba(127,224,178,.22); border-radius: 11px; }
.loading-view h2 { margin: 0; font-family: var(--display); font-size: 18px; letter-spacing: -.01em; }
.loading-view p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.scan-phases { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 20px; padding: 0; }
.scan-phases li { display: grid; gap: 3px; padding: 11px 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; font-size: 10.5px; font-weight: 700; }
.scan-phases li span { color: var(--muted-2); font-size: 9px; font-weight: 500; line-height: 1.4; }
.skeleton-grid { display: grid; grid-template-columns: 1.4fr .75fr; gap: 20px; }
.skeleton-panel { height: 265px; padding: 20px; background: rgba(17,25,30,.65); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.skeleton-line { height: 10px; margin-bottom: 15px; background: linear-gradient(90deg, rgba(178,197,190,.07), rgba(178,197,190,.16), rgba(178,197,190,.07)); background-size: 220% 100%; border-radius: 4px; animation: shimmer 1.4s infinite; }
.skeleton-line.wide { width: 75%; height: 17px; margin-bottom: 28px; }
.skeleton-line.short { width: 35%; }
.skeleton-line.mid { width: 54%; }

/* Analysis progress bar (live SSE / fallback poll) */
.progress-bar-wrap { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.progress-track { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--route-dim), var(--route)); border-radius: inherit; }
.progress-pct { color: var(--muted); font-family: var(--mono); font-size: 10px; min-width: 36px; text-align: right; }
.scan-phases .phase-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; color: var(--muted-2); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; font-size: 10.5px; font-weight: 700; transition: color 160ms, border-color 160ms, background 160ms; }
.scan-phases .phase-item.active { color: var(--route); border-color: rgba(127,224,178,.3); background: rgba(127,224,178,.06); }
.scan-phases .phase-item.done { color: var(--text); }
.phase-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; transition: background 160ms; }
.scan-phases .phase-item.active .phase-dot { background: var(--route); box-shadow: 0 0 0 3px rgba(127,224,178,.2); animation: phase-pulse 1.2s ease infinite; }
.scan-phases .phase-item.done .phase-dot { background: var(--route); }
.phase-item div { display: grid; gap: 1px; }
.phase-item span { color: var(--muted-2); font-size: 9px; font-weight: 500; line-height: 1.35; }
.progress-error { margin-top: 12px; padding: 10px 12px; color: var(--red); background: rgba(239,154,148,.08); border: 1px solid rgba(239,154,148,.2); border-radius: 8px; font-size: 11px; }

@keyframes phase-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(127,224,178,.2); }
  50% { box-shadow: 0 0 0 6px rgba(127,224,178,0); }
}

/* Primary labels stay intact as their control groups reflow. */
.analyze-button, .new-analysis, .fetch-button, .copy-mini, .fail-button,
.seg-chip, .quick-pick { white-space: nowrap; }

/* Compact desktop chrome gains a full touch target without changing mouse
   layouts or the visible glyph size. */
@media (pointer: coarse) {
  .icon-button, .dots-button, .mini-btn, .copy-mini, .reveal-key,
  .oreo-ctrl-btn, .oreo-icon-btn, .oreo-send,
  .explanation-select, .rename-input, .tree-filter {
    min-width: 44px;
    min-height: 44px;
  }
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -40% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes route-pulse { 0% { box-shadow: 0 0 0 0 rgba(127, 224, 178, .35); } 100% { box-shadow: 0 0 0 9px rgba(127, 224, 178, 0); } }
.step-row.is-failed .step-dot { animation: route-pulse 1.6s var(--ease) 2; }

@media (max-width: 1050px) {
  .topbar { padding: 0 23px; }
  .sidebar { width: 64px; padding-left: 10px; padding-right: 10px; }
  .layout { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar-label, .nav-item span:not(.nav-icon), .new-analysis span, .history, .sidebar-foot { display: none; }
  .new-analysis { width: 40px; height: 40px; padding: 0; margin: 0 auto 29px; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item .nav-icon { width: auto; }
  .main { padding-left: clamp(25px, 5vw, 60px); padding-right: clamp(25px, 5vw, 60px); }
  .brand-sub { display: none; }
  .scan-phases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .topbar-center { display: none; }
  .main { padding-top: 38px; }
  .analysis-head { display: block; }
  .analysis-actions { margin-top: 17px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .sticky-column > .panel { position: static; }
  .overview-strip { grid-template-columns: 1fr 1fr; grid-template-areas: "summary summary" "branch language" "files files"; }
  .skeleton-grid { grid-template-columns: 1fr; }
  .route-status { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { height: 62px; padding: 0 16px; }
  .brand { gap: 9px; }
  .brand-logo, .brand-img { width: 46px; height: 46px; }
  .layout { min-height: calc(100vh - 62px); display: block; }
  .sidebar { display: none; }
  .main { padding: 32px 16px 54px; }
  h1 { font-size: 38px; }
  .hero-copy { font-size: 12px; line-height: 1.7; }
  .repo-form { display: block; padding: 6px; }
  .repo-input-wrap { padding: 0 9px; }
  .analyze-button { width: 100%; margin-top: 3px; }
  .form-meta { align-items: flex-start; flex-direction: column; gap: 7px; margin-top: 11px; }
  .form-meta .shortcut { display: none; }
  .analysis-actions button { flex: 1; }
  .overview-strip { grid-template-columns: 1fr 1fr; grid-template-areas: "summary summary" "branch language" "files files"; }
  .info-grid { grid-template-columns: 1fr; gap: 17px; }
  .step-row { grid-template-columns: 18px 24px minmax(0, 1fr); gap: 10px; }
  .step-body { padding-right: 30px; }
  .step-check { position: absolute; top: 15px; right: 10px; margin: 0; min-width: 24px; width: 24px; height: 24px; }
  .inline-fields { grid-template-columns: 1fr; gap: 0; }
  .model-row, .provider-options { grid-template-columns: 1fr; }
  .free-ai-cta { align-items: stretch; flex-direction: column; }
  .free-ai-cta .secondary-button, .free-ai-actions > button, .free-ai-actions > a { width: 100%; justify-content: center; }
  .free-ai-model { align-items: flex-start; flex-direction: column; gap: 4px; }
  .fetch-button { width: 100%; justify-content: center; }
  .modal-layer { padding: 12px; }
  .modal-head, .modal-body { padding-left: 17px; padding-right: 17px; }
  .connection-pill { display: none; }
  .scan-phases { grid-template-columns: 1fr 1fr; }
  .fail-button, .secondary-button, .install-button { min-height: 44px; }
  .graph-scroll { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.skip-link { position: absolute; top: -100px; left: 16px; z-index: var(--z-skip-link); padding: 8px 14px; color: var(--route-ink); background: var(--route); border-radius: 0 0 8px 8px; font-size: 11px; font-weight: 800; text-decoration: none; transition: top var(--dur-instant) var(--ease); }
.skip-link:focus { top: 0; }

/* --- Feature 1: plain-English overview --- */
.plain-panel { margin-bottom: 21px; border-color: rgba(127, 224, 178, .2); }
.plain-body { padding: 17px 20px 20px; }
.plain-analogy { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; color: #c9ecdd; background: rgba(127, 224, 178, .07); border: 1px solid rgba(127, 224, 178, .18); border-radius: 10px; font-size: 12px; line-height: 1.6; }
.plain-analogy svg { flex: none; margin-top: 2px; color: var(--route); }
.plain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.plain-card { padding: 14px 15px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 10px; }
.plain-card.wide { grid-column: span 2; }
.plain-kicker { color: var(--route); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.plain-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.plain-card ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: 11.5px; line-height: 1.7; display: grid; gap: 6px; }

/* --- Features 3 + 4: Curious Explorer + follow-ups --- */
.explorer-panel { margin-bottom: 21px; }
.explorer-body { padding: 17px 20px 20px; }
.explorer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.explorer-btn { display: flex; align-items: flex-start; gap: 11px; min-height: 44px; padding: 13px 14px; color: var(--text); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 11px; text-align: left; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.explorer-btn:hover:not(:disabled) { border-color: rgba(127, 224, 178, .42); background: var(--route-dim); }
.explorer-btn.active { border-color: rgba(127, 224, 178, .5); background: rgba(127, 224, 178, .08); box-shadow: 0 0 0 3px rgba(127, 224, 178, .06); }
.explorer-btn:disabled { cursor: wait; opacity: .75; }
.explorer-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; color: var(--route); background: rgba(127, 224, 178, .1); border-radius: 8px; }
.explorer-text { display: grid; gap: 3px; min-width: 0; }
.explorer-text strong { font-size: 12px; letter-spacing: -.01em; }
.explorer-text small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.insight-custom { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(178, 197, 190, .16); }
.insight-custom label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.insight-custom-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.insight-panel { margin-top: 14px; padding: 17px 18px; background: #0c1418; border: 1px solid var(--line-strong); border-radius: 12px; animation: rise var(--dur-normal) var(--ease) both; }
.insight-panel.loading, .insight-panel.error { display: flex; align-items: flex-start; gap: 12px; }
.insight-panel.error { border-color: rgba(239, 154, 148, .3); color: var(--muted); font-size: 12px; }
.insight-loading { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); font-size: 12px; }
.insight-loading p, .insight-panel.error p { margin: 5px 0 0; font-size: 11px; }
.insight-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.insight-title-wrap { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.insight-ic { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: var(--route); background: var(--route-dim); border-radius: 8px; }
.insight-title-wrap h4 { margin: 1px 0 7px; font-size: 14px; letter-spacing: -.01em; }
.insight-intro { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.insight-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.insight-list li { position: relative; padding: 11px 12px 11px 30px; color: var(--muted); background: rgba(255, 255, 255, .02); border: 1px solid rgba(178, 197, 190, .1); border-radius: 9px; font-size: 11.5px; line-height: 1.65; }
.insight-list li::before { content: ''; position: absolute; left: 12px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--route); }
.insight-outro { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; padding: 11px 12px; color: #c9ecdd; background: rgba(127, 224, 178, .06); border: 1px solid rgba(127, 224, 178, .16); border-radius: 9px; font-size: 11px; line-height: 1.6; }
.insight-outro svg { flex: none; margin-top: 2px; color: var(--route); }
.followups { margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(178, 197, 190, .16); }
.followups-label { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.followup-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.followup-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px; padding: 8px 11px; color: var(--muted); background: var(--panel-raised); border: 1px solid var(--line-strong); border-radius: 999px; font-size: 11px; text-align: left; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.followup-chip:hover { color: var(--route-bright); border-color: rgba(127, 224, 178, .45); background: rgba(127, 224, 178, .08); }
.chip-arrow { display: inline-grid; place-items: center; flex: none; color: var(--route); }

/* --- Feature 2: sidebar history menu + file tree --- */
.history-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px; border-radius: 8px; }
.history-row.active, .history-entry.renaming { background: rgba(127, 224, 178, .07); }
.history-row.active .history-entry { color: var(--route-bright); }
.history-entry { min-width: 0; }
.history-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.history-sub { display: block; max-width: 100%; color: var(--muted-2); font-family: var(--mono); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.menu-wrap { position: relative; flex: none; }
.dots-button { display: grid; place-items: center; width: 26px; height: 26px; color: var(--muted-2); background: transparent; border-radius: 6px; opacity: 0; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.history-row:hover .dots-button, .dots-button[aria-expanded="true"] { opacity: 1; }
.dots-button:hover { color: var(--text); background: var(--panel-raised); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: var(--z-menu); min-width: 148px; padding: 5px; background: #17231f; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-menu); animation: modal-in var(--dur-instant) var(--ease) both; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; color: var(--muted); background: transparent; border-radius: 7px; font-size: 11px; font-weight: 600; text-align: left; }
.menu-item:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.menu-item.danger { color: #f3a5a0; }
.menu-item.danger:hover { background: rgba(239, 154, 148, .1); color: #f6bcb8; }
.history-entry.renaming { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid rgba(127, 224, 178, .35); border-radius: 8px; }
.rename-input { min-width: 0; flex: 1; height: 28px; padding: 0 8px; color: var(--text); background: var(--bg-deep); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; outline: 2px solid transparent; outline-offset: 1px; }
.rename-input:focus { border-color: var(--route); }
.mini-btn { display: grid; place-items: center; flex: none; width: 26px; height: 26px; color: var(--muted); background: var(--panel-raised); border: 1px solid var(--line); border-radius: 6px; }
.mini-btn.save { color: var(--route-ink); background: var(--route); border-color: var(--route); }
.mini-btn:hover { color: var(--text); border-color: var(--line-strong); }
.side-section { margin-top: 26px; min-width: 0; }
.side-section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 10px 11px; }
.side-section-head .sidebar-label { margin: 0; }
.side-count { color: var(--muted-2); font-family: var(--mono); font-size: 10px; }
.tree-filter { width: 100%; height: 30px; margin-bottom: 8px; padding: 0 10px; color: var(--text); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 7px; font-size: 11px; outline: 2px solid transparent; outline-offset: 1px; }
.tree-filter:focus { border-color: rgba(127, 224, 178, .5); }
.tree-filter::placeholder { color: var(--muted-2); }
.file-tree { max-height: 340px; overflow: auto; padding: 6px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line); border-radius: 10px; scrollbar-width: thin; }
.tree-row { display: flex; align-items: center; gap: 7px; width: 100%; padding: 5px 7px; border-radius: 6px; font-size: 11px; }
.tree-row.dir { color: var(--muted); background: transparent; text-align: left; font-weight: 600; }
.tree-row.dir:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.tree-row.file { color: var(--muted-2); cursor: default; }
.tree-row.file:hover { color: var(--muted); background: rgba(255, 255, 255, .02); }
.tree-caret { display: inline-grid; place-items: center; flex: none; width: 14px; color: var(--muted-2); transition: transform var(--dur-instant) var(--ease); }
.tree-caret.open { transform: rotate(90deg); color: var(--route); }
.tree-ic.dir { color: var(--amber); flex: none; }
.tree-ic.file { color: var(--muted-2); flex: none; }
.tree-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-name.mono { font-family: var(--mono); font-size: 10px; }
.tree-count { margin-left: auto; flex: none; color: var(--muted-2); font-family: var(--mono); font-size: 9px; }
.tree-children { margin-left: 10px; padding-left: 8px; border-left: 1px solid rgba(178, 197, 190, .12); }
.tree-empty { padding: 10px; color: var(--muted-2); font-size: 10px; }
.tree-foot { margin-top: 7px; padding: 0 2px; color: var(--muted-2); font-size: 9px; line-height: 1.5; }

@media (max-width: 800px) {
  .plain-grid { grid-template-columns: 1fr; }
  .plain-card.wide { grid-column: span 1; }
  .explorer-grid { grid-template-columns: 1fr; }
  .insight-custom-row { grid-template-columns: 1fr; }
}

/* ===========================================================================
   v2 — living path, failure-first, path graph, contract, reader mode, health
   =========================================================================== */

/* tones used by the score ring, factor bars and risk chips */
.tone-mint { color: var(--route); }
.tone-blue { color: var(--blue); }
.tone-amber { color: var(--amber); }
.tone-red { color: var(--red); }

/* --- Feature 6: health ----------------------------------------------------- */
.health-body { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 20px; padding: 18px 20px 14px; }
.health-score { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 2px; }
.ring { width: 108px; height: 108px; }
.ring-track { fill: none; stroke: rgba(178,197,190,.14); stroke-width: 5; }
.ring-fill { fill: none; stroke-width: 5; stroke-linecap: round; stroke: var(--route); transition: stroke-dashoffset var(--dur-major) var(--ease); }
.ring-fill.tone-blue { stroke: var(--blue); }
.ring-fill.tone-amber { stroke: var(--amber); }
.ring-fill.tone-red { stroke: var(--red); }
.ring-value { fill: var(--text); font-family: var(--mono); font-size: 19px; font-weight: 700; }
.ring-max { fill: var(--muted-2); font-family: var(--mono); font-size: 8px; }
.health-band { display: grid; gap: 5px; text-align: center; }
.health-band strong { font-size: 12px; letter-spacing: -.01em; }
.health-band span { color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.health-factors { display: grid; gap: 13px; align-content: start; }
.factor-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 10.5px; font-weight: 700; }
.factor-top b { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--muted); }
.factor-track { height: 4px; margin: 5px 0 4px; background: rgba(178,197,190,.12); border-radius: 999px; overflow: hidden; }
.factor-track i { display: block; height: 100%; background: var(--route); border-radius: 999px; }
.factor-track i.tone-blue { background: var(--blue); }
.factor-track i.tone-amber { background: var(--amber); }
.factor-track i.tone-red { background: var(--red); }
.factor p { margin: 0; color: var(--muted-2); font-size: 10px; line-height: 1.55; }
.health-caps { display: grid; gap: 6px; padding: 0 20px 12px; }
.cap-item { display: flex; align-items: flex-start; gap: 7px; padding: 8px 10px; color: var(--amber); background: var(--amber-dim); border: 1px solid rgba(238,194,122,.2); border-radius: 7px; font-size: 10.5px; line-height: 1.5; }
.health-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 11px 20px 13px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; }
.health-foot span { display: inline-flex; align-items: center; gap: 5px; }

/* --- Feature 2: failure-first --------------------------------------------- */
.fail-list { display: grid; }
.fail-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 132px; gap: 12px; padding: 15px 20px; border-bottom: 1px solid rgba(178,197,190,.08); }
.fail-row:last-child { border-bottom: 0; }
.fail-row.origin-inferred { background: rgba(178,197,190,.02); }
.fail-row.origin-predicted { background: rgba(147,184,239,.04); }
.fail-rank { color: var(--muted-2); font-family: var(--mono); font-size: 11px; padding-top: 2px; }
.fail-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fail-title h4 { margin: 0; font-size: 12px; letter-spacing: -.01em; }
.fail-main p { margin: 6px 0 8px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.origin-badge { padding: 3px 6px; color: var(--muted-2); background: var(--panel-raised); border: 1px solid var(--line); border-radius: 5px; font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: .06em; }
.origin-inferred .origin-badge { color: var(--muted); }
.origin-predicted .origin-badge { color: var(--blue); border-color: rgba(147,184,239,.3); }
.origin-reported .origin-badge { color: var(--red); border-color: rgba(239,154,148,.28); }
.fail-scale { display: flex; align-items: center; gap: 9px; color: var(--muted-2); font-size: 9.5px; }
.scale-track { flex: 1; max-width: 190px; min-height: 4px; height: 4px; background: rgba(178,197,190,.12); border-radius: 999px; overflow: hidden; }
.scale-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--red)); border-radius: 999px; }
.no-count { font-style: italic; }
.fail-evidence { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.fail-evidence a { color: var(--blue); font-size: 10px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fail-evidence a:hover { text-decoration: underline; }
.fail-fix { margin-top: 9px; }
.fail-patch { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding-top: 3px; }
.patched, .unpatched { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 6px; font-size: 9.5px; font-weight: 700; }
.patched { color: var(--route); background: var(--route-dim); }
.unpatched { color: var(--muted-2); background: var(--panel-raised); border: 1px solid var(--line); }
.link-button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 2px; color: var(--muted); background: none; border: 0; font-size: 9.5px; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(178,197,190,.3); cursor: pointer; }
.link-button:hover { color: var(--route); text-decoration-color: var(--route); }
.fail-empty { display: flex; align-items: center; gap: 9px; padding: 18px 20px; color: var(--muted); font-size: 11px; }
.fail-empty svg { color: var(--route); flex: none; }
.fail-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 20px 12px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; }
.fail-notice { margin: 0 20px 14px; padding: 8px 10px; background: var(--panel-soft); border-radius: 7px; }

/* --- Feature 3: path graph ------------------------------------------------- */
.graph-scroll { overflow-x: auto; padding: 16px 20px 8px; }
.graph-svg { display: block; }
.graph-edge { fill: none; stroke: rgba(178,197,190,.16); stroke-width: 1.2; }
.graph-edge.on-path { stroke: var(--route); stroke-width: 1.7; }
.graph-node { fill: var(--panel-raised); stroke: var(--line); stroke-width: 1; }
.graph-node.root, .graph-node.end { fill: var(--panel-soft); }
.graph-node.active { fill: rgba(127,224,178,.13); stroke: var(--route); }
.graph-text { fill: var(--muted); font-family: var(--mono); font-size: 10px; }
.graph-text.active { fill: var(--route-bright); }
.graph-hit { cursor: pointer; }
.graph-hit:hover rect { fill: rgba(255,255,255,.05); }
.graph-hit:focus-visible { outline: 2px solid var(--route); outline-offset: 3px; border-radius: 8px; }
.graph-alt { margin: 4px 20px 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); }
.graph-alt summary { cursor: pointer; padding: 10px 12px; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.graph-alt-body { display: grid; gap: 10px; padding: 4px 12px 12px; }
.graph-alt-row { display: grid; gap: 6px; }
.graph-alt-row span { display: grid; gap: 1px; color: var(--muted-2); font-size: 9.5px; }
.graph-alt-row strong { color: var(--text); font-size: 10.5px; }
.graph-alt-row em { font-style: normal; }
.graph-axis-labels { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 4px 20px 12px; }
.axis-label { display: grid; gap: 2px; min-width: 130px; }
.axis-label strong { font-size: 10px; }
.axis-label span { color: var(--muted-2); font-size: 9.5px; }
.graph-detail { padding: 0 20px 12px; }
.graph-tradeoff { display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; color: var(--blue); background: rgba(147,184,239,.09); border-radius: 7px; font-size: 10.5px; line-height: 1.55; }
.graph-tradeoff.warn { color: var(--amber); background: var(--amber-dim); }
.graph-tradeoff + .graph-tradeoff { margin-top: 6px; }
.path-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 20px 14px; border-top: 1px solid var(--line); }
.pills-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-2); font-family: var(--mono); font-size: 9.5px; margin-right: 4px; }
.path-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: var(--muted); background: var(--panel-raised); border: 1px solid var(--line); border-radius: 999px; font-size: 9.5px; }
.path-pill.done { color: var(--route); border-color: rgba(127,224,178,.3); background: var(--route-dim); }
.graph-foot { padding: 0 20px 14px; }
.path-selection { color: var(--route); text-align: right; }

/* --- Feature 1: living path ------------------------------------------------ */
.steps-panel { border-top: 2px solid var(--route); }
.step-row.is-failed { background: rgba(239,154,148,.05); box-shadow: inset 0 -2px 0 var(--red); }
.step-row.is-failed .step-number { color: var(--red); border-color: rgba(239,154,148,.4); }
.step-row.is-revised .step-number { display: grid; place-items: center; color: var(--route); border-color: rgba(127,224,178,.38); }
.rev-badge { margin-left: 7px; padding: 2px 5px; color: var(--route); background: var(--route-dim); border-radius: 4px; font-family: var(--mono); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; vertical-align: 2px; }
.step-guard, .step-patch { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; color: var(--amber); font-size: 10px; line-height: 1.5; }
.step-guard svg, .step-patch svg { flex: none; margin-top: 1px; }
.step-patch { color: var(--route); }
.verify-block { border-color: rgba(127,224,178,.24); }
.verify-block::before { display: none; }
.verify-icon { margin-top: 1px; color: var(--route); }
.step-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 9px; }
.fail-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 9px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; font-size: 9.5px; font-weight: 700; cursor: pointer; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.fail-button:hover { color: var(--red); border-color: rgba(239,154,148,.45); background: rgba(239,154,148,.07); }
.failed-tag { color: var(--red); font-size: 9.5px; font-weight: 700; }
.steps-foot { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px 20px 14px; border-top: 1px solid var(--line); }
.tempo-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 9.5px; }

.rev-list { display: grid; gap: 0; margin: 0; padding: 6px 20px 14px; list-style: none; }
.rev-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(178,197,190,.08); }
.rev-item:last-child { border-bottom: 0; }
.rev-marker { color: var(--route); font-family: var(--mono); font-size: 10px; }
.rev-body h4 { margin: 0 0 4px; font-size: 11.5px; }
.rev-body p { margin: 0 0 7px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.rev-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted-2); font-family: var(--mono); font-size: 9px; }

/* --- recovery report ------------------------------------------------------- */
.recovery-panel { border-top: 2px solid var(--route); }
.recovery-body { padding: 16px 20px 18px; }
.recovery-diagnosis { margin: 0; color: var(--text); font-size: 12px; line-height: 1.65; }
.recovery-second { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.recovery-body h4 { margin: 16px 0 8px; color: var(--muted-2); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.recovery-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.recovery-list code { margin-left: 8px; padding: 2px 6px; color: #b8d7d1; background: #0a1114; border-radius: 4px; font-family: var(--mono); font-size: 9.5px; }
.recovery-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* --- Feature 4: contract -------------------------------------------------- */
.contract-panel { border-color: rgba(229, 207, 155, .28); }
.contract-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 20px; color: var(--muted-2); background: var(--panel-soft); border-bottom: 1px solid var(--line); font-size: 9.5px; }
.contract-id { color: var(--stamp); letter-spacing: .04em; }
.contract-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 17px 20px; }
.contract-section h4 { margin: 0 0 9px; color: var(--muted-2); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.contract-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.contract-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: baseline; }
.contract-list strong { font-size: 11px; }
.contract-list span, .contract-list code { color: var(--muted); font-size: 10px; line-height: 1.5; }
.contract-list code { font-family: var(--mono); }
.contract-list .from { grid-column: 1 / -1; color: var(--muted-2); font-size: 9px; }
.contract-list .conf-declared { color: var(--route); font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.contract-list .conf-inferred { color: var(--amber); font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.contract-list .scope, .contract-list .risk { font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.contract-state { margin: 0 0 9px; color: var(--muted); font-size: 10.5px; line-height: 1.65; }
.expect-line { display: flex; align-items: flex-start; gap: 6px; margin: 7px 0 0; color: var(--route); font-size: 10px; }
.contract-none { margin: 0; color: var(--muted-2); font-size: 10px; font-style: italic; }
.contract-gaps { margin: 0 20px 16px; padding: 12px 14px; background: var(--panel-soft); border: 1px dashed var(--line-strong); border-radius: 9px; }
.contract-gaps h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--amber); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.contract-gaps ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 10px; line-height: 1.6; }
.contract-gaps strong { color: var(--text); }
.contract-check { padding: 15px 20px; border-top: 1px solid var(--line); }
.contract-check h4 { margin: 0 0 10px; color: var(--muted-2); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.contract-check ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.contract-check li { display: grid; gap: 4px; }
.contract-check label { display: flex; align-items: flex-start; gap: 9px; font-size: 11px; line-height: 1.5; cursor: pointer; }
.contract-check input { appearance: none; position: relative; min-width: 16px; width: 16px; height: 16px; margin: 1px 0 0; flex: none; border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; }
.contract-check input:checked { background: var(--route); border-color: var(--route); }
.contract-check input:checked::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid var(--bg-deep); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.contract-check li.ticked span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted-2); }
.contract-check code { margin-left: 25px; padding: 4px 7px; color: #b8d7d1; background: #0a1114; border-radius: 5px; font-family: var(--mono); font-size: 9.5px; overflow-wrap: anywhere; }
.contract-signed { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding: 10px 12px; color: var(--route); background: var(--route-dim); border: 1px solid rgba(127,224,178,.3); border-radius: 8px; font-size: 10.5px; font-weight: 700; }
.contract-sign { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 20px; background: var(--panel-soft); border-top: 1px solid var(--line); }
.sign-block { display: grid; gap: 2px; }
.sign-block span { color: var(--muted-2); font-size: 8.5px; text-transform: uppercase; letter-spacing: .1em; }
.sign-block strong { font-size: 11px; }
.sign-block em { color: var(--muted); font-size: 9.5px; font-style: normal; }
.sign-hash { display: grid; gap: 2px; padding: 8px 11px; color: var(--stamp); background: rgba(229,207,155,.06); border: 1px solid rgba(229,207,155,.24); border-radius: 7px; font-size: 11px; letter-spacing: .08em; text-align: right; }
.sign-hash span { color: var(--muted-2); font-family: var(--sans); font-size: 9px; letter-spacing: 0; }
.contract-guarantees { display: grid; gap: 5px; margin: 0; padding: 13px 20px 16px; list-style: none; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; line-height: 1.55; }
.contract-guarantees li { display: flex; gap: 7px; }
.contract-guarantees li::before { content: '—'; color: var(--line-strong); flex: none; }

/* --- Feature 5: reader mode ------------------------------------------------ */
.seg-block { margin-top: 16px; max-width: 920px; }
.seg-label { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; margin-bottom: 8px; color: var(--muted-2); font-size: 10px; font-weight: 700; }
.seg-label em { color: var(--muted-2); font-size: 9.5px; font-style: normal; font-weight: 500; }
.seg-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg-option { display: grid; gap: 4px; padding: 11px 12px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.seg-option strong { color: var(--text); font-size: 11px; }
.seg-option span { color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.seg-option:hover { border-color: var(--line-strong); background: var(--panel-raised); }
.seg-option.active { border-color: var(--route); background: var(--route-dim); }
.seg-option.active strong { color: var(--route-bright); }
.seg-inline { display: flex; align-items: center; gap: 5px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.seg-chip { padding: 6px 9px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; font-size: 9.5px; font-weight: 700; cursor: pointer; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.seg-chip:hover { color: var(--text); }
.seg-chip.active { color: var(--route-ink); background: var(--route); }
.seg-note { padding-right: 7px; color: var(--muted-2); font-family: var(--mono); font-size: 8.5px; }

/* --- failure dialog ------------------------------------------------------- */
.fail-modal { max-width: 620px; }
.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.field-label em { color: var(--route); font-style: normal; font-size: 9.5px; }
.failure-text { min-height: 120px; padding: 10px; font-family: var(--mono); font-size: 10px; line-height: 1.6; resize: vertical; }
.quick-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-pick { padding: 6px 9px; color: var(--muted); background: var(--panel-raised); border: 1px solid var(--line); border-radius: 999px; font-size: 9.5px; cursor: pointer; transition: color var(--dur-instant) var(--ease), background-color var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease); }
.quick-pick:hover { color: var(--text); border-color: var(--route); }
.fail-expect { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; background: var(--panel-soft); border-radius: 8px; }
.fail-expect svg { color: var(--route); flex: none; margin-top: 1px; }
.fail-expect p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.resume-note { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; padding: 10px 13px; color: var(--route); background: var(--route-dim); border: 1px solid rgba(127,224,178,.24); border-radius: 10px; font-size: 10.5px; }
.resume-note .link-button { margin-left: auto; color: var(--route); }

@media (max-width: 1080px) {
  .health-body { grid-template-columns: 1fr; }
  .health-score { flex-direction: row; justify-content: flex-start; text-align: left; }
  .health-band { text-align: left; }
  .contract-grid { grid-template-columns: 1fr; gap: 16px; }
  .fail-row { grid-template-columns: 24px minmax(0, 1fr); }
  .fail-patch { grid-column: 2; flex-direction: row; align-items: center; }
}

@media (max-width: 720px) {
  .seg-row { grid-template-columns: 1fr; }
  .analysis-actions { width: 100%; }
  .seg-inline { width: 100%; justify-content: space-between; }
  .insight-custom-row { grid-template-columns: 1fr; }
  .step-row { grid-template-columns: 18px 24px minmax(0, 1fr); }
  .step-check { position: absolute; top: 12px; right: 8px; margin: 0; min-width: 32px; width: 32px; height: 32px; }
  .step-body { padding-right: 34px; }
}

/* Mobile bottom navigation — provides section switching on small screens where the sidebar is hidden. */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-mobile-nav); padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; min-width: 44px; flex: 1; padding: 6px 4px; color: var(--muted-2); background: transparent; border: 0; border-radius: 8px; font-size: 9px; font-weight: 700; transition: color var(--dur-instant) var(--ease), background var(--dur-instant) var(--ease); }
.mobile-nav-item:hover, .mobile-nav-item:active { color: var(--route); background: var(--route-dim); }
@media (max-width: 600px) {
  .mobile-nav { display: flex; }
  .main { padding-bottom: 72px; }
}

/* Focus-visible ring for interactive SVG graph nodes. */
.graph-hit:focus-visible rect { stroke: var(--route); stroke-width: 2; outline: none; }

/* --- Daylight mode ----------------------------------------------------------
   Light theme. Only variable overrides + remaps of hard-coded dark surfaces.
   Nothing above this block is changed. */
[data-theme="light"] {
  --bg: #f2f5f3;
  --bg-deep: #ffffff;
  --panel: #ffffff;
  --panel-raised: #e9efec;
  --panel-soft: #f7faf8;
  --ledger: #edf1ee;
  --line: rgba(28, 62, 50, .14);
  --line-strong: rgba(28, 62, 50, .28);
  --route: #09704d;
  --route-bright: #075f40;
  --route-dim: rgba(15, 157, 108, .12);
  --route-line: rgba(15, 157, 108, .42);
  --text: #0f1d18;
  --muted: #33504a;
  --muted-2: #52655e;
  --amber: #8a5f0d;
  --amber-dim: rgba(138, 95, 13, .1);
  --red: #a93226;
  --blue: #2456ad;
  --stamp: #7e6325;
  --shadow: 0 5px 16px rgba(20, 40, 32, .09);
  --shadow-md: 0 7px 20px rgba(20, 40, 32, .1);
  --shadow-menu: 0 10px 24px rgba(20, 40, 32, .13);
  --shadow-modal: 0 18px 46px rgba(20, 40, 32, .16);
  --dot: rgba(28, 62, 50, .14);
  --manual: #102019;
  --manual-ink: #f2f6f3;
  --manual-muted: #afc0b8;
  --manual-line: rgba(242, 246, 243, .24);
  --manual-accent: #8ce3b7;
  --manual-control: #f4f7f5;
  --manual-control-text: #102019;
  --manual-control-muted: #50635b;
}
[data-theme="light"] body::after { opacity: .28; }
[data-theme="light"] .topbar { background: var(--bg); }
[data-theme="light"] .mobile-nav { background: var(--bg); }
[data-theme="light"] .repo-form,
[data-theme="light"] .panel,
[data-theme="light"] .route-preview,
[data-theme="light"] .overview-cell,
[data-theme="light"] .skeleton-panel,
[data-theme="light"] .modal,
[data-theme="light"] .menu-pop { background: #ffffff; }
[data-theme="light"] .route-status,
[data-theme="light"] .overview-strip { background: #ffffff; }
[data-theme="light"] .toast { background: #ffffff; }
[data-theme="light"] .insight-panel { background: var(--panel-soft); }
[data-theme="light"] .file-tree { background: rgba(28, 62, 50, .04); }
[data-theme="light"] .tree-filter,
[data-theme="light"] .tree-filter::placeholder { color: var(--muted-2); }
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .history-entry:hover,
[data-theme="light"] .tree-row.dir:hover,
[data-theme="light"] .step-row:hover,
[data-theme="light"] .menu-item:hover,
[data-theme="light"] .mini-btn:hover,
[data-theme="light"] .reveal-key:hover,
[data-theme="light"] .copy-mini:hover,
[data-theme="light"] .secondary-button:hover,
[data-theme="light"] .fetch-button:hover,
[data-theme="light"] .icon-button:hover { background: rgba(28, 62, 50, .06); }
[data-theme="light"] .graph-hit:hover rect { fill: rgba(28, 62, 50, .06); }
[data-theme="light"] .nav-item.is-active,
[data-theme="light"] .seg-option.active {
  background: rgba(15, 157, 108, .08);
  border-color: rgba(15, 157, 108, .38);
}
[data-theme="light"] .seg-option.active {
  box-shadow: 0 0 0 1px rgba(15, 157, 108, .4), 0 4px 12px rgba(20, 40, 32, .08);
}
[data-theme="light"] .tag { background: #ffffff; }
[data-theme="light"] .tag.scan,
[data-theme="light"] .plain-kicker { color: #8a5f0d; }
[data-theme="light"] .plain-analogy,
[data-theme="light"] .insight-outro { color: #0b5c40; background: rgba(15, 157, 108, .08); border-color: rgba(15, 157, 108, .22); }
[data-theme="light"] .error-banner { color: #8f2b25; background: rgba(169, 50, 38, .08); border-color: rgba(169, 50, 38, .26); }
[data-theme="light"] .error-banner strong { color: #6f1f1a; }
[data-theme="light"] .step-dot.status-failed { color: #8f2b25; }
[data-theme="light"] .menu-item.danger { color: #a93226; }
[data-theme="light"] .repo-avatar {
  color: #17332c;
  background: var(--panel-raised);
  border-color: rgba(28, 62, 50, .22);
}
[data-theme="light"] .brand-logo { filter: none; }
[data-theme="light"] .status-dot.online { box-shadow: 0 0 0 4px rgba(15, 157, 108, .14); }
[data-theme="light"] .rule-label,
[data-theme="light"] .seg-label em { color: #52655e; }

/* ===========================================================================
   Oreo the cat bot — floating local-SVG button + messenger panel.
   Fixed 20px/20px bottom-right, z-index above every app layer.
   =========================================================================== */
/* Excalidraw-style handwriting, messenger ONLY. Served locally from
   /assets/fonts/ so the rest of the site keeps its own type. */
@font-face {
  font-family: 'Excalifont';
  src: url('/assets/fonts/Excalifont-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.oreo-panel, .oreo-tip {
  --oreo-hand: 'Excalifont', 'Segoe Print', 'Comic Sans MS', 'Chalkboard SE', cursive;
}
.oreo-bubble-msg, .oreo-input, .oreo-chip, .oreo-tip-text, .oreo-head-text strong, .oreo-head-text span {
  font-family: var(--oreo-hand);
}
/* Code stays monospace even inside the messenger — readability first. */
.oreo-pre, .oreo-pre code, .oreo-code { font-family: var(--mono); }
.oreo-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-oreo);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.oreo-float > * { pointer-events: auto; }
.oreo-fab {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: grab;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .65));
  transition: transform var(--dur-instant) var(--ease);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.oreo-fab:hover { transform: translateY(-2px) scale(1.03); }
.oreo-fab:active { transform: scale(.96); cursor: grabbing; }
.oreo-fab:focus-visible { outline: 2px solid var(--route); outline-offset: 4px; }
.oreo-mascot { width: 72px; height: 72px; display: block; pointer-events: none; }
.oreo-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.oreo-ctrl-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.oreo-ctrl-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--panel-raised); }
.oreo-ctrl-btn[aria-pressed="true"] { color: var(--route-bright); border-color: var(--route-line); }
.oreo-float.oreo-dragging { transition: none; }
.oreo-float.oreo-dragging .oreo-fab { transform: none; }
.oreo-float.oreo-dragging, .oreo-float.oreo-dragging .oreo-fab { cursor: grabbing; }
.oreo-show {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 13px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .6);
}
.oreo-show:hover { color: var(--route-bright); border-color: var(--route-line); }
.oreo-tip {
  max-width: 180px;
  padding: 7px 10px 8px;
  display: grid;
  gap: 2px;
  color: var(--text);
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .6);
  font-size: 11px;
  line-height: 1.45;
  animation: oreo-tip-in var(--dur-normal) var(--ease) both;
}
.oreo-tip-name { color: var(--route); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.oreo-tip-text { color: var(--text); }
.oreo-tip-anim { animation: oreo-tip-fade .5s var(--ease) both; }
@keyframes oreo-tip-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes oreo-tip-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.oreo-panel {
  /* Docked in the blank left gutter (clear of the 240px sidebar), fixed to
     the viewport so it stays nearby no matter how far you have scrolled.
     The robot himself stays wherever you dragged him. */
  position: fixed;
  left: 264px;
  bottom: 24px;
  z-index: var(--z-oreo-panel);
  width: min(320px, calc(100vw - 300px));
  height: min(440px, calc(100vh - 190px));
  min-height: 300px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .65);
  animation: modal-in var(--dur-normal) var(--ease) both;
}
.oreo-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  background: var(--panel-raised);
  border-bottom: 1px solid var(--line);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.oreo-head:active { cursor: grabbing; }
.oreo-head button { cursor: pointer; }
.oreo-panel.oreo-panel-dragging { cursor: grabbing; }
.oreo-panel.oreo-panel-dragging .oreo-head { cursor: grabbing; }
.oreo-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  color: var(--route-ink);
  background: var(--route);
  border-radius: 50%;
  font-weight: 800;
  font-size: 17px;
}
.oreo-avatar-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 10px;
  height: 10px;
  background: #2ecc71;
  border: 2px solid var(--panel-raised);
  border-radius: 50%;
}
.oreo-head-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.oreo-head-text strong { font-size: 13px; letter-spacing: -.01em; }
.oreo-head-text span { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oreo-icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
}
.oreo-icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.oreo-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  scrollbar-width: thin;
}
.oreo-msg { display: flex; }
.oreo-msg.user { justify-content: flex-end; }
.oreo-msg.bot { justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 3px; }
.oreo-msg-name { color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding-left: 4px; }
.oreo-bubble-msg {
  max-width: 88%;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 14px;
  overflow-wrap: anywhere;
}
.oreo-msg.user .oreo-bubble-msg { color: var(--route-ink); background: var(--route); border-bottom-right-radius: 4px; font-weight: 500; }
.oreo-msg.bot .oreo-bubble-msg { color: var(--text); background: var(--panel-raised); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
/* Standard markdown inside bot bubbles */
.oreo-md p { margin: 0 0 8px; color: inherit; }
.oreo-md p:last-child { margin-bottom: 0; }
.oreo-md h3, .oreo-md h4, .oreo-md h5, .oreo-md h6 { margin: 4px 0 8px; font-size: 13px; letter-spacing: -.01em; line-height: 1.4; }
.oreo-md ul, .oreo-md ol { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.oreo-md li { line-height: 1.6; }
.oreo-md li::marker { color: var(--route); }
.oreo-md a { color: var(--route-bright); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.oreo-md blockquote { margin: 0 0 8px; padding: 8px 10px; color: #c9ecdd; background: rgba(127, 224, 178, .07); border-left: 1px solid var(--route); border-radius: 0 8px 8px 0; font-size: 11.5px; }
.oreo-md hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.oreo-code { padding: 1px 5px; color: #b8d7d1; background: #0a1114; border: 1px solid rgba(178, 197, 190, .14); border-radius: 5px; font-family: var(--mono); font-size: 10.5px; }
.oreo-pre { margin: 0 0 8px; max-width: 100%; overflow: auto; padding: 10px 11px; color: #c0d8d3; background: #090f12; border: 1px solid var(--line); border-radius: 9px; font-family: var(--mono); font-size: 10.5px; line-height: 1.6; white-space: pre-wrap; }
.oreo-pre:last-child { margin-bottom: 0; }
.oreo-table-wrap { max-width: 100%; overflow: auto; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 9px; }
.oreo-table-wrap table { width: 100%; border-collapse: collapse; font-size: 11px; }
.oreo-table-wrap th, .oreo-table-wrap td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.oreo-table-wrap th { color: var(--text); background: var(--panel-soft); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.oreo-table-wrap tr:last-child td { border-bottom: 0; }
.oreo-chips { display: flex; gap: 7px; overflow-x: auto; padding: 4px 12px 10px; scrollbar-width: none; }
.oreo-chips::-webkit-scrollbar { display: none; }
.oreo-chip {
  flex: none;
  padding: 7px 11px;
  color: var(--muted);
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.oreo-chip:hover { color: var(--route-bright); border-color: var(--route-line); background: var(--route-dim); }
.oreo-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--panel-soft); }
.oreo-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  outline: 2px solid transparent; outline-offset: 1px;
}
.oreo-input:focus { border-color: var(--route); box-shadow: 0 0 0 3px rgba(127, 224, 178, .08); }
.oreo-send {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--route-ink);
  background: var(--route);
  border-radius: 50%;
  font-size: 15px;
}
.oreo-send:hover { background: var(--route-bright); }
.oreo-typing { display: inline-flex; gap: 5px; align-items: center; padding: 13px 14px; }
.oreo-typing span { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; animation: oreo-blink 1.1s infinite; }
.oreo-typing span:nth-child(2) { animation-delay: .15s; }
.oreo-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes oreo-blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
[data-theme="light"] .oreo-tip { background: #ffffff; }
[data-theme="light"] .oreo-panel { background: #ffffff; }
[data-theme="light"] .oreo-head { background: #f2f5f3; }
[data-theme="light"] .oreo-msg.bot .oreo-bubble-msg { background: #f2f5f3; }
[data-theme="light"] .oreo-md a { color: #0b7a55; }
[data-theme="light"] .oreo-md blockquote { color: #0b5c40; }
[data-theme="light"] .oreo-form { background: #f7faf8; }
[data-theme="light"] .oreo-input { background: #ffffff; }
@media (max-width: 1050px) {
  /* Collapsed 64px icon sidebar: keep the panel clear of it. */
  .oreo-panel { left: 84px; width: min(320px, calc(100vw - 108px)); }
}
@media (max-width: 600px) {
  .oreo-float { right: 12px; bottom: 64px; }
  .oreo-fab { width: 64px; height: 64px; }
  .oreo-mascot { width: 60px; height: 60px; }
  /* No sidebar on mobile: bottom sheet above the mobile nav. */
  .oreo-panel { left: 12px; right: 12px; bottom: 76px; width: auto; height: min(400px, calc(100vh - 190px)); }
  .oreo-tip { max-width: 190px; font-size: 11px; }
}


/* Native form controls keep a geometry-stable outline and expose it instantly
   for keyboard focus, including the protected Oreo composer. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--route);
  outline-offset: 1px;
}
