@font-face {
  font-family: "Departure Mono";
  src: url("/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #12140f;
  --surface: #1a1d17;
  --surface-soft: #20241c;
  --field: #141711;
  --fg: #eef0e8;
  --text: #cdd2c5;
  --muted: #a5ac9a;
  --quiet: #858e7d;
  --line: #343a30;
  --line-strong: #4a5344;
  --green: #a2cc88;
  --green-ink: #182114;
  --amber: #d3b27a;
  --red: #e59a8d;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
  --mono: "Departure Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --shell: min(1240px, calc(100% - 64px));
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
  caret-color: var(--green);
  scrollbar-color: var(--line-strong) var(--bg);
  scrollbar-width: thin;
}

body { min-width: 320px; margin: 0; background: var(--bg); }
::selection { background: var(--green); color: var(--green-ink); }
a { color: inherit; text-underline-offset: .2em; }
button, select, textarea { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 550; }
h1 { max-width: 24ch; font-size: 28px; line-height: 1.2; letter-spacing: -.025em; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-size: 13px; line-height: 1.35; }
strong { color: var(--fg); font-weight: 600; }

.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; z-index: 50; top: 8px; left: 8px; transform: translateY(-160%); padding: 8px 12px; background: var(--fg); color: var(--bg); }
.skip-link:focus { transform: translateY(0); }

