@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-latin.woff2") format("woff2"); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("fonts/great-vibes-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Dancing Script"; src: url("fonts/dancing-script-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Caveat; src: url("fonts/caveat-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
    --bg: #f3f2ee;
    --surface: #ffffff;
    --ink: #16181d;
    --muted: #63666e;
    --soft: #8a8d94;
    --line: #e2e0da;
    --line-strong: #d3d0c8;
    --accent: #4338ca;
    --accent-deep: #3730a3;
    --accent-soft: #e8e8fb;
    --pop: #8ff0ff;
    --btn-grad: linear-gradient(95deg, #3730a3 0%, #4338ca 35%, #2563eb 65%, #0891b2 100%);
    --good: #0b7a5c;
    --good-soft: #e2f3ec;
    --warn: #a35a00;
    --warn-soft: #fdf0dc;
    --bad: #c42b1c;
    --bad-soft: #fde7e4;
    --side: #0c0e1d;
    --side-2: #151834;
    --side-line: #262a4d;
    --side-ink: #eceefb;
    --side-muted: #9da1c7;
    --shadow: 0 1px 2px rgba(22, 24, 29, 0.04);
    font-family: "Instrument Sans", system-ui, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; margin: 0 0 0.35rem; }
h1 { font-size: 2rem; line-height: 1.1; font-stretch: 92%; letter-spacing: -0.035em; }
h2 { font-size: 1.05rem; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.mark { width: 1.7rem; height: 1.7rem; display: block; flex: none; }
.brand strong i { font-style: normal; background: linear-gradient(180deg, #5ab0ff, #6d4cf0); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* App shell */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
    background: var(--side);
    color: var(--side-ink);
    padding: 1.1rem 0.8rem 0.8rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.side .brand { color: white; display: flex; gap: 0.6rem; align-items: center; text-decoration: none; padding: 0.2rem 0.5rem; }
.side .brand strong { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em; }
.org {
    margin: 1rem 0.3rem 0.4rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--side-line);
    border-radius: 10px;
    background: var(--side-2);
    color: var(--side-ink);
    font-size: 0.82rem;
    font-weight: 600;
}
.org:empty { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; overflow: auto; }
.side-foot { flex: none; display: flex; flex-direction: column; gap: 0.55rem; padding-top: 0.7rem; }
.side-request { width: 100%; }
.side-nav p {
    margin: 1rem 0.65rem 0.3rem;
    color: #6e7299;
    font-size: 0.72rem;
    font-weight: 600;
}
.side-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--side-muted);
    text-decoration: none;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    font-weight: 500;
}
.side-nav a svg {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}
.side-nav a.active svg, .side-nav a:hover svg { opacity: 1; }
.side-nav a:hover { background: var(--side-2); color: white; text-decoration: none; }
.side-nav a.active { background: var(--side-2); color: white; }
.side-nav a.active::before { content: ""; position: absolute; left: -0.8rem; top: 0.55rem; bottom: 0.55rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--pop); }
.nav-count { margin-left: auto; min-width: 1.15rem; padding: 0 0.35rem; border-radius: 999px; background: var(--pop); color: var(--side); font-size: 0.72rem; font-weight: 700; line-height: 1.35rem; text-align: center; }
button.notice { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; width: 100%; margin: 0 0 0.6rem; padding: 0.9rem 1rem; text-align: left; font-weight: 400; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
button.notice:hover { background: var(--surface); border-color: var(--accent); box-shadow: none; }
button.notice.is-unread { border-color: var(--accent); background: var(--accent-soft); }
button.notice strong { font-weight: 600; }
.side-user {
    padding: 0.85rem 0.45rem 0.2rem;
    border-top: 1px solid var(--side-line);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem 0.65rem;
    align-items: center;
}
.side-user span:nth-child(2) { font-size: 0.88rem; }
.side-user form { grid-column: 1 / -1; }
.avatar {
    width: 3.1rem; height: 3.1rem; flex: none; border-radius: 14px;
    background: var(--accent); color: white;
    display: grid; place-items: center; font-weight: 600; line-height: 1;
}
.avatar.sm { width: 2rem; height: 2rem; border-radius: 8px; font-size: 0.72rem; background: var(--side-2); color: var(--pop); border: 1px solid var(--side-line); }

.main { min-width: 0; }
.content { width: min(1120px, calc(100% - 3rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.content:has(.access-table) { width: calc(100% - 2.5rem); }
.content > h1 + .lede, .content > .kicker + h1 + .lede { max-width: 42rem; }
.lede, .meta { color: var(--muted); }
.lede { margin-top: 0; margin-bottom: 1.2rem; font-size: 1.02rem; }
.kicker {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 0.45rem;
}

/* Surfaces */
.panel, .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.panel { padding: 1.15rem 1.25rem; margin: 0.9rem 0; }
.panel h2 { padding-bottom: 0.6rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.card { padding: 1rem 1.1rem; display: block; color: inherit; text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.card:hover { border-color: var(--ink); text-decoration: none; }
.card span, .metrics span { display: block; color: var(--muted); font-size: 0.78rem; }
.card strong, .metrics strong { display: block; margin-top: 0.25rem; font-size: 1.6rem; font-weight: 600; font-stretch: 90%; font-variant-numeric: tabular-nums; letter-spacing: -0.035em; }
.grid, .metrics { display: grid; gap: 0.75rem; margin: 0.9rem 0 1rem; }
.grid { grid-template-columns: repeat(4, 1fr); }
.metrics { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.metrics div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
}
.glance {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.15rem 0 0.9rem;
}
.glance a {
    display: block;
    min-width: 0;
    padding: 0.85rem 0.95rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
}
.glance a:hover { border-color: var(--ink); text-decoration: none; }
.glance span { display: block; color: var(--muted); font-size: 0.78rem; }
.glance strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.45rem;
    font-weight: 600;
    font-stretch: 90%;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.035em;
}
.glance small {
    display: block;
    margin-top: 0.3rem;
    color: var(--soft);
    font-size: 0.75rem;
    line-height: 1.35;
    min-height: 2rem;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.6rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; padding: 0; border: 0; }
.overview-split { align-items: start; }
.overview-split > .panel { margin: 0; }
.overview-side { position: sticky; top: 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.overview-side .panel { margin: 0; }
.team-line, .holder {
    display: block;
    padding: 0.75rem 0;
    color: inherit;
    text-decoration: none;
}
.team-line + .team-line, .holder + .holder { border-top: 1px solid var(--line); }
.team-line:hover, .holder:hover { background: #fafaf8; text-decoration: none; }
.team-line:hover strong, .holder:hover strong { color: var(--accent); }
.team-line-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.team-line-top strong { font-weight: 600; }
.team-line-top span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.team-line .meta, .note-line { margin: 0.35rem 0 0; }
.share {
    margin: 0.45rem 0;
    height: 4px;
    border-radius: 99px;
    background: #eceae4;
    overflow: hidden;
}
.share > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
    color: var(--muted);
    background: var(--bg);
    border-radius: 999px;
    padding: 0.08rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
}
.mix {
    display: flex;
    height: 10px;
    border-radius: 99px;
    overflow: hidden;
    background: #eceae4;
    gap: 2px;
}
.mix > span { display: block; min-width: 2px; }
.mix-owner, .legend i.mix-owner { background: var(--accent); }
.mix-admin, .legend i.mix-admin { background: #818cf8; }
.mix-member, .legend i.mix-member { background: #8d8a96; }
.mix-normal, .legend i.mix-normal { background: var(--good); }
.mix-elevated, .legend i.mix-elevated { background: #e0a24a; }
.mix-privileged, .legend i.mix-privileged { background: var(--warn); }
.mix-critical, .legend i.mix-critical { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; margin: 0.7rem 0 0; padding: 0; list-style: none; }
.legend a, .legend li { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.82rem; text-decoration: none; }
.legend a:hover { color: var(--ink); text-decoration: none; }
.legend i { width: 0.55rem; height: 0.55rem; border-radius: 2px; }
.legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.holder { display: grid; grid-template-columns: auto 1fr auto; gap: 0.65rem; align-items: center; }
.holder .avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    font-size: 0.72rem;
    background: var(--accent-soft);
    color: var(--accent);
}
.holder strong { display: block; font-weight: 600; }
.holder .meta { margin: 0; }
.holder > b { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Controls */
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid transparent;
    background: var(--btn-grad);
    background-repeat: no-repeat;
    background-origin: border-box;
    background-size: 125% 100%;
    background-position: 0% 50%;
    color: white;
    border-radius: 10px;
    padding: 0.5rem 0.95rem;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    transition: background-position 0.3s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
}
.btn:hover, button:hover { background-position: 100% 50%; box-shadow: 0 6px 18px -8px rgba(67, 56, 202, 0.6); }
.btn.secondary, button.secondary, button.ghost {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line-strong);
}
.btn.secondary:hover, button.secondary:hover, button.ghost:hover { background: var(--bg); border-color: var(--ink); }
.side button.ghost { background: transparent; color: var(--side-muted); border-color: var(--side-line); padding: 0.35rem 0.65rem; font-weight: 500; }
.side button.ghost:hover { color: white; border-color: var(--side-muted); }
.btn.danger, button.danger { background: var(--surface); border-color: #f0c3bd; color: var(--bad); }
.btn.danger:hover, button.danger:hover { background: var(--bad); border-color: var(--bad); color: white; }
a.btn:hover { text-decoration: none; }
.btn-go::after, .auth-card button[type="submit"]::after {
    content: "";
    width: 1.7rem;
    height: 1.7rem;
    margin: -0.15rem 0 -0.15rem 0.6rem;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h9M8.5 4l4 4-4 4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.9rem no-repeat;
    transition: transform 0.15s ease;
}
.btn-go:hover::after, .auth-card button[type="submit"]:hover::after { transform: translateX(2px); }

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.85rem; }
.field span { color: var(--ink); font-size: 0.85rem; font-weight: 600; }
.check { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.88rem; }
.check input { flex: none; }
.panel:not(.inline) > .check { margin: 0.15rem 0 0.9rem; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: white;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--soft); }
input:hover, select:hover, textarea:hover { border-color: #bdb9b0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select {
    appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6.2 8 10.2 12 6.2' fill='none' stroke='%2363666e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 0.9rem;
    padding-right: 2.15rem;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); box-shadow: none; }
textarea { min-height: 6rem; resize: vertical; }
.inline { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; }
.inline .field { flex: 1; min-width: 10rem; margin-bottom: 0; }
.inline .field.field-wide { flex: 2.5; min-width: 16rem; }
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
    align-items: end;
}
.field-grid .field { margin: 0; min-width: 0; }
.field-grid .field input,
.field-grid .field select { width: 100%; min-width: 0; }
.level-list { list-style: none; margin: 0.2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.level-name { font-weight: 600; margin-bottom: 0.35rem; }
.level-name .meta { font-weight: 500; margin-left: 0.25rem; }
.level-line {
    display: grid;
    grid-template-columns: 9rem auto 1fr;
    gap: 0.45rem 0.5rem;
    align-items: center;
}
.level-line select,
.level-line input { width: 100%; min-width: 0; }
.level-line button { justify-self: start; }
.level-line input[name="description"] { grid-column: 1 / -1; }
.panel.inline > h2, .panel.inline > p { flex-basis: 100%; margin-top: 0; margin-bottom: 0.2rem; }
.panel > .inline + .inline { margin-top: 0.75rem; }
.panel > .inline + button { margin-top: 1.1rem; }
input[type="file"] { padding: 0.35rem; color: var(--muted); }
input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
td form, td .inline { align-items: center; }
td .row-actions { display: flex; gap: 0.4rem; flex-wrap: nowrap; }
td select, td input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), .inline select, .inline input:not([type="checkbox"]):not([type="radio"]) { width: auto; min-width: 8rem; }
.inline .field input, .inline .field select, .inline .field textarea { width: 100%; }
.panel.inline.report-filters { min-width: 0; }
.panel.inline.report-filters .field { flex: 1 1 11rem; min-width: 11rem; max-width: 18rem; }
.panel.inline.report-filters .field-wide { flex: 1 1 100%; max-width: none; }
.panel.inline .form-actions { flex: 1 0 100%; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.panel.inline .form-actions + .meta { flex: 1 0 100%; margin: 0; }
.key-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.key-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--line);
}
.key-list form { margin: 0; }

/* Tables */
.panel { overflow-x: auto; }
.findings-table { table-layout: fixed; }
.findings-table th:nth-child(1), .findings-table td:nth-child(1) { width: 46%; }
.findings-table th:nth-child(2), .findings-table td:nth-child(2) { width: 8rem; }
.findings-table td { vertical-align: top; }
.findings-table .evidence { white-space: pre-line; overflow-wrap: anywhere; margin-top: 0.35rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.access-table { width: 100%; table-layout: fixed; }
.access-table th, .access-table td { overflow-wrap: break-word; }
.access-table .meta { overflow-wrap: anywhere; }
.access-table th:nth-child(1) { width: 9%; }
.access-table th:nth-child(2) { width: 12%; }
.access-table th:nth-child(3) { width: 7%; }
.access-table th:nth-child(4) { width: 6%; }
.access-table th:nth-child(5) { width: 6%; }
.access-table th:nth-child(6) { width: 12%; }
.access-table th:nth-child(7) { width: 7%; }
.access-table th:nth-child(8) { width: 6%; }
.access-table th:nth-child(9) { width: 12%; }
.access-table th:nth-child(10) { width: 12%; }
.access-table th:nth-child(11) { width: 6%; }
.access-table th:nth-child(12) { width: 5%; }
th, td { text-align: left; padding: 0.75rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
    color: var(--soft);
    font-size: 0.76rem;
    font-weight: 600;
    background: transparent;
    border-bottom-color: var(--line-strong);
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfaf8; }

/* Status */
.stamp, .pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 6px;
    padding: 0.16rem 0.5rem;
    font-size: 0.74rem;
    font-weight: 600;
    background: #eeede8;
    color: var(--muted);
    margin: 0 0.25rem 0.25rem 0;
}
.pill.has-note { cursor: help; }
.pill.has-note:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill.has-note::after { content: "*"; color: var(--accent); font-weight: 700; line-height: 1; }
.note-pop {
    position: fixed;
    z-index: 30;
    max-width: 20rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: var(--ink);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: 0 16px 40px -18px rgba(22, 24, 29, 0.7);
    pointer-events: none;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.stamp::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; }
.stamp-active, .stamp-granted, .pill-compliant { background: var(--good-soft); color: var(--good); }
.stamp-pending, .stamp-approved, .stamp-historical, .stamp-review-required, .pill-review-required, .pill-access-expiring { background: var(--warn-soft); color: var(--warn); }
.stamp-open { background: var(--accent-soft); color: var(--accent); }
.stamp-revoked, .stamp-rejected, .stamp-cancelled, .stamp-expired, .stamp-revocation_due, .stamp-suspended, .stamp-offboarding, .pill-open-violations, .pill-critical-violation, .pill-suspended, .pill-offboarding { background: var(--bad-soft); color: var(--bad); }
.machine {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0.2rem 0 0;
    padding: 0;
    list-style: none;
}
.machine li {
    display: flex;
    align-items: center;
    color: var(--soft);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.machine li + li::before {
    content: "";
    width: 1.4rem;
    height: 1px;
    margin: 0 0.55rem;
    background: var(--line-strong);
    flex: none;
}
.machine li.is-done { color: var(--muted); }
.machine li.is-done + li::before { background: #b9b6ae; }
.machine li:not(.is-current) > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.machine li:not(.is-current) > span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: currentColor;
    flex: none;
}
.machine li.is-later > span::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.machine .stamp { margin: 0; }
.page-head .page-note { margin: 0.45rem 0 0; }
dt { color: var(--muted); font-size: 0.78rem; margin-top: 0.7rem; }
dd { margin: 0.1rem 0 0; }
.flash, .errors { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.8rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid; }
.flash { background: var(--good-soft); color: var(--good); border-color: #bfe3d3; }
.errors { background: var(--bad-soft); color: var(--bad); border-color: #f6c6bf; }
.split { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 0.9rem; align-items: start; }
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    margin: 0 0 0.15rem;
}
.page-head > div:first-child { min-width: 0; }
.page-head h1 { margin-bottom: 0.35rem; }
.page-head > h1 { margin: 0; }
.page-head p { margin: 0; }
.page-actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
}
.page-actions form { margin: 0; }
.action-stack { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.9rem; }
.action-stack > .panel { margin: 0; }
.action-stack .form-actions { display: flex; justify-content: flex-end; }
.profile-head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.15rem 1.25rem;
}
.profile-head h1 { margin-bottom: 0.15rem; }
.profile-head > :not(.avatar) { min-width: 0; flex: 1; }
.profile-head form.profile-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8.75rem;
    gap: 0.35rem 0.55rem;
    align-items: end;
    max-width: 34rem;
    margin: 0.8rem 0 0;
}
.profile-head form.profile-row .field { min-width: 0; }
.profile-head form.profile-row input,
.profile-head form.profile-row select,
.profile-head form.profile-row button {
    height: 2.6rem;
    min-height: 2.6rem;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1.2;
}
.profile-head form.profile-row button {
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    white-space: nowrap;
}
.indicators { margin: 0.45rem 0 0; }
.tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin: 1rem 0 0.4rem;
    padding: 0.25rem;
    background: #e9e7e1;
    border-radius: 12px;
    width: fit-content;
    max-width: 100%;
}
.tabs a { padding: 0.38rem 0.75rem; border-radius: 9px; color: var(--muted); font-weight: 500; text-decoration: none; }
.tabs a.active, .tabs a:hover { background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; border-left: 2px solid var(--line); padding: 0 0 1rem 1rem; margin-left: 0.35rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 0.35rem; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.timeline li b { display: block; }
.story ol { list-style: none; margin: 0.15rem 0 0; padding: 0; }
.story li { position: relative; border-left: 2px solid var(--line); margin-left: 0.3rem; padding: 0 0 1rem 1.05rem; }
.story li:last-child { padding-bottom: 0; }
.story li::before { content: ""; position: absolute; left: -5px; top: 0.4rem; width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.story li.is-approval::before, .story li.is-grant::before { background: var(--good); }
.story li.is-refusal::before, .story li.is-cancel::before, .story li.is-revocation::before { background: var(--bad); }
.story li.is-reopen::before, .story li.is-review::before { background: var(--warn); }
.story-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.15rem 1.25rem; }
.story-top strong { font-size: 0.92rem; font-weight: 600; }
.story-top time { margin-left: auto; color: var(--soft); font-size: 0.78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.story-who { margin: 0.12rem 0 0; }
.story li .meta { margin: 0.12rem 0 0; }
.facts { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.45rem 0.8rem; margin: 0 0 1rem; }
.facts dt { margin: 0; }
.facts dd { margin: 0; }
.request-card { max-width: 40rem; padding: 1.8rem 2rem; border-radius: 22px; box-shadow: 0 30px 70px -45px rgba(22, 24, 29, 0.3); }
.request-card button[type="submit"] { margin-top: 0.4rem; padding: 0.5rem 0.5rem 0.5rem 1rem; }
.request-card button[type="submit"]::after { content: ""; width: 1.7rem; height: 1.7rem; margin: -0.15rem 0 -0.15rem 0.6rem; border-radius: 7px; background: rgba(255, 255, 255, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h9M8.5 4l4 4-4 4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.9rem no-repeat; }
.finding:first-of-type { border-top: 0; }

.side-user a { color: var(--side-ink); font-size: 0.88rem; font-weight: 500; }
.pill-label { background: var(--accent-soft); color: var(--accent); }
.profile-form .inline { margin-bottom: 0.75rem; }

.signature-typed { font-size: 2.6rem; line-height: 1.15; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.font-great-vibes { font-family: "Great Vibes", "Snell Roundhand", "Apple Chancery", cursive; }
.font-dancing-script { font-family: "Dancing Script", "Snell Roundhand", cursive; font-weight: 500; }
.font-caveat { font-family: Caveat, "Bradley Hand", cursive; font-weight: 500; }
.signature-sheet {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 1rem 0.6rem;
    margin-bottom: 0.4rem;
    min-height: 5.5rem;
    display: flex;
    align-items: center;
}
.signature-drawn { max-width: 100%; max-height: 7rem; display: block; }
.profile-head .signature-sheet { margin: 0.6rem 0 0; min-height: 0; padding: 0.4rem 0.8rem; width: fit-content; max-width: 22rem; }
.profile-head .signature-typed { font-size: 1.9rem; }
.profile-head .signature-drawn { max-height: 4rem; }

.segmented { display: inline-flex; gap: 0.25rem; padding: 0.25rem; background: #e9e7e1; border-radius: 12px; margin-bottom: 1rem; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 0.38rem 0.9rem; border-radius: 9px; color: var(--muted); cursor: pointer; }
.segmented input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.signature-form:has(#style-typed:checked) .drawn-pane,
.signature-form:has(#style-drawn:checked) .typed-pane { display: none; }
.signature-form .field { max-width: 32rem; }
.font-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; }
.font-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: white;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 0.8rem 0.9rem 0.6rem;
    cursor: pointer;
}
.font-choice input { position: absolute; opacity: 0; pointer-events: none; }
.font-choice small { color: var(--muted); font-size: 0.75rem; }
.font-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.font-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.signature-pad {
    position: relative;
    max-width: 640px;
    height: 200px;
    background: white;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    margin-bottom: 0.6rem;
}
.signature-pad.needs-ink { border-color: var(--bad); background: var(--bad-soft); }
.signature-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 1; }
.signature-baseline {
    position: absolute;
    left: 1.2rem;
    right: 1.2rem;
    bottom: 2.6rem;
    border-top: 1px solid var(--line-strong);
    padding-top: 0.25rem;
    color: #b3ada4;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}
.actions { display: flex; gap: 0.55rem; margin-top: 1.2rem; }

/* Public pages */
body.public {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(700px 420px at 85% -10%, rgba(143, 240, 255, 0.35), transparent 60%),
        radial-gradient(800px 480px at 0% 0%, rgba(67, 56, 202, 0.1), transparent 60%),
        var(--bg);
}
.public-bar { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.public-bar-inner { width: min(1200px, calc(100% - 3rem)); height: 56px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.public-bar .brand { display: flex; gap: 0.55rem; align-items: center; color: var(--ink); text-decoration: none; }
.public-bar .brand strong { font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; }
.nav { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.nav a:not(.btn) { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--ink); text-decoration: none; }
.nav .btn { padding: 0.4rem 0.85rem; font-size: 0.88rem; }
.nav .btn-go { padding: 0.3rem 0.3rem 0.3rem 0.85rem; }
.nav .btn-go::after { width: 1.5rem; height: 1.5rem; margin: 0 0 0 0.5rem; border-radius: 6px; background-size: 0.8rem; }
.wrap { flex: 1; width: min(1040px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }
.wrap > h1 { font-size: 2.6rem; }
.public-foot { width: min(1200px, calc(100% - 3rem)); margin: 0 auto; padding: 1.4rem 0 1.8rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); color: var(--soft); font-size: 0.82rem; }
.public-foot nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.public-foot a { color: var(--muted); }

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    max-width: 980px;
    margin: 4vh auto 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 70px -40px rgba(22, 24, 29, 0.35);
}
.auth-card { padding: 2.8rem 2.8rem 2.4rem; }
.auth-split .auth-card.panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.auth-card h1 { font-size: 2.3rem; }
.auth-card .lede { margin-bottom: 1.6rem; }
.auth-card button[type="submit"] { width: 100%; justify-content: space-between; margin-top: 0.6rem; padding: 0.55rem 0.55rem 0.55rem 1.1rem; font-size: 1rem; }
.auth-card .auth-alt { margin: 1.2rem 0 0; color: var(--muted); font-size: 0.9rem; text-align: center; }
.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2.8rem;
    background: var(--side);
    color: var(--side-ink);
    overflow: hidden;
}
.auth-aside::before { content: ""; position: absolute; right: -30%; top: -30%; width: 90%; height: 70%; background: radial-gradient(circle, rgba(143, 240, 255, 0.22), transparent 65%); }
.auth-aside h2 { position: relative; font-size: 1.9rem; line-height: 1.1; font-stretch: 92%; letter-spacing: -0.035em; margin: 0 0 0.7rem; }
.auth-aside h2 span { background: linear-gradient(95deg, #8b8cff, #ff9be7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-aside > p { position: relative; margin: 0; color: var(--side-muted); }
.auth-ledger { position: relative; margin: auto 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; padding-top: 2rem; }
.auth-ledger li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 0.85rem; border: 1px solid var(--side-line); border-radius: 12px; background: var(--side-2); font-size: 0.88rem; }
.auth-ledger small { display: block; color: var(--side-muted); font-size: 0.76rem; }
.auth-ledger em { flex: none; padding: 0.15rem 0.5rem; border-radius: 6px; font-style: normal; font-size: 0.72rem; font-weight: 600; }
.auth-ledger em.ok { background: rgba(61, 220, 151, 0.14); color: #6ee7b0; }
.auth-ledger em.wait { background: rgba(255, 197, 61, 0.14); color: #ffd36b; }
.auth-ledger em.due { background: rgba(255, 99, 99, 0.16); color: #ff8f8f; }

@media (max-width: 960px) {
    .shell, .split, .grid, .auth-split { grid-template-columns: 1fr; }
    .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .overview-side { position: static; }
    .side { position: relative; height: auto; }
    .side-nav { flex: none; min-height: 0; overflow: visible; }
    .auth-aside { display: none; }
    .auth-card { padding: 2rem 1.5rem; }
}

@media (max-width: 640px) {
    .field-grid, .glance { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .page-actions { justify-content: flex-start; }
}

.agreement-text { max-height: 32rem; overflow-y: auto; line-height: 1.55; }
.agreement-text.plain { white-space: pre-wrap; }
.agreement-text h3 { font-size: 0.95rem; margin: 1rem 0 0.3rem; }
.agreement-document { width: 100%; height: 32rem; border: 1px solid var(--line); border-radius: 12px; }

dialog.ask {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.25rem 1.35rem 1.15rem;
    width: min(26rem, calc(100vw - 2rem));
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px -24px rgba(12, 14, 29, 0.55);
}
dialog.ask::backdrop { background: rgba(12, 14, 29, 0.46); }
dialog.ask p { margin: 0 0 1.1rem; font-size: 1.05rem; }
dialog.ask .ask-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin: 0; }

.approvals {
    margin-top: 1rem;
    padding: 0.85rem 0.95rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfaf8;
}
.approvals-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.approvals-state { display: grid; flex: none; margin-top: 0.12rem; color: var(--muted); }
.approvals-state svg { width: 16px; height: 16px; display: block; }
.approvals.is-pending .approvals-state svg { fill: none; }
.approvals.is-done .approvals-state { color: var(--good); }
.approvals.is-done .approvals-state svg,
.approvals.is-refused .approvals-state svg { fill: currentColor; }
.approvals.is-refused .approvals-state { color: var(--bad); }
.approvals-summary { flex: 1; min-width: 0; }
.approvals-summary strong { display: block; font-size: 0.92rem; font-weight: 600; letter-spacing: -0.015em; }
.approvals-meter {
    margin-top: 0.45rem;
    height: 4px;
    border-radius: 99px;
    background: #e4e2db;
    overflow: hidden;
}
.approvals-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.approvals.is-done .approvals-meter > span { background: var(--good); }
.approvals-body { margin-top: 0.85rem; margin-left: calc(16px + 0.6rem); }
.approvals-block + .approvals-block { margin-top: 0.8rem; }
.approvals-label { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.75rem; }
.approvals-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.approvals-people li { display: flex; align-items: center; gap: 0.65rem; min-height: 2.05rem; }
.approvals-avatar {
    position: relative;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: none;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(22, 24, 29, 0.06);
}
.approvals-avatar.is-role {
    background: transparent;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    box-shadow: none;
}
.approvals-avatar.is-role svg { width: 0.95rem; height: 0.95rem; }
.approvals-tick {
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 50%;
    background: var(--good);
    border: 1.5px solid #fbfaf8;
    display: grid;
    place-items: center;
}
.approvals-tick.is-bad { background: var(--bad); }
.approvals-tick svg { width: 0.55rem; height: 0.55rem; display: block; }
.approvals-who { min-width: 0; display: flex; flex-direction: column; }
.approvals-name { font-weight: 600; font-size: 0.9rem; color: var(--ink); line-height: 1.25; }
.approvals-name a { color: inherit; font-weight: inherit; }
.approvals-name a:hover { color: var(--accent); }
.approvals-who .meta { font-size: 0.78rem; line-height: 1.3; }
