/* EAISight console. Brand v1.0 (docs/brand/README.md; palette = docs/brand/marks.js RAW): ink and paper
   swap roles in dark mode; amber is for graphics only (symbol, focus rings, selected state) and
   "amber text" for links. Account-type series always come with a text label, Anonymous is hatched and
   Unknown dotted, and Shadow AI always carries an icon and the words. Fonts are self-hosted WOFF2
   (SIL OFL, licences in /fonts): Source Serif 4 (titles, wordmark), DM Sans (UI), DM Mono (data, IDs). */

@font-face {
    font-family: "DM Sans";
    src: url("fonts/dm-sans-latin-opsz.woff2") format("woff2-variations");
    font-weight: 100 1000;
    font-display: swap;
}
@font-face {
    font-family: "Source Serif 4";
    src: url("fonts/source-serif-4-latin-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Source Serif 4";
    src: url("fonts/source-serif-4-latin-600.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "DM Mono";
    src: url("fonts/dm-mono-latin-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "DM Mono";
    src: url("fonts/dm-mono-latin-500.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}

:root {
    /* Core (RAW.core, light) */
    --ink: #151B2B;
    --paper: #F6F4EF;
    --surface-card: #FDFCFA;
    --raised: #FFFFFF;
    --line: #DFDAD0;
    --muted: #5B6170;
    --amber: #B8561B;
    --amber-text: #9A4512;
    --amber-tint: #F7E3D0;
    /* Semantic */
    --success: #2E7D4F;
    --warning: #8F6200;
    --error: #B3261E;
    --info: #2E5E9E;
    /* Data series: account types (always paired with a text label) */
    --series-business: #1F5FA8;
    --series-personal: #3A9A5B;
    --series-anonymous: #9C2F7A;   /* hatched */
    --series-api-key: #A07E00;
    --series-unknown: #80868F;     /* dotted */
    --series-local: #5B4FA0;       /* not in the brand palette: local models, a sixth class */
    --shadow-ai: #B3261E;          /* always with the icon and the words "Shadow AI" */

    /* Roles used by the components (names kept from before the brand). */
    --cls-business: var(--series-business);
    --cls-personal: var(--series-personal);
    --cls-anonymous: var(--series-anonymous);
    --cls-api-key: var(--series-api-key);
    --cls-local: var(--series-local);
    --cls-unknown: var(--series-unknown);

    --bg: var(--paper);
    --bg-muted: color-mix(in srgb, var(--line) 40%, var(--paper));
    --surface: var(--surface-card);
    --border: var(--line);
    --text: var(--ink);
    --text-soft: var(--muted);
    --link: var(--amber-text);
    --btn-bg: var(--ink);
    --btn-bg-hover: color-mix(in srgb, var(--ink) 86%, var(--paper));
    --btn-text: var(--paper);
    --focus: var(--amber);
    --selected: var(--amber-tint);
    --bar-bg: color-mix(in srgb, var(--line) 70%, var(--paper));
    --bar-fill: var(--info);
    --ok-bg: color-mix(in srgb, var(--success) 10%, var(--surface)); --ok-text: var(--success); --ok-border: color-mix(in srgb, var(--success) 32%, var(--surface));
    --warn-bg: color-mix(in srgb, var(--warning) 10%, var(--surface)); --warn-text: var(--warning); --warn-border: color-mix(in srgb, var(--warning) 32%, var(--surface));
    --err-bg: color-mix(in srgb, var(--error) 9%, var(--surface)); --err-text: var(--error); --err-border: color-mix(in srgb, var(--error) 30%, var(--surface));

    --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
    --font-mono: "DM Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

    /* Pattern overlays for the Anonymous (hatch) and Unknown (dots) series, drawn in the card colour. */
    --hatch: repeating-linear-gradient(135deg, color-mix(in srgb, var(--surface) 70%, transparent) 0 1.5px, transparent 1.5px 4.5px);
    --dots: radial-gradient(circle, color-mix(in srgb, var(--surface) 80%, transparent) 0 1px, transparent 1.3px);
    /* Shadow AI icon: a warning triangle, used as a mask so it takes the Shadow AI colour. */
    --shadow-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.2 15.4 14.5H.6Z' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M7.2 5.6h1.6v4.6H7.2zM7.2 11.3h1.6v1.6H7.2z'/%3E%3C/svg%3E");

    --radius: 12px;
    --radius-sm: 8px;
    --maxw: 1100px;
    --maxw-wide: 1360px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Core (RAW.core, dark): ink and paper swap roles. */
        --ink: #F6F4EF;
        --paper: #151B2B;
        --surface-card: #1C2336;
        --raised: #242C41;
        --line: #333C54;
        --muted: #A3AABA;
        --amber: #F2A35E;
        --amber-text: #F5B47A;
        --amber-tint: #3A2A22;
        --success: #5CC98A;
        --warning: #E9B949;
        --error: #F2867D;
        --info: #8DB4EA;
        --series-business: #5C9EE6;
        --series-personal: #5CD3B0;
        --series-anonymous: #F08AC8;
        --series-api-key: #DDBF4A;
        --series-unknown: #8D94A2;
        --series-local: #A99BEA;
        --shadow-ai: #FF7B6B;
        --bg-muted: color-mix(in srgb, #000 18%, var(--paper));
        --btn-bg-hover: #FFFFFF;
        --ok-bg: color-mix(in srgb, var(--success) 14%, var(--surface));
        --warn-bg: color-mix(in srgb, var(--warning) 14%, var(--surface));
        --err-bg: color-mix(in srgb, var(--error) 14%, var(--surface));
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

/* html keeps 15px so rem-based spacing is unchanged; body text is the brand's Body 14/22. */
html, body {
    margin: 0; padding: 0;
    background: var(--bg); color: var(--text);
    font-family: var(--font-body); font-size: 15px; line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body { font-size: 14px; line-height: 22px; font-variant-numeric: tabular-nums; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--amber-tint); color: var(--ink); }
h1:focus, h1:focus-visible { outline: none; }

/* Type scale (brand): Display Serif 600 48/56, Page title Serif 600 28/36, Section Sans 600 18/26,
   KPI Sans 600 32/40 tabular, Body 14/22, Small 13/20, Label Sans 500 12/16 caps +6 %, Mono 13/20. */
h1, h2, h3 { color: var(--text); margin: 0 0 .5em; }
h1 { font-family: var(--font-display); font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.005em; }
h2 { font-size: 18px; line-height: 26px; font-weight: 600; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--font-mono); font-size: 13px; line-height: 20px; font-weight: 400; }
.label { font-family: var(--font-body); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.wide { max-width: var(--maxw-wide); }
.container.narrow { max-width: 760px; }
@media (max-width: 520px) { .container { padding: 0 16px; } }

.site { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

.overline {
    display: inline-block; margin: 0 0 .6rem;
    font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft);
}
.muted { color: var(--text-soft); font-size: 13px; line-height: 20px; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; margin-top: 1.4rem; }

/* --- Brand: symbol + wordmark (Components/Layout/BrandLockup.razor) ---
   Wordmark: Source Serif 4 600, "EAI" at 64 % tracked .08em, "Sight" -0.01em, one colour.
   Lock-up gap 0.75x (x = keyhole diameter = 10/48 of the symbol). */
.brand-symbol { display: block; flex: none; }
.brand-symbol__door { fill: var(--ink); }
.brand-symbol__light { fill: var(--amber); }
.wordmark { font-family: var(--font-display); font-weight: 600; color: var(--text); white-space: nowrap; line-height: 1; }
.wordmark__eai { font-size: .64em; letter-spacing: .08em; margin-right: .06em; }
.wordmark__sight { letter-spacing: -0.01em; }
.lockup { --sym: 28px; display: inline-flex; align-items: center; gap: calc(var(--sym) * .156); color: var(--text); text-decoration: none; }
.lockup:hover { text-decoration: none; }
.lockup .wordmark { font-size: calc(var(--sym) * .82); }
.lockup--stacked { --sym: 48px; flex-direction: column; gap: calc(var(--sym) * .2); }
.lockup--stacked .wordmark { font-size: calc(var(--sym) * .62); }
.auth-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.4rem; }
.auth-tagline { font-family: var(--font-display); font-weight: 400; font-size: 17px; line-height: 24px; color: var(--text-soft); margin: .9rem 0 0; }

/* "Provided by" partner slot: after our lock-up, a 1 px Line rule, then the MSP's name in text. */
.provided-by { display: inline-flex; align-items: center; gap: .6rem; color: var(--text-soft); font-size: 13px; line-height: 20px; white-space: nowrap; }
.provided-by::before { content: ""; width: 1px; height: 20px; background: var(--line); }
.provided-by strong { color: var(--text); font-weight: 600; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .6rem 1.05rem; border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    transition: background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--text-soft); }
.btn--primary { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.btn--primary:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.btn--ghost { background: transparent; }
.btn--danger { background: var(--err-bg); color: var(--err-text); border-color: var(--err-border); }
.btn--sm { padding: .3rem .65rem; font-size: .85rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- Header / footer --- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; align-items: center; gap: 2rem; height: 60px; }
.site-nav { display: flex; gap: 1.4rem; }
.site-nav a { color: var(--text-soft); font-weight: 500; text-decoration: none; padding: 19px 0 17px; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }
.site-nav a.active { border-bottom-color: var(--amber); }
.site-header__actions { display: flex; gap: .7rem; margin-left: auto; align-items: center; }
.header-signout { margin: 0; }
.header-user { white-space: nowrap; }
.site-footer { border-top: 1px solid var(--border); padding: 1.2rem 0; color: var(--text-soft); font-size: .85rem; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-soft); }

/* --- Page head / bands --- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1.5rem; }
.page-head h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.17; letter-spacing: -0.01em; }
.page-head__lead { color: var(--text-soft); font-size: 1.1rem; line-height: 1.55; max-width: 44rem; }
.band { padding: 1rem 0 3rem; }
.band--flush { padding-top: 0; }

/* --- Cards --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.card--pad { padding: 1.6rem; }
.card--flush { margin-bottom: 1.5rem; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.card__head h3 { margin: 0; }
.card p:last-child { margin-bottom: 0; }
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin: .4rem 0; color: var(--text-soft); }
.grid { display: grid; gap: 1.1rem; margin-bottom: 1.5rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- Console --- */
.console { padding: 1.8rem 0 3rem; }
.console-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.console-head h1 { margin: 0; }
.console-head__actions { display: flex; gap: .6rem; align-items: center; }
.crumb { font-size: .85rem; color: var(--text-soft); text-decoration: none; }
.crumb::before { content: "← "; }
/* The divider is an inset shadow, not a border + negative tab margin: with overflow-x: auto the
   1px overhang made the strip scroll vertically (an up/down scrollbar). Narrow screens scroll sideways only. */
.tabs { display: flex; gap: .3rem; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 1.5rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tab { padding: .6rem .9rem; color: var(--text-soft); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab--active { color: var(--text); border-bottom-color: var(--amber); }
.section-title-left { margin: 2rem 0 .8rem; }
.section-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.section-row .section-title-left { margin-bottom: .8rem; }
.admin-back { margin-top: 1.5rem; }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.segmented button { font: inherit; font-weight: 600; font-size: .88rem; padding: .45rem .85rem; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; }
.segmented button.is-on { background: var(--selected); color: var(--text); box-shadow: inset 0 0 0 1px var(--amber); }

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.5rem; }
.stat-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat__num { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--text-soft); font-size: 13px; line-height: 20px; }
.stat--alert { border-left: 4px solid var(--warning); }
.stat--shadow { border-left-color: var(--shadow-ai); }

/* Shadow AI: the alert colour never appears without this icon and the words "Shadow AI". */
.shadow-flag::before, .stat--shadow .stat__label::before {
    content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .35em; vertical-align: -0.12em;
    background: var(--shadow-ai); -webkit-mask: var(--shadow-icon) center / contain no-repeat; mask: var(--shadow-icon) center / contain no-repeat;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { text-align: left; padding: .65rem .9rem; white-space: nowrap; vertical-align: top; }
.admin-table thead th { color: var(--text-soft); font-weight: 500; font-size: 12px; line-height: 16px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.admin-table tbody tr { border-top: 1px solid var(--border); }
.admin-table tbody tr:first-child { border-top: none; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table tbody tr[aria-selected="true"], .admin-table tbody tr.is-selected { background: var(--selected); }
.admin-table td.wrap { white-space: normal; min-width: 10rem; }
.admin-table .sub { color: var(--text-soft); font-size: .8rem; }
.row--muted td { opacity: .6; }

/* Bars */
.bar { display: inline-block; width: 160px; height: 8px; border-radius: 4px; background: var(--bar-bg); overflow: hidden; vertical-align: middle; }
.bar__fill { display: block; height: 100%; background: var(--bar-fill); border-radius: 4px; }
.bar__label { margin-left: .6rem; font-variant-numeric: tabular-nums; }
.bar-cell { min-width: 15rem; }
.share { display: flex; align-items: center; gap: .6rem; }
.share .bar { width: 90px; }
.share__num { font-variant-numeric: tabular-nums; }
.classbar { display: flex; width: 100%; min-width: 180px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bar-bg); gap: 1px; }
.classbar__seg { display: block; height: 100%; }
.split-cell { min-width: 14rem; }
.split-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem 1.4rem; }
.split-list li { display: grid; grid-template-columns: 1fr auto auto auto; gap: .8rem; align-items: center; font-size: .88rem; color: var(--text-soft); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: 0; padding: 0; font-size: .82rem; color: var(--text-soft); }
.legend li { display: inline-flex; align-items: center; gap: .35rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.cls-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; margin: 0 .6rem .15rem 0; white-space: nowrap; }
.cls-business { background: var(--cls-business); }
.cls-personal { background: var(--cls-personal); }
.cls-anonymous { background: var(--hatch), var(--cls-anonymous); }
.cls-api-key { background: var(--cls-api-key); }
.cls-local { background: var(--cls-local); }
.cls-unknown { background: var(--dots) 0 0 / 4px 4px, var(--cls-unknown); }
.bar__fill--shadow { background: var(--shadow-ai); }

/* Badges / notices */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-family: var(--font-mono); font-size: 12px; line-height: 18px; border: 1px solid transparent; white-space: nowrap; }
.badge--ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }
.badge--warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.badge--muted { background: var(--bg-muted); color: var(--text-soft); border-color: var(--border); }
.notice { padding: .8rem 1rem; border-radius: var(--radius-sm); margin: 0 0 1.2rem; background: var(--surface); border: 1px solid var(--border); }
.notice--ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.notice--err { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }

/* Forms */
.form-grid { display: flex; flex-direction: column; gap: .9rem; margin: .8rem 0 1.1rem; }
.form-grid label, .auth-form label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; font-size: .88rem; }
.form-grid label em, .auth-form label em { color: var(--text-soft); font-weight: 400; font-style: normal; }
.form-grid input[type=text], .form-grid input[type=number], .form-grid textarea, .auth-form input, .export-form input {
    padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--raised); color: var(--text); font: inherit;
}
.form-grid textarea { resize: vertical; font-family: var(--font-mono); font-size: .88rem; }
.check { flex-direction: row !important; align-items: flex-start; gap: .55rem !important; font-weight: 400 !important; }
.check input { margin-top: .25rem; }
.export-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.export-form label { display: inline-flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--text-soft); }
.create-tenant { margin-top: 2rem; max-width: 640px; }

.tiers { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.tier { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-soft); }
.tier label { display: flex; gap: .45rem; align-items: center; color: var(--text); }
.tier--on { border-color: var(--amber); background: var(--selected); }
.tier span { font-size: .85rem; }

.secret-result { border-left: 4px solid var(--success); margin-bottom: 1.4rem; }
.code-box {
    font-family: var(--font-mono); font-size: 1.15rem; font-weight: 500; letter-spacing: .04em; word-break: break-all;
    padding: .8rem 1rem; margin: .6rem 0 1rem; background: var(--bg); border: 1px dashed var(--text-soft); border-radius: var(--radius-sm);
}
.cmd {
    font-family: var(--font-mono); font-size: .85rem; white-space: pre-wrap; word-break: break-all;
    padding: .8rem 1rem; margin: 0 0 1rem; background: var(--bg-muted); border: 1px solid var(--border); border-radius: var(--radius-sm);
}

/* --- Auth pages --- */
.auth-page { min-height: calc(100vh - 120px); display: grid; place-items: center; padding: 3rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.8rem; text-align: center; }
.auth-card h1 { margin-bottom: .8rem; }
.auth-sub { color: var(--text-soft); margin-bottom: 1.2rem; }
.auth-form { display: flex; flex-direction: column; gap: .9rem; text-align: left; margin-top: .4rem; }
.auth-form button { margin-top: .3rem; }
.auth-alt { margin-top: 1.2rem; color: var(--text-soft); font-size: .9rem; }
.auth-error { background: var(--err-bg); color: var(--err-text); border: 1px solid var(--err-border); border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .9rem; margin-bottom: 1rem; text-align: left; }
.auth-note { color: var(--text-soft); }
.auth-ms { margin-bottom: .3rem; }
.ms-logo {
    width: 16px; height: 16px; display: inline-block; flex: 0 0 auto;
    background:
        linear-gradient(#f25022 0 0) 0 0 / 7px 7px no-repeat,
        linear-gradient(#7fba00 0 0) 9px 0 / 7px 7px no-repeat,
        linear-gradient(#00a4ef 0 0) 0 9px / 7px 7px no-repeat,
        linear-gradient(#ffb900 0 0) 9px 9px / 7px 7px no-repeat;
}
.auth-divider { display: flex; align-items: center; gap: .8rem; color: var(--text-soft); margin: 1rem 0; font-size: 12px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* --- Responsive --- */
@media (max-width: 960px) {
    .stat-grid, .stat-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--2 { grid-template-columns: 1fr; }
    .split-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .site-nav { display: none; }
    .header-user { display: none; }
}

#blazor-error-ui {
    background: var(--err-bg); color: var(--err-text); bottom: 0; left: 0; right: 0;
    display: none; padding: .8rem 1.2rem; position: fixed; z-index: 1000; border-top: 1px solid var(--err-border);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .7rem; }

/* ADR-0002 additions: sign-in confirmations, billing banner, chooser cards, inline form rows. */
.auth-ok { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-border); border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .9rem; margin-bottom: 1rem; text-align: left; }
.billing-banner { background: var(--warn-bg); color: var(--warn-text); text-align: center; padding: .45rem 1rem; font-size: .85rem; }
/* "View as" preview bar: platform admin previewing a reseller / client role. */
.viewas-bar { display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .45rem 1rem;
    background: var(--warn-bg); color: var(--warn-text); border-bottom: 2px solid var(--amber); font-size: .88rem; position: sticky; top: 0; z-index: 20; }
.viewas-bar form { margin: 0; }
.radio-list { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.radio-list legend { font-weight: 600; margin-bottom: .3rem; }
.card--link { display: block; text-decoration: none; color: inherit; }
.card--link:hover { border-color: var(--amber); }
.form-grid--inline { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Passkeys + TOTP QR (Account page, sign-in second step). The QR stays black on white in dark mode:
   authenticator apps scan dark-on-light most reliably. */
.qr-box {
    width: 220px; max-width: 100%; padding: 10px; margin: .6rem 0 1rem;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.qr-box svg { display: block; width: 100%; height: auto; }
.passkey-status { min-height: 1.2em; margin: .4rem 0 0; font-size: .9rem; color: var(--text-soft); }
.passkey-status--err { color: var(--err-text); }
.no-passkeys [data-passkey] { display: none; }

/* --- Teams, API & MCP (docs/specs/company-api-and-mcp-v1.md) --- */
.team-filter, .form-grid select, .form-grid input[type=email], .form-grid input[type=search] {
    font: inherit; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--raised); color: var(--text);
}
.team-filter { margin-right: .5rem; font-size: .88rem; }
.team-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.team-list button { width: 100%; text-align: left; font: inherit; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; display: flex; justify-content: space-between; gap: .6rem; }
.team-list button.is-on { border-color: var(--amber); background: var(--selected); font-weight: 600; }
.team-list .count { color: var(--text-soft); font-size: .85rem; }
.placeholder-card { border-style: dashed; }

/* --- Approved AI (docs/specs/approved-ai-v1.md): approval classes, always paired with a text label --- */
/* Approved = success; the three shadow classes share the Shadow AI colour, told apart by pattern and
   always by their label (ApprovalBadge adds the Shadow AI icon); unknown is dotted like the series. */
.appr-approved { background: var(--success); }
.appr-unapproved-tool { background: var(--shadow-ai); }
.appr-wrong-account { background: var(--hatch), var(--shadow-ai); }
.appr-not-authorised { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--surface) 70%, transparent) 0 1.5px, transparent 1.5px 4.5px), var(--shadow-ai); }
.appr-unknown { background: var(--dots) 0 0 / 4px 4px, var(--cls-unknown); }
.appr-not-configured { background: var(--bar-bg); border: 1px solid var(--border); }
.stat--ok { border-left: 4px solid var(--success); }
.stat--muted { border-left: 4px solid var(--cls-unknown); }
.stat__sub { display: block; font-size: .78rem; color: var(--text-soft); margin-top: .25rem; }
.class-filter { margin-left: .5rem; }
.rule-off td { opacity: .6; }
.rule-form .form-grid--inline label { min-width: 12rem; }
.checks { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.checks label { flex-direction: row !important; align-items: center; gap: .35rem !important; font-weight: 400 !important; }
.preview { border-left: 4px solid var(--info); }
.warn-list { margin: .4rem 0 0; padding-left: 1.2rem; }

/* ---- Public site: home page and legal pages ------------------------------------------------ */
.display { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5.2vw, 52px); line-height: 1.1; letter-spacing: -0.015em; margin: .3rem 0 1rem; }
.display--sm { font-size: clamp(26px, 3.6vw, 36px); }
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(1.5rem, 4vw, 3rem); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.hero__mark { display: flex; justify-content: center; }
.hero__mark .brand-symbol { width: min(220px, 60%); height: auto; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature h2 { margin-top: .5rem; }
.feature p { color: var(--text-soft); margin: 0; }
.band--muted { background: var(--bg-muted); padding: 3rem 0; margin: 1rem 0 2rem; }
.section-heading { font-family: var(--font-display); font-size: 26px; line-height: 34px; margin-bottom: .8rem; }
.steps { list-style: none; counter-reset: step; margin: 1.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
    border: 2px solid var(--amber); font-weight: 600; margin-bottom: .7rem; }
.steps p { color: var(--text-soft); margin: 0; }
.ticks { list-style: none; padding-left: 0; }
.ticks li { padding-left: 1.5rem; position: relative; }
.ticks li::before { content: ""; position: absolute; left: .15rem; top: .45rem; width: .45rem; height: .75rem;
    border: solid var(--amber); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.band--cta { padding: 2rem 0 4rem; }
.cta { text-align: center; }
.actions--center { justify-content: center; }
@media (max-width: 860px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__mark { display: none; }
    .grid--3, .steps { grid-template-columns: 1fr; }
}

/* Legal / policy pages: readable long-form text. */
.prose { max-width: 46rem; font-size: 15px; line-height: 1.65; }
.prose h2 { font-family: var(--font-display); font-size: 22px; line-height: 30px; margin: 2.2rem 0 .6rem; scroll-margin-top: 4rem; }
.prose h3 { margin: 1.4rem 0 .4rem; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }
.prose table { border-collapse: collapse; width: 100%; margin: .8rem 0 1.2rem; font-size: 14px; }
.prose th, .prose td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); padding: .5rem .6rem .5rem 0; }
.prose th { font-weight: 600; }
.prose .updated { color: var(--text-soft); font-size: 13px; }
.toc { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: 14px; margin: 1rem 0 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
