/* Litmus — ink-dark lab UI. Brand: litmus-purple (neutral dye).
   Signature: the litmus strip, rose (weak) → amber (needs review) → teal (strong). */

:root {
  --ink: #0e1017;
  --panel: #141721;
  --panel-2: #191d2b;
  --line: #262b3d;
  --line-soft: #1e2333;
  --text: #edeff6;
  --muted: #949aaf;
  --faint: #6b7188;
  --purple: #b3a1f7;
  --purple-deep: #7c66e0;
  --teal: #52d6b4;
  --amber: #efb35f;
  --rose: #f07a90;
  --strip: linear-gradient(90deg, #f07a90, #efb35f 38%, #b3a1f7 62%, #52d6b4);
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--ink); color: var(--text); font-family: var(--body); font-size: 14px; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(179, 161, 247, .3); }

/* ---------- signature strip ---------- */
.strip { position: relative; height: 8px; border-radius: 4px; background: var(--strip); }
.strip-marker { position: absolute; top: 50%; width: 16px; height: 16px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 2px 8px rgba(0,0,0,.5); transition: left 1.1s cubic-bezier(.3,1.2,.35,1); }
.strip-legend { display: flex; justify-content: space-between; margin-top: 8px; color: var(--faint); font: 10px var(--mono); letter-spacing: .5px; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; height: 62px; padding: 0 26px; border-bottom: 1px solid var(--line-soft); background: rgba(14,16,23,.92); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; cursor: pointer; }
.brand-strip { width: 14px; height: 26px; border-radius: 3px; background: linear-gradient(180deg, #f07a90, #b3a1f7 55%, #52d6b4); }
.brand-name { font: 560 21px var(--display); letter-spacing: -.4px; color: var(--text); }
.top-center { margin: auto; color: var(--faint); font: 10px var(--mono); letter-spacing: 1.2px; }
.top-center span { color: var(--purple); }
.top-nav { display: flex; gap: 8px; }
.top-link { padding: 7px 13px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s; }
.top-link:hover { color: var(--text); border-color: var(--purple-deep); }

/* ---------- views ---------- */
.view { display: none; }
.view.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } .strip-marker { transition: none; } }

