:root {
  color-scheme: light;
  --navy-950: #071523;
  --navy-900: #0a1d30;
  --navy-850: #0e2740;
  --navy-800: #12314f;
  --blue-700: #145b91;
  --blue-600: #1d70ad;
  --blue-100: #e8f2fa;
  --orange-600: #e78a0b;
  --orange-500: #f5a623;
  --orange-100: #fff3db;
  --green-700: #117657;
  --green-100: #ddf5ec;
  --red-700: #b42318;
  --red-100: #fee9e7;
  --yellow-700: #93630a;
  --yellow-100: #fff3cd;
  --ink: #162536;
  --muted: #68798a;
  --subtle: #8b99a7;
  --canvas: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #dce5ed;
  --line-strong: #c6d3df;
  --shadow-sm: 0 1px 2px rgba(7, 21, 35, .05), 0 8px 24px rgba(7, 21, 35, .04);
  --shadow-md: 0 16px 44px rgba(7, 21, 35, .09);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }

.app-frame { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: 100vh; }
.workspace { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  color: #edf5fc;
  background:
    radial-gradient(circle at 12% 4%, rgba(245, 166, 35, .16), transparent 24%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.brand-card {
  display: block;
  padding: 12px 12px 11px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}
.brand-card img { display: block; width: 100%; height: 74px; object-fit: contain; }
.brand-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: #526678; }
.brand-caption strong { color: var(--navy-900); font-size: 12px; letter-spacing: .08em; }
.brand-caption small { font-size: 10px; }

.side-nav { display: flex; flex-direction: column; gap: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group-title { margin: 0 10px 5px; color: #7790a7; font-size: 10px; line-height: 1.2; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-item {
  min-height: 42px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #b8c9d8;
  font-weight: 600;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .07); transform: translateX(2px); }
.nav-item.active, .nav-item[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, rgba(245, 166, 35, .24), rgba(245, 166, 35, .11));
  border-color: rgba(245, 166, 35, .34);
  box-shadow: inset 3px 0 0 var(--orange-500);
}
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 20px; color: #7fa2bf; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { color: var(--orange-500); }
.nav-icon svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-account { margin-top: auto; padding: 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; background: rgba(255, 255, 255, .045); }
.account-name { min-width: 0; display: flex; align-items: center; gap: 10px; }
.account-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 12px; background: var(--orange-500); color: var(--navy-950); font-weight: 900; text-transform: uppercase; }
.account-name span { min-width: 0; display: flex; flex-direction: column; }
.account-name strong, .account-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name strong { color: #fff; font-size: 13px; }
.account-name small { color: #8ea6ba; font-size: 11px; }
.account-actions { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.account-actions form { margin: 0; }

/* Mobile header */
.mobilebar { display: none; min-height: 68px; padding: 10px 14px; align-items: center; gap: 10px; background: var(--navy-950); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.mobile-brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.mobile-brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; }
.mobile-brand span { min-width: 0; display: flex; flex-direction: column; }
.mobile-brand strong { font-size: 14px; letter-spacing: .06em; }
.mobile-brand small { color: #90a8bd; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu { margin-left: auto; position: relative; }
.mobile-menu summary { list-style: none; cursor: pointer; padding: 9px 12px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; color: #fff; font-weight: 700; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu[open] summary { border-color: var(--orange-500); }
.mobile-menu nav { position: absolute; z-index: 40; top: calc(100% + 10px); right: 0; width: min(330px, calc(100vw - 28px)); max-height: calc(100vh - 90px); overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-md); }
.mobile-menu .nav-group { gap: 2px; padding: 5px 0; }
.mobile-menu .nav-group + .nav-group { border-top: 1px solid var(--line); }
.mobile-menu .nav-group-title { color: var(--subtle); margin-top: 5px; }
.mobile-menu .nav-item { color: var(--ink); }
.mobile-menu .nav-item:hover { color: var(--navy-900); background: var(--surface-2); transform: none; }

/* Workspace */
.shell, .workspace-main { width: 100%; max-width: 1680px; margin: 0 auto; padding: 34px clamp(20px, 3.3vw, 54px) 64px; flex: 1; }
.workspace-kicker { margin: 0 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.workspace-kicker strong { color: var(--navy-800); letter-spacing: .07em; text-transform: uppercase; }
.workspace-kicker .secure { display: inline-flex; align-items: center; gap: 7px; }
.footer { padding: 18px clamp(20px, 3.3vw, 54px); display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); color: var(--subtle); background: rgba(255, 255, 255, .6); font-size: 11px; }

/* Headings and status */
.page-head, .hero { margin: 0 0 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-head > div, .hero > div { min-width: 0; }
.page-head h1, .hero h1 { margin: 3px 0 7px; color: var(--navy-950); font-size: clamp(29px, 3vw, 42px); line-height: 1.1; letter-spacing: -.035em; }
.page-head p, .hero p { max-width: 860px; margin: 0; color: var(--muted); font-size: 16px; }
.eyebrow { margin: 0 !important; color: var(--orange-600) !important; font-size: 11px !important; line-height: 1.3; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.health, .status { padding: 10px 14px; display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; border: 1px solid #b9ddcf; border-radius: 999px; background: var(--green-100); color: var(--green-700); font-size: 13px; font-weight: 700; white-space: nowrap; }
.status-dot { width: 9px; height: 9px; display: inline-block; flex: 0 0 9px; border-radius: 50%; background: #20a878; box-shadow: 0 0 0 4px rgba(32, 168, 120, .12); }

/* Metrics */
.stats, .metrics { margin: 0 0 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stats article, .metrics article {
  min-width: 0;
  min-height: 124px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stats article::before, .metrics article::before { content: ""; width: 34px; height: 3px; margin-bottom: 17px; border-radius: 3px; background: linear-gradient(90deg, var(--orange-500), #ffd27f); }
.stats span, .metrics span { color: var(--muted); font-size: 13px; }
.stats strong, .metrics strong { margin-top: 6px; color: var(--navy-950); font-size: 34px; line-height: 1; letter-spacing: -.04em; }

/* Navigation cards */
.quick-grid { margin: 0 0 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quick-link { min-height: 148px; padding: 20px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.quick-link:hover { transform: translateY(-2px); border-color: #a9c7df; box-shadow: var(--shadow-md); }
.quick-link .quick-icon { width: 42px; height: 42px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 13px; color: var(--blue-700); background: var(--blue-100); }
.quick-link .quick-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-link strong { color: var(--navy-950); font-size: 16px; }
.quick-link small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.quick-link .quick-arrow { margin-top: auto; padding-top: 12px; color: var(--orange-600); font-weight: 800; }

/* Cards and panels */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel, .card, .stream-grid article { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel { padding: 22px; }
.panel.narrow { max-width: 720px; }
.card { margin: 20px 0; overflow: hidden; }
.panel h2, .card h2 { margin: 3px 0 18px; color: var(--navy-950); font-size: 21px; letter-spacing: -.015em; }
.panel p, .card p { color: var(--muted); }
.panel-head, .card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-head { padding: 21px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fbfcfd); }
.card-head h2 { margin-bottom: 0; }
.panel-head.padded { padding: 0; }
.presence-list > div { padding: 13px 0; display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; border-top: 1px solid var(--line); }
.presence-list > div:first-child { border-top: 0; }
.presence-list strong { color: var(--navy-950); }
.presence-list small { color: var(--muted); }
.facts { margin: 0; padding: 0; list-style: none; }
.facts li { padding: 12px 0; display: flex; align-items: center; border-top: 1px solid var(--line); color: #415568; }
.facts li:first-child { border-top: 0; }
.empty { padding: 28px 14px; color: var(--muted); text-align: center; }
.privacy-note { color: var(--muted); font-size: 12px; }
.history-panel { margin-top: 20px; }

/* Forms */
label { display: flex; flex-direction: column; gap: 7px; color: #415568; font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; min-height: 42px; padding: 10px 12px; outline: none; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
input::placeholder, textarea::placeholder { color: #9aa8b5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(29, 112, 173, .13); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card > .form-grid, .card > form.form-grid { margin: 0; padding: 24px; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-inline, .filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.filters { padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.filters label { min-width: 190px; flex: 1; }
.check { flex-direction: row; align-items: center; gap: 9px; font-weight: 600; }
.check input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--orange-500); }
fieldset { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 7px; color: var(--muted); }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks.vertical { max-height: 420px; overflow: auto; flex-direction: column; gap: 3px; }
.checks.vertical .check { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.checks.vertical span { display: flex; flex-direction: column; }
.create-box { margin-bottom: 20px; }
.create-box summary { cursor: pointer; color: var(--blue-700); font-weight: 800; }

/* Buttons */
.button, button {
  min-height: 40px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  color: var(--navy-900);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-weight: 750;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.button:hover, button:hover { border-color: #89aecb; background: var(--blue-100); }
.button:active, button:active { transform: translateY(1px); }
.button:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(245, 166, 35, .55); outline-offset: 2px; }
.button.primary, .primary { color: #241604; border-color: #e99a19; background: linear-gradient(180deg, #ffc457, var(--orange-500)); }
.button.primary:hover, .primary:hover { background: #ffbc42; border-color: #db840a; }
.button.danger, button.danger, .danger { color: var(--red-700); border-color: #efbbb6; background: var(--red-100); }
.button.ghost { background: transparent; }
.sidebar .button.ghost { color: #d4e0ea; border-color: rgba(255, 255, 255, .17); }
.sidebar .button.ghost:hover { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button.wide { width: 100%; min-height: 47px; }
.actions, .page-actions, .row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions label { flex-direction: row; align-items: center; gap: 5px; }

/* Alerts */
.alert, .notice { margin: 0 0 18px; padding: 13px 15px; border: 1px solid; border-radius: 12px; }
.alert.success, .notice { color: var(--green-700); border-color: #b9ddcf; background: var(--green-100); }
.alert.danger { color: var(--red-700); border-color: #efbbb6; background: var(--red-100); }
.alert.warning { color: var(--yellow-700); border-color: #ead494; background: var(--yellow-100); }

/* Tables and technical details */
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 15px; color: #5c7083; background: var(--surface-2); font-size: 10px; line-height: 1.3; font-weight: 850; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 15px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f9fbfd; }
td strong, td small { display: block; }
td strong { color: var(--navy-950); }
td small { margin-top: 4px; color: var(--muted); }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
code { color: var(--blue-700); }
.mono { overflow-wrap: anywhere; }
.ua { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.details { margin: 0; display: grid; grid-template-columns: minmax(160px, 230px) minmax(0, 1fr); }
.details dt, .details dd { margin: 0; padding: 13px 18px; border-top: 1px solid var(--line); }
.details dt { color: var(--muted); font-weight: 700; }
.details dd { overflow-wrap: anywhere; }
.details dt:first-of-type, .details dt:first-of-type + dd { border-top: 0; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.json-view { max-height: 65vh; overflow: auto; padding: 16px; border: 1px solid #263d52; border-radius: 12px; background: var(--navy-950); color: #e4edf5; line-height: 1.55; }
.hash-value { overflow-wrap: anywhere; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tags span, .badge, .pill { padding: 4px 8px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.tags span, .badge { color: #49647b; background: #edf3f7; }
.badge.active, .badge.passed, .pill.ok, .ok { color: var(--green-700); background: var(--green-100); }
.badge.warning, .pill.warn, .warn { color: var(--yellow-700); background: var(--yellow-100); }
.badge.locked, .badge.disabled, .badge.revoked, .badge.denied, .badge.failed, .pill.bad, .bad { color: var(--red-700); background: var(--red-100); }

.stream-grid { padding: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stream-grid article { padding: 20px; }
.stream-grid h3 { color: var(--navy-950); font-size: 19px; }
.stream-grid audio { width: 100%; margin-top: 14px; }
.error-card { max-width: 720px; margin: 12vh auto; padding: 42px; text-align: center; }
.error-card h1 { font-size: 34px; }

/* Login */
.login-layout { min-height: 100vh; background: var(--navy-950); }
.login-shell { width: 100%; min-height: 100vh; padding: 28px; display: grid; place-items: center; background: radial-gradient(circle at 18% 10%, rgba(245, 166, 35, .18), transparent 28%), linear-gradient(145deg, var(--navy-900), var(--navy-950)); }
.login-card { width: min(1040px, 100%); display: grid; grid-template-columns: minmax(0, .95fr) minmax(380px, .78fr); overflow: hidden; border: 1px solid rgba(255, 255, 255, .13); border-radius: 26px; background: #fff; box-shadow: 0 34px 110px rgba(0, 0, 0, .36); }
.login-intro { min-height: 610px; padding: 42px; display: flex; flex-direction: column; color: #fff; background: radial-gradient(circle at 75% 15%, rgba(245, 166, 35, .24), transparent 30%), linear-gradient(160deg, var(--navy-850), var(--navy-950)); }
.login-brand { width: min(310px, 100%); padding: 14px; border-radius: 17px; background: #fff; }
.login-brand img { display: block; width: 100%; height: 112px; object-fit: contain; }
.login-intro-copy { margin: auto 0; max-width: 480px; }
.login-intro-copy .eyebrow { color: #ffc35b !important; }
.login-intro-copy h2 { margin: 8px 0 14px; font-size: clamp(31px, 4vw, 48px); line-height: 1.05; letter-spacing: -.04em; }
.login-intro-copy p { margin: 0; color: #a9bfd1; font-size: 16px; }
.login-trust { margin: 28px 0 0; padding: 0; display: grid; gap: 10px; list-style: none; color: #d9e6ef; font-size: 13px; }
.login-trust li { display: flex; align-items: center; gap: 8px; }
.login-form-pane { padding: clamp(30px, 5vw, 58px); display: flex; flex-direction: column; justify-content: center; }
.login-heading h1 { margin: 5px 0 8px; color: var(--navy-950); font-size: 34px; letter-spacing: -.03em; }
.login-heading > p:last-child { margin: 0 0 25px; color: var(--muted); }
.login-foot { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 1280px) {
  .app-frame { grid-template-columns: 258px minmax(0, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app-frame { display: block; }
  .sidebar { display: none; }
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 30; }
  .grid.two { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-kicker { display: none; }
  .shell, .workspace-main { padding-top: 26px; }
  .login-card { grid-template-columns: 1fr; max-width: 620px; }
  .login-intro { min-height: auto; padding: 28px; }
  .login-intro-copy { margin: 28px 0 0; }
  .login-intro-copy h2 { font-size: 32px; }
  .login-trust { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .shell, .workspace-main { padding: 22px 13px 45px; }
  .page-head, .hero { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-head h1, .hero h1 { font-size: 30px; }
  .page-head p, .hero p { font-size: 14px; }
  .health, .status { white-space: normal; }
  .stats, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stats article, .metrics article { min-height: 112px; padding: 15px; }
  .stats strong, .metrics strong { font-size: 28px; }
  .quick-grid { grid-template-columns: 1fr; gap: 10px; }
  .quick-link { min-height: 122px; }
  .panel { padding: 17px; }
  .card-head { padding: 17px; align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-all { grid-column: auto; }
  .filters { padding: 14px; align-items: stretch; flex-direction: column; }
  .filters label { min-width: 0; width: 100%; }
  .details { grid-template-columns: 1fr; }
  .details dt { padding-bottom: 4px; border-bottom: 0; }
  .details dd { padding-top: 2px; }
  .presence-list > div { grid-template-columns: 1fr auto; }
  .presence-list small { grid-column: 1 / -1; }
  .footer { flex-direction: column; gap: 5px; }
  .login-shell { padding: 12px; }
  .login-card { border-radius: 19px; }
  .login-intro { padding: 20px; }
  .login-brand { width: 220px; }
  .login-brand img { height: 78px; }
  .login-intro-copy h2 { font-size: 26px; }
  .login-form-pane { padding: 27px 21px 30px; }
}

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

/* Small entry layer kept separate so the full shared stylesheet remains immutable. */
.brand-card img { height: 150px; }
.login-brand { width: min(300px, 100%); }
.login-brand img { height: 210px; }

@media (max-width: 620px) {
  .login-brand { width: 190px; }
  .login-brand img { height: 145px; }
}

/* User-controlled appearance. Values are local to the browser and never leave it. */
html { font-size: 16px; }
html[data-font-scale="80"] { font-size: 12.8px; }
html[data-font-scale="90"] { font-size: 14.4px; }
html[data-font-scale="100"] { font-size: 16px; }
html[data-font-scale="110"] { font-size: 17.6px; }
html[data-font-scale="120"] { font-size: 19.2px; }

body { font-size: .9375rem; }
.brand-caption strong { font-size: .75rem; }
.brand-caption small, .nav-group-title, .mobile-brand small, .tags span, .badge, .pill { font-size: .625rem; }
.account-name strong, .health, .status, .stats span, .metrics span, .quick-link small, label, table { font-size: .8125rem; }
.account-name small, .footer, .eyebrow { font-size: .6875rem !important; }
.mobile-brand strong { font-size: .875rem; }
.workspace-kicker, .privacy-note, code, .mono, .button.compact, .button.small { font-size: .75rem; }
.page-head h1, .hero h1 { font-size: clamp(1.8125rem, 3vw, 2.625rem); }
.page-head p, .hero p, .quick-link strong { font-size: 1rem; }
.stats strong, .metrics strong { font-size: 2.125rem; }
.panel h2, .card h2 { font-size: 1.3125rem; }
th { font-size: .625rem; }
.stream-grid h3 { font-size: 1.1875rem; }
.error-card h1 { font-size: 2.125rem; }
.login-intro-copy h2 { font-size: clamp(1.9375rem, 4vw, 3rem); }
.login-intro-copy p { font-size: 1rem; }
.login-trust { font-size: .8125rem; }
.login-heading h1 { font-size: 2.125rem; }
.login-foot { font-size: .75rem; }

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9f1f8;
  --muted: #9bb0c2;
  --subtle: #72899e;
  --canvas: #07111c;
  --surface: #0e1d2c;
  --surface-2: #112335;
  --line: #263c50;
  --line-strong: #38536b;
  --blue-100: #12314a;
  --blue-700: #7fc2f4;
  --blue-600: #6eb5eb;
  --orange-100: #3c2b12;
  --green-100: #10392f;
  --green-700: #68d8b2;
  --red-100: #3a1b20;
  --red-700: #ff9ca5;
  --yellow-100: #392e15;
  --yellow-700: #ffd273;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .22), 0 10px 26px rgba(0, 0, 0, .15);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, .34);
  background: var(--canvas);
}
html[data-theme="dark"] body { background: var(--canvas); color: var(--ink); }
html[data-theme="dark"] .workspace { background: radial-gradient(circle at 86% -8%, rgba(245, 166, 35, .08), transparent 28%), var(--canvas); }
html[data-theme="dark"] .mobile-menu nav,
html[data-theme="dark"] .stats article,
html[data-theme="dark"] .metrics article,
html[data-theme="dark"] .quick-link,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .stream-grid article,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .login-form-pane { background: var(--surface); }
html[data-theme="dark"] .card-head { background: linear-gradient(180deg, #112335, #0e1d2c); }
html[data-theme="dark"] .mobile-menu .nav-item { color: var(--ink); }
html[data-theme="dark"] .mobile-menu .nav-item:hover,
html[data-theme="dark"] tbody tr:hover { background: #13283b; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .button,
html[data-theme="dark"] button { color: var(--ink); background: #0a1826; }
html[data-theme="dark"] .button:hover,
html[data-theme="dark"] button:hover { background: #15334b; }
html[data-theme="dark"] .button.primary,
html[data-theme="dark"] .primary { color: #241604; background: linear-gradient(180deg, #ffc457, var(--orange-500)); }
html[data-theme="dark"] th,
html[data-theme="dark"] .filters { background: var(--surface-2); }
html[data-theme="dark"] td strong,
html[data-theme="dark"] .stats strong,
html[data-theme="dark"] .metrics strong,
html[data-theme="dark"] .quick-link strong,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .page-head h1,
html[data-theme="dark"] .hero h1,
html[data-theme="dark"] .login-heading h1 { color: #f4f8fb; }
html[data-theme="dark"] .footer { background: rgba(8, 19, 30, .82); }

.display-settings { position: relative; border: 1px solid rgba(255, 255, 255, .1); border-radius: 13px; background: rgba(255, 255, 255, .04); }
.display-settings summary { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; color: #d8e4ed; font-size: .8125rem; font-weight: 750; }
.display-settings summary::after { content: "+"; color: var(--orange-500); font-size: 1.1rem; }
.display-settings[open] summary::after { content: "−"; }
.display-settings summary::-webkit-details-marker { display: none; }
.display-settings-panel { padding: 0 11px 12px; display: grid; gap: 11px; }
.appearance-label { color: #829bb0; font-size: .625rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.appearance-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.appearance-options.font-options { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.appearance-choice { min-width: 0; min-height: 32px; padding: 5px 6px; color: #c9d8e4; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; font-size: .6875rem; font-weight: 750; }
.appearance-choice:hover { color: #fff; background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .25); }
.appearance-choice[aria-pressed="true"] { color: #201505; background: var(--orange-500); border-color: var(--orange-500); }
.mobile-menu .display-settings { margin: 7px 5px 4px; background: var(--surface-2); border-color: var(--line); }
.mobile-menu .display-settings summary { color: var(--ink); }
.mobile-menu .appearance-label { color: var(--muted); }
.mobile-menu .appearance-choice { color: var(--ink); background: var(--surface); border-color: var(--line); }
.mobile-menu .appearance-choice[aria-pressed="true"] { color: #201505; background: var(--orange-500); border-color: var(--orange-500); }
.login-display-settings { position: fixed; z-index: 50; top: 16px; right: 16px; width: min(310px, calc(100vw - 32px)); background: rgba(7, 21, 35, .92); backdrop-filter: blur(12px); }

@media (max-width: 620px) {
  .page-head h1, .hero h1 { font-size: 1.875rem; }
  .stats strong, .metrics strong { font-size: 1.75rem; }
  .login-intro-copy h2 { font-size: 1.625rem; }
  .login-display-settings { top: 9px; right: 9px; width: 185px; }
  .login-display-settings .appearance-options.font-options { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.appearance-choice[data-appearance-font]::after { content: "%"; }
