:root {
  --ink: #17191c;
  --muted: #687078;
  --paper: #f5f6f3;
  --surface: #ffffff;
  --line: #d9ddd8;
  --green: #16734a;
  --green-soft: #e5f4eb;
  --blue: #205ea8;
  --amber: #9a5a08;
  --amber-soft: #fff1d6;
  --red: #b42318;
  --red-soft: #fde8e6;
  --radius: 6px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "IBM Plex Sans", "Segoe UI", sans-serif; font-size: 1rem; line-height: 1.5; }
button, input, select { font: inherit; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: 88rem; margin: 0 auto; padding-inline: 1rem; }
.topbar { background: var(--ink); color: #fff; border-bottom: 3px solid #41c884; }
.topbar-inner { min-height: 4rem; width: 100%; max-width: 88rem; margin: 0 auto; padding: .5rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { display: inline-flex; align-items: center; gap: .65rem; font-family: "Roboto Mono", "Courier New", monospace; font-weight: 700; letter-spacing: 0; }
.signal { width: .75rem; height: .75rem; background: #41c884; border-radius: 50%; box-shadow: 0 0 0 .25rem rgba(65,200,132,.18); }
.topbar-actions, .account-actions, .switch-form { display: flex; align-items: center; gap: .5rem; }
.account-actions { flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 700; }
.live i { width: .5rem; height: .5rem; border-radius: 50%; background: #41c884; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.button { min-height: 2.75rem; border: 1px solid transparent; border-radius: var(--radius); padding: .65rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; font-weight: 650; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: #fff; }
.button.secondary { background: var(--surface); border-color: #aeb6af; color: var(--ink); }
.button.quiet { background: transparent; border-color: #53585e; color: #fff; }
.button.danger { background: transparent; border-color: #e3aaa5; color: var(--red); }
.plus { font-size: 1.35rem; line-height: 1; }
.summary-band { background: #e8ebe6; border-bottom: 1px solid var(--line); }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-grid > div { padding: 1rem 0; display: flex; flex-direction: column; border-bottom: 1px solid #cfd4ce; }
.summary-grid strong { font: 700 1.6rem/1 "Roboto Mono", monospace; }
.summary-grid span { color: var(--muted); font-size: .875rem; }
.danger-text strong { color: var(--red); }
.section { padding-top: 2rem; padding-bottom: 2rem; }
.section-head { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; margin-bottom: 1.25rem; }
.section-head.compact { margin-bottom: 1rem; }
.eyebrow { margin: 0 0 .25rem; color: var(--green); text-transform: uppercase; font: 700 .75rem/1.3 "Roboto Mono", monospace; letter-spacing: 0; }
h1, h2 { margin: 0; line-height: 1.15; letter-spacing: 0; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.account-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.account-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.account-main { display: flex; gap: .8rem; min-width: 0; }
.avatar { flex: 0 0 2.75rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: #e2e7ef; color: var(--blue); font-weight: 800; }
.account-copy { min-width: 0; flex: 1; }
.account-copy p { margin: .2rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.account-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.badge { display: inline-flex; align-items: center; min-height: 1.5rem; border-radius: 999px; padding: .12rem .5rem; background: #edf0ed; color: #50575d; font: 700 .75rem/1 "Roboto Mono", monospace; white-space: nowrap; }
.badge.connected, .badge.ready, .badge.active { background: var(--green-soft); color: var(--green); }
.badge.failing, .badge.switching, .badge.needs_target_access { background: var(--amber-soft); color: var(--amber); }
.badge.error, .badge.revoked, .badge.unassigned { background: var(--red-soft); color: var(--red); }
.account-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.access.ok { color: var(--green); }.access.bad { color: var(--red); }
.inline-error, .form-error { color: var(--red) !important; overflow-wrap: anywhere; }
.route-band { background: #eef0ed; border-block: 1px solid var(--line); }
.view-tabs { display: flex; gap: .25rem; padding: .2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.view-tabs a { min-height: 2.5rem; padding: .5rem .75rem; display: inline-flex; align-items: center; border-radius: 4px; color: var(--muted); font-weight: 650; }
.view-tabs a.active { background: var(--ink); color: #fff; }
.route-note { margin: -.5rem 0 1rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 58rem; }
th, td { text-align: left; padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f4f5f2; color: var(--muted); font: 700 .75rem/1.2 "Roboto Mono", monospace; text-transform: uppercase; }
td { font-size: .9rem; }
.empty-state { padding: 2rem; text-align: center; color: var(--muted); }
td small { display: block; max-width: 40ch; color: var(--red); overflow-wrap: anywhere; }
.problem-row { background: #fffaf2; }
select, input { min-height: 2.75rem; width: 100%; border: 1px solid #aeb6af; border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: .55rem .7rem; }
.switch-form select { min-width: 10rem; }
.audit-list { border-top: 1px solid var(--line); }
.audit-row { display: grid; grid-template-columns: 1fr; gap: .15rem; padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.audit-row time, .event-type { color: var(--muted); font-family: "Roboto Mono", monospace; }
.login-body { min-height: 100vh; background: var(--ink); color: #fff; display: grid; place-items: center; padding: 1rem; }
.login-shell { width: min(100%, 25rem); }
.login-shell > .wordmark { margin-bottom: 1.5rem; }
.login-panel, .qr-panel { background: var(--surface); color: var(--ink); border-radius: var(--radius); border-top: 4px solid #41c884; padding: 1.5rem; box-shadow: 0 1.5rem 4rem rgba(0,0,0,.2); }
.form-stack { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.25rem; }
.form-stack label { font-weight: 650; }
.form-error { min-height: 1.5rem; margin: 0; }
.qr-shell { min-height: calc(100vh - 4rem); padding: 1rem; display: grid; place-items: start center; }
.qr-panel { width: min(100%, 32rem); margin-top: 2rem; box-shadow: none; border: 1px solid var(--line); border-top: 4px solid var(--green); }
.qr-frame { width: min(100%, 20rem); aspect-ratio: 1; margin: 1rem auto; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
@media (min-width: 768px) {
  .container, .topbar-inner { padding-inline: 2rem; }
  .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .summary-grid > div { padding: 1.25rem 0; border-bottom: 0; }
  .section-head { flex-direction: row; align-items: end; justify-content: space-between; }
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-row { grid-template-columns: 11rem 12rem 1fr; gap: 1rem; }
}
@media (min-width: 1024px) {
  .account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
