:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #07101d;
    color: #e8eef7;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #13243d 0, #07101d 42rem); }
a { color: #8fc8ff; }
.topbar { min-height: 4rem; display: flex; gap: 2rem; align-items: center; padding: .8rem 2rem; border-bottom: 1px solid #26364c; background: rgba(7,16,29,.92); }
.brand { color: #fff; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
nav { display: flex; gap: 1rem; }
nav a { color: #9fb0c5; text-decoration: none; padding: .45rem .6rem; border-radius: .4rem; }
nav a[aria-current="page"] { color: #fff; background: #1e334f; }
.identity { margin-left: auto; display: flex; align-items: center; gap: 1rem; color: #9fb0c5; font-size: .9rem; }
.identity form { margin: 0; }
.page { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0; }
.hero { margin-bottom: 2rem; }
.hero.compact { margin-bottom: 1.4rem; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: .2rem 0 .6rem; letter-spacing: -.04em; }
h2 { margin-top: 0; }
.eyebrow { color: #6fd6b3; text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 800; }
.muted, .empty { color: #92a4bb; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.metric-grid article, .panel, .auth-card { background: rgba(15,30,49,.88); border: 1px solid #263b56; border-radius: .85rem; box-shadow: 0 16px 50px rgba(0,0,0,.18); }
.metric-grid article { padding: 1.25rem; display: flex; flex-direction: column; gap: .35rem; }
.metric-grid strong { font-size: 1.8rem; }
.metric-grid span { color: #9fb0c5; font-size: .85rem; }
.panel { padding: 1.4rem; margin-bottom: 1.5rem; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; }
.panel-heading h2 { margin-bottom: .5rem; }
.auth-card { width: min(430px, 100%); margin: 4rem auto; padding: 2rem; }
label { display: block; margin: 1rem 0 .35rem; color: #b8c7d9; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #38516d; border-radius: .55rem; background: #081526; color: #fff; padding: .8rem .9rem; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #5cb8ff; outline-offset: 2px; }
button { margin-top: 1.2rem; border: 0; border-radius: .55rem; background: #5cb8ff; color: #06111f; padding: .75rem 1rem; font: inherit; font-weight: 800; cursor: pointer; }
button.secondary { margin: 0; padding: .5rem .7rem; background: #243b56; color: #e8eef7; }
button.secondary-action { background: #243b56; color: #e8eef7; }
button.danger { background: #a74755; color: #fff; }
button.small { margin: 0; padding: .45rem .65rem; font-size: .8rem; }
.alert { margin: 1rem 0; padding: .8rem; border-radius: .5rem; border: 1px solid #86434c; background: #3f1f27; color: #ffd9dd; }
.alert.warning { border-color: #8a6b29; background: #3b3017; color: #ffe6a6; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; text-align: left; border-bottom: 1px solid #273a52; }
th { color: #9fb0c5; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
td { vertical-align: top; }
td small { display: block; margin-top: .28rem; color: #8093aa; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; overflow-wrap: anywhere; }
.action-panel summary { cursor: pointer; font-size: 1.1rem; font-weight: 800; }
.action-panel[open] summary { margin-bottom: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 0 1rem; }
.form-grid label { margin-top: .7rem; }
.form-submit { align-self: end; }
.form-submit button { width: 100%; }
.form-help { grid-column: 1 / -1; margin-bottom: 0; }
fieldset { min-width: 0; margin: .8rem 0 0; padding: .7rem .9rem; border: 1px solid #38516d; border-radius: .55rem; }
legend { color: #b8c7d9; font-weight: 700; padding: 0 .35rem; }
.check-label { display: inline-flex; align-items: center; margin: .25rem 1rem .25rem 0; font-weight: 500; }
.check-label input { width: auto; margin: 0 .4rem 0 0; }
.inline-form { margin: 0; }
.status { display: inline-flex; align-items: center; border: 1px solid #40536a; border-radius: 999px; padding: .2rem .52rem; color: #c3d0df; background: #1b2b40; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.status-active, .status-healthy, .status-succeeded { color: #a7f2d8; border-color: #367b68; background: #14372f; }
.status-published, .status-verified, .status-restored { color: #a7f2d8; border-color: #367b68; background: #14372f; }
.status-pending, .status-queued, .status-leased, .status-running, .status-draft, .status-requested, .status-uploading, .status-restore_pending { color: #b7dcff; border-color: #3e709d; background: #17334d; }
.status-approved { color: #ffe4a8; border-color: #896b2d; background: #3a3019; }
.status-disabled, .status-revoked, .status-expired, .status-failed, .status-cancelled { color: #ffc7ce; border-color: #8d4651; background: #3c2027; }
.status-superseded { color: #a9b6c6; border-color: #516176; background: #202b39; }
.status-fresh { color: #a7f2d8; border-color: #367b68; background: #14372f; }
.status-stale, .status-warning, .status-insufficient { color: #ffe4a8; border-color: #896b2d; background: #3a3019; }
.status-offline, .status-critical { color: #ffc7ce; border-color: #8d4651; background: #3c2027; }
.status-registration-discovered, .status-registration-eligible, .status-registration-prepared { color: #b7dcff; border-color: #3e709d; background: #17334d; }
.status-registration-awaiting_human, .status-registration-submitted, .status-registration-email_verified, .status-registration-partner_approved, .status-registration-locally_staged { color: #ffe4a8; border-color: #896b2d; background: #3a3019; }
.status-registration-active { color: #a7f2d8; border-color: #367b68; background: #14372f; }
.status-registration-rejected, .status-registration-rolled_back { color: #ffc7ce; border-color: #8d4651; background: #3c2027; }
.metric-word { font-size: 1.15rem !important; overflow-wrap: anywhere; }
.observation-grid { margin: 1rem 0 0; }
.connection-hint { display: flex; flex-direction: column; gap: .35rem; border: 1px dashed #49627e; border-radius: .7rem; padding: 1rem; color: #b8c7d9; background: rgba(8,21,38,.6); }
.connection-hint span { color: #92a4bb; }
.review-list { display: grid; gap: .75rem; }
.review-list article { display: grid; grid-template-columns: minmax(210px, .8fr) minmax(280px, 1.5fr); gap: 1rem; align-items: center; border: 1px solid #2b405b; border-radius: .65rem; padding: .85rem 1rem; background: rgba(8,21,38,.5); }
.review-list article > div { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.review-list small { width: 100%; color: #8093aa; }
.review-list p { margin: 0; color: #b8c7d9; }
.rule-reason { font-size: 1.05rem; line-height: 1.6; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.2rem; color: #92a4bb; font-size: .85rem; }
.pagination a, .pagination > span:first-child, .pagination > span:last-child { border: 1px solid #38516d; border-radius: .45rem; padding: .42rem .68rem; text-decoration: none; }
.pagination span[aria-disabled="true"] { opacity: .45; }
.credential-card { width: min(720px, 100%); }
.credential-value { resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.5; overflow-wrap: anywhere; }
.details-list { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 1.4rem 0; }
.details-list dt { color: #92a4bb; }
.details-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.button-link { display: inline-block; border-radius: .55rem; background: #5cb8ff; color: #06111f; padding: .75rem 1rem; text-decoration: none; font-weight: 800; }
.small-link { padding: .48rem .68rem; font-size: .82rem; }
.partner-editor-list { display: grid; gap: 1rem; margin-top: 1.2rem; }
.row-count-form { display: flex; align-items: end; gap: .8rem; margin: 1rem 0; }
.row-count-form > div { width: min(220px, 100%); }
.row-count-form button { margin: 0; }
.partner-editor { padding: 1rem; background: rgba(8,21,38,.55); }
.partner-editor legend { color: #d9e8f8; }
.numeric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.check-row { margin-top: .7rem; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.2rem; }
.action-row button { margin: 0; }
.step-up-form { width: min(520px, 100%); }
.compact-action summary { cursor: pointer; color: #8fc8ff; }
.compact-action form { min-width: 240px; }
.diff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.diff-grid article { border: 1px solid #2b405b; border-radius: .65rem; padding: 1rem; }
.diff-grid article h2 { font-size: 1rem; }
.diff-grid li { margin-bottom: .55rem; overflow-wrap: anywhere; }
.diff-grid small { display: block; color: #8093aa; }
.secondary-link { background: #243b56; color: #e8eef7; }
.form-wide { grid-column: 1 / -1; }
.form-panel { width: min(940px, 100%); }
.registration-grid { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
.registration-grid article { padding: 1rem; }
.registration-grid strong { font-size: 1.45rem; }
.gate-panel { border-color: #4c607a; background: rgba(17,36,58,.92); }
.critical-gate { border-color: #896b2d; }
.danger-panel { border-color: #713b45; }
.copy-list { display: grid; grid-template-columns: minmax(135px, .35fr) minmax(0, 1fr); gap: 0; margin: 1rem 0 0; border: 1px solid #2b405b; border-radius: .65rem; overflow: hidden; }
.copy-list dt, .copy-list dd { margin: 0; padding: .8rem 1rem; border-bottom: 1px solid #273a52; overflow-wrap: anywhere; }
.copy-list dt { color: #9fb0c5; background: rgba(8,21,38,.45); font-weight: 700; }
.copy-list dt:last-of-type, .copy-list dd:last-of-type { border-bottom: 0; }
.compact-copy-list { margin-top: .5rem; }
.work-list { display: grid; gap: .75rem; }
.work-list article { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(260px, 1.35fr); gap: .5rem 1rem; align-items: center; border: 1px solid #2b405b; border-radius: .65rem; padding: .9rem 1rem; background: rgba(8,21,38,.5); }
.work-list article > div, .work-title { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.work-list p { margin: 0; color: #b8c7d9; }
.work-list small { grid-column: 1 / -1; color: #8093aa; }
.filter-form { display: flex; align-items: end; gap: 1rem; }
.filter-form > div { flex: 1; }
.filter-form label { margin-top: 0; }
.filter-form button { margin: 0; }
.footer { text-align: center; color: #71839a; padding: 1.5rem; border-top: 1px solid #1c2c40; font-size: .8rem; }

@media (max-width: 760px) {
    .topbar { align-items: flex-start; flex-wrap: wrap; padding: 1rem; gap: .8rem; }
    .identity { width: 100%; margin-left: 0; justify-content: space-between; }
    nav { order: 3; width: 100%; overflow-x: auto; }
    .page { padding-top: 1.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    .panel { padding: 1rem; }
    .pagination { justify-content: space-between; gap: .5rem; }
    .pagination > span:nth-child(2) { text-align: center; }
    .review-list article { grid-template-columns: 1fr; }
    .numeric-grid, .diff-grid { grid-template-columns: 1fr; }
    .row-count-form { align-items: stretch; flex-direction: column; }
    .form-wide { grid-column: auto; }
    .copy-list { grid-template-columns: 1fr; }
    .copy-list dt, .copy-list dd { border-bottom: 1px solid #273a52; }
    .work-list article { grid-template-columns: 1fr; }
    .work-list small { grid-column: auto; }
    .filter-form { align-items: stretch; flex-direction: column; }
}
