:root {
    --bg: #07101f;
    --panel: #0d1a2f;
    --panel-2: #12223b;
    --line: #1f3352;
    --text: #e8eef8;
    --muted: #93a4bf;
    --cyan: #3fd0f0;
    --violet: #9b8cff;
    --gold: #e6b54a;
    --red: #ff7a7a;
    --amber: #f4b860;
    --green: #5fd49a;
    --radius: 10px;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

a { color: var(--cyan); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-top: 1.25rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, ui-monospace, monospace; font-size: .85em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Top bar */
.topbar {
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
    padding: .6rem 1.25rem; background: #050c18; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: var(--muted); font-size: .75rem; }
.mainnav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.mainnav a { color: var(--muted); text-decoration: none; padding: .35rem .5rem; border-radius: 6px; }
.mainnav a:hover { color: var(--text); background: var(--panel); }
.mainnav a.active { color: var(--text); background: var(--panel-2); }
.session { display: flex; align-items: center; gap: .6rem; }
.mode { font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--line); }
.mode.offline { color: var(--amber); border-color: #5b4a24; }
.mode.online { color: var(--green); border-color: #245b40; }
select, input, textarea {
    background: var(--panel); color: var(--text); border: 1px solid var(--line);
    border-radius: 8px; padding: .45rem .6rem; font: inherit;
}
textarea { width: 100%; resize: vertical; margin: .75rem 0; }
select:focus, input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }

.content { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; border-top: 1px solid var(--line); }

/* Home */
.hero { padding: 1rem 0 .5rem; }
.eyebrow { color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; margin: 0 0 .35rem; }
.eyebrow a { color: inherit; }
.lead { font-size: 1.08rem; color: #c9d5e8; max-width: 70ch; }
.pillars { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.pillars li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.pillars strong { color: var(--gold); }
.pillars span { color: var(--muted); font-size: .9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 1rem 0; }
.card {
    display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem 1.1rem; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--cyan); transform: translateY(-1px); }
.card p { color: #c2cee1; }

/* Pack header */
.pack-head { margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: .75rem 0; }
.tabs a { padding: .5rem .85rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-bottom-color: var(--gold); }
.notice { background: #13202f; border-left: 3px solid var(--violet); padding: .55rem .8rem; color: #c9d1ea; font-size: .88rem; border-radius: 0 8px 8px 0; }

/* Panels and forms */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1rem 0; }
.panel h2 { margin-top: 0; }
.samples { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.chip { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; font: inherit; font-size: .85rem; }
.chip:hover { border-color: var(--cyan); }
.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.btn {
    background: var(--gold); color: #1a1406; border: 0; border-radius: 8px; padding: .55rem 1.1rem;
    font: inherit; font-weight: 600; cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.small { padding: .25rem .6rem; font-size: .85rem; }
.linklike { background: none; border: 0; color: var(--cyan); cursor: pointer; font: inherit; padding: 0; text-align: left; }
.warning { color: var(--amber); }
.ok { color: var(--green); }

/* Results */
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.answer-text { font-size: 1.02rem; }
.answer.declined .answer-text { color: var(--amber); }
.question { color: var(--muted); font-style: italic; }
.cite {
    display: inline-block; font-size: .7rem; font-weight: 700; color: #06121f; background: var(--cyan);
    border-radius: 4px; padding: 0 .3rem; margin-left: .15rem; vertical-align: super; line-height: 1.4; cursor: help;
}
.sources { margin-top: .5rem; }
.sources summary { cursor: pointer; color: var(--muted); }
.sources ol { list-style: none; padding: 0; }
.sources li { margin: .6rem 0; }
blockquote {
    margin: .35rem 0; padding: .4rem .7rem; border-left: 3px solid var(--line); background: var(--panel-2);
    color: #cdd7e8; border-radius: 0 6px 6px 0; white-space: pre-line;
}
.stats { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1rem; }
.stat { padding: .25rem .65rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: .85rem; }
.stat.high { color: var(--red); border-color: #5b2a2a; }
.stat.medium { color: var(--amber); border-color: #5b4a24; }
.stat.low { color: var(--muted); }
.stat.good { color: var(--green); border-color: #245b40; }
.issues { list-style: none; padding: 0; margin: 0; }
.issue { border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: .7rem .9rem; margin: .6rem 0; background: #0b1729; }
.issue p { margin: .35rem 0; }
.issue.sev-high { border-left-color: var(--red); }
.issue.sev-medium { border-left-color: var(--amber); }
.issue.sev-low { border-left-color: var(--muted); }
.issue-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.sev, .sev-tag { text-transform: uppercase; font-size: .7rem; font-weight: 700; letter-spacing: .05em; }
.sev-high .sev, .sev-tag.sev-high { color: var(--red); }
.sev-medium .sev, .sev-tag.sev-medium { color: var(--amber); }
.sev-low .sev, .sev-tag.sev-low { color: var(--muted); }
.rule { font-size: .8rem; }
.suggestion { color: #d9f3e6; }
.reference { color: var(--muted); font-size: .85rem; }
.draft-q { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }

/* Tables */
.grid { width: 100%; border-collapse: collapse; margin: .5rem 0; font-size: .92rem; }
.grid th, .grid td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.grid .row-bad td:first-child { color: var(--red); }
.grid .row-ok td:first-child { color: var(--green); }
.grid blockquote { font-size: .85rem; }
.matrix td:nth-child(2) { width: 28%; }
.audit td { font-size: .82rem; }
.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.status-met, .status-approved { color: var(--green); border-color: #245b40; }
.status-partial, .status-draft { color: var(--amber); border-color: #5b4a24; }
.status-gap, .status-rejected { color: var(--red); border-color: #5b2a2a; }
.doc-preview { white-space: pre-wrap; background: var(--panel-2); padding: .8rem; border-radius: 8px; font-size: .85rem; max-height: 420px; overflow: auto; }

/* Approval */
.approval { margin-top: 1.25rem; padding: .8rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: #0a1526; }
.approval.status-approved { border-color: #245b40; }
.approval.status-rejected { border-color: #5b2a2a; }
.approval.status-draft { border-color: #5b4a24; }
.decide { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.decide input { flex: 1; min-width: 200px; }

#blazor-error-ui {
    background: #3b1d1d; color: var(--text); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media (max-width: 720px) {
    .grid { display: block; overflow-x: auto; }
    .topbar { gap: .6rem; }
}

/* Public demo and feedback */
.demo-banner {
    background: #1a1830; border-bottom: 1px solid #3a3470; color: #d9d4ff; font-size: .88rem;
    padding: .5rem 1.25rem; text-align: center;
}
.demo-banner a { color: var(--gold); }
.mainnav a.nav-feedback { color: var(--gold); }
.steps { padding-left: 1.2rem; }
.steps li { margin: .35rem 0; }
.feedback-nudge { text-align: center; }
.feedback-form fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; }
.feedback-form legend { font-weight: 600; margin-bottom: .4rem; }
.req { color: var(--muted); font-weight: 400; font-size: .85rem; }
.star-row { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.star { cursor: pointer; font-size: 2rem; line-height: 1; color: #33456a; }
.star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star.on { color: var(--gold); }
.star:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.star-row .muted { margin-left: .6rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.form-grid label, label.block { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; margin-bottom: 1rem; }
label.block textarea { margin: 0; font-weight: 400; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.check { display: flex; align-items: center; gap: .45rem; font-weight: 400; cursor: pointer; }
.contact { background: var(--panel-2); border-radius: 8px; padding: .8rem 1rem !important; }
.privacy { font-size: .82rem; }
