:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e0e7;
  --brand: #12395f;
  --brand-2: #255e8d;
  --soft: #edf3f8;
  --ok: #0a7c55;
  --warn: #9a6500;
  --risk: #9d2c2c;
  --shadow: 0 18px 50px rgba(25, 39, 52, .10);
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, textarea { font: inherit; }
a { color: inherit; }
.page-shell { width:min(1180px, calc(100% - 32px)); margin:0 auto 72px; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:24px 0; }
.brand-wrap { display:flex; align-items:center; gap:12px; }
.brand-mark { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; background:var(--brand); color:white; font-weight:800; letter-spacing:-.04em; }
.brand { font-weight:800; letter-spacing:-.02em; }
.descriptor { font-size:12px; color:var(--muted); margin-top:2px; }
.human-link { text-decoration:none; font-weight:700; color:var(--brand); border-bottom:1px solid currentColor; }
.hero { display:flex; justify-content:space-between; gap:24px; align-items:end; padding:44px 0 28px; }
.eyebrow, .panel-kicker { font-size:11px; font-weight:800; letter-spacing:.13em; color:var(--brand-2); }
h1 { font-size:clamp(42px, 7vw, 76px); line-height:.95; letter-spacing:-.055em; margin:12px 0 16px; }
.lead { font-size:20px; line-height:1.5; max-width:720px; color:#394654; margin:0; }
.trust-row { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.trust-row span { background:#e9eef3; border-radius:999px; padding:7px 10px; color:#465462; font-size:12px; font-weight:700; }
.status-card { display:flex; align-items:center; gap:12px; min-width:220px; background:var(--card); border:1px solid var(--line); padding:14px 16px; border-radius:16px; box-shadow:0 10px 30px rgba(23,32,42,.05); }
.status-card strong, .status-card small { display:block; }
.status-card small { color:var(--muted); margin-top:3px; }
.status-dot { width:10px; height:10px; border-radius:50%; background:#e6a623; box-shadow:0 0 0 5px rgba(230,166,35,.12); }

.app-grid { display:grid; grid-template-columns:minmax(0, 1fr); gap:22px; align-items:start; max-width:900px; margin:0 auto; }
.app-grid.result-mode { max-width:none; }
.chat-card, .panel { background:var(--card); border:1px solid var(--line); border-radius:20px; box-shadow:var(--shadow); }
.chat-card { overflow:hidden; }
.chat-head { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:20px 22px 16px; border-bottom:1px solid var(--line); }
.chat-head strong, .chat-head small { display:block; }
.chat-head small { margin-top:4px; color:var(--muted); }
.chat-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.ghost-btn { border:1px solid var(--line); background:white; color:#425466; border-radius:10px; padding:8px 11px; cursor:pointer; font-weight:700; }
.ghost-btn:hover { background:#f8fafc; }
.ghost-btn.compact { font-size:12px; padding:6px 8px; }
.progress-wrap { display:flex; align-items:center; gap:12px; padding:12px 22px 0; color:var(--muted); font-size:12px; }
.progress-track { height:6px; background:#e9edf1; border-radius:99px; flex:1; overflow:hidden; }
.progress-bar { height:100%; width:0; background:linear-gradient(90deg, var(--brand), #3f7faa); transition:width .35s ease; }
.messages { min-height:430px; max-height:58vh; overflow:auto; padding:22px; display:flex; flex-direction:column; gap:14px; scroll-behavior:smooth; }
.msg { display:flex; gap:10px; max-width:90%; animation:fadein .18s ease; }
.msg.assistant { align-self:flex-start; }
.msg.user { align-self:flex-end; flex-direction:row-reverse; }
.avatar { flex:0 0 30px; height:30px; border-radius:50%; display:grid; place-items:center; font-size:11px; font-weight:800; }
.assistant .avatar { background:var(--brand); color:white; }
.user .avatar { background:#e9eef3; color:#4a5968; }
.bubble { padding:12px 14px; border-radius:16px; line-height:1.48; white-space:pre-wrap; }
.assistant .bubble { background:#f0f4f8; border-top-left-radius:5px; }
.user .bubble { background:var(--brand); color:white; border-top-right-radius:5px; }
.msg.system { align-self:center; max-width:100%; }
.msg.system .bubble { font-size:12px; background:#fff8e7; border:1px solid #f0ddaa; color:#745416; }
.typing .bubble { color:var(--muted); font-style:italic; }
.composer { display:flex; gap:10px; align-items:flex-end; padding:16px 22px 10px; border-top:1px solid var(--line); }
textarea { width:100%; resize:none; border:1px solid #cdd6df; border-radius:12px; padding:12px 13px; outline:none; min-height:50px; max-height:150px; background:white; }
textarea:focus { border-color:#7aa2c5; box-shadow:0 0 0 3px rgba(37,94,141,.10); }
.primary-btn { border:0; background:var(--brand); color:white; font-weight:800; border-radius:12px; min-height:50px; padding:0 18px; cursor:pointer; }
.primary-btn:disabled { opacity:.55; cursor:not-allowed; }
.microcopy { padding:0 22px 18px; font-size:11px; color:var(--muted); }

.panel { padding:20px; }
.panel h2 { margin:6px 0 16px; font-size:21px; letter-spacing:-.02em; }
.panel-head-inline { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.hidden { display:none !important; }
.side-column { display:flex; flex-direction:column; gap:22px; }

.result-panel { grid-column:1; padding:26px; scroll-margin-top:18px; }
.result-panel h2 { font-size:28px; margin-bottom:20px; }
.result-rows { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); column-gap:34px; }
.result-row { display:flex; align-items:center; justify-content:space-between; gap:14px; border-bottom:1px solid #eef1f4; padding:12px 0; min-width:0; }
.result-row span:first-child { color:#596675; }
.badge { display:inline-flex; justify-content:center; text-align:center; border-radius:999px; padding:6px 9px; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.035em; background:#eef2f6; max-width:210px; }
.badge.good { color:var(--ok); background:#e6f6ef; }
.badge.warn { color:var(--warn); background:#fff4d8; }
.badge.risk { color:var(--risk); background:#fdeaea; }
.cta-box { margin-top:22px; border-radius:16px; padding:18px 20px; background:var(--soft); display:grid; grid-template-columns:minmax(0, 1fr) auto; column-gap:22px; align-items:center; }
.cta-box strong { font-size:18px; }
.cta-box p { color:#526170; font-size:13px; line-height:1.5; margin:6px 0 0; grid-column:1; }
.primary-link { grid-column:2; grid-row:1 / span 2; display:inline-block; text-decoration:none; background:var(--brand); color:white; border-radius:10px; padding:11px 14px; font-weight:800; font-size:13px; white-space:nowrap; }
.finding-box { margin-top:20px; border-top:1px solid #e7ebef; padding-top:18px; }
.finding-box h3 { margin:0 0 8px; font-size:15px; }
.result-bullets { margin:0; padding-left:20px; color:#465462; line-height:1.55; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); column-gap:34px; }
.result-bullets li { margin:6px 0; padding-right:12px; }
.ruleset-note { margin:18px 0 0; color:var(--muted); font-size:11px; line-height:1.45; }

.app-grid.result-mode .result-panel { order:1; }
.app-grid.result-mode .chat-card { order:2; }
.app-grid.result-mode .side-column { order:3; }
.chat-card.complete-collapsed .progress-wrap,
.chat-card.complete-collapsed .messages,
.chat-card.complete-collapsed .composer,
.chat-card.complete-collapsed .microcopy { display:none; }
.chat-card.complete-collapsed .chat-head { border-bottom:0; }

.debug-panel pre { margin:0; background:#101820; color:#d7e3ec; border-radius:12px; padding:14px; min-height:260px; max-height:430px; overflow:auto; font:12px/1.48 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@keyframes fadein { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

@media (max-width: 860px) {
  .hero { align-items:flex-start; flex-direction:column; }
  .status-card { min-width:0; }
  .messages { max-height:none; min-height:390px; }
  .result-rows, .result-bullets { grid-template-columns:1fr; }
  .cta-box { grid-template-columns:1fr; }
  .primary-link { grid-column:1; grid-row:auto; margin-top:12px; width:max-content; }
}
@media (max-width: 540px) {
  .page-shell { width:min(100% - 20px, 1180px); }
  .topbar { padding:16px 0; }
  .descriptor { display:none; }
  .hero { padding-top:28px; }
  .lead { font-size:17px; }
  .chat-head, .messages, .composer { padding-left:15px; padding-right:15px; }
  .chat-head { align-items:flex-start; flex-direction:column; }
  .msg { max-width:96%; }
  .result-panel { padding:20px; }
}

/* V3.6 public-beta hardening */
.cta-box > div { min-width:0; }
.cta-deliverables { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.cta-deliverables span { display:inline-flex; align-items:center; background:rgba(255,255,255,.72); border:1px solid #d7e1ea; border-radius:999px; padding:6px 9px; color:#3d4d5d; font-size:11px; font-weight:750; }
.cta-meta { margin-top:9px; color:#5a6876; font-size:11px; font-weight:700; }
.snapshot-box { margin-top:16px; padding:15px 17px; border:1px solid #e0e6ec; border-radius:14px; background:#fbfcfd; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px 18px; align-items:center; }
.snapshot-box strong { display:block; font-size:14px; }
.snapshot-box p { margin:4px 0 0; color:#667085; font-size:12px; line-height:1.45; }
.snapshot-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.email-panel { grid-column:1 / -1; border-top:1px solid #e6ebef; padding-top:14px; }
.email-panel > label:first-child { display:block; font-size:12px; font-weight:750; margin-bottom:6px; color:#425466; }
.email-row { display:flex; gap:8px; align-items:stretch; }
.email-row input[type="email"] { flex:1; min-width:0; border:1px solid #cdd6df; border-radius:10px; padding:10px 11px; outline:none; background:white; }
.email-row input[type="email"]:focus { border-color:#7aa2c5; box-shadow:0 0 0 3px rgba(37,94,141,.10); }
.compact-primary { min-height:42px; padding:0 14px; white-space:nowrap; }
.consent-row { display:flex; align-items:flex-start; gap:8px; margin-top:11px; font-size:12px; color:#4c5b69; line-height:1.4; cursor:pointer; }
.consent-row input { margin-top:2px; }
.email-note { font-size:11px !important; margin-top:9px !important; }
.email-status { min-height:18px; margin-top:8px; font-size:12px; font-weight:650; color:#596675; }
.email-status.success { color:var(--ok); }
.email-status.error { color:var(--risk); }
.hp-field { position:absolute !important; left:-10000px !important; width:1px !important; height:1px !important; opacity:0 !important; pointer-events:none !important; }
.microcopy strong { color:#566473; }

@media (max-width: 860px) {
  .snapshot-box { grid-template-columns:1fr; }
  .snapshot-actions { justify-content:flex-start; }
  .email-panel { grid-column:1; }
  .email-row { flex-direction:column; }
  .compact-primary { width:max-content; }
}

@media print {
  body { background:#fff; }
  .page-shell { width:100%; margin:0; }
  .topbar, .hero, .chat-card, .side-column, .snapshot-box { display:none !important; }
  .app-grid, .app-grid.result-mode { display:block; max-width:none; margin:0; }
  .result-panel { display:block !important; box-shadow:none; border:0; border-radius:0; padding:0; }
  .primary-link { display:none !important; }
  .cta-box { break-inside:avoid; }
  .finding-box { break-inside:avoid; }
}

/* Public endpoint abuse protection */
.turnstile-box{margin:10px 24px 0;max-width:420px;min-height:0}
.turnstile-box.hidden{display:none}
.security-status{margin:6px 24px 0;font-size:12px;color:#667085;min-height:0}
@media (max-width:720px){.turnstile-box,.security-status{margin-left:16px;margin-right:16px}}

.scope-note{margin:10px 2px 0;padding:10px 12px;border-left:3px solid #0b5fa5;background:#f1f6fa;border-radius:0 8px 8px 0;font-size:14px;color:#24384a}

a.brand-wrap{text-decoration:none;color:inherit}
a.brand-wrap:hover .brand{text-decoration:underline}
a.brand-wrap:focus-visible{outline:2px solid #0b5fa5;outline-offset:3px;border-radius:6px}
