:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #fff;
  --ink: #242229;
  --muted: #625d68;
  --line: #e5e3e8;
  --subtle: #f1eff3;
  --brand: #6a4671;
  --brand-strong: #2a1b2e;
  --brand-soft: #f0e8f2;
  --brand-hover: #3d2a43;
  --sidebar-line: #503d56;
  --sidebar-ink: #faf6fb;
  --sidebar-muted: #d6cad9;
  --sidebar-active: #47324d;
  --sidebar-accent: #d6aedf;
  --on-accent: #fff;
  --ok: #196345;
  --ok-bg: #e6f5ed;
  --wait: #78500c;
  --wait-bg: #fff3d9;
  --bad: #a33242;
  --bad-bg: #fcecef;
  --accent: #b34732;
  --accent-hover: #973725;
  --accent-soft: #fcece7;
  --lady-bg: #24182b;
  --lady-surface: #392c43;
  --lady-ink: var(--sidebar-ink);
  --lady-muted: #d8c9dc;
  --lady-line: #59445f;
  --lady-accent: #eddbf6;
  --lady-mic-hover: #503e59;
  --lady-mute-bg: #8e2f41;
  --lady-mute-hover: #a4384a;
  --lady-mute-line: #dc6170;
  --lady-end-bg: #402633;
  --lady-end-hover: #543041;
  --lady-end-ink: #f994a0;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 2px 4px #2a1b2e0a;
  --shadow-float: 0 18px 52px #2a1b2e26;
  --focus: #85529d;
  --focus-invert: #eed0fb;
  --scrim: #24183180;
  --sidebar-width: 234px;
  --content-max: 1320px;
  --gutter: clamp(20px, 2.7vw, 36px);
  --topbar-height: 64px;
  font-family: Inter, "Aptos", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--ink); font-size: 15px; }