/* ---------- typography ---------- */
h1 { margin: 0; font: 420 44px/1.08 var(--display); letter-spacing: -.8px; }
h1 em { font-style: italic; color: var(--purple); }
.page-kicker { margin-bottom: 14px; color: var(--purple); font: 10px var(--mono); letter-spacing: 1.4px; }
.lede { max-width: 560px; margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.mono-note { color: var(--faint); font: 11px var(--mono); }

/* ---------- welcome ---------- */
.welcome-view { max-width: 1180px; margin: auto; padding: 90px 48px 70px; }
.welcome-view.active { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; min-height: calc(100vh - 62px); }
.eyebrow { margin-bottom: 18px; color: var(--rose); font: 10px var(--mono); letter-spacing: 1.6px; }
.welcome-copy h1 { font-size: 58px; }
.welcome-copy p { max-width: 540px; margin: 22px 0 34px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.hero-strip { max-width: 440px; }
.hero-marker { left: 12%; animation: sweep 2.6s .5s cubic-bezier(.35,1,.4,1) forwards; }
@keyframes sweep { to { left: 88%; } }
@media (prefers-reduced-motion: reduce) { .hero-marker { animation: none; left: 88%; } }
.role-grid { display: grid; gap: 14px; }
.role-card { position: relative; padding: 26px 24px 22px; border: 1px solid var(--line); border-left: 4px solid var(--purple-deep); border-radius: 12px; background: linear-gradient(140deg, var(--panel-2), var(--panel)); text-align: left; cursor: pointer; transition: .18s; }
.role-card:hover { transform: translateY(-3px); border-color: var(--purple); box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.role-card.maintainer-role { border-left-color: var(--teal); }
.role-card small { color: var(--faint); font: 10px var(--mono); letter-spacing: 1px; }
.role-card h2 { margin: 10px 0 8px; font: 560 22px/1.25 var(--display); letter-spacing: -.3px; }
.role-card p { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.role-card b { color: var(--purple); font: 500 12px var(--mono); }
.role-card.maintainer-role b { color: var(--teal); }
.welcome-foot { grid-column: 1 / -1; margin-top: 10px; color: var(--faint); font: 11px var(--mono); line-height: 1.7; }

/* ---------- app shell ---------- */
.app-view.active { display: flex; min-height: calc(100vh - 62px); }
.rail { display: flex; flex-direction: column; flex-shrink: 0; width: 232px; padding: 28px 14px 18px; border-right: 1px solid var(--line-soft); }
.rail-role { display: flex; align-items: center; gap: 10px; padding: 0 10px 24px; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 12px var(--purple); }
.rail-role.maintainer .role-dot { background: var(--teal); box-shadow: 0 0 12px var(--teal); }
.rail-role small { display: block; color: var(--faint); font: 9px var(--mono); letter-spacing: 1px; }
.rail-role strong { font-size: 13px; }
.rail-item { margin-bottom: 3px; padding: 10px 12px; border: 0; border-radius: 7px; background: none; color: var(--muted); text-align: left; font-size: 13px; font-weight: 600; cursor: pointer; }
.rail-item:hover { color: var(--text); background: var(--panel); }
.rail-item.active { color: var(--text); background: var(--panel-2); box-shadow: inset 3px 0 var(--purple); }
.rail-bottom { margin-top: auto; padding: 10px; color: var(--faint); font: 10px/1.6 var(--mono); }

.workspace { width: 100%; max-width: 1150px; padding: 46px clamp(28px, 5vw, 72px) 80px; }
.contributor-panel, .maintainer-panel { display: none; }
.contributor-panel.active, .maintainer-panel.active { display: block; animation: fade .25s ease; }

/* ---------- inputs & buttons ---------- */
.cta { padding: 11px 18px; border: 0; border-radius: 8px; background: var(--purple); color: #17122e; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: .15s; }
.cta:hover { background: #c6b8ff; }
.cta:disabled { opacity: .5; cursor: wait; }
.cta.ghost { background: transparent; border: 1px solid var(--purple-deep); color: var(--purple); }
.cta.ghost:hover { background: rgba(179,161,247,.08); }
.profile-bar { display: flex; align-items: flex-end; gap: 14px; max-width: 640px; margin: 30px 0 22px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.profile-input { flex: 1; }
.profile-input label, .repo-onboard label, .focus-box label, .plan-form label { display: block; margin-bottom: 6px; color: var(--faint); font: 9px var(--mono); letter-spacing: 1px; }
.profile-input input, .repo-input-row input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; font-weight: 600; }
textarea { width: 100%; min-height: 110px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; outline: 0; resize: vertical; background: var(--ink); color: var(--text); font: 13px/1.65 var(--body); }
textarea:focus { border-color: var(--purple-deep); }

/* ---------- loading & empty ---------- */
.match-loading { display: none; align-items: center; gap: 12px; margin: 28px 0; color: var(--muted); font: 11px var(--mono); }
.match-loading.active { display: flex; }
.loader { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--purple); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { display: grid; place-content: center; min-height: 240px; padding: 34px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); }
.empty-state h2 { margin: 0 0 8px; font: 560 18px var(--display); color: var(--text); }
.empty-state p { max-width: 420px; margin: 0; font-size: 12px; line-height: 1.7; }

/* ---------- contributor results ---------- */
.skill-card { display: flex; justify-content: space-between; gap: 22px; margin: 6px 0 20px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, #1b1930, var(--panel)); }
.skill-card small { color: var(--purple); font: 9px var(--mono); letter-spacing: 1px; }
.skill-card h2 { margin: 7px 0; font: 560 20px var(--display); }
.skill-card p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; justify-content: flex-end; max-width: 240px; }
.skill-tags span { padding: 5px 8px; border: 1px solid var(--purple-deep); border-radius: 6px; color: var(--purple); font: 10px var(--mono); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 14px; }
.section-head h2 { margin: 0; font: 560 19px var(--display); }
.section-head span { color: var(--faint); font: 10px var(--mono); }
.matches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.match-card { display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); transition: .15s; }
.match-card:hover { border-color: var(--purple-deep); }
.match-card.invited { border-color: rgba(82,214,180,.45); background: linear-gradient(160deg, rgba(82,214,180,.06), var(--panel) 55%); }
.match-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.match-top small { color: var(--faint); font: 9px var(--mono); }
.match-score { color: var(--purple); font: 500 13px var(--mono); }
.invited-badge { display: inline-block; margin-bottom: 8px; padding: 3px 7px; border-radius: 5px; background: rgba(82,214,180,.14); color: var(--teal); font: 500 9px var(--mono); letter-spacing: .5px; }
.match-card h3 { margin: 0 0 7px; font: 600 14px/1.35 var(--body); letter-spacing: -.2px; }
.match-card > p { flex: 1; margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.match-why { margin-bottom: 12px; padding: 9px 11px; border-left: 2px solid var(--purple-deep); background: rgba(179,161,247,.06); color: #c9c0ee; font-size: 10.5px; line-height: 1.6; border-radius: 0 6px 6px 0; }
.match-card footer { display: flex; justify-content: space-between; align-items: center; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.match-card footer a { color: var(--muted); font: 10px var(--mono); text-decoration: none; }
.match-card footer a:hover { color: var(--text); }
.claim-button { padding: 7px 11px; border: 1px solid var(--purple-deep); border-radius: 6px; background: rgba(179,161,247,.1); color: var(--purple); font-size: 11px; font-weight: 700; cursor: pointer; }
.claim-button:hover { background: rgba(179,161,247,.2); }

/* ---------- how it works ---------- */
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 32px; }
.how-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.how-step { color: var(--purple); font: 500 10px var(--mono); letter-spacing: 1.4px; }
.how-grid h3 { margin: 12px 0 7px; font: 600 14px var(--body); }
.how-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

/* ---------- trail ---------- */
.trail-content { max-width: 720px; margin-top: 28px; }
.trail-card { position: relative; margin: 0 0 14px; padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--purple-deep); border-radius: 10px; background: var(--panel); }
.trail-card.verdict-strong_signal { border-left-color: var(--teal); }
.trail-card.verdict-needs_review { border-left-color: var(--amber); }
.trail-card.verdict-weak_signal { border-left-color: var(--rose); }
.trail-card small { color: var(--faint); font: 10px var(--mono); }
.trail-card h3 { margin: 6px 0 8px; font: 600 14px var(--body); }
.trail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 4px 8px; border-radius: 5px; font: 500 10px var(--mono); }
.chip.purple { background: rgba(179,161,247,.12); color: var(--purple); }
.chip.teal { background: rgba(82,214,180,.12); color: var(--teal); }
.chip.amber { background: rgba(239,179,95,.12); color: var(--amber); }
.chip.rose { background: rgba(240,122,144,.12); color: var(--rose); }
.chip.dim { background: var(--panel-2); color: var(--muted); }
.trail-card a { color: var(--muted); font: 10px var(--mono); }

/* ---------- journey ---------- */
.journey-view { max-width: 1000px; margin: auto; padding: 38px clamp(22px, 5vw, 64px) 80px; }
.back-link { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.back-link:hover { color: var(--text); }
.journey-header { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; margin: 26px 0 30px; }
.journey-header h1 { font-size: 34px; max-width: 560px; }
.steps { display: flex; gap: 22px; padding-top: 10px; }
.step { display: grid; justify-items: center; gap: 6px; }
.step span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); font: 500 11px var(--mono); }
.step small { color: var(--faint); font: 9px var(--mono); letter-spacing: .5px; }
.step.active span { border-color: var(--purple); background: var(--purple); color: #17122e; }
.step.done span { border-color: var(--purple-deep); color: var(--purple); }
.journey-card { margin-bottom: 16px; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(150deg, #181a29, var(--panel)); }
.journey-card h2 { margin: 0 0 10px; font: 560 21px var(--display); }
.journey-card > p { max-width: 680px; margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.context-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.context-item { padding: 13px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--ink); }
.context-item small { color: var(--purple); font: 10px var(--mono); word-break: break-all; }
.context-item .role-tag { float: right; color: var(--faint); font: 9px var(--mono); text-transform: uppercase; }
.context-item p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.callout { margin: 14px 0; padding: 12px 15px; border-left: 3px solid var(--amber); border-radius: 0 8px 8px 0; background: rgba(239,179,95,.07); color: #e8cda2; font-size: 12px; line-height: 1.65; }
.callout strong { color: var(--amber); }
.callout .mono-note { display: block; margin-top: 6px; color: rgba(239,179,95,.65); }
.plan-form textarea { min-height: 130px; margin-top: 4px; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.hint { color: var(--faint); font: 10px var(--mono); }
.analysis-point { margin: 12px 0; padding: 15px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--ink); }
.analysis-point h3 { margin: 0 0 8px; color: var(--amber); font: 500 11px var(--mono); letter-spacing: .5px; }
.analysis-point p { margin: 0 0 8px; color: #c4c9da; font-size: 12px; line-height: 1.65; }
.evidence { color: var(--purple); font: 10px var(--mono); word-break: break-all; }
.soundness-strip { max-width: 420px; margin: 16px 0 6px; }
.soundness-label { margin-bottom: 8px; font: 500 11px var(--mono); letter-spacing: .5px; }
.revision-chip { display: inline-block; margin-left: 10px; }

/* ---------- trust brief ---------- */
.brief { padding: 22px 24px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(150deg, #181a29, var(--panel)); }
.brief-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 4px; }
.brief-head h2 { margin: 4px 0 0; font: 560 22px var(--display); text-transform: capitalize; }
.brief-head .page-kicker { margin-bottom: 4px; }
.verdict-chip { padding: 6px 11px; border-radius: 7px; font: 500 11px var(--mono); white-space: nowrap; }
.verdict-chip.strong_signal { background: rgba(82,214,180,.14); color: var(--teal); }
.verdict-chip.needs_review { background: rgba(239,179,95,.14); color: var(--amber); }
.verdict-chip.weak_signal { background: rgba(240,122,144,.14); color: var(--rose); }
.brief-strip { max-width: 100%; margin: 14px 0 18px; }
.brief > p { margin: 0 0 14px; color: #c4c9da; font-size: 13px; line-height: 1.7; }
.brief-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.brief-grid > div { padding: 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--ink); }
.brief-grid small { color: var(--faint); font: 9px var(--mono); letter-spacing: .8px; }
.brief-grid b { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.55; }
.trail-note { margin: 12px 0; padding: 12px 15px; border-left: 3px solid var(--purple-deep); border-radius: 0 8px 8px 0; background: rgba(179,161,247,.06); color: #c9c0ee; font-size: 12px; line-height: 1.65; }
.trail-note.strong { border-left-color: var(--teal); background: rgba(82,214,180,.06); color: #b9e6d9; }
.trail-note.warn { border-left-color: var(--rose); background: rgba(240,122,144,.06); color: #ecc0ca; }
.drift-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font: 11px var(--mono); }

/* ---------- maintainer priority ---------- */
.focus-box { max-width: 780px; margin: 30px 0 26px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.focus-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 12px; }
.focus-row span { color: var(--faint); font: 10px var(--mono); }
.priority-workspace { max-width: 980px; }
.priority-brief { margin-bottom: 18px; padding: 15px 18px; border-left: 3px solid var(--purple); border-radius: 0 9px 9px 0; background: rgba(179,161,247,.07); color: #d3ccf1; font-size: 13px; line-height: 1.7; }
.priority-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.priority-section { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.priority-section h2 { margin: 0 0 14px; font: 560 17px var(--display); }
.priority-row { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.priority-row:first-of-type { border-top: 0; padding-top: 0; }
.priority-number { min-width: 34px; padding-top: 1px; color: var(--purple); font: 500 13px var(--mono); }
.priority-row h3 { margin: 0 0 5px; font: 600 12.5px var(--body); }
.priority-row p { margin: 0 0 6px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.priority-row a { color: var(--muted); font: 10px var(--mono); text-decoration: none; }
.priority-row a:hover { color: var(--text); }
.row-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.brief-inline { margin-top: 10px; }
.brief-inline .brief { padding: 16px; }
.memory-card { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 14px; padding: 16px 18px; border: 1px solid rgba(179,161,247,.3); border-radius: 11px; background: linear-gradient(135deg, #1c1a30, var(--panel)); }
.memory-card small { color: var(--purple); font: 9px var(--mono); letter-spacing: 1px; }
.memory-card h2 { margin: 6px 0; font: 560 16px var(--display); }
.memory-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.memory-metrics { display: flex; gap: 18px; flex-shrink: 0; }
.memory-metrics span { display: grid; gap: 3px; text-align: center; color: var(--purple); font: 500 16px var(--mono); }
.memory-metrics b { color: var(--faint); font: 500 8px var(--mono); text-transform: uppercase; letter-spacing: .5px; }
.collision-card { margin: 14px 0; padding: 16px 18px; border: 1px solid rgba(240,122,144,.3); border-radius: 11px; background: rgba(240,122,144,.05); }
.collision-card small { color: var(--rose); font: 9px var(--mono); letter-spacing: 1px; }
.collision-card h2 { margin: 6px 0 10px; font: 560 16px var(--display); color: var(--rose); }
.collision-card p { margin: 0; color: #e3bac3; font-size: 12px; line-height: 1.65; }
.collision-card p + p { margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(240,122,144,.15); }
.collision-card strong { color: var(--rose); }

/* ---------- knowledge graph ---------- */
.graph-card { margin: 14px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.graph-card small { color: var(--purple); font: 9px var(--mono); letter-spacing: 1px; }
.graph-card h2 { margin: 6px 0 4px; font: 560 16px var(--display); }
.graph-card > p { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.graph-svg { width: 100%; height: auto; display: block; }
.graph-svg text { fill: var(--muted); font: 8px var(--mono); }
.graph-svg line { stroke: #363c55; stroke-width: 1; opacity: .55; }
.graph-svg circle { stroke: var(--ink); stroke-width: 1.5; }

/* ---------- maintainer repos ---------- */
.repo-onboard { max-width: 660px; margin: 30px 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.repo-input-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); }
.repo-input-row span { color: var(--faint); font: 12px var(--mono); }
.repo-onboard small { color: var(--faint); font-size: 10.5px; }
.registered-repos { display: grid; gap: 12px; max-width: 780px; }
.repo-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.repo-row h3 { margin: 0 0 4px; font: 600 14px var(--body); }
.repo-row p { margin: 0; color: var(--muted); font: 10px var(--mono); }
.repo-row .cta { padding: 8px 13px; font-size: 11px; }

/* ---------- litmus bot console ---------- */
.bot-console { max-width: 760px; margin: 30px 0 20px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.bot-toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.bot-toggle-row strong { font-size: 14px; }
.bot-toggle-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.switch { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; cursor: pointer; }
.switch-track { position: relative; width: 44px; height: 24px; border-radius: 12px; background: var(--line); transition: .2s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch.on .switch-track { background: var(--teal); }
.switch.on .switch-thumb { left: 23px; background: #0c2b23; }
.switch-label { color: var(--muted); font: 500 11px var(--mono); min-width: 22px; text-align: left; }
.switch.on .switch-label { color: var(--teal); }
.bot-identity:not(:empty) { display: flex; align-items: center; gap: 11px; margin-top: 16px; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--ink); }
.bot-identity.is-app { border-color: rgba(82,214,180,.3); background: rgba(82,214,180,.05); }
.bot-identity strong { font-size: 12px; }
.bot-identity p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.bot-console label { display: block; margin: 16px 0 8px; color: var(--faint); font: 9px var(--mono); letter-spacing: 1px; }
.bot-issue-list { display: grid; gap: 8px; }
.bot-issue { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--ink); text-align: left; cursor: pointer; transition: .15s; }
.bot-issue:hover { border-color: var(--purple-deep); background: var(--panel-2); }
.bot-issue-num { flex-shrink: 0; color: var(--purple); font: 500 12px var(--mono); }
.bot-issue-body { display: block; }
.bot-issue-body strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.bot-issue .row-chips { margin: 7px 0 0; }
.bot-message { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--ink); }
.bot-message.reply { border-left: 3px solid var(--line); background: var(--panel-2); }
.bot-message.verdict { border-color: rgba(179,161,247,.3); background: rgba(179,161,247,.05); }
.bot-message-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.bot-message-head strong { font-size: 12px; }
.bot-message-head a { margin-left: auto; color: var(--muted); font: 10px var(--mono); text-decoration: none; }
.bot-message-head a:hover { color: var(--text); }
.bot-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: rgba(179,161,247,.15); font-size: 12px; }
.bot-avatar.human { background: var(--line); color: var(--muted); font: 500 11px var(--mono); }
.bot-message p { margin: 0 0 8px; color: #c4c9da; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; }
.bot-message p:last-child { margin-bottom: 0; }
.bot-question { font: 560 15px/1.55 var(--display) !important; color: var(--text) !important; }
.bot-why { color: var(--muted) !important; font-size: 11.5px !important; }

/* ---------- toast ---------- */
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 9; max-width: 380px; padding: 12px 16px; border-radius: 8px; background: #efeaff; color: #241d47; font-size: 12px; font-weight: 600; line-height: 1.5; transform: translateY(90px); opacity: 0; transition: .3s; }
.toast.show { transform: none; opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .welcome-view.active { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .welcome-copy h1 { font-size: 44px; }
  .matches, .how-grid { grid-template-columns: 1fr 1fr; }
  .rail { width: 64px; padding: 20px 8px; }
  .rail-role div, .rail-bottom { display: none; }
  .rail-item { font-size: 10px; text-align: center; padding: 9px 4px; }
  .workspace { padding: 34px 26px; }
}
@media (max-width: 640px) {
  .top-center { display: none; }
  h1, .welcome-copy h1 { font-size: 32px; }
  .matches, .how-grid, .priority-columns, .context-grid, .brief-grid { grid-template-columns: 1fr; }
  .app-view.active { display: block; }
  .rail { flex-direction: row; width: 100%; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
  .rail-role { display: none; }
  .rail-item { white-space: nowrap; font-size: 11px; }
  .workspace { padding: 28px 18px; }
  .profile-bar { flex-direction: column; align-items: stretch; }
  .journey-header { flex-direction: column; }
  .skill-card { flex-direction: column; }
  .skill-tags { justify-content: flex-start; max-width: none; }
  .memory-card { flex-direction: column; align-items: flex-start; }
  .focus-row { flex-direction: column; align-items: flex-start; }
  .repo-input-row { flex-wrap: wrap; }
}
