/*
 * Oasis Fund Management — Investor & Introducer Portal
 *
 * Brand tokens from the oasisfundmanagement.com brochure site: its ink navy
 * for the masthead and sign-in field, its gold for accents. Working surfaces
 * stay light, because this is where people read statements and review
 * documents for long stretches. Gold on white fails contrast at #c9a04a, so
 * gold as text uses the darker --brand-gold-text.
 *
 * Fonts are SELF-HOSTED in assets/fonts/ and nothing here reaches outside this
 * origin. No @import, no external url(), no inline styles anywhere — the CSP
 * forbids all of it.
 */

/* ─── Faces ──────────────────────────────────────────────────────────────
 * Both are variable fonts, so one file covers the whole weight range. 64 KB
 * for the pair, served from this origin.
 * Cormorant Garamond and Manrope are SIL Open Font License 1.1.
 */
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('/assets/fonts/cormorant-garamond.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Manrope';
    src: url('/assets/fonts/manrope.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    /* ── Palette ── */
    --brand-blue:           #0a1520;   /* brochure --ink */
    --brand-blue-hover:     #132433;
    --brand-paper:          #f9f6f4;   /* Paper White */
    --brand-white:          #ffffff;

    /* Copper — the only sanctioned warm palette */
    --brand-copper:         #8a6a22;   /* gold as text: 5.0:1 on white */
    --brand-copper-dark:    #6f5418;
    --brand-copper-darkest: #4f3b10;
    --brand-copper-light:   #f6ecd6;
    --brand-sand:           #c9a04a;   /* brochure --gold: button fill */
    --brand-sand-hover:     #e0bd6d;

    /* Surfaces */
    --surface:            #ffffff;
    --surface-alt:        #f5f2ee;
    --surface-sunken:     #faf8f6;

    /* Text */
    --text:               #1e2537;
    --text-strong:        #0a1520;
    --text-muted:         #6b7280;
    --text-on-blue:       #ffffff;

    /* Lines and depth */
    --border:             #e5e0dc;
    --border-strong:      #d1cbc4;
    --shadow-card:        0 2px 10px rgba(2, 6, 38, .06);
    --shadow-raised:      0 4px 16px rgba(2, 6, 38, .10);
    --shadow-deep:        0 10px 40px rgba(0, 0, 0, .35);

    /* Status — warmed to sit on paper rather than on white */
    --ok:      #1f6b45;  --ok-bg:   #e7f2ec;
    --wait:    #913f0d;  --wait-bg: #ffe7d2;
    --need:    #9a3324;  --need-bg: #f8e9e6;
    --idle-bg: #eeebe8;

    --radius:       10px;
    --radius-card:  16px;
    --measure:      68ch;

    --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-sans:  'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono:  ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--brand-paper);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, 78rem); margin-inline: auto; }

.skip { position: absolute; left: -9999px; background: var(--brand-blue); color: #fff; padding: .6rem 1rem; }
.skip:focus { left: 1rem; top: .5rem; z-index: 10; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── Masthead ─────────────────────────────────────────────────────────── */

.masthead { background: var(--brand-blue); color: var(--text-on-blue); }
.masthead-inner {
    display: flex; flex-wrap: wrap; gap: 1rem;
    align-items: center; justify-content: space-between;
    /* Taller than it needs to be for the text alone, so the logo can sit at a
       size where it reads properly rather than being shrunk to fit a thin bar. */
    padding-block: 1.15rem;
    min-height: 68px;
}
.brand { display: flex; align-items: center; gap: .85rem; color: inherit; text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-text {
    font-family: var(--font-serif);
    font-size: 1.15rem; font-weight: 500; letter-spacing: .01em;
    padding-left: .85rem; border-left: 1px solid rgba(255,255,255,.22);
    color: #e8eaf0;
}

.masthead-nav { display: flex; align-items: center; gap: 1.3rem; font-size: .85rem; }
.masthead-nav a { color: #c2c8d6; text-decoration: none; padding-block: .2rem; border-bottom: 1px solid transparent; }
.masthead-nav a:hover, .masthead-nav a:focus { color: #fff; border-bottom-color: var(--brand-sand); }
.whoami { color: #8b93a7; }

.inline { display: inline; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: #c2c8d6; font: inherit; font-size: .85rem; }
.linkish:hover { color: #fff; }

/* ─── Structure ────────────────────────────────────────────────────────── */

main { padding-block: 2.5rem 4.5rem; }

h1 { font-family: var(--font-serif); font-size: 2rem; line-height: 1.2; margin: 0 0 .5rem; font-weight: 500; color: var(--text-strong); }
h2 { font-family: var(--font-serif); font-size: 1.35rem; margin: 2rem 0 .7rem; font-weight: 500; color: var(--text-strong); }
h3 { font-size: .95rem; margin: 1.5rem 0 .5rem; font-weight: 600; color: var(--text-strong); }
p  { margin: 0 0 .9rem; max-width: var(--measure); }

a { color: var(--brand-copper); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-copper-dark); }

code { font-family: var(--font-mono); font-size: .86em; }

.muted { color: var(--text-muted); font-size: .88rem; }
.warn  { color: var(--need); }
.breadcrumb { font-size: .82rem; color: var(--text-muted); margin-bottom: 1.4rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-copper); }

.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.9rem 2rem; margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}
.panel.narrow { max-width: 34rem; margin-inline: auto; }

.filehead { margin-bottom: 1.9rem; }

/* ─── Forms ────────────────────────────────────────────────────────────── */

.stack { display: flex; flex-direction: column; gap: .6rem; max-width: 38rem; margin-top: 1.1rem; }
label { font-size: .82rem; font-weight: 600; color: var(--text-strong); }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
    font: inherit; font-size: .95rem;
    padding: .7rem .8rem;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: var(--surface-alt); color: var(--text); width: 100%;
}
input:focus, textarea:focus, select:focus { background: #fff; border-color: var(--brand-copper); }
textarea { resize: vertical; min-height: 6.5rem; line-height: 1.6; }

input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 2px solid var(--brand-copper); outline-offset: 2px;
}

/* The code field is deliberately narrow. text-align centres the DIGITS inside it;
   margin-inline centres the BOX, which is what keeps it under the centred heading
   on the sign-in card instead of hanging off the left edge. */
.code-input { letter-spacing: .35em; font-size: 1.3rem; text-align: center; max-width: 11rem; margin-inline: auto; }
.code-entry label { text-align: center; }

button {
    font-family: var(--font-sans); font-size: .87rem; font-weight: 600;
    padding: .7rem 1.3rem; cursor: pointer;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: #fff; color: var(--text-strong);
    align-self: flex-start; transition: background-color .12s ease, border-color .12s ease;
}
button:hover { border-color: var(--brand-copper); color: var(--brand-copper-dark); }
button.primary { background: var(--brand-sand); border-color: var(--brand-sand); color: var(--brand-blue); }
button.primary:hover { background: var(--brand-sand-hover); border-color: var(--brand-sand-hover); color: var(--brand-blue); }

.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.check input { width: auto; }
.inline-form { display: inline-block; margin-right: .75rem; }

details { margin-top: 1.3rem; border-top: 1px solid var(--border); padding-top: 1rem; }
summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--brand-copper); }
summary:hover { color: var(--brand-copper-dark); }

/* ─── Messages ─────────────────────────────────────────────────────────── */

.notice, .error, .callout {
    padding: .85rem 1rem; border-radius: var(--radius);
    border-left: 3px solid; font-size: .9rem; max-width: var(--measure);
}
.notice  { background: var(--ok-bg);   border-color: var(--ok);          color: #145234; }
.error   { background: var(--need-bg); border-color: var(--need);        color: #7d2a1e; }
.callout { background: var(--brand-copper-light); border-color: var(--brand-copper); color: var(--brand-copper-darkest); }
.callout-link { font-size: .88rem; font-weight: 600; }

/* ─── Progress ─────────────────────────────────────────────────────────── */

.progress { margin-bottom: 2.4rem; }
.progress-line { font-size: 1rem; }
.bar { height: .5rem; background: var(--idle-bg); border-radius: 999px; overflow: hidden; max-width: 30rem; margin-bottom: .6rem; }
.bar-fill { display: block; height: 100%; background: var(--brand-copper); }

/* ─── Sections and items ───────────────────────────────────────────────── */

.phase { margin-bottom: 2.6rem; }
.phase-note, .section-note { color: var(--text-muted); font-size: .9rem; }

.section {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.4rem 1.7rem; margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
}
.section-letter {
    display: inline-grid; place-items: center;
    width: 1.7rem; height: 1.7rem; margin-right: .55rem;
    background: var(--brand-blue); color: #fff; border-radius: 50%;
    font-family: var(--font-sans); font-size: .76rem; font-weight: 600;
}

.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; padding: .8rem 0; border-top: 1px solid var(--border); }
.item:first-child { border-top: 0; }
.item-link { flex: 1 1 26rem; text-decoration: none; color: inherit; display: flex; gap: .8rem; }
.item-link:hover .item-text { color: var(--brand-copper); }
.item-code { font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); flex: 0 0 2.7rem; padding-top: .15rem; }
.item-code.big { font-family: var(--font-serif); font-size: 1.3rem; color: var(--brand-blue); flex: none; font-weight: 500; }
.item-text { font-size: .93rem; }
.item-text-small { font-size: .83rem; color: var(--text-muted); display: block; }
.item-title { font-family: var(--font-serif); font-size: 1.45rem; line-height: 1.35; max-width: var(--measure); font-weight: 500; color: var(--text-strong); }
.item-title-small { font-size: 1rem; color: var(--text-muted); max-width: var(--measure); }
.item-header { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-bottom: 1rem; }

/* ─── Pills and tags ───────────────────────────────────────────────────── */

.pill, .tag {
    font-family: var(--font-sans); font-size: .71rem; font-weight: 600;
    padding: .22rem .6rem; border-radius: 999px; white-space: nowrap;
}
.pill-not_started, .pill-closed  { background: var(--idle-bg); color: var(--text-muted); }
.pill-provided, .pill-na_requested { background: var(--wait-bg); color: var(--wait); }
.pill-accepted, .pill-na_confirmed, .pill-open { background: var(--ok-bg); color: var(--ok); }
.pill-more_needed, .pill-on_hold { background: var(--need-bg); color: var(--need); }

.tag { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); font-weight: 500; }
.tag-verified   { border-color: var(--brand-copper); color: var(--brand-copper); }
.tag-restricted { border-color: var(--need); color: var(--need); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.1rem; }

/* ─── Notes and quotes ─────────────────────────────────────────────────── */

.note { border-left: 3px solid var(--border-strong); background: var(--surface-sunken); padding: .85rem 1rem; margin-bottom: .9rem; border-radius: 0 var(--radius) var(--radius) 0; }
.note-firm_only { border-left-color: var(--brand-copper); background: var(--brand-copper-light); }
.note-meta { font-size: .75rem; color: var(--text-muted); margin-bottom: .3rem; }
.note p:last-child { margin-bottom: 0; }

blockquote {
    margin: 0 0 .9rem; padding: 1rem 1.2rem;
    background: var(--surface-sunken); border: 1px solid var(--border);
    border-radius: var(--radius); max-width: var(--measure); white-space: pre-wrap;
}
blockquote.frozen { background: var(--idle-bg); color: var(--text-muted); }

/* ─── Tables ───────────────────────────────────────────────────────────── */

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: .8rem 1rem; border-top: 1px solid var(--border); vertical-align: top; }
thead th {
    border-top: 0; border-bottom: 1px solid var(--border-strong);
    background: var(--surface-alt);
    font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600;
}
tbody tr:hover { background: var(--surface-sunken); }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.flagged { background: var(--brand-copper-light); }
tr.flagged:hover { background: #ffdfc2; }
.phasecount { display: inline-block; margin-right: .8rem; font-size: .83rem; color: var(--text-muted); }
.ratio { font-variant-numeric: tabular-nums; }

/* ─── Comparison ───────────────────────────────────────────────────────── */

.versionpicker { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.5rem; font-size: .85rem; }
.versionpicker select { width: auto; min-width: 14rem; }
.versionpicker button { align-self: auto; }

.sidebyside { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
@media (min-width: 60rem) { .sidebyside { grid-template-columns: 1fr 1fr; } }
.version { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1.3rem 1.5rem; box-shadow: var(--shadow-card); }
.version h2 { margin-top: 0; }

.diff { max-width: none; line-height: 1.95; white-space: pre-wrap; }
.d-remove { background: var(--need-bg); color: #7d2a1e; text-decoration: line-through; text-decoration-thickness: 1px; padding: .05rem .15rem; border-radius: 2px; }
.d-add    { background: var(--ok-bg);  color: #145234; text-decoration: underline; text-decoration-thickness: 2px; padding: .05rem .15rem; border-radius: 2px; }

/* ─── Timeline ─────────────────────────────────────────────────────────── */

.timeline { list-style: none; margin: 0; padding: 0; font-size: .87rem; }
.timeline li { padding: .5rem 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; }
.timeline li:first-child { border-top: 0; }
.when { font-family: var(--font-mono); font-size: .76rem; color: var(--text-muted); flex: 0 0 12rem; }

/* ─── Documents ────────────────────────────────────────────────────────── */

.doclist { list-style: none; margin: 0 0 1rem; padding: 0; }
.doclist li { display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; padding: .7rem 0; border-top: 1px solid var(--border); }
.doclist li:first-child { border-top: 0; }
.doclist a { flex: 1 1 20rem; }
.linkish-danger { background: none; border: 0; padding: 0; cursor: pointer; color: var(--need); font: inherit; font-size: .82rem; text-decoration: underline; }
.linkish-plain  { background: none; border: 0; padding: 0; cursor: pointer; color: var(--brand-copper); font: inherit; font-size: .82rem; text-decoration: underline; }
input[type="file"] {
    font: inherit; font-size: .9rem; padding: .8rem;
    border: 1px dashed var(--border-strong); border-radius: var(--radius);
    background: var(--surface-sunken); width: 100%;
}
.hashline { font-family: var(--font-mono); font-size: .71rem; color: var(--text-muted); word-break: break-all; }
.doc-superseded { opacity: .6; }
.doc-superseded a { text-decoration: line-through; }

/* ─── Enrolment ────────────────────────────────────────────────────────── */

.steps { padding-left: 1.2rem; }
.steps > li { margin-bottom: 1.9rem; }
.steps h2 { margin-top: 0; font-size: 1.1rem; }
.secret code { font-family: var(--font-mono); font-size: 1rem; letter-spacing: .08em; background: var(--surface-alt); padding: .6rem .8rem; display: inline-block; border-radius: var(--radius); border: 1px solid var(--border); }
.keydetail { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; font-size: .85rem; margin: .9rem 0; }
.keydetail dt { color: var(--text-muted); font-size: .78rem; }
.keydetail dd { margin: 0; }
.codes { list-style: none; margin: 1rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .5rem; }
.codes code { font-family: var(--font-mono); background: var(--surface-alt); padding: .5rem .6rem; display: block; text-align: center; border-radius: var(--radius); letter-spacing: .04em; border: 1px solid var(--border); }

.qr { display: inline-block; padding: .85rem; margin: .6rem 0 1.1rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); line-height: 0; box-shadow: var(--shadow-card); }
.qr svg { display: block; width: 200px; height: 200px; }
.manualkey { margin-top: .6rem; border-top: 0; padding-top: 0; }

.rolegrant { display: inline-flex; gap: .3rem; align-items: center; }
.rolegrant select { width: auto; font-size: .8rem; padding: .25rem .35rem; }
.panel .tablewrap { border: 0; box-shadow: none; }
details .stack { max-width: 34rem; }

/* ─── Sign-in ──────────────────────────────────────────────────────────── */

/* The unauthenticated pages take the Mirage treatment: navy field, paper card. */
body.signin { background: var(--brand-blue); }
body.signin main { padding-block: 3rem 4rem; }
body.signin .masthead { background: transparent; }
body.signin .masthead-inner { justify-content: center; padding-block: 2rem 0; }
body.signin .brand-text { display: none; }
body.signin .brand-logo { height: 58px; }
body.signin .panel {
    background: var(--brand-paper); border: 0;
    border-radius: var(--radius-card); box-shadow: var(--shadow-deep);
    padding: 2.2rem 2.4rem;
}
body.signin h1 { text-align: center; font-size: 1.6rem; }
body.signin .panel > p:first-of-type { text-align: center; color: var(--text-muted); font-size: .9rem; }
body.signin .footer { border-top-color: rgba(255,255,255,.12); }
body.signin .footer p { color: #6f7691; }
.signin-title, .signin-sub {
    /* max-width: none matters — the base p rule caps at 68ch, and centring text
       inside a narrow box is not the same as centring the box. */
    max-width: none; text-align: center;
}
.signin-title { color: #fff; font-family: var(--font-serif); font-size: 1.75rem; font-weight: 500; margin: 1.3rem 0 .25rem; letter-spacing: .01em; }
.signin-sub   { color: #9aa1b6; font-size: .85rem; margin-bottom: 2.2rem; }
body.signin .panel > p:first-of-type { max-width: none; }

/* The sign-in card, as Mirage renders it: a full-width call to action and a
   centred secondary link beneath. */
body.signin .stack { max-width: none; margin-top: 1.4rem; }
body.signin .stack button { align-self: stretch; width: 100%; padding-block: .8rem; margin-top: .6rem; }
body.signin .panel > p.muted { text-align: center; max-width: none; margin-top: 1.2rem; margin-bottom: 0; }
body.signin .stack label { margin-top: .4rem; }

/* ─── Footer ───────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--border); padding-block: 1.6rem; color: var(--text-muted); font-size: .82rem; }
.footer p { margin: 0; max-width: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Progress-bar widths as classes — the CSP forbids inline styles. */
.bar-0 { width: 0%; }
.bar-5 { width: 5%; }
.bar-10 { width: 10%; }
.bar-15 { width: 15%; }
.bar-20 { width: 20%; }
.bar-25 { width: 25%; }
.bar-30 { width: 30%; }
.bar-35 { width: 35%; }
.bar-40 { width: 40%; }
.bar-45 { width: 45%; }
.bar-50 { width: 50%; }
.bar-55 { width: 55%; }
.bar-60 { width: 60%; }
.bar-65 { width: 65%; }
.bar-70 { width: 70%; }
.bar-75 { width: 75%; }
.bar-80 { width: 80%; }
.bar-85 { width: 85%; }
.bar-90 { width: 90%; }
.bar-95 { width: 95%; }
.bar-100 { width: 100%; }

/* ─── Guides ───────────────────────────────────────────────────────────── */

.guide-head {
    display: flex; flex-wrap: wrap; gap: 1rem;
    align-items: flex-start; justify-content: space-between;
    margin-bottom: 2rem;
}
.pdf-button {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--brand-sand); color: var(--brand-blue);
    border: 1px solid var(--brand-sand); border-radius: var(--radius);
    padding: .6rem 1.1rem; font-size: .85rem; font-weight: 600;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.pdf-button:hover { background: var(--brand-sand-hover); border-color: var(--brand-sand-hover); color: var(--brand-blue); }

/* Two downloads sit together; the guide is the primary one, so the checklist is
   outlined rather than filled and does not compete with it. */
.guide-downloads { display: flex; flex-wrap: wrap; gap: .55rem; flex-shrink: 0; }
.pdf-button.secondary {
    background: transparent; border-color: var(--border-strong); color: var(--text-strong);
}
.pdf-button.secondary:hover {
    background: transparent; border-color: var(--brand-copper); color: var(--brand-copper-dark);
}

.guide-layout { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 62rem) { .guide-layout { grid-template-columns: 15rem 1fr; } }

.guide-toc {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.2rem 1.3rem;
    box-shadow: var(--shadow-card); font-size: .85rem;
}
@media (min-width: 62rem) { .guide-toc { position: sticky; top: 1.5rem; } }
.guide-toc-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 600; margin-bottom: .6rem; }
.guide-toc ol { margin: 0; padding-left: 1.1rem; }
.guide-toc li { margin-bottom: .4rem; }
.guide-toc a { color: var(--text); text-decoration: none; }
.guide-toc a:hover { color: var(--brand-copper); text-decoration: underline; }

.guide-body { max-width: 46rem; }
.guide-body p { font-size: .97rem; }
.g-h { display: flex; gap: .7rem; align-items: baseline; margin-top: 2.6rem; scroll-margin-top: 1.5rem; }
.g-h:first-child { margin-top: 0; }
.g-num {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 1.6rem; height: 1.6rem; background: var(--brand-blue); color: #fff;
    border-radius: 50%; font-family: var(--font-sans); font-size: .72rem; font-weight: 600;
}
.g-sub { margin-top: 1.8rem; font-size: 1rem; }
.g-list { padding-left: 1.2rem; max-width: var(--measure); }
.g-list li { margin-bottom: .45rem; font-size: .97rem; }
.g-steps { list-style: none; counter-reset: step; padding: 0; margin: 1.2rem 0; max-width: var(--measure); }
.g-steps li { counter-increment: step; position: relative; padding-left: 2.4rem; margin-bottom: 1.1rem; }
.g-steps li::before {
    content: counter(step); position: absolute; left: 0; top: .05rem;
    display: grid; place-items: center; width: 1.6rem; height: 1.6rem;
    background: var(--brand-copper-light); color: var(--brand-copper-darkest);
    border-radius: 50%; font-size: .75rem; font-weight: 700;
}
.g-steps strong { display: block; margin-bottom: .15rem; color: var(--text-strong); }
.g-steps span { display: block; font-size: .95rem; }

.g-note, .g-warn { border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1.3rem 0; max-width: var(--measure); border-left: 3px solid; }
.g-note { background: var(--surface-alt); border-color: var(--border-strong); }
.g-warn { background: var(--brand-copper-light); border-color: var(--brand-copper); }
.g-note p, .g-warn p { margin: 0; font-size: .93rem; }
.g-warn p { color: var(--brand-copper-darkest); }

.g-fig { margin: 1.6rem 0 1.8rem; }
.g-fig img {
    display: block; width: 100%; height: auto;
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
}
.g-fig figcaption { margin-top: .55rem; font-size: .82rem; color: var(--text-muted); }
.g-table { margin: 1.3rem 0 1.6rem; }
.g-table td:first-child { font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.g-rule { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.guide-cards { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 2rem; }
@media (min-width: 48rem) { .guide-cards { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); } }
.guide-card {
    display: flex; flex-direction: column; gap: .3rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.4rem 1.5rem;
    text-decoration: none; color: inherit; box-shadow: var(--shadow-card);
    border-top: 3px solid var(--brand-sand);
}
.guide-card:hover { border-color: var(--brand-copper); box-shadow: var(--shadow-raised); }
.guide-card-kicker { font-size: .71rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-copper); font-weight: 600; }
.guide-card-title { font-family: var(--font-serif); font-size: 1.25rem; color: var(--text-strong); }
.guide-card-sub { font-size: .88rem; color: var(--text-muted); }

/* ─── Demo environment (§12 Q9) ─────────────────────────────────────────── */
.demo-banner {
    background: var(--brand-copper-light);
    color: var(--brand-copper-darkest);
    text-align: center;
    font-size: .82rem;
    padding: .4rem 1rem;
    border-bottom: 1px solid var(--border);
}
body.signin .demo-banner { background: transparent; color: var(--brand-sand); border: 0; }
.demo-tag {
    display: inline-block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .05rem .4rem;
    border-radius: 4px;
    background: var(--brand-sand);
    color: var(--brand-blue);
    vertical-align: middle;
}

/* ─── Portal: stat tiles, statuses, tree ────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.25rem 0 2rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat-n { display: block; font-family: var(--font-serif); font-size: 2rem; line-height: 1.1; color: var(--text-strong); }
.stat-l { font-size: .8rem; color: var(--text-muted); }
.stat-alert .stat-n { color: var(--need); }

.pill-active, .pill-approved, .pill-mfa_passed { background: var(--ok-bg); color: var(--ok); }
.pill-invited, .pill-prospect, .pill-onboarding, .pill-under_review, .pill-password_ok { background: var(--wait-bg); color: var(--wait); }
.pill-suspended, .pill-rejected, .pill-terminated, .pill-failed, .pill-mfa_failed, .pill-locked_out { background: var(--need-bg); color: var(--need); }

.lvl-1 { padding-left: 0; }
.lvl-2 { padding-left: 1.4rem; }
.lvl-3 { padding-left: 2.8rem; }
.lvl-4 { padding-left: 4.2rem; }
.lvl-5 { padding-left: 5.6rem; }
.lvl-mark { color: var(--brand-copper); margin-right: .35rem; }

.hosting-flag { font-size: .72rem; padding: .05rem .35rem; border-radius: 4px; background: var(--wait-bg); color: var(--wait); white-space: nowrap; }
.rangepicker { margin: .5rem 0 1rem; font-size: .9rem; }
.rangepicker strong, .rangepicker a { margin-right: .75rem; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.actions form { display: inline; }
details.inline-details summary { cursor: pointer; color: var(--brand-copper); font-size: .88rem; }
details.inline-details[open] { margin-top: .4rem; }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.col-actions { min-width: 15rem; }
.col-actions .stack input[type="text"] { width: 100%; }
.col-actions .actions:empty { display: none; }
.detail-cell { max-width: 26rem; overflow-wrap: anywhere; font-size: .82rem; }

/* ─── KYC: risk pills, dormant items, answers ───────────────────────────── */
.pill-risk-low      { background: var(--ok-bg);   color: var(--ok); }
.pill-risk-standard { background: var(--wait-bg); color: var(--wait); }
.pill-risk-high     { background: var(--need-bg); color: var(--need); }
.item-dormant { opacity: .55; }
.answer {
    background: var(--surface-sunken);
    border-left: 3px solid var(--brand-sand);
    padding: .7rem .9rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    white-space: pre-wrap;
}
.fs-09 { font-size: .9rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .9rem; }
fieldset legend { font-size: .85rem; color: var(--text-muted); padding: 0 .3rem; }
