:root {
  color-scheme: light;
  --canvas: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #fafafd;
  --ink: #202535;
  --muted: #596477;
  --line: #e0e4ec;
  --control-line: #8490a3;
  --accent: #6d28d9;
  --accent-hover: #5620ad;
  --accent-soft: #f1eafb;
  --green: #14613e;
  --green-soft: #eaf6ef;
  --red: #a52732;
  --red-soft: #fff0f1;
  --amber: #80500b;
  --amber-soft: #fff6e3;
  --sidebar-width: 232px;
  --radius: 12px;
  --shadow: 0 3px 12px rgb(26 32 55 / 4%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  min-width: 280px;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
}
svg { display: block; flex-shrink: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: #e5d5ff; color: #31115e; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; line-height: 1.25; letter-spacing: -.035em; font-weight: 700; }
h2 { font-size: 16px; line-height: 1.4; letter-spacing: -.015em; font-weight: 650; }
h3 { font-size: 13px; line-height: 1.5; font-weight: 650; }
.muted, .foot { color: var(--muted); }
.technical { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.5;
  text-transform: uppercase;
}
.sr-only, .nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 100;
  transform: translateY(-180%);
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 650;
}
.skip-link:focus { transform: translateY(0); }
.nav-toggle { display: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 24px 22px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 37px;
  height: 37px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 21px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.07em;
}
.brand-mark span { margin: 7px 0 0 1px; font-size: 12px; letter-spacing: 0; }
.brand-name { font-size: 20px; font-weight: 750; line-height: 1.15; letter-spacing: -.03em; }
.brand-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
}
.navigation { flex: 1 0 auto; padding: 0 12px 20px; }
.nav-group + .nav-group { margin-top: 20px; }
.nav-heading {
  margin: 0 12px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  margin: 2px 0;
  padding: 8px 12px;
  border-radius: 7px;
  color: #465064;
  font-size: 13px;
  font-weight: 550;
}
.nav-link:hover { background: var(--surface-soft); color: var(--ink); text-decoration: none; }
.nav-link.is-active { background: var(--accent-soft); color: #5920b4; font-weight: 700; }
.nav-link.is-active::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  content: "";
}
.nav-subitems { display: grid; gap: 1px; margin: 6px 0 0 21px; padding-left: 13px; border-left: 1px solid var(--line); }
.nav-subitems a {
  display: block;
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.nav-subitems a:hover { background: var(--surface-soft); color: var(--accent); text-decoration: none; }
.sidebar-identity {
  display: grid;
  gap: 3px;
  flex-shrink: 0;
  margin-top: auto;
  padding: 17px 23px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.identity-label { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.identity-name { color: var(--ink); font-size: 13px; font-weight: 650; }
.identity-email, .identity-roles { color: var(--muted); font-size: 11px; }
.menu-toggle, .drawer-close, .drawer-backdrop { display: none; }

.app { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 28px;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.page-heading { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.page-heading-text { min-width: 0; }
.page-heading p { max-width: 680px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.content { max-width: 1680px; margin: 0 auto; padding: 24px 30px 0; }
.content:focus { outline: none; }
.app-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 32px;
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.app-footer a { color: var(--muted); }
.section-stack { display: grid; gap: 22px; min-width: 0; }
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
section[id] { scroll-margin-top: 24px; }
section[id]:target { outline: 2px solid #b390eb; outline-offset: 4px; }
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 19px 22px 16px;
}
.section-header p { max-width: 850px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.section-header .text-link { padding-top: 3px; font-size: 12px; }
.panel-body { padding: 0 22px 22px; }
.panel-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.panel-footer p { flex: 1 1 230px; }
.snapshot-note { margin: 0 0 19px; color: var(--muted); font-size: 12px; }
.notice { padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.notice-warning, .warnbox { border-color: #c99643; background: var(--amber-soft); color: var(--amber); }
noscript .notice { margin-bottom: 20px; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 35px;
  padding: 7px 12px;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  background: var(--surface);
  color: #364156;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
button:hover, .button:hover { border-color: #626d80; background: #f2f3f8; color: var(--ink); text-decoration: none; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .65; }
.button-primary { border-color: var(--accent); background: var(--accent); color: white; }
.button-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: white; }
.button-danger { border-color: #c2737a; background: var(--surface); color: var(--red); }
.button-danger:hover { border-color: var(--red); background: var(--red-soft); color: var(--red); }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 35px;
  padding: 7px 10px;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.4;
}
select { padding-right: 25px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #657084; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #626d80; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); outline-width: 2px; outline-offset: 2px; }
input[type="number"] { font-variant-numeric: tabular-nums; }
label, .field { font-size: 12px; font-weight: 550; color: #465064; }
.field { display: flex; flex: 1 1 140px; flex-direction: column; gap: 5px; min-width: 0; }
.field-wide { flex: 2 1 230px; }
.field-code { flex: 0 1 125px; }
.field-number { flex: 0 1 115px; }
.field-full { flex-basis: 100%; }
.inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 0; }
.inline-form > button { flex-shrink: 0; }
.form-area { padding: 17px 22px 21px; border-top: 1px solid var(--line); background: var(--surface-soft); border-radius: 0 0 var(--radius) var(--radius); }
.form-area h3 { margin-bottom: 11px; }
.form-message { flex-basis: 100%; font-size: 12px; overflow-wrap: anywhere; }
.form-message:empty { display: none; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.load-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 10px; max-width: 100%; }
.key-field { display: grid; gap: 5px; width: 205px; max-width: 100%; font-size: 11px; }
.load-message {
  display: block;
  align-self: center;
  max-width: 320px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.load-toolbar:has(.key-field) .load-message { align-self: flex-end; padding-bottom: 8px; }

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #a4acbc #f5f6fa;
  scrollbar-width: thin;
}
.table-scroll:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.table-scroll:focus-visible { outline-offset: -3px; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 12px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.5; }
th {
  background: #f2f4f8;
  color: #485367;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
th:first-child, td:first-child { padding-left: 22px; white-space: nowrap; }
th:last-child, td:last-child { padding-right: 22px; }
tr:nth-child(odd) td { background: #fafbfe; }
tr:hover td { background: #f4f0fb; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.muted:only-child { padding-top: 22px; padding-bottom: 22px; white-space: normal; }
td button { min-height: 28px; margin: 0 0 3px; padding: 3px 8px; font-size: 11px; white-space: nowrap; }
td .bad, td .ok { max-width: 100%; overflow-wrap: anywhere; }
#keys, #users { min-width: 1080px; }
#recent { min-width: 1120px; font-variant-numeric: tabular-nums; }
#resources, #scopes { min-width: 850px; }
#guardrails { min-width: 950px; }
#guardrails td:nth-child(4) { max-width: 430px; font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; }
#recent td:nth-child(1), #keys td:nth-child(9), #users td:nth-child(8) { white-space: nowrap; }
#users td:last-child { min-width: 220px; }
#sessions { min-width: 730px; }
#sessions td:nth-child(4) { max-width: 330px; overflow-wrap: anywhere; }
.table-heading { padding: 12px 22px; border-top: 1px solid var(--line); }
.role-reference { padding: 17px 22px 20px; border-top: 1px solid var(--line); }
#roles { margin-top: 8px; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.ok { color: var(--green); }
.bad { color: var(--red); }
.warning-state { color: var(--amber); }
.status-pill, td span.ok, td span.bad, .totp-state {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.6;
}
.status-pill.ok, td span.ok, .totp-state.ok { background: var(--green-soft); }
.status-pill.bad, td span.bad { background: var(--red-soft); }
.totp-state.warning-state { background: var(--amber-soft); }

pre, code { font-family: var(--mono); font-size: 12px; }
code { padding: 2px 5px; border-radius: 4px; background: var(--accent-soft); color: #542399; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  margin: 15px 0 0;
  padding: 14px 16px;
  border: 1px solid #b7a1d7;
  border-radius: 7px;
  background: #f7f3fe;
  color: #442270;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.secret-output { user-select: text; }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.introduction { padding: 30px; border-top: 3px solid var(--accent); }
.introduction h2 { max-width: 430px; margin: 11px 0 15px; font-size: 31px; line-height: 1.18; letter-spacing: -.04em; }
.lead { max-width: 540px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.introduction .action-row { margin-top: 27px; }
.system-facts { margin: 0; padding: 0 22px 8px; }
.system-facts > div { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.system-facts dt { color: var(--muted); font-size: 12px; }
.system-facts dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.system-facts dd.technical { font-size: 11px; line-height: 1.7; }
.fact-detail { display: block; margin-top: 5px; color: var(--muted); }
.overview-destinations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column: 1 / -1; gap: 16px; }
.destination-card { display: block; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color 120ms ease; }
.destination-card:hover { border-color: var(--accent); text-decoration: none; }
.destination-icon { display: inline-flex; padding: 9px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.destination-card h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 17px; font-size: 14px; }
.destination-card h2 span { color: var(--accent); }
.destination-card p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.installation-note { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }

.rm-top { padding-bottom: 18px; }
.rm-counts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 18px; }
.rm-counts > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}
.rm-counts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rm-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin: 0; padding: 17px 22px 0; border-top: 1px solid var(--line); }
.rm-filters .field { flex-basis: 140px; }
.rm-filters .field-wide { flex-basis: 230px; }
.rm-new { padding: 16px 22px; }
.rm-new summary { color: var(--accent); cursor: pointer; }
.rm-new summary b { font-size: 13px; }
.rm-new summary span { margin-left: 12px; color: var(--muted); font-size: 12px; }
.rm-new[open] summary { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.rm-new form { margin: 0; }
.editing-hint { color: var(--muted); font-size: 12px; }
#groups { min-width: 0; }
#groups:empty::before {
  display: block;
  padding: 30px 22px;
  border: 1px dashed #a7afbf;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  content: "nothing yet — no items match the current filters.";
}
.rm-group { margin-bottom: 28px; }
.rm-group:last-child { margin-bottom: 0; }
.rm-group h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 14px; }
.rm-group h2 small { min-width: 24px; padding: 1px 7px; border-radius: 5px; background: #e9ecf3; color: #465064; font-size: 11px; font-weight: 600; text-align: center; }
.rm-item {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 16px;
  margin: 8px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.rm-item > div { min-width: 0; }
.rm-item .n { padding-top: 2px; color: var(--muted); font: 11px/1.8 var(--mono); }
.rm-item .t { color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.rm-item .t input { width: 100%; font-weight: 650; }
.rm-item .b { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.rm-item .b.muted { opacity: 1 !important; }
.rm-item [data-edit] { cursor: text; }
.rm-item [data-edit]:hover { text-decoration: underline; text-decoration-color: #bca2e4; text-underline-offset: 4px; }
.rm-item .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.rm-item .tag { padding: 1px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); }
.rm-item .ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rm-item select { width: auto; max-width: 150px; min-height: 30px; padding: 4px 22px 4px 8px; font-size: 11px; }
.rm-item button { min-height: 30px; padding: 4px 8px; font-size: 11px; }
.rm-item button[data-notes] { min-height: 26px; }
.rm-item button[data-del] { min-width: 30px; color: var(--red); }
.rm-item button[data-del]:hover { border-color: var(--red); background: var(--red-soft); }
.rm-item[data-status="in_progress"] { border-left: 3px solid var(--accent); padding-left: 14px; }
.rm-item[data-status="done"] { border-left: 3px solid var(--green); padding-left: 14px; }
.rm-item[data-status="dropped"] { border-style: dashed; }
.rm-item[data-status="dropped"] .t { text-decoration: line-through; text-decoration-thickness: 1px; }
.st { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.st-idea, .rm-counts > .st-idea { background: #eef0f5; color: #4d586c; }
.st-planned, .rm-counts > .st-planned { background: #f4effb; color: #63399a; }
.st-in_progress, .rm-counts > .st-in_progress { background: #ede2fc; color: #5920b4; }
.st-done, .rm-counts > .st-done { background: var(--green-soft); color: var(--green); }
.st-dropped, .rm-counts > .st-dropped { background: var(--red-soft); color: var(--red); }
.pri { color: var(--accent); font-weight: 750; }
.rm-notes { grid-column: 2 / 4; min-width: 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.rm-notes > div { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rm-notes form { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rm-notes input { flex: 1 1 180px; min-height: 35px; }
.rm-notes form button { min-height: 35px; }

.account-content { max-width: 1100px; }
.account-identity { display: flex; align-items: center; gap: 15px; padding: 3px 0 5px; }
.account-avatar { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border: 1px solid #dac9f3; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 20px; font-weight: 650; }
.account-identity h2 { margin-bottom: 3px; font-size: 19px; overflow-wrap: anywhere; }
.account-identity p { font-size: 12px; overflow-wrap: anywhere; }
.account-identity > div { min-width: 0; }
.totp-state { margin-bottom: 16px; }
.totp-setup { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.totp-setup p { margin: 10px 0; font-size: 12px; }
#qr { width: fit-content; max-width: 100%; margin: 15px 0; }
#qr svg, #qr img { display: block; width: 196px; max-width: 100%; height: auto; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: white; }
#secret { display: inline-block; max-width: 100%; padding: 7px 10px; user-select: all; }
#ftotpOff { max-width: 650px; }
.permission-list { font-family: var(--mono); font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }

.auth-stage { display: grid; place-items: center; min-height: calc(100vh - 250px); min-height: calc(100dvh - 250px); padding: 32px 0; }
.auth-card { width: 100%; max-width: 430px; padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 10px 35px rgb(34 26 57 / 6%); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand .eyebrow { margin: 0; font-size: 10px; }
.auth-card h2 { margin-bottom: 7px; font-size: 25px; letter-spacing: -.035em; }
.auth-card > .muted { font-size: 13px; }
.auth-card form { display: grid; gap: 17px; margin-top: 25px; }
.auth-card label { display: grid; gap: 7px; font-size: 13px; }
.auth-card input { min-height: 42px; }
.auth-card button { min-height: 42px; }
.auth-card .msg { min-height: 20px; margin: 0; color: var(--red); font-size: 13px; overflow-wrap: anywhere; }
.auth-card .msg.ok { background: none; color: var(--green); }
.auth-footnote { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }

@media (min-width: 960px) and (max-width: 1199px) {
  :root { --sidebar-width: 212px; }
  .topbar { padding: 22px; }
  .content { padding: 22px 22px 0; }
  .overview-layout { grid-template-columns: 1fr; }
  .rm-item { grid-template-columns: 40px minmax(0, 1fr); }
  .rm-item .ctl { grid-column: 2; }
  .rm-notes { grid-column: 2; }
}

@media (max-width: 959px) {
  :root { --sidebar-width: 260px; }
  .nav-toggle { display: block; position: fixed; top: 22px; left: 22px; }
  .sidebar { display: none; width: min(var(--sidebar-width), calc(100vw - 48px)); box-shadow: 12px 0 40px rgb(20 25 40 / 16%); }
  .nav-toggle:checked ~ .sidebar { display: flex; }
  .nav-toggle:checked ~ .drawer-backdrop { display: block; }
  .drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgb(25 28 43 / 35%); cursor: pointer; }
  .menu-toggle, .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid var(--control-line);
    border-radius: 6px;
    background: white;
    color: var(--ink);
    cursor: pointer;
  }
  .menu-toggle { margin-top: 4px; }
  .drawer-close { width: 30px; height: 30px; }
  .menu-toggle:hover, .drawer-close:hover { background: var(--accent-soft); }
  .nav-toggle:focus-visible ~ .app .menu-toggle,
  .nav-toggle:checked:focus-visible ~ .sidebar .drawer-close { outline: 3px solid var(--accent); outline-offset: 3px; }
  .app { margin-left: 0; }
  .topbar { padding: 20px 22px; }
  .content { padding: 22px 22px 0; }
  .load-toolbar { flex-basis: 100%; }
  .overview-layout { grid-template-columns: 1fr; }
  .auth-stage { min-height: calc(100dvh - 260px); }
}

@media (max-width: 699px) {
  h1 { font-size: 22px; }
  .topbar { gap: 16px; padding: 17px 16px; }
  .content { padding: 18px 14px 0; }
  .page-heading p { font-size: 12px; }
  .section-stack { gap: 18px; }
  .section-header { padding: 17px 16px 14px; }
  .panel-body { padding: 0 16px 18px; }
  .panel-footer { padding: 14px 16px; }
  .form-area, .role-reference { padding: 16px; }
  .field, .field-code, .field-number { flex: 1 1 135px; }
  .field-wide { flex: 1 1 220px; }
  .field-full { flex-basis: 100%; }
  .inline-form { gap: 12px 10px; }
  .inline-form > button { min-height: 37px; }
  .load-message { flex: 1 1 100%; max-width: none; }
  .load-toolbar:has(.key-field) .load-message { padding-bottom: 0; }
  .key-field { flex: 1 1 175px; width: auto; }
  .table-heading { padding: 11px 16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .introduction { padding: 23px; }
  .introduction h2 { font-size: 28px; }
  .overview-destinations { grid-template-columns: 1fr; gap: 12px; }
  .destination-card { padding: 19px; }
  .destination-card h2 { margin-top: 13px; }
  .system-facts { padding-right: 16px; padding-left: 16px; }
  .system-facts > div { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
  .rm-counts { gap: 6px; padding: 0 16px 16px; }
  .rm-counts > span { gap: 6px; padding: 4px 8px; font-size: 11px; }
  .rm-filters { padding: 16px 16px 0; }
  .rm-new { padding: 16px; }
  .rm-new summary span { display: block; margin: 7px 0 0 16px; }
  .rm-item { grid-template-columns: 35px minmax(0, 1fr); gap: 10px; padding: 14px 12px; }
  .rm-item[data-status="in_progress"], .rm-item[data-status="done"] { padding-left: 10px; }
  .rm-item .ctl { grid-column: 2; gap: 7px; }
  .rm-item .ctl select { min-height: 34px; max-width: 145px; }
  .rm-item .ctl button { min-width: 34px; min-height: 34px; }
  .rm-notes { grid-column: 1 / -1; }
  .rm-item .meta { font-size: 11px; }
  .auth-stage { min-height: 0; padding: 12px 0 26px; }
  .auth-card { padding: 25px 22px; }
  .app-footer { margin-top: 25px; }
}

@media (max-width: 379px) {
  .field, .field-wide, .field-code, .field-number { flex-basis: 100%; }
  .system-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .rm-item .ctl { grid-column: 1 / -1; }
  .auth-card { padding: 22px 17px; }
}

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

@media print {
  .sidebar, .nav-toggle, .menu-toggle, .drawer-backdrop, .skip-link, .load-toolbar, .app-footer { display: none !important; }
  .app { margin: 0; }
  body, .topbar { background: white; }
  .content { max-width: none; padding: 16px 0; }
  .topbar { padding: 0 0 16px; }
  .panel, .auth-card { box-shadow: none; }
  .table-scroll { overflow: visible; }
  table, #keys, #users, #recent, #resources, #scopes, #guardrails, #sessions { min-width: 0; font-size: 9px; }
  th, td { padding: 5px; overflow-wrap: anywhere; }
  .secret-output, #totpSetup { display: none !important; }
}

/* ===== projects · builds · infrastructure (2026-10-24) ===== */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 24px; margin: 0; }
.kv > div { display: flex; flex-direction: column; gap: 2px; } .kv dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); } .kv dd { margin: 0; font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } @media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
.stack-form { display: flex; flex-direction: column; gap: 12px; } .stack-form textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.field.checkbox { flex-direction: row; align-items: center; gap: 8px; align-self: flex-end; padding-bottom: 8px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.timeline .ev { position: relative; padding-left: 10px; display: grid; gap: 2px; } .timeline .ev::before { content: ""; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, #6d28d9); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline .ev time { font-size: 11px; color: var(--muted, #6b7280); } .timeline .ev b { font-size: 12px; text-transform: capitalize; } .timeline .ev span { font-size: 13px; }
.timeline .ev-failed::before, .timeline .ev-scan_blocked::before, .timeline .ev-verify_failed::before, .timeline .ev-rejected::before { background: #dc2626; } .timeline .ev-deployed::before, .timeline .ev-scan_passed::before, .timeline .ev-done::before, .timeline .ev-verified::before { background: #16a34a; }
.doc { white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: #f8f8fb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 420px; overflow: auto; margin: 0 0 12px; } .doc.small { max-height: 160px; font-size: 11px; }
.status-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 14px; font-size: 12px; } .status-strip .step { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted, #6b7280); background: #fff; }
.status-strip .step.done { border-color: #16a34a; color: #166534; background: #f0fdf4; } .status-strip .step.now { border-color: var(--accent, #6d28d9); color: var(--accent, #6d28d9); background: #f5f3ff; font-weight: 600; } .status-strip .sep { color: var(--line); }
.st-queued, .st-requested, .st-onboarding, .st-planned { background: #f3f4f6; color: #374151; } .st-drafting, .st-waiting_for_agent, .st-building, .st-verifying, .st-scanning, .st-deploying, .st-running, .st-approved { background: #eff6ff; color: #1d4ed8; }
.st-awaiting_approval { background: #fffbeb; color: #b45309; } .st-built, .st-deployed, .st-pass, .st-done, .st-ready, .st-applied, .st-reserved, .st-ok, .st-active { background: #f0fdf4; color: #166534; } .st-failed, .st-cancelled, .st-blocked, .st-rejected, .st-error, .st-critical, .st-high { background: #fef2f2; color: #b91c1c; } .st-medium { background: #fff7ed; color: #c2410c; } .st-low, .st-info, .st-in_use, .st-booting { background: #f5f3ff; color: #5b21b6; }
.actions { display: flex; gap: 8px; align-items: center; } .small { font-size: 11px; } .bad { color: #b91c1c; } .job-detail { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.button-secondary { font: inherit; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; } .button-secondary:hover { border-color: var(--accent, #6d28d9); color: var(--accent, #6d28d9); }
table code { font-size: 12px; }