button, select, input, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled), select:not(:disabled) { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button, select, input, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-underline-offset: .18em; }
:where(button, a, select, input, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
:where(#page, h1)[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
h1 { font-size: clamp(31px, 3.2vw, 38px); letter-spacing: -.039em; font-weight: 700; }
h2 { font-size: clamp(18px, 1.85vw, 21px); letter-spacing: -.024em; }
h3 { font-size: 16px; letter-spacing: -.012em; }
svg { vertical-align: middle; }
.icon { width: 1.2em; height: 1.2em; flex: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .045em; }
.panel { min-width: 0; padding: clamp(16px, 1.8vw, 24px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; border-radius: 999px; background: var(--subtle); color: var(--muted); font-size: 12px; line-height: 1.35; font-weight: 650; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-wait { background: var(--wait-bg); color: var(--wait); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.3; font-weight: 650; text-align: center; text-decoration: none; transition: background-color 150ms ease, border-color 150ms ease; }
.btn:not(:disabled):hover { background: var(--subtle); border-color: var(--brand-soft); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.btn-primary:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.icon-btn { width: 44px; padding: 0; font-size: 17px; }
.field { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
:where(select, input:not([type="checkbox"], [type="radio"], [type="range"]), textarea) { min-width: 0; max-width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.field :where(select, input, textarea) { width: 100%; font-size: 14px; font-weight: 500; }
.page-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; margin-block-end: 20px; }
.page-header__copy { min-width: 0; }
.page-header .eyebrow { margin-block-end: 5px; }
.page-header__description { max-width: 62ch; margin-block-start: 7px; }
.page-header__actions { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; min-width: 0; }

#app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "sidebar topbar" "sidebar main"; height: 100vh; height: 100dvh; }
.topbar { grid-area: topbar; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: var(--topbar-height); padding: 0 var(--gutter); border-block-end: 1px solid var(--line); background: var(--surface); }
.topbar-context, .topbar-account, .topbar-city, .topbar-person { display: flex; align-items: center; }
.topbar-context { gap: 11px; }
.topbar-city { gap: 7px; font-weight: 650; }
.city-icon { color: var(--brand); }
.topbar-account { gap: 20px; }
.topbar-person { gap: 8px; font-size: 14px; font-weight: 650; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 33px; height: 33px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 14px; line-height: 1; font-weight: 750; }
.demo-label { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; background: var(--subtle); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.signal-dot { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--sidebar-accent); }
.demo-label .signal-dot { background: var(--brand); }
.sidebar { grid-area: sidebar; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 30px 16px 14px; background: var(--brand-strong); color: var(--sidebar-ink); }
.sidebar :focus-visible, .login-brand :focus-visible { outline-color: var(--focus-invert); }
.sidebar-brand { position: relative; padding: 1px 10px 26px; border-block-end: 1px solid var(--sidebar-line); }
.wordmark { width: max-content; color: var(--sidebar-ink); font-size: 25px; font-weight: 700; letter-spacing: -.065em; line-height: 1; }
.wordmark > :first-child { font-weight: 500; }
.wordmark-dot { margin-inline-start: 1px; color: var(--sidebar-accent); }
.sidebar-subtitle { margin-block-start: 9px; color: var(--sidebar-muted); font-size: 13px; line-height: 1.3; }
.sidebar-nav { display: grid; gap: 4px; margin-block: 20px 24px; }
.sidebar-nav a, .logout { display: flex; position: relative; align-items: center; gap: 11px; min-height: 46px; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--sidebar-muted); font-size: 14px; font-weight: 650; line-height: 1.25; text-decoration: none; transition: background-color 150ms ease, color 150ms ease; }
.sidebar-nav a:hover, .logout:hover { background: var(--brand-hover); color: var(--sidebar-ink); }
.sidebar-nav a[aria-current="page"] { background: var(--sidebar-active); color: var(--sidebar-ink); }
.sidebar-nav a[aria-current="page"]::before { position: absolute; top: 11px; bottom: 11px; left: 0; width: 2px; border-radius: 2px; background: var(--sidebar-accent); content: ""; }
.sidebar-nav a[aria-current="page"] .icon { color: var(--sidebar-accent); }
.sidebar-foot { border-block-start: 1px solid var(--sidebar-line); padding-block-start: 13px; }
.sidebar-demo { display: flex; align-items: center; gap: 8px; padding-inline: 11px; color: var(--sidebar-muted); font-size: 12px; }
.logout { width: 100%; margin-block-start: 6px; border: none; background: transparent; text-align: left; }
.main-scroll { grid-area: main; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
#page { max-width: var(--content-max); margin-inline: auto; padding: clamp(22px, 2.7vw, 34px) var(--gutter) 30px; }

.menu-toggle, .menu-close, .drawer-backdrop { display: none; }
.skip-link { position: fixed; z-index: 10; inset: 8px auto auto 8px; padding: 11px 15px; border-radius: var(--radius-sm); background: var(--surface); transform: translateY(calc(-100% - 16px)); }
.skip-link:focus { transform: none; }

.login-screen { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 24px; }
.login-layout { display: grid; grid-template-columns: .78fr 1fr; width: min(100%, 766px); overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow-float); }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: 34px; background: var(--brand-strong); }
.login-brand .wordmark { font-size: clamp(26px, 3.5vw, 40px); }
.login-brand-foot { display: flex; align-items: center; gap: 9px; padding-block-start: 15px; border-block-start: 1px solid var(--sidebar-line); color: var(--sidebar-muted); font-size: 13px; }
.login-content { padding: clamp(24px, 4vw, 54px); }
.login-content h1 { margin-block: 8px 11px; }
.login-help { max-width: 36ch; color: var(--muted); }
.login-options { display: grid; gap: 8px; margin-block-start: 22px; }
.profile-option { display: grid; align-items: center; grid-template-columns: auto 1fr auto; gap: 10px; min-height: 53px; padding: 8px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: left; font-weight: 650; transition: background-color 150ms ease, border-color 150ms ease; }
.profile-option:hover:not(:disabled) { background: var(--subtle); border-color: var(--brand); }
.option-arrow { color: var(--brand); font-size: 19px; }
.login-note { margin-block-start: 16px; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  :root { --gutter: clamp(14px, 4vw, 23px); --topbar-height: 58px; }
  #app-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "topbar" "main"; }
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(318px, calc(100% - 30px)); padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); visibility: hidden; transform: translateX(-102%); transition: transform 200ms ease; }
  #app-shell[data-menu-open] .sidebar { visibility: visible; transform: translateX(0); }
  #app-shell[data-menu-open] .drawer-backdrop:not([hidden]) { display: block; position: fixed; z-index: 49; inset: 0; background: var(--scrim); }
  .menu-toggle, .menu-close { display: inline-flex; }
  .menu-close { position: absolute; top: -6px; right: 0; border-color: var(--sidebar-line); color: var(--sidebar-ink); background: var(--brand-strong); }
  .btn.menu-close:hover { border-color: var(--sidebar-line); background: var(--brand-hover); }
  .topbar { gap: 8px; }
  .topbar-context, .topbar-account { gap: 9px; }
  .topbar-city { font-size: 14px; }
  .page-header { gap: 12px; margin-block-end: 18px; }
  .page-header__actions { max-width: 100%; }
}
@media (max-width: 525px) {
  .login-screen { padding: 15px; }
  .login-layout { grid-template-columns: minmax(0, 1fr); }
  .login-brand { flex-direction: row; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 20px 24px; }
  .login-brand-foot { padding: 0; border: 0; }
  .topbar-person > :last-child { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .city-icon { display: none; }
}
@media (max-width: 359px) {
  .topbar { gap: 4px; padding-inline: 10px; }
  .topbar-context, .topbar-account { gap: 5px; }
  .topbar .demo-label { gap: 4px; padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .sidebar, .btn, .profile-option, .sidebar-nav a, .logout { transition: none; }
}
