:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --surface: #0f1115;
  --surface-2: #15181d;
  --surface-3: #1b1f25;
  --line: #252a31;
  --line-strong: #353b45;
  --text: #f2f1eb;
  --muted: #a5abb4;
  --quiet: #737a84;
  --accent: #a9ffcf;
  --accent-2: #c8d7ff;
  --danger: #ffb5b5;
  --warning: #ffe0a6;
  --max: 1240px;
  --sidebar: 270px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
code, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
[hidden] { display: none !important; }

.site-header {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; flex-direction: column; flex: 0 0 auto; gap: 2px; }
.brand-name { font-size: 22px; font-weight: 760; letter-spacing: 0.19em; }
.brand-motto { color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-size: 10px; letter-spacing: 0.13em; }
.nav { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 22px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav .nav-cta { color: var(--text); border: 1px solid var(--line-strong); padding: 0 14px; border-radius: 8px; }

.marketing-body main, .site-footer { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; }
.hero { min-height: 680px; padding: 104px 0 74px; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line); }
.owner-hero { min-height: 760px; }
.eyebrow, .section-kicker { color: var(--accent); font: 600 11px/1.3 "SFMono-Regular", Consolas, monospace; letter-spacing: 0.14em; }
.hero h1 { max-width: 1080px; margin: 24px 0 18px; font-size: clamp(48px, 8vw, 104px); line-height: 0.96; letter-spacing: -0.055em; font-weight: 640; }
.hero-lede { margin: 0 0 22px; font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(24px, 3vw, 38px); font-weight: 400; color: var(--accent); }
.hero-copy { max-width: 850px; margin: 0; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 38px; }
.button { border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 16px; font: 600 13px/1 "SFMono-Regular", Consolas, monospace; background: rgba(255,255,255,0.018); color: var(--text); cursor: pointer; }
.button:hover { border-color: var(--muted); background: rgba(255,255,255,0.035); }
.button.primary { background: var(--text); color: #0b0c0e; border-color: var(--text); }
.button.quiet { color: var(--muted); }
.button.danger { color: var(--danger); }
.button.full { width: 100%; justify-content: center; display: inline-flex; }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.machine-strip { margin-top: 60px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--quiet); font: 12px/1.5 "SFMono-Regular", Consolas, monospace; }
.machine-strip.compact { margin-top: 24px; padding-top: 14px; }
.section { padding: 92px 0; border-bottom: 1px solid var(--line); }
.section h2 { margin: 14px 0 20px; max-width: 920px; font-size: clamp(34px, 5vw, 62px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 590; }
.section-intro { max-width: 760px; color: var(--muted); font-size: 17px; }
.sequence { margin-top: 54px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.sequence-step { min-height: 310px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(15,17,21,0.55); }
.step-number { color: var(--quiet); font: 12px/1 "SFMono-Regular", Consolas, monospace; }
.sequence-step h3 { margin: 48px 0 14px; font-size: 22px; font-weight: 590; }
.sequence-step code, .primitive-card code { display: block; color: var(--accent); font-size: 12px; overflow-wrap: anywhere; }
.sequence-step p, .primitive-card p { color: var(--muted); font-size: 14px; }
.grid-section { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 80px; align-items: start; }
.primitive-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.primitive-card { min-height: 255px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.primitive-label { color: var(--quiet); font: 10px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: 0.12em; }
.primitive-card h3 { margin: 38px 0 12px; font-size: 25px; font-weight: 590; }
.callout-section { padding-bottom: 130px; }
.site-footer { min-height: 260px; padding: 60px 0; display: grid; grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr); gap: 72px; align-items: start; border-top: 1px solid var(--line); }
.footer-brand { font-size: 24px; font-weight: 760; letter-spacing: 0.19em; }
.footer-motto { margin-top: 4px; font-family: Georgia, "Times New Roman", serif; color: var(--muted); font-size: 13px; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; text-align: left; }
.footer-group { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-group-label { margin-bottom: 8px; color: var(--accent); font: 600 10px/1.3 "SFMono-Regular", Consolas, monospace; }
.footer-group a { color: var(--muted); font-size: 13px; }

.console-body { min-height: 100vh; }
.owner-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: rgba(10,11,13,0.96); border-right: 1px solid var(--line); padding: 28px 20px; display: flex; flex-direction: column; z-index: 10; backdrop-filter: blur(14px); }
.sidebar-brand { padding: 0 10px 26px; border-bottom: 1px solid var(--line); }
.side-nav { display: flex; flex-direction: column; gap: 5px; padding-top: 26px; }
.side-nav button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; padding: 12px 12px; cursor: pointer; font-size: 14px; }
.side-nav button:hover, .side-nav button.active { background: var(--surface-2); color: var(--text); }
.badge { min-width: 24px; padding: 3px 7px; border-radius: 999px; background: var(--accent); color: #07110c; text-align: center; font: 700 11px/1.2 "SFMono-Regular", Consolas, monospace; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.owner-main { grid-column: 2; min-width: 0; }
.auth-shell { min-height: 100vh; padding: 44px max(28px, 5vw); display: flex; flex-direction: column; }
.auth-brand { align-self: flex-start; }
.auth-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.75fr); gap: min(8vw, 120px); align-items: center; width: min(1180px, 100%); margin: 0 auto; padding: 80px 0; }
.auth-copy h1 { margin: 18px 0 24px; font-size: clamp(48px, 6vw, 82px); line-height: 0.98; letter-spacing: -0.055em; font-weight: 620; }
.auth-copy p { max-width: 650px; color: var(--muted); font-size: 17px; }
.security-points { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 38px; color: var(--quiet); font: 11px/1.4 "SFMono-Regular", Consolas, monospace; }
.auth-panel { background: rgba(15,17,21,0.94); border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: 0 28px 80px rgba(0,0,0,0.28); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-bottom: 26px; }
.auth-tabs button { border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); padding: 13px; cursor: pointer; }
.auth-tabs button:last-child { border-right: 0; }
.auth-tabs button.active { background: var(--surface-2); color: var(--text); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-stack label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 12px; }
input, textarea, select { width: 100%; color: var(--text); background: #0b0d10; border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 13px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #626a75; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-note { margin: 0; color: var(--quiet); font-size: 12px; }
.notice { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 12px; }
.notice.warning { color: var(--warning); border-color: rgba(255,224,166,0.24); background: rgba(255,224,166,0.04); }

#console-shell { min-height: 100vh; padding: 0 42px 60px; }
.topbar { position: sticky; top: 0; z-index: 8; min-height: 104px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(10,11,13,0.88); backdrop-filter: blur(16px); }
.topbar h2 { margin: 3px 0 0; font-size: 28px; letter-spacing: -0.025em; }
.topbar-kicker, .panel-kicker { color: var(--accent); font: 600 10px/1.4 "SFMono-Regular", Consolas, monospace; letter-spacing: 0.12em; }
.identity-pill { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; background: var(--surface); }
.status-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px rgba(169,255,207,0.08); }
.identity-pill div { display: flex; flex-direction: column; }
.identity-pill strong { font-size: 13px; }
.identity-pill small { color: var(--quiet); font: 10px/1.4 "SFMono-Regular", Consolas, monospace; }
.console-view { padding-top: 34px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.metrics-grid article { min-height: 158px; background: var(--surface); padding: 22px; display: flex; flex-direction: column; }
.metrics-grid span { color: var(--quiet); font: 10px/1.4 "SFMono-Regular", Consolas, monospace; letter-spacing: 0.1em; }
.metrics-grid strong { margin-top: 22px; font-size: 34px; font-weight: 590; letter-spacing: -0.03em; }
.metrics-grid small { margin-top: auto; color: var(--muted); font-size: 12px; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.panel { background: rgba(15,17,21,0.94); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.panel-head, .editor-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel h3, .editor-head h3 { margin: 4px 0 0; font-size: 20px; }
.panel p { color: var(--muted); }
.text-button { border: 0; background: transparent; color: var(--accent); cursor: pointer; font: 600 11px/1.4 "SFMono-Regular", Consolas, monospace; }
.list-stack { display: flex; flex-direction: column; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row strong { font-size: 14px; }
.list-row p { margin: 4px 0 0; font-size: 12px; }
.row-meta { color: var(--quiet); font: 11px/1.5 "SFMono-Regular", Consolas, monospace; }
.empty-state { color: var(--quiet); font-size: 13px; padding: 24px 0; }
.action-bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 22px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 18px; border-radius: 10px; }
.action-bar p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.action-group { display: flex; flex-wrap: wrap; gap: 8px; }
.data-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.table-row { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(120px, 0.6fr) minmax(160px, 0.8fr) auto; align-items: center; gap: 20px; padding: 17px 20px; border-top: 1px solid var(--line); }
.table-row:first-child { border-top: 0; }
.table-row.header { min-height: 44px; color: var(--quiet); font: 10px/1.4 "SFMono-Regular", Consolas, monospace; letter-spacing: 0.08em; background: #0c0e11; }
.table-row strong { font-size: 14px; }
.table-row small { display: block; color: var(--quiet); margin-top: 3px; font: 10px/1.4 "SFMono-Regular", Consolas, monospace; }
.status-chip { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 8px; color: var(--muted); font: 10px/1 "SFMono-Regular", Consolas, monospace; }
.status-chip.good { color: var(--accent); border-color: rgba(169,255,207,0.28); }
.status-chip.waiting { color: var(--warning); border-color: rgba(255,224,166,0.28); }
.review-grid, .workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.review-card, .workspace-card { padding: 22px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; }
.review-card h3, .workspace-card h3 { margin: 10px 0 7px; font-size: 20px; }
.review-card p, .workspace-card p { color: var(--muted); font-size: 13px; min-height: 40px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--quiet); font: 10px/1.5 "SFMono-Regular", Consolas, monospace; padding-top: 15px; border-top: 1px solid var(--line); margin-top: 16px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.security-layout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.status-line { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--quiet); font-size: 12px; }
.status-line strong { color: var(--accent); font: 600 11px/1.4 "SFMono-Regular", Consolas, monospace; }
.flash { position: sticky; top: 112px; z-index: 7; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface-2); font-size: 13px; }
.flash.error { color: var(--danger); border-color: rgba(255,181,181,0.24); }
.flash.success { color: var(--accent); border-color: rgba(169,255,207,0.24); }

.modal { width: min(900px, calc(100vw - 30px)); max-height: calc(100vh - 50px); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 40px 120px rgba(0,0,0,0.55); }
.modal::backdrop { background: rgba(0,0,0,0.72); backdrop-filter: blur(5px); }
.modal-inner { padding: 24px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.modal-head h2 { margin: 5px 0 0; font-size: 26px; }
.modal-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; }
.diff-box { max-height: 50vh; overflow: auto; border: 1px solid var(--line); background: #08090b; padding: 16px; white-space: pre; font: 12px/1.55 "SFMono-Regular", Consolas, monospace; color: #d7d9dc; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.copy-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.copy-box input { font-family: "SFMono-Regular", Consolas, monospace; }

.empty-state-padded { padding: 30px; }
.muted-copy { color: var(--muted); }
.spaced-notice { margin-top: 16px; }
.diff-warning { margin-top: 12px; }
.review-note-label { display: block; margin-top: 16px; color: var(--muted); font-size: 12px; }

.agent-body { min-height: 100vh; padding: 0 26px 60px; }
.agent-header { width: min(1500px, 100%); margin: 0 auto; min-height: 88px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.agent-header-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 11px/1.4 "SFMono-Regular", Consolas, monospace; }
.agent-shell { width: min(1500px, 100%); margin: 0 auto; padding-top: 24px; }
.agent-context h1 { margin: 7px 0 8px; font-size: clamp(30px, 4vw, 54px); letter-spacing: -0.04em; }
.agent-context > p { max-width: 920px; font-size: 15px; }
.agent-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.file-panel { min-height: 680px; }
.file-list { margin-top: 16px; max-height: 590px; overflow: auto; border-top: 1px solid var(--line); }
.file-item { width: 100%; display: block; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); padding: 10px 4px; cursor: pointer; font: 11px/1.4 "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.file-item:hover, .file-item.active { color: var(--accent); }
.editor-panel { min-height: 680px; display: flex; flex-direction: column; }
.code-editor { flex: 1; min-height: 590px; resize: none; border-radius: 4px; font: 13px/1.55 "SFMono-Regular", Consolas, monospace; tab-size: 2; }
.submit-panel { margin-top: 14px; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 42px; }
.submit-panel h2 { margin: 8px 0 12px; font-size: 30px; letter-spacing: -0.035em; }
.floating-flash { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 520px; padding: 13px 16px; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 9px; box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.simple-state { width: min(760px, calc(100% - 40px)); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.simple-state h1 { margin: 20px 0 10px; font-size: clamp(38px, 6vw, 68px); line-height: 1; letter-spacing: -0.05em; }
.simple-state p { color: var(--muted); font-size: 17px; }

@media (max-width: 1100px) {
  .sequence { grid-template-columns: repeat(2, 1fr); }
  .grid-section { grid-template-columns: 1fr; gap: 36px; }
  .owner-shell { grid-template-columns: 220px minmax(0, 1fr); --sidebar: 220px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .review-grid, .workspace-grid { grid-template-columns: 1fr; }
  .security-layout { grid-template-columns: 1fr; }
  .agent-layout { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .site-header { min-height: 80px; }
  .nav a:not(.nav-cta) { display: none; }
  .hero { padding-top: 70px; min-height: 650px; }
  .sequence, .primitive-grid { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .owner-shell { display: block; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar-brand { display: none; }
  .side-nav { flex-direction: row; padding: 0; }
  .side-nav button { white-space: nowrap; width: auto; }
  .sidebar-bottom { margin: 0 0 0 auto; padding: 0 0 0 10px; border: 0; }
  .sidebar-bottom .button { white-space: nowrap; }
  .owner-main { grid-column: auto; }
  #console-shell { padding: 0 18px 40px; }
  .topbar { min-height: 90px; }
  .auth-grid { grid-template-columns: 1fr; padding: 45px 0; }
  .auth-copy h1 { font-size: 52px; }
  .auth-panel { max-width: 620px; }
  .split-grid { grid-template-columns: 1fr; }
  .action-bar { align-items: flex-start; flex-direction: column; }
  .table-row { grid-template-columns: minmax(0, 1fr) auto; }
  .table-row > :nth-child(2), .table-row > :nth-child(3) { display: none; }
  .agent-layout { grid-template-columns: 1fr; }
  .file-panel { min-height: auto; }
  .file-list { max-height: 300px; }
  .submit-panel { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .marketing-body main, .site-footer, .site-header { width: min(calc(100% - 24px), var(--max)); }
  .hero h1 { font-size: 50px; }
  .hero-lede { font-size: 22px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .identity-pill { display: none; }
  .footer-links { grid-template-columns: 1fr; }
  .auth-shell { padding: 26px 16px; }
  .auth-copy h1 { font-size: 44px; }
  .auth-panel { padding: 18px; }
  .sidebar { gap: 8px; }
  .side-nav button { font-size: 12px; padding: 9px; }
}