.masthead { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.preview-ribbon { min-height: 28px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 3px 14px; border-bottom: 1px solid #293025; background: #191d15; color: #d2dec8; font: 10px var(--mono); letter-spacing: .01em; }
.live-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.ribbon-side { position: absolute; right: max(32px, calc((100vw - 1240px) / 2)); color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.nav { min-height: 52px; display: flex; align-items: center; gap: 28px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); font: 14px var(--mono); text-decoration: none; white-space: nowrap; }
.mark { color: var(--green); font-size: 18px; letter-spacing: -.12em; }
.mark span, .footer-mark span { color: var(--fg); }
.wordmark-tail { margin-left: 3px; color: var(--quiet); font-size: 10px; }
.nav-links { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav-links a { color: var(--muted); font: 11px var(--sans); text-decoration: none; }
.nav-links a:hover, .top-link:hover { color: var(--fg); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 4px; padding: 0 13px; cursor: pointer; font: 12px var(--sans); font-weight: 600; text-decoration: none; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.button:disabled { cursor: not-allowed; }
.button-primary { border-color: var(--green); background: var(--green); color: var(--green-ink); }
.button-primary:hover:not(:disabled) { border-color: #b8dba2; background: #b8dba2; }
.button-primary:disabled { border-color: #485340; background: #343d2e; color: #b8c5ad; }
.button-quiet { border-color: var(--line); background: transparent; color: var(--text); }
.button-quiet:hover:not(:disabled), .button-outline:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface); color: var(--fg); }
.button-outline { border-color: var(--line-strong); background: transparent; color: var(--fg); }
.github-button { gap: 7px; }
.github-mark { display: inline-grid; width: 17px; height: 17px; place-items: center; border: 1px solid var(--line-strong); color: var(--muted); font: 7px var(--mono); }
.github-button:disabled { color: var(--quiet); }
.session-pill, .status-tag, .synthetic-tag { display: inline-flex; min-height: 24px; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; color: var(--green); font: 9px var(--mono); letter-spacing: .035em; white-space: nowrap; }
.session-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

main { padding-bottom: 64px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 18px 0 14px; }
.intro-copy { max-width: 710px; }
.intro h1 { margin-bottom: 4px; }
.intro-text { max-width: 67ch; color: var(--text); font-size: 13px; line-height: 1.5; }
.intro-stamp { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 10px; min-width: 172px; border-left: 1px solid var(--line); padding: 2px 0 2px 14px; }
.stamp-label { grid-column: 1 / -1; color: var(--muted); font: 9px var(--mono); letter-spacing: .05em; }
.stamp-value { display: flex; align-items: center; gap: 7px; color: var(--green); font: 10px var(--mono); }
.stamp-value i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.stamp-note { color: var(--quiet); font-size: 10px; }
.repo-next { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.repo-next strong { color: var(--text); font-weight: 600; }
.notice { position: sticky; top: 84px; z-index: 10; margin: 10px 0 0; border: 1px solid var(--line-strong); border-radius: 4px; padding: 9px 12px; background: var(--surface); color: var(--text); font-size: 12px; }
.notice[data-kind="error"] { border-color: #80574f; color: #f0c1b9; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .72fr); gap: 32px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 15px; }
.editor-column { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.editor-heading { min-height: 28px; margin-bottom: 10px; }
.synthetic-tag { border-color: #524838; color: var(--amber); }
.editor { overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.editor-topline { min-height: 39px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 12px; color: var(--muted); font-size: 11px; }
.editor-topline select { min-height: 28px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 24px 0 8px; background: var(--field); color: var(--fg); font-size: 11px; }
.sample-tag { margin-left: auto; color: var(--amber); font: 9px var(--mono); letter-spacing: .015em; }
.editor textarea { display: block; width: 100%; min-height: 176px; resize: vertical; border: 0; border-radius: 0; padding: 13px 15px; background: var(--field); color: #dce4d5; font: 12px/1.7 var(--mono); tab-size: 2; white-space: pre; overflow: auto; }
.editor textarea:focus { outline: none; }
.editor:focus-within { border-color: #66745b; }
.editor-bottomline { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 6px 12px; color: var(--muted); font-size: 10px; }
.editor-bottomline span { flex: 0 0 auto; font: 10px var(--mono); }
.editor-actions { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 7px 12px; }
.local-note { color: var(--muted); font-size: 11px; }
.run-button { min-width: 164px; }

.rail { min-width: 0; border-left: 1px solid var(--line); padding-left: 24px; }
.rail-section { padding: 0 0 16px; }
.rail-section + .rail-section { border-top: 1px solid var(--line); padding-top: 15px; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account-state, .tiny-caption { color: var(--muted); font: 9px var(--mono); letter-spacing: .04em; }
.account-state[data-state="active"] { color: var(--green); }
.account-title { margin-top: 8px; font-size: 16px; }
.account-copy { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.demo-wide { width: 100%; justify-content: flex-start; margin-top: 12px; }
.usage-primary { display: flex; align-items: baseline; gap: 8px; margin-top: 9px; font: 22px var(--mono); letter-spacing: -.02em; }
.usage-divider { color: var(--quiet); font-size: 15px; }
.usage-primary span:last-child { color: var(--muted); font-size: 15px; }
.usage-progress { display: block; width: 100%; height: 4px; margin-top: 10px; appearance: none; border: 0; border-radius: 4px; background: #363d31; }
.usage-progress::-webkit-progress-bar { border-radius: 4px; background: #363d31; }
.usage-progress::-webkit-progress-value { border-radius: 4px; background: var(--green); }
.usage-progress::-moz-progress-bar { border-radius: 4px; background: var(--green); }
.usage-legend { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 10px; }
.usage-legend span { display: flex; align-items: center; gap: 6px; }
.usage-legend b { color: var(--text); font: 10px var(--mono); font-weight: 400; }
.legend-spent, .legend-reserved { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.legend-reserved { background: var(--amber); }
.usage-remaining { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.usage-remaining b { color: var(--fg); font: 11px var(--mono); }
.usage-empty { margin-top: 8px; color: var(--muted); font-size: 12px; }
.microcopy { margin-top: 9px; color: var(--quiet); font-size: 10px; line-height: 1.45; }

.privacy-section { display: grid; grid-template-columns: minmax(190px, .58fr) minmax(0, 1.42fr); gap: 30px; margin-top: 46px; border-top: 1px solid var(--line); padding-top: 18px; }
.privacy-intro h2 { margin-top: 1px; }
.privacy-intro > p:last-child { max-width: 39ch; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.consent-panel { border: 1px solid var(--line); border-radius: 5px; padding: 14px; background: var(--surface); }
.consent-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.consent-topline h3 { font-size: 14px; }
.status-off { border-color: #5b503c; color: var(--amber); }
.status-current { border-color: #45563a; color: var(--green); }
.status-future { color: var(--muted); }
.scope-callout { display: grid; grid-template-columns: 54px 1fr; gap: 10px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.scope-mark { color: var(--amber); font: 10px var(--mono); }
.scope-callout p { color: var(--text); font-size: 11px; line-height: 1.5; }
.scope-callout strong { font-weight: 600; }
.consent-form { margin-top: 10px; }
.consent-form fieldset { margin: 0; border: 0; padding: 0; }
.consent-form fieldset:disabled { opacity: .68; }
.consent-form legend { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; color: var(--text); font-size: 11px; line-height: 1.45; cursor: pointer; }
.check-row input { width: 16px; height: 16px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--green); }
.consent-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.consent-actions .button { min-height: 36px; }
.consent-hint { color: var(--muted); font-size: 10px; line-height: 1.4; }

.lower-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 42px; margin-top: 48px; border-top: 1px solid var(--line); padding-top: 18px; }
.history-section, .plans-section { min-width: 0; }
.text-button { border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.text-button:hover { border-color: #80574f; color: var(--red); }
.empty-history { margin-top: 15px; color: var(--muted); font-size: 12px; }
.history-list { list-style: none; margin: 12px 0 0; padding: 0; }
.history-item { border-top: 1px solid var(--line); }
.history-button { display: grid; width: 100%; grid-template-columns: minmax(80px, .7fr) minmax(100px, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; border: 0; padding: 7px 0; background: transparent; text-align: left; cursor: pointer; }
.history-button:hover .history-language { color: var(--green); }
.history-time, .history-count { color: var(--muted); font: 10px var(--mono); }
.history-language { color: var(--text); font-size: 11px; }
.history-count { color: var(--green); white-space: nowrap; }
.history-count[data-has-findings="true"] { color: var(--amber); }
.inline-error { margin-top: 10px; color: #efb8af; font-size: 11px; }
.plan-list { margin-top: 10px; border-top: 1px solid var(--line); }
.plan-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-row.plan-current { border-top: 1px solid var(--green); }
.plan-name { display: flex; align-items: center; gap: 9px; }
.plan-index { color: var(--quiet); font: 9px var(--mono); }
.plan-name h3 { font-size: 12px; }
.plan-name h3 small { color: var(--muted); font-size: 10px; font-weight: 400; }
.plan-name .status-tag { margin-left: auto; }
.plan-row > p { margin: 5px 0 0 24px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.plan-row > p strong { color: var(--fg); font: 11px var(--mono); font-weight: 400; }
.plan-row > p.plan-fine { margin-top: 3px; color: var(--quiet); font-size: 10px; }

.results { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.result-heading { align-items: center; }
.result-state { color: var(--green); font: 9px var(--mono); letter-spacing: .035em; }
.result-summary { margin-top: 8px; color: var(--muted); font-size: 11px; }
.finding-list { display: grid; gap: 8px; margin-top: 12px; }
.finding { border-left: 1px solid #897248; padding: 2px 0 3px 10px; }
.finding h3 { color: var(--fg); font: 11px var(--mono); overflow-wrap: anywhere; }
.finding-meta { margin-top: 3px; color: var(--muted); font: 9px var(--mono); }
.finding-fix { margin-top: 6px; color: var(--text); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.finding-fix pre { overflow: auto; margin: 5px 0 0; border: 1px solid var(--line); border-radius: 4px; padding: 8px; background: var(--field); color: var(--text); font: 10px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-findings { border-left-color: var(--green); color: var(--text); }
.json-details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.json-details summary { width: fit-content; color: var(--muted); cursor: pointer; font-size: 10px; }
.json-details pre { max-height: 300px; overflow: auto; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 4px; padding: 10px; background: var(--field); color: var(--text); font: 10px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

.footer { min-height: 56px; display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-mark { color: var(--fg); font: 12px var(--mono); text-decoration: none; }
.footer p { font-size: 10px; }
.top-link { margin-left: auto; color: var(--muted); font-size: 10px; text-decoration: none; }

@media (max-width: 880px) {
  :root { --shell: min(100% - 40px, 760px); }
  .workspace { grid-template-columns: minmax(0, 1.4fr) minmax(235px, .75fr); gap: 22px; }
  .rail { padding-left: 18px; }
  .intro-stamp { min-width: 156px; }
  .nav { gap: 18px; }
  .nav-links { gap: 14px; }
}

@media (max-width: 680px) {
  :root { --shell: calc(100% - 32px); }
  html { scroll-padding-top: 138px; }
  .ribbon-side { display: none; }
  .preview-ribbon { justify-content: flex-start; font-size: 9px; }
  .nav { min-height: 0; flex-wrap: wrap; gap: 8px; padding: 9px 0; }
  .wordmark { order: 0; margin-right: auto; }
  .wordmark-tail { display: none; }
  .nav-actions { order: 1; width: 100%; }
  .nav-actions .button { flex: 1 1 auto; min-height: 38px; padding-inline: 9px; font-size: 11px; }
  .nav-links { order: 2; width: 100%; justify-content: flex-start; gap: 18px; border-top: 1px solid var(--line); padding-top: 7px; margin-left: 0; }
  .nav-links a { font-size: 11px; }
  .intro { align-items: flex-start; gap: 12px; padding: 15px 0 12px; }
  .intro h1 { font-size: 24px; }
  .intro-text { max-width: 58ch; font-size: 12px; }
  .intro-stamp { display: none; }
  .repo-next { padding-block: 7px; font-size: 10px; }
  .workspace { grid-template-columns: 1fr; gap: 20px; margin-top: 11px; padding-top: 12px; }
  .editor-heading { margin-bottom: 8px; }
  .editor textarea { min-height: 165px; font-size: 11px; }
  .rail { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-top: 1px solid var(--line); border-left: 0; padding: 14px 0 0; }
  .rail-section { padding: 0; }
  .rail-section + .rail-section { border-top: 0; padding-top: 0; }
  .privacy-section { grid-template-columns: 1fr; gap: 12px; margin-top: 35px; padding-top: 14px; }
  .privacy-intro > p:last-child { max-width: 65ch; }
  .lower-grid { grid-template-columns: 1fr; gap: 30px; margin-top: 35px; padding-top: 14px; }
}

@media (max-width: 440px) {
  .editor-topline { gap: 7px; padding-inline: 8px; }
  .editor-topline select { max-width: 105px; }
  .sample-tag { font-size: 7px; }
  .editor textarea { padding: 11px 9px; font-size: 10px; }
  .editor-bottomline { gap: 8px; padding-inline: 8px; font-size: 9px; }
  .editor-actions { align-items: stretch; flex-direction: column; gap: 8px; padding: 9px; }
  .run-button { width: 100%; }
  .rail { grid-template-columns: 1fr; }
  .consent-panel { padding: 11px; }
  .scope-callout { grid-template-columns: 1fr; gap: 3px; }
  .consent-actions { align-items: stretch; flex-direction: column; gap: 8px; }
  .consent-actions .button { width: 100%; }
  .history-button { grid-template-columns: minmax(68px, .7fr) minmax(75px, 1fr) auto; gap: 6px; }
  .history-time, .history-count { font-size: 9px; }
  .history-language { font-size: 10px; }
  .footer { flex-wrap: wrap; gap: 6px 12px; padding-block: 11px; }
  .footer p { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.login-page { display: flex; min-height: 100vh; min-height: 100svh; flex-direction: column; }
.login-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.login-product-label { color: var(--muted); font: 9px var(--mono); letter-spacing: .055em; }
.login-main { display: grid; flex: 1; place-items: center; padding-block: 28px; }
.login-card { width: min(100%, 480px); border: 1px solid var(--line); border-radius: 7px; padding: clamp(22px, 5vw, 32px); background: var(--surface); }
.login-copy h1 { max-width: 20ch; font-size: 26px; }
.login-copy p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-action { margin-top: 22px; }
.login-github { width: 100%; min-height: 46px; font-size: 13px; }
.login-github:disabled { border-color: #485340; background: #30382b; color: #bcc8b1; }
.login-github .github-mark { color: currentColor; }
.login-state { min-height: 2.9em; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-retry { margin-top: 3px; }
.login-access-note { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 13px; }
.login-access-note h2 { font-size: 13px; }
.login-access-note p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-footer { margin-top: auto; }

@media (max-width: 680px) {
  .login-header { min-height: 52px; }
  .login-product-label { font-size: 8px; }
  .login-main { align-items: start; padding-block: 36px 26px; }
  .login-card { padding: 22px 18px; }
}
