:root {
  color-scheme: light;
  --ink: #172232;
  --muted: #607083;
  --line: #ced6df;
  --soft: #f2f5f8;
  --panel: #ffffff;
  --navy: #163a5f;
  --blue: #21659a;
  --blue-dark: #174e78;
  --green: #1f6a4b;
  --red: #a63636;
  --amber: #8a5a10;
  --shadow: 0 1px 3px rgba(20, 35, 50, .12);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: #e9eef3; color: var(--ink); }
body { margin: 0; min-width: 1120px; min-height: 100vh; font-size: 14px; line-height: 1.4; }
button, input, select { font: inherit; }
button, input, select { min-height: 34px; }
button { border: 1px solid var(--blue-dark); border-radius: 4px; background: var(--blue); color: #fff; padding: 6px 13px; cursor: pointer; font-weight: 650; }
button:hover { background: var(--blue-dark); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #e4a72d; outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .5; }
button.secondary { background: #fff; color: var(--navy); border-color: #8495a6; }
button.quiet { background: transparent; color: var(--navy); border-color: transparent; }
button.danger { background: var(--red); border-color: #7e2727; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 14px; top: -60px; z-index: 20; background: #fff; padding: 8px 12px; }
.skip-link:focus { top: 10px; }
.topbar { height: 76px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 28px; box-shadow: var(--shadow); }
.topbar h1 { margin: 1px 0 0; font-size: 24px; }
.topbar .eyebrow { color: #c7d8e7; }
.topbar .quiet { color: #fff; border-color: rgba(255,255,255,.4); margin-left: 14px; }
.session-box { display: flex; align-items: center; }
main { max-width: 1540px; margin: 0 auto; padding: 18px 24px 40px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
h2 { margin: 0 0 12px; font-size: 18px; }
p { margin: 7px 0 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 17px; box-shadow: var(--shadow); }
.auth-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.gate-grid { max-width: 920px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 22px auto; }
form { display: grid; gap: 6px; }
label { margin-top: 5px; color: #32475a; font-weight: 650; }
input, select { width: 100%; border: 1px solid #98a7b6; border-radius: 3px; background: #fff; color: var(--ink); padding: 5px 8px; }
form > button { justify-self: start; margin-top: 10px; }
.message { border: 1px solid #8aa3b8; background: #eef6fc; color: #173b59; border-radius: 4px; padding: 10px 13px; margin-bottom: 14px; }
.message.error { border-color: #ce8b8b; background: #fff0f0; color: #752525; }
.message.uncertain { border-color: #d4ae66; background: #fff8e8; color: #664514; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #9eabb7; margin-bottom: 12px; }
.tabs button { border-radius: 4px 4px 0 0; border-color: #a6b2bd; background: #f7f9fb; color: var(--navy); min-width: 145px; }
.tabs button[aria-current="page"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.brand-notice { display: flex; gap: 12px; align-items: baseline; border: 1px solid #d5c28f; background: #fff9e9; color: #604b1c; padding: 9px 13px; margin: 0 0 14px; border-radius: 4px; }
.step-up { margin-bottom: 14px; border-left: 5px solid var(--amber); }
.step-up form { grid-template-columns: 1.2fr 1fr 1.3fr auto; align-items: end; }
.step-up form button { margin: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.section-heading h2 { margin-top: 2px; }
.split-layout { display: grid; grid-template-columns: minmax(700px, 2.3fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.workspace-view > .panel, .workspace-view > .split-layout { margin-bottom: 16px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.metric { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); padding: 10px 13px; box-shadow: var(--shadow); }
.metric strong { display: block; font-size: 22px; }
.metric span { color: var(--muted); }
.table-wrap { overflow: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
caption { text-align: left; color: var(--muted); padding: 0 0 7px; }
th, td { border-bottom: 1px solid #dde3e9; padding: 7px 9px; text-align: left; vertical-align: top; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: var(--soft); color: #30485e; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:hover { background: #f7fbff; }
td.actions { text-align: right; }
td.actions button { min-height: 28px; padding: 3px 8px; margin-left: 4px; font-size: 12px; }
.status { display: inline-block; border-radius: 999px; padding: 2px 8px; font-weight: 700; }
.status.active { color: var(--green); background: #e4f4ec; }
.status.suspended { color: var(--red); background: #fbe8e8; }
.status.inactive { color: var(--red); background: #fbe8e8; }
.status.pending { color: var(--amber); background: #fff1cf; }
.empty { color: var(--muted); padding: 22px; text-align: center; }
.action-panel { border-left: 5px solid var(--red); max-width: 680px; }
.button-row { display: flex; gap: 8px; align-items: center; margin-top: 9px; }
.button-row button { margin: 0; }
.facts { margin: 8px 0 14px; }
.facts div { display: grid; grid-template-columns: 150px 1fr; border-bottom: 1px solid #e1e6eb; padding: 6px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; }
.secret-panel { margin-bottom: 14px; border-left: 5px solid var(--green); }
.secret-panel pre { max-height: 260px; overflow: auto; background: #0f2232; color: #f4f7fa; padding: 13px; border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.qr { width: 220px; height: 220px; background: #fff; border: 1px solid var(--line); margin: 10px 0; }
code { font-family: "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.mutation-form[data-uncertain="true"] { border-left: 4px solid var(--amber); padding-left: 10px; }
.management-scope { border-left: 5px solid var(--blue); margin-bottom: 16px; }
.scope-fields { display: grid; grid-template-columns: minmax(280px, 1.5fr) minmax(180px, .7fr) auto; gap: 14px; align-items: end; }
.scope-action { padding-bottom: 0; }
.scope-hint { color: var(--muted); margin-bottom: 0; }
.management-columns { grid-template-columns: minmax(760px, 2.4fr) minmax(330px, 1fr); }
.selection-summary { border: 1px solid var(--line); background: var(--soft); padding: 9px; font-family: "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.checkbox { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.checkbox input { width: auto; min-height: auto; }
.management-mutation hr, hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
#management-confirm-panel { max-width: 820px; }
#management-action-email-row { display: grid; gap: 6px; }
#secret-login-link { color: var(--blue-dark); font-weight: 700; }
#management-workspace > .panel, #management-workspace > .split-layout { margin-bottom: 16px; }
