:root {
  color-scheme: light;

  /* Foundation */
  --bg: #f4f6fa;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;
  --surface-hover: #edf2fa;
  --surface-glass: rgba(255, 255, 255, .91);

  /* Borders */
  --hairline: rgba(110, 110, 115, .09);
  --line: rgba(110, 110, 115, .14);
  --line-strong: rgba(110, 110, 115, .25);

  /* Type */
  --text: #334158;
  --text-strong: #14263f;
  --text-muted: #52617b;
  --text-faint: #5e6d83;

  /* Brand and state */
  --accent: #3265d2;
  --accent-2: #2555bd;
  --accent-3: #3265d2;
  --accent-glow: rgba(0, 113, 227, .22);
  --accent-soft: rgba(0, 113, 227, .11);
  --info: #0066cc;
  --info-glow: rgba(0, 102, 204, .15);
  --ok: #24834a;
  --ok-dim: #207442;
  --ok-glow: rgba(36, 131, 74, .16);
  --warn: #946000;
  --warn-glow: rgba(148, 96, 0, .16);
  --danger: #b42336;
  --danger-strong: #9b1c2d;
  --danger-glow: rgba(180, 35, 54, .15);
  --magenta: #76559b;

  /* Geometry */
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-sm: 0 4px 20px rgba(31, 50, 82, .04);
  --shadow-md: 0 12px 36px rgba(31, 50, 82, .08);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .1);
  --sidebar-w: 240px;
  --topbar-h: 76px;
  --transition: 140ms cubic-bezier(.2, .75, .25, 1);

  /* Typefaces */
  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", ui-sans-serif, system-ui,
               "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC",
               sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Monaco,
               Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
body.has-shell { background: var(--bg); }
body.sidebar-open { overflow: hidden; }

a {
  color: var(--info);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition), background var(--transition);
}
a:hover { color: #004f9e; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
::selection { color: var(--text-strong); background: rgba(0, 113, 227, .38); }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 9px 13px;
  color: white;
  background: var(--accent-3);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  transform: translateY(-180%);
}
.skip-link:focus { color: white; transform: translateY(0); }
.sr-only {
  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;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(110, 110, 115, .22);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(110, 110, 115, .38); }

svg[viewBox="0 0 24 24"] {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

/* Public pages --------------------------------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 34px auto;
  padding: 0 24px 48px;
}
.wrap.home-wrap {
  width: min(480px, 100%);
  margin-top: clamp(72px, 12vh, 130px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}
.brand {
  color: var(--text-strong);
  font-weight: 720;
  letter-spacing: -.02em;
}
.brand.brand-lg { margin-bottom: 18px; font-size: 20px; }

/* Application shell --------------------------------------------------- */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100svh;
  padding: 22px 14px 16px;
  overflow-y: auto;
  background: rgba(250, 250, 250, .96);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 4px 8px 20px;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -.025em;
}
.sidebar-brand .logo {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #424245, #1d1d1f);
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
  font-size: 15px;
  font-weight: 800;
}
.sidebar-brand-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.15; }
.sidebar-brand-copy strong { color: var(--text-strong); font-size: 15px; font-weight: 760; }
.sidebar-brand-copy small { margin-top: 4px; color: var(--text-faint); font-size: 9px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-close {
  display: none;
  min-width: 48px;
  min-height: 44px;
  padding: 8px 10px;
  margin-left: auto;
  color: var(--text-strong);
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
}
.sidebar-section {
  padding: 13px 12px 8px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 610;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}
.sidebar-link svg { width: 18px; height: 18px; opacity: .72; }
.sidebar-link:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, .045);
  transform: none;
}
.sidebar-link.active {
  color: var(--text-strong);
  background: rgba(29, 29, 31, .055);
  border-color: transparent;
  box-shadow: none;
}
.sidebar-link.active::before {
  content: none;
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: -5px;
  width: 3px;
  background: linear-gradient(var(--accent-2), var(--info));
  border-radius: 999px;
  box-shadow: 0 0 14px var(--accent-glow);
}
.sidebar-link.active svg { opacity: 1; color: var(--accent-2); }
.sidebar-footer {
  padding-top: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.sidebar-footer form { margin: 0; }
.sidebar-logout {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.main { display: flex; min-width: 0; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  min-height: var(--topbar-h);
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 247, .82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
.topbar-inner {
  display: flex;
  width: 100%;
  max-width: 1460px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 28px;
}
.page-title {
  min-width: 0;
  margin: 0;
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.25;
}
.page-title::before { content: none; }
.page-title small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 520;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.content {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 40px 36px 80px;
}
.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: block;
  background: rgba(29, 29, 31, .24);
  backdrop-filter: blur(4px);

  opacity: 0;

  visibility: hidden;

  transition: opacity 280ms ease, visibility 280ms;
}

/* Layout and cards ----------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  position: relative;
  min-width: 0;
  padding: 26px;
  overflow: visible;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card.elev { box-shadow: var(--shadow-lg); }
.card.hover:hover {
  border-color: rgba(0, 102, 204, .28);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card.stat {
  display: flex;
  min-height: 152px;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
}
.card.stat::before { content: none; }
.card.stat::after { content: none; }
.hero-stats > .card:first-child {
  background: var(--surface);
  border-color: var(--line);
}
.stat .k, .k {
  margin: 0 0 5px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.stat .v, .v {
  position: relative;
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  line-height: 1.15;
}
.stat .v.big, .big { font-size: clamp(28px, 2.4vw, 36px); }
.stat .small { margin-top: 1px; }
.stat .accent-bar {
  width: 56px;
  height: 3px;
  margin-top: 5px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: none;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-flush { padding: 0; overflow: hidden; }
.users-card { background: rgba(255, 255, 255, .86); }
.filter-toolbar { min-width: min(100%, 540px); }
.create-user-card {
  background: linear-gradient(145deg, rgba(0, 113, 227, .075), rgba(255, 255, 255, .72));
  border-color: rgba(0, 102, 204, .18);
}
.section-head-card { background: rgba(255, 255, 255, .68); }
.chart-card { background: rgba(255, 255, 255, .74); }
.chart-card > .bold, .chart-card > .section-title { font-size: 13px; }
.history-card { background: rgba(255, 255, 255, .62); }
.history-load-host { min-height: 70px; margin-top: 10px; }
.history-placeholder { display: flex; min-height: 70px; align-items: center; justify-content: center; }
.daily-table-card { background: rgba(255, 255, 255, .84); }

/* Badges --------------------------------------------------------------- */
.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  color: #535358;
  background: rgba(110, 110, 115, .08);
  border: 1px solid rgba(110, 110, 115, .16);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 680;
  letter-spacing: .025em;
  line-height: 1;
  white-space: nowrap;
}
.badge.badge-info, .badge.yellow {
  color: #0066cc;
  background: var(--info-glow);
  border-color: rgba(0, 102, 204, .25);
}
.badge.badge-danger {
  color: #b42336;
  background: var(--danger-glow);
  border-color: rgba(180, 35, 54, .26);
}
.badge.gray { color: var(--text-muted); }
.poll-status { min-width: 82px; justify-content: center; }
.poll-status.is-live { color: #207442; background: var(--ok-glow); border-color: rgba(36, 131, 74, .25); }
.poll-status.is-paused { color: #885700; background: var(--warn-glow); border-color: rgba(148, 96, 0, .26); }
.poll-status.is-error { color: #b42336; background: var(--danger-glow); border-color: rgba(180, 35, 54, .26); }
.poll-status:not(.badge) { background: transparent; border: 0; }
.poll-status-button { cursor: pointer; font: inherit; }
.poll-status-button:hover { color: var(--text-strong); border-color: var(--line-strong); }

/* Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  color: white;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: -.005em;
  line-height: 1.1;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}
.btn:hover {
  color: white;
  background: #0066cc;
  box-shadow: none;
  transform: none;
}
.btn:active { transform: scale(.98); }
.btn.secondary {
  color: var(--text);
  background: rgba(110, 110, 115, .07);
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}
.btn.secondary:hover {
  color: var(--text-strong);
  background: rgba(110, 110, 115, .13);
  border-color: rgba(0, 102, 204, .28);
  box-shadow: none;
}
.btn.ghost {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.btn.ghost:hover { color: var(--text-strong); background: rgba(110, 110, 115, .09); box-shadow: none; }
.btn.danger-btn {
  color: #b42336;
  background: var(--danger-glow);
  border-color: rgba(180, 35, 54, .24);
  box-shadow: none;
}
.btn.danger-btn:hover { color: #921c2a; background: rgba(180, 35, 54, .22); }
.btn.btn-sm { min-height: 34px; padding: 6px 10px; border-radius: 999px; font-size: 11px; }
.btn.full { width: 100%; }
.btn.primary { color: white; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.copied, .btn.ghost.copied {
  color: #207442;
  background: var(--ok-glow);
  border-color: rgba(36, 131, 74, .3);
}
button:disabled, .btn:disabled { opacity: .48; cursor: wait; transform: none; box-shadow: none; }

/* Shared controls and short, compositor-only feedback. */
.password-control { position: relative; min-width: 0; }
.inline-form .password-control input { padding-right: 62px; }
.password-toggle { position: absolute; inset-block: 3px; right: 4px; min-width: 50px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.password-toggle:hover, .password-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.btn.is-submitting { cursor: progress; opacity: .8; }
.btn.is-submitting::after { content: ''; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: submit-spin 700ms linear infinite; }
.sidebar-footer-label { display: block; padding: 8px 12px; color: var(--text-faint); font-size: 10px; letter-spacing: .04em; }
@keyframes submit-spin { to { transform: rotate(360deg); } }
@keyframes workspace-arrive { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .user-workspace [data-workspace-page]:not([hidden]) { animation: workspace-arrive 160ms ease-out; }
}
/* Forms --------------------------------------------------------------- */
.inline-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.inline-form select,
.inline-form textarea,
.cycle-config-form input,
.user-filter-input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--text-strong);
  background: rgba(245, 245, 247, .62);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  font-size: 12.5px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.inline-form input:focus,
.inline-form select:focus,
.inline-form textarea:focus,
.cycle-config-form input:focus,
.user-filter-input:focus {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(0, 102, 204, .65);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .12);
}
.inline-form input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-glow);
}
input::placeholder, textarea::placeholder { color: #6e6e73; opacity: 1; }
.inline-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .025em;
}
.field-help {
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}
label.switch {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0;
  text-transform: none;
}
label.switch input { width: 16px; height: 16px; accent-color: var(--accent); }
.cycle-config-form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.cycle-config-form input { min-height: 31px; padding: 5px 7px; font-variant-numeric: tabular-nums; }
.inline-form-row { display: inline-flex; margin: 0; }
.edit-user-control { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.edit-user-control .summary-preview { margin: 0; }
.edit-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: min(620px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  color: var(--text);
  background: #ffffff;
  border: 1px solid rgba(0, 102, 204, .28);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin: auto;
}
.edit-dialog::backdrop { background: rgba(29, 29, 31, .28); backdrop-filter: blur(6px); }
.edit-dialog-form { padding: 22px; }
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 { margin: 2px 0 0; color: var(--text-strong); font-size: 20px; letter-spacing: -.025em; }
.dialog-fields { gap: 13px; }
.field-span-2 { grid-column: 1 / -1; }
.dialog-options { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 18px; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.code-area {
  width: 100%;
  padding: 16px;
  resize: vertical;
  color: #333336;
  background: #f5f5f7;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  tab-size: 2;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.code-area:focus { border-color: rgba(0, 102, 204, .7); box-shadow: 0 0 0 3px var(--accent-soft); }
.code-area.code-tall { min-height: 600px; }
.code-area.code-med { min-height: 360px; }
.code-area.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-glow); }
.json-error { display: none; margin-bottom: 10px; color: #b42336; font-size: 12px; }
.json-error.visible { display: block; }

/* Tables --------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-size: 12.5px;
}
.table th, .table td { padding: 14px 16px; text-align: left; vertical-align: top; }
.table thead th {
  color: var(--text-faint);
  background: rgba(245, 245, 247, .38);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr + tr td { border-top: 1px solid var(--hairline); }
.table tbody tr:hover { background: rgba(0, 113, 227, .045); }
.table tbody td { color: #424245; }
.table tfoot td, .table tfoot th { border-top: 1px solid var(--line-strong); }
.scroll-x { max-width: 100%; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
.scroll-x:focus-visible,
.codex-chart-frame:focus-visible,
svg.hourly-bars:focus-visible,
.codex-quota-chart:focus-visible {
  outline: 2px solid rgba(0, 102, 204, .85);
  outline-offset: 3px;
}
.users-table .spark-cell { width: 160px; }
.users-table .spark-cell svg { width: 150px; max-width: 100%; }
.user-actions { row-gap: 5px; }
tr.hidden { display: none; }

/* Progress ------------------------------------------------------------- */
.bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  background: #e8e8ed;
  border: 0;
  border-radius: 999px;
}
.bar::after { content: none; }
.fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  box-shadow: none;
  transition: width 650ms cubic-bezier(.2, .8, .2, 1);
}
.fill.danger { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.fill.unlimited {
  width: 100% !important;
  opacity: .45;
  background: linear-gradient(90deg, rgba(0, 102, 204, .2), rgba(0, 113, 227, .35));
}
.mini-bar {
  height: 6px;
  margin: 7px 0 5px;
  overflow: hidden;
  background: rgba(245, 245, 247, .7);
  border-radius: 999px;
}
.mini-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 550ms cubic-bezier(.2, .8, .2, 1);
}
.mini-fill.danger { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.mini-fill.unlimited { width: 100% !important; opacity: .35; }

/* Alerts and disclosure ------------------------------------------------ */
.flash, .err {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
}
.flash { color: #207442; background: rgba(36, 131, 74, .08); border-color: rgba(36, 131, 74, .18); }
.err { color: #b42336; background: rgba(180, 35, 54, .09); border-color: rgba(180, 35, 54, .2); }
.flash::before, .err::before {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}
.flash::before { content: "成功"; color: #207442; background: var(--ok-glow); }
.err::before { content: "错误"; color: #b42336; background: var(--danger-glow); }
details > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  color: #535358;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  font-weight: 650;
  user-select: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "›";
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--accent-2);
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  transition: transform var(--transition), background var(--transition);
}
details[open] > summary::before { transform: rotate(90deg); background: rgba(0, 113, 227, .18); }
details[open] > summary { margin-bottom: 14px; }
details.summary-muted > summary { color: var(--text-muted); }

/* Code, text and utilities -------------------------------------------- */
code, .mono {
  padding: 4px 7px;
  color: #424245;
  background: rgba(245, 245, 247, .62);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
}
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gap-sm { gap: 7px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.center-narrow { max-width: 500px; margin: 0 auto; }
.bold { color: var(--text-strong); font-weight: 680; font-variant-numeric: tabular-nums; }
.section-title {
  margin: 0;
  color: var(--text-strong);
  font-family: inherit;
  font-size: inherit;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
  line-height: inherit;
}
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 510;
  font-variant-numeric: tabular-nums;
}
.break { word-break: break-all; }
.empty {
  padding: 30px 18px;
  color: var(--text-faint);
  text-align: center;
  font-size: 12px;
}
.system-row, .system-row td { color: var(--text-faint); }
[data-role="used"], [data-role="online"], [data-role="detail"] { font-variant-numeric: tabular-nums; }

/* Reusable marks and links -------------------------------------------- */
.app-logo {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #424245, #1d1d1f);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
  font-weight: 800;
}
.app-logo::after { content: none; }
.app-logo.lg { width: 48px; height: 48px; border-radius: 15px; font-size: 18px; }
.app-logo.sm { width: 32px; height: 32px; border-radius: 10px; box-shadow: none; font-size: 12px; }
.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid rgba(0, 102, 204, .22);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 750;
}
.copy-mono { display: flex; min-width: 0; align-items: center; gap: 8px; }
.copy-mono code { flex: 1; min-width: 0; padding: 10px 11px; }
.copy-link { padding: 6px 8px; }
.copy-link svg, .btn.ghost.btn-sm svg { width: 14px; height: 14px; }
.link-cell { min-width: 138px; }
.link-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 12px;
}
.link-row + .link-row { margin-top: 4px; }
.link-row > a { display: inline-flex; flex: 1; min-width: 0; align-items: center; gap: 7px; padding: 4px 0; }

/* Auth --------------------------------------------------------------- */
.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}
.auth-wrap { width: min(430px, 100%); }
.auth-card {
  position: relative;
  min-width: 0;
  padding: 36px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.auth-brand .logo {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #424245, #1d1d1f);
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
  font-weight: 800;
}
.auth-brand strong { display: block; color: var(--text-strong); font-size: 14px; }
.auth-brand small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10.5px; }
.auth-wrap > .auth-card > .title { margin: 0 0 8px; color: var(--text-strong); font-size: 22px; line-height: 1.25; }
.auth-wrap > .auth-card > .subtitle { margin: 0 0 22px; color: var(--text-muted); font-size: 12px; }
.auth-card .auth-head {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.auth-card .auth-head .title { color: var(--text-strong); font-size: 20px; font-weight: 750; letter-spacing: -.025em; }
.auth-card .auth-head h1.title { margin: 0; line-height: 1.25; }
.auth-card .auth-head .sub { margin-top: 3px; color: var(--text-muted); font-size: 11.5px; }
.auth-card form { margin: 0; }
.auth-card .btn { min-height: 44px; }
.welcome-card { padding: 56px 40px; }
.login-card { border-color: rgba(0, 102, 204, .19); }

/* Profiles and user panel -------------------------------------------- */
.profile-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.user-panel-nav {
  padding: 14px 16px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.user-panel-title { margin: 0; font-size: 16px; line-height: 1.25; }
.profile-link {
  border-radius: 16px;
  min-height: 78px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 13px;
  white-space: normal;
}
.profile-link small { color: var(--text-faint); font-size: 10.5px; font-weight: 520; line-height: 1.4; }
.profile-link.selected, .profile-link.selected:hover {
  color: var(--text-strong);
  background: rgba(0, 113, 227, .16);
  border-color: rgba(0, 102, 204, .48);
  box-shadow: inset 0 0 0 1px rgba(0, 102, 204, .08);
}
.import-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.import-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  background: rgba(245, 245, 247, .36);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.import-selected-copy { min-width: 150px; }
.import-selected-copy .bold { margin: 2px 0; color: var(--text-strong); }
.import-actions { justify-content: flex-end; flex-wrap: wrap; }
.profile-qr-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px;
  margin-top: 12px;
  background: rgba(245, 245, 247, .28);
  border: 1px solid var(--hairline);
  border-radius: 13px;
}
.profile-qr-panel[hidden] { display: none; }
.profile-qr-panel .qr-wrap {
  display: flex;
  width: fit-content;
  padding: 12px;
  background: white;
  border-radius: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}
.profile-qr-panel img { display: block; width: min(220px, 54vw); height: auto; aspect-ratio: 1; }
.summary-preview { margin-left: 8px; color: var(--text-faint); font-size: 11px; font-weight: 500; }
.panel-trend { padding-top: 10px; }
.panel-trend svg.spark { width: 100%; height: 64px; }

/* Health -------------------------------------------------------------- */
.health-ok { border-color: rgba(36, 131, 74, .14); }
.health-bad { border-color: rgba(180, 35, 54, .22); }
.health-ok .v { color: #207442; }
.health-bad .v { color: #b42336; }
.health-ok::after, .health-bad::after {
  content: "";
  position: absolute;
  top: 19px;
  right: 19px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.health-ok::after { background: var(--ok); box-shadow: 0 0 13px var(--ok); }
.health-bad::after { background: var(--danger); box-shadow: 0 0 13px var(--danger); }

/* Charts -------------------------------------------------------------- */
.spark { display: block; }
.spark-area { fill: rgba(0, 113, 227, .13); }
.spark-line { fill: none; stroke: #0066cc; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.spark-dot { fill: #0066cc; stroke: #ffffff; stroke-width: .75; }
.spark-cell { min-width: 132px; padding-top: 16px; padding-bottom: 16px; }
.hourly-bars, .heatmap { display: block; width: 100%; height: auto; overflow: visible; }
.hourly-bars .bars .hourly-bar { fill: var(--accent-2); opacity: .82; }
.hourly-bars .bars .hourly-bar:hover { opacity: 1; }
.hourly-bars .bars .hourly-bar.peak { fill: var(--info); }
.hourly-bars .day-separators line { stroke: var(--line); stroke-width: 1; }
.hourly-bars .day-labels .day-label,
.heatmap .heat-date,
.heatmap .heat-hour {
  fill: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 9px;
}
.heatmap .heat-cell { fill: #004080; }
.heatmap .heat-cell.future { fill: rgba(110, 110, 115, .05); stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 2; }
.heatmap-data-details { border-top: 1px solid var(--hairline); }
.heatmap-data-details > summary { margin-top: 8px; }
.heatmap-data-scroll { margin-top: 10px; border: 1px solid var(--line); border-radius: 11px; }
.heatmap-data-table { min-width: 1180px; font-size: 10.5px; }
.heatmap-data-table th,
.heatmap-data-table td {
  padding: 8px 9px;
  text-align: right;
  white-space: nowrap;
}
.heatmap-data-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  color: var(--text-strong);
  background: #ffffff;
  border-right: 1px solid var(--line);
  text-align: left;
}
.heatmap-data-table thead th:first-child { background: #f5f5f7; }
#top-n-host { display: flex; flex-direction: column; }
.top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 51px;
  padding: 10px 20px;
  color: var(--text);
  border-top: 1px solid var(--hairline);
}
.top-row:first-child { border-top: 0; }
.top-row:hover { color: var(--text-strong); background: rgba(0, 113, 227, .06); }
.top-uid { overflow: hidden; color: #0066cc; font-size: 12.5px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.top-spark { display: inline-flex; min-width: 100px; align-items: center; }
.top-spark .spark { width: 100px; height: 15px; }
.top-bytes { color: var(--text-strong); font-size: 12px; font-weight: 670; font-variant-numeric: tabular-nums; }
.hover-tip {
  z-index: 50;
  padding: 7px 10px;
  color: var(--text-strong);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
}

/* Codex quota dashboard ---------------------------------------------- */
.codex-dashboard {
  --codex-week: #087f83;
  --codex-week-dark: #075f63;
  --codex-week-soft: #eaf6f5;
  --codex-five: #7467e8;
  --codex-ink: #172238;
  --codex-muted: #65758a;
  --codex-paper: #fbfcfe;
  --codex-paper-line: #dce4ed;
  max-width: 1400px;
  margin: 0 auto;
}
.codex-intro {
  display: flex;
  min-height: 142px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 36px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.codex-intro h2 { margin: 5px 0 7px; color: var(--text-strong); font-size: clamp(25px, 2.4vw, 34px); letter-spacing: -.045em; }
.codex-intro p { max-width: 690px; margin: 0; color: #626267; font-size: 13px; }
.codex-eyebrow { color: #626267; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.codex-live-cluster { display: flex; flex: 0 0 auto; align-items: flex-end; flex-direction: column; gap: 8px; text-align: right; }

.codex-primary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.codex-quota-card {
  min-height: 254px;
  padding: 25px 26px;
  overflow: hidden;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.codex-quota-card::before { content: none; }
.codex-quota-card.tone-violet { border-color: var(--line); }
.codex-quota-card.tone-cyan { border-color: var(--line); }
.codex-quota-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.codex-quota-value {
  min-height: 62px;
  color: var(--text-strong);
  font-size: clamp(46px, 5.4vw, 68px);
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.065em;
  line-height: 1;
}
.codex-window-orb {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background: rgba(0, 113, 227, .16);
  border: 1px solid rgba(0, 102, 204, .28);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(0, 113, 227, .2), inset 0 0 0 9px rgba(245, 245, 247, .5);
}
.tone-cyan .codex-window-orb { background: rgba(75, 201, 193, .13); border-color: rgba(75, 201, 193, .28); box-shadow: 0 0 28px rgba(75, 201, 193, .15), inset 0 0 0 9px rgba(245, 245, 247, .5); }
.codex-window-orb::after { content: ""; position: absolute; inset: 15px; background: var(--accent-2); border-radius: 50%; }
.tone-cyan .codex-window-orb::after { background: #53d2c7; }
.codex-quota-bar { height: 12px; margin-top: 24px; border-color: rgba(255, 255, 255, .09); }
.tone-cyan .codex-quota-bar .fill { background: linear-gradient(90deg, #238f8c, #53d2c7); box-shadow: 0 0 18px rgba(75, 201, 193, .22); }
.codex-quota-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 1px 16px; color: var(--text-faint); font-size: 10.5px; }
.codex-quota-meta strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.codex-reset-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.codex-reset-label { color: var(--text-faint); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.codex-reset-block strong { justify-self: end; color: var(--text-strong); font-size: 14px; font-variant-numeric: tabular-nums; }
.codex-reset-block time { grid-column: 1 / -1; margin-top: 3px; color: var(--text-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.codex-quota-card.is-low .codex-quota-value { color: var(--warn); }
.codex-quota-card.is-low .fill { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.codex-quota-card.is-unavailable { border-style: dashed; }
.codex-quota-card.is-unavailable .codex-quota-value { color: var(--text-muted); font-size: clamp(30px, 4vw, 42px); letter-spacing: -.03em; }
.codex-quota-card.is-unavailable .codex-window-orb { opacity: .34; }

.codex-dashboard.is-week-only [data-quota="five_hour"],
.codex-dashboard.is-week-only [data-series="five-hour"],
.codex-dashboard.is-week-only [data-col="five-hour"] { display: none; }
.codex-dashboard.is-week-only .codex-primary-grid { grid-template-columns: minmax(0, 1fr); }
.codex-dashboard.is-week-only .codex-quota-card.tone-cyan {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  column-gap: 42px;
  min-height: 224px;
  align-items: center;
}
.codex-dashboard.is-week-only .tone-cyan .codex-quota-card-head,
.codex-dashboard.is-week-only .tone-cyan .codex-quota-bar,
.codex-dashboard.is-week-only .tone-cyan .codex-quota-meta { grid-column: 1; }
.codex-dashboard.is-week-only .tone-cyan .codex-quota-bar { margin-top: 18px; }
.codex-dashboard.is-week-only .tone-cyan .codex-reset-block {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: stretch;
  align-content: center;
  padding: 12px 0 12px 36px;
  border-top: 0;
  border-left: 1px solid var(--hairline);
}

.codex-context-card { display: flex; min-height: 116px; align-items: center; gap: 17px; padding: 19px 20px; background: var(--surface); border-radius: 16px; }
.codex-context-card .v { margin-bottom: 3px; font-size: 20px; }
.codex-context-icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  color: #626267;
  background: rgba(75, 201, 193, .1);
  border: 1px solid rgba(75, 201, 193, .18);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 760;
}

.codex-collector-error {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 14px;
  color: var(--danger);
  background: var(--danger-glow);
  border: 1px solid rgba(180, 35, 54, .22);
  border-radius: 12px;
  font-size: 11.5px;
}
.codex-collector-error[hidden] { display: none; }
.codex-collector-error strong { flex: 0 0 auto; color: var(--danger); }
.codex-collector-error span { min-width: 0; word-break: break-word; }
.codex-collector-error .btn { flex: 0 0 auto; margin-left: auto; }

.codex-chart-card { padding: 0; overflow: hidden; background: var(--codex-paper); border-color: var(--codex-paper-line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.codex-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 25px 27px 20px; background: #fff; }
.codex-chart-head .k { color: var(--codex-week); }
.codex-chart-head h3 { margin: 2px 0 4px; color: #18243a; font-size: 22px; letter-spacing: -.03em; }
.codex-chart-head p { max-width: 790px; margin: 0; color: var(--codex-muted); font-size: 11.5px; }
.codex-range-switch { display: inline-flex; flex: 0 0 auto; padding: 4px; background: #f0f3f7; border: 1px solid #dbe2eb; border-radius: 12px; }
.codex-range-switch button {
  min-width: 42px;
  min-height: 31px;
  padding: 5px 10px;
  color: #59697f;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 680;
}
.codex-range-switch button:hover { color: #18243a; background: #fff; }
.codex-range-switch button.active { color: white; background: var(--codex-week); box-shadow: 0 7px 16px rgba(8, 127, 131, .24); }
.codex-chart-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(132px, 180px)) minmax(240px, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 13px 27px;
  background: #f6f8fb;
  border-top: 1px solid #e4e9f0;
  border-bottom: 1px solid #dfe5ed;
}
.codex-chart-stat { display: flex; min-width: 0; overflow-wrap: anywhere; min-height: 58px; justify-content: center; flex-direction: column; gap: 3px; padding: 9px 13px; background: #fff; border: 1px solid #e0e6ee; border-radius: 11px; }
.codex-chart-stat.is-primary { background: var(--codex-week-soft); border-color: #c7e3e1; }
.codex-chart-stat span { color: #59697f; font-size: 10.5px; font-weight: 720; letter-spacing: .035em; }
.codex-chart-stat strong { color: var(--codex-ink); font-size: 20px; font-weight: 790; font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1.05; }
.codex-chart-stat.is-primary strong { color: var(--codex-week-dark); }
.codex-chart-key { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 15px; color: #53647a; font-size: 10.5px; font-weight: 650; }
.codex-chart-key > span { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.codex-chart-key i, .codex-chart-tooltip i { display: inline-block; width: 22px; height: 0; background: transparent; border-top: 3px dashed var(--codex-five); border-radius: 0; }
.codex-chart-key i.series-week, .codex-chart-tooltip i.series-week { height: 4px; background: var(--codex-week); border: 0; border-radius: 999px; }
.codex-chart-summary { min-width: 0; margin-left: 4px; overflow: hidden; color: #59697f; font-size: 10.5px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.codex-chart-frame { position: relative; min-height: 350px; overflow-x: auto; overflow-y: hidden; background: #fff; scrollbar-color: #c1ccd9 transparent; }
.codex-quota-chart { display: block; width: 100%; min-width: 900px; height: auto; background: var(--codex-paper); touch-action: pan-x; cursor: crosshair; }
.codex-grid-line { stroke: #dce3ec; stroke-width: 1; vector-effect: non-scaling-stroke; }
.codex-tick { stroke: #a8b4c3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.codex-axis-label { fill: #526176; font-family: var(--font-sans); font-size: 10px; font-variant-numeric: tabular-nums; }
.codex-axis-baseline { stroke: #aeb9c7; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.codex-series-area.series-week { fill: #e8f4f3; fill-opacity: .76; stroke: none; }
.codex-series-line { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.codex-series-line.series-five { stroke: var(--codex-five); stroke-width: 2.5; stroke-dasharray: 9 7; }
.codex-series-line.series-week { stroke: var(--codex-week); stroke-width: 3.25; stroke-dasharray: none; }
.codex-low-zone-label rect { fill: #fff; stroke: #f1cbd1; stroke-width: 1; vector-effect: non-scaling-stroke; }
.codex-low-zone-label text { fill: #a94659; font-family: var(--font-sans); font-size: 10px; font-weight: 720; }
.codex-week-event-line { stroke: rgba(8, 127, 131, .28); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.codex-week-event-guide rect { fill: #fff; stroke: #bfdedc; stroke-width: 1; vector-effect: non-scaling-stroke; }
.codex-week-event-guide text { fill: var(--codex-week-dark); font-family: var(--font-sans); font-size: 10.5px; font-weight: 720; font-variant-numeric: tabular-nums; }
.codex-week-event-node { fill: #fff; stroke: var(--codex-week); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.codex-week-event-node.is-highlighted { fill: var(--codex-week); stroke: #fff; stroke-width: 2.5; }
.codex-week-event-guide.is-reset .codex-week-event-line { stroke-dasharray: none; stroke-width: 1.8; }
.codex-week-event-guide.is-reset rect { stroke: var(--codex-week); stroke-width: 1.4; }
.codex-week-event-node.is-reset { fill: var(--codex-week); stroke: #fff; stroke-width: 2.5; }
.codex-crosshair line { stroke: rgba(33, 48, 68, .38); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.codex-crosshair circle { fill: #fff; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.codex-crosshair circle.series-five { stroke: var(--codex-five); }
.codex-crosshair circle.series-week { stroke: var(--codex-week); }
.codex-chart-empty { position: absolute; inset: 0; display: grid; min-width: 300px; place-items: center; padding: 30px; color: #53647a; font-size: 12px; pointer-events: none; }
.codex-chart-empty[hidden] { display: none; }
.codex-chart-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  min-width: 198px;
  gap: 7px;
  padding: 11px 12px;
  color: #2a3850;
  background: rgba(255, 255, 255, .98);
  border: 1px solid #cbd5e2;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(24, 36, 56, .18);
  pointer-events: none;
  font-size: 10.5px;
}
.codex-chart-tooltip[hidden] { display: none; }
.codex-chart-tooltip time { padding-bottom: 6px; color: #66758b; border-bottom: 1px solid #e1e6ed; font-variant-numeric: tabular-nums; }
.codex-chart-tooltip span { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.codex-chart-tooltip strong { color: #172238; font-variant-numeric: tabular-nums; }
.codex-chart-tooltip .event-change { padding-top: 6px; color: #5c6c81; border-top: 1px solid #e7ebf0; }
.codex-chart-tooltip .event-change i { width: 8px; height: 8px; margin-left: 5px; background: #fff; border: 2px solid var(--codex-week); border-radius: 50%; }
.codex-chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 27px 15px; color: #59697f; background: #fff; border-top: 1px solid #dfe5ed; font-size: 10.5px; }
.codex-chart-foot span:first-child { flex: 0 0 auto; color: #53647a; font-variant-numeric: tabular-nums; }

.codex-records-card { padding: 0; overflow: hidden; background: #fff; border-color: var(--codex-paper-line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.codex-records-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 25px 17px; border-bottom: 1px solid #e2e7ee; }
.codex-records-head .k { color: var(--codex-week); }
.codex-records-head h3 { margin: 1px 0 0; color: #18243a; font-size: 18px; letter-spacing: -.025em; }
.codex-records-card .badge.gray { color: #53647a; background: #f0f3f7; border-color: #d8dfe9; }
.codex-records-table { width: 100%; min-width: 850px; border-collapse: collapse; color: #35445a; font-size: 12px; }
.codex-records-table th { padding: 12px 18px; color: #53647a; background: #f6f8fb; border-bottom: 1px solid #dfe5ed; font-size: 9.5px; font-weight: 780; letter-spacing: .075em; text-align: left; text-transform: uppercase; }
.codex-records-table td { padding: 14px 18px; border-bottom: 1px solid #edf0f4; font-variant-numeric: tabular-nums; }
.codex-records-table tbody tr:last-child td { border-bottom: 0; }
.codex-records-table tbody tr:hover { background: #f3f8f8; }
.codex-records-table time { color: #45556b; font-weight: 650; }
.codex-records-table .record-value { display: inline-flex; min-width: 72px; justify-content: center; padding: 5px 9px; border-radius: 999px; font-size: 11px; }
.codex-records-table .record-value.five { color: #5947e8; background: #efedff; }
.codex-records-table .record-value.week { color: var(--codex-week-dark); background: var(--codex-week-soft); }
.codex-records-table .empty { color: #59697f; background: #fff; }

.codex-data-note { display: flex; align-items: flex-start; gap: 12px; padding: 15px 17px; color: var(--text-muted); background: rgba(75, 201, 193, .045); border: 1px solid rgba(75, 201, 193, .13); border-radius: 13px; font-size: 11px; }
.codex-data-note-mark { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; color: var(--info); background: rgba(75, 201, 193, .1); border-radius: 8px; font-weight: 800; }
.codex-data-note strong { color: var(--text); }
.codex-data-note p { margin: 3px 0 0; }

/* Daily and drill-down views ----------------------------------------- */
.daily-table th, .daily-table td { white-space: nowrap; }
.daily-table .user-col {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 118px;
  color: var(--text-strong);
  background: #ffffff;
  border-right: 1px solid var(--line);
  text-align: left;
}
.daily-table tbody tr:hover .user-col { background: var(--surface-2); }
.daily-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.daily-table .user-total { color: var(--text-strong); font-weight: 680; }
.daily-table .day-col, .daily-table .day-cell { min-width: 82px; text-align: right; font-variant-numeric: tabular-nums; }
.daily-table .day-mmdd { color: var(--text); font-size: 11.5px; font-weight: 680; }
.daily-table .day-weekday { margin-top: 2px; color: var(--text-faint); font-size: 9.5px; }
.daily-table .empty-day { color: #4f627c; }
.daily-table .day-today { color: #535358; background: var(--accent-soft); }
.daily-table thead th.day-today { box-shadow: inset 0 -2px 0 var(--accent); }
.daily-table tfoot td, .daily-table tfoot th { color: var(--text-strong); background: rgba(245, 245, 247, .9); }
.daily-table-collapsed { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.daily-table-collapsed th, .daily-table-collapsed td { padding: 7px 9px; color: var(--text-muted); border-bottom: 1px solid var(--hairline); text-align: right; white-space: nowrap; }
.daily-table-collapsed thead th { color: var(--text-faint); font-weight: 600; }
.daily-table-collapsed tbody th { color: var(--text); text-align: left; }
.back-link { display: inline-flex; margin-bottom: 12px; color: var(--text-muted); font-size: 11.5px; font-weight: 600; }
.back-link:hover { color: var(--accent-2); }
.user-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 2px 0 12px; color: var(--text-strong); font-size: 22px; letter-spacing: -.025em; }
.user-title .small { font-size: 11px; font-weight: 520; }
.alert-row { padding: 10px 12px; margin-bottom: 6px; color: var(--text); background: rgba(110, 110, 115, .06); border: 1px solid var(--hairline); border-radius: 9px; font-size: 11px; }

/* Dashboard filters --------------------------------------------------- */
.user-filter-input { width: min(260px, 100%); }
.filter-chips .chip {
  min-height: 32px;
  padding: 6px 11px;
  color: var(--text-muted);
  background: rgba(110, 110, 115, .06);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.filter-chips .chip:hover { color: var(--text-strong); border-color: var(--line-strong); }
.filter-chips .chip.active { color: white; background: #0071e3; border-color: #0071e3; box-shadow: 0 6px 16px var(--accent-glow); }

/* Explicit account choice for administrator-created users. */
.create-account-types, .create-quota-fields { padding: 0; margin: 0 0 20px; border: 0; min-width: 0; }
.create-account-types legend, .create-quota-fields legend { margin-bottom: 12px; color: var(--text-strong); font-weight: 650; }
.create-account-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inline-form .create-account-choice { display: flex; align-items: center; gap: 12px; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; letter-spacing: 0; }
.create-account-choice input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); }
.create-account-choice strong { display: block; color: var(--text-strong); font-size: 14px; }
.create-account-choice small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.create-account-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.create-account-summary { padding: 12px 16px; background: var(--surface-2); border-radius: 12px; }
.create-account-summary:empty { display: none; }
@media (max-width: 600px) {
  .create-account-options { grid-template-columns: 1fr; }
}

/* Grouped administrator account list. */
.users-list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px 24px 16px; }
.users-list-heading h2 { font-size: 20px; }
.users-list-heading p { margin: 7px 0 0; }
.account-group-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 24px 20px; }
.account-group-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: 12px; text-align: left; transition: background var(--transition), border-color var(--transition); }
.account-group-filter span { color: var(--text-strong); font-size: 20px; font-variant-numeric: tabular-nums; }
.account-group-filter.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.account-group-filter:hover { border-color: var(--accent); }
.users-card > .card-head { border-top: 1px solid var(--line); background: var(--surface-2); }
.users-card .filter-toolbar { min-width: 0; }
.user-group-heading th { padding: 20px 18px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.user-group-title { display: flex; align-items: center; gap: 10px; color: var(--text-strong); font-size: 14px; font-weight: 650; }
.user-group-heading p { margin: 6px 0 0; color: var(--text-muted); font-size: 11px; font-weight: 400; }
.user-more-actions > summary { font-size: 11px; color: var(--text-muted); padding: 6px 0; }
.user-more-actions > summary::before { width: 16px; height: 16px; font-size: 15px; }
.user-more-actions[open] > summary { margin-bottom: 0; }
.user-more-actions .user-actions { padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
#create-user-section { scroll-margin-top: 110px; }
@media (max-width: 760px) {
  .account-group-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 16px; }
  .users-list-heading { padding: 20px 16px 16px; }
}

/* Focus and motion ---------------------------------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid rgba(0, 102, 204, .85);
  outline-offset: 2px;
}
@keyframes panel-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dialog-appear {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.content, .auth-card, .user-panel-nav {
  animation: panel-rise 520ms cubic-bezier(.22, 1, .36, 1) backwards;
}
.edit-dialog[open] { animation: dialog-appear 240ms cubic-bezier(.22, 1, .36, 1); }
@media (hover: hover) and (pointer: fine) {
  .card.hover:hover { transform: translateY(-3px); }
}
@media (hover: none) {
  .card.hover:hover { transform: none; }
}
.welcome-eyebrow { margin: 24px 0 12px; color: var(--text-muted); font-size: 12px; letter-spacing: .16em; }
.welcome-title { margin: 0; color: var(--text-strong); font-size: clamp(32px, 5vw, 40px); font-weight: 650; letter-spacing: -.055em; line-height: 1.12; }
.welcome-description { margin: 20px auto 32px; max-width: 28em; color: var(--text-muted); font-size: 15px; line-height: 1.8; }
.welcome-brand { display: flex; justify-content: center; }
.welcome-footnote { margin: 28px 0 0; color: var(--text-faint); font-size: 12px; }

/* Responsive ---------------------------------------------------------- */
@media (max-width: 1120px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: min(286px, 84vw);
    transform: translateX(-103%);
    transition: transform 240ms cubic-bezier(.2, .75, .25, 1);
  }
  .sidebar.open { transform: translateX(0); }
  body.sidebar-open .scrim { opacity: 1; visibility: visible; }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar-toggle { display: inline-flex; }
  .topbar { min-height: var(--topbar-h); }
  .topbar-inner { padding: 11px 18px; }
  .content { padding: 22px 18px 60px; }
  .scroll-x .table:not(.users-table) { min-width: 720px; }
}

@media (max-width: 720px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
  }
  .topbar-inner > .row { min-width: 0; flex-wrap: nowrap; }
  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1px;
  }
  .topbar-actions > .badge:last-child { margin-left: auto; }
  .page-title { min-width: 0; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
  .page-title small { max-width: 70vw; }
  .cycle-config-form { flex: 0 0 auto; }
  .cycle-config-form input { width: 48px !important; }
  .profile-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-filter-input { width: 100%; max-width: none !important; min-width: 0 !important; }
  .codex-intro { align-items: flex-start; flex-direction: column; gap: 14px; }
  .codex-live-cluster { align-items: flex-start; text-align: left; }
  .codex-primary-grid { grid-template-columns: 1fr; }
  .codex-dashboard.is-week-only .codex-quota-card.tone-cyan { display: block; min-height: 0; }
  .codex-dashboard.is-week-only .tone-cyan .codex-reset-block {
    padding: 14px 0 0;
    margin-top: 0;
    border-top: 1px solid var(--hairline);
    border-left: 0;
  }
  .codex-chart-head { align-items: flex-start; flex-direction: column; }
  .codex-range-switch { width: 100%; }
  .codex-range-switch button { flex: 1; }
  .codex-chart-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .codex-chart-key { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .codex-chart-summary { flex-basis: 100%; margin-left: 0; }
  .codex-chart-foot { align-items: flex-start; flex-direction: column; gap: 5px; }
  .codex-dashboard.is-week-only .codex-records-table { min-width: 620px; }

  .users-table, .scroll-x .users-table { display: block; width: 100%; min-width: 0 !important; }
  .card .users-table { width: 100%; margin: 0; }
  .users-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .users-table tbody, .users-table tr { display: block; width: 100%; }
  .users-table tr.hidden { display: none; }
  .users-table tbody tr {
    width: calc(100% - 24px);
    margin: 0 12px 12px;
    padding: 14px;
    background: rgba(245, 245, 247, .62);
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .users-table tbody tr:first-child { margin-top: 12px; }
  .users-table tbody tr + tr td { border-top: 0; }
  .users-table td { display: block; width: 100%; min-width: 0; padding: 8px 0; }
  .users-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--text-faint);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .users-table td[data-label="用户"]::before { display: none; }
  .users-table td[data-label="用户"] > .row > div:last-child { min-width: 0; }
  .users-table td[data-label="用户"] .bold,
  .users-table td[data-label="用户"] .small,
  .user-title,
  .user-title ~ .small.faint {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .users-table .spark-cell { width: 100%; padding-top: 4px; }
  .users-table .spark-cell svg { width: min(100%, 380px); max-width: none; height: 44px; }
  .users-table .link-cell { min-width: 0; }
  .users-table .link-row { max-width: 380px; }
  .summary-preview { display: block; margin: 5px 0 0; }
}

@media (max-width: 560px) {
  .wrap { margin: 20px auto; padding: 0 14px 36px; }
  .wrap.home-wrap { margin-top: 50px; }
  .auth-card { padding: 24px 20px; }
  .content { padding: 18px 14px 52px; }
  .grid { gap: 12px; }
  .grid-4 { grid-template-columns: 1fr; }
  .hero-stats.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 17px; border-radius: 15px; }
  .card.stat { min-height: 116px; }
  .stat .v.big, .big { font-size: 29px; }
  .profile-links { grid-template-columns: 1fr; }
  .import-head { align-items: center; }
  .import-selected { align-items: flex-start; flex-direction: column; }
  .import-actions { width: 100%; justify-content: flex-start; }
  .profile-qr-panel { grid-template-columns: 1fr; justify-items: start; }
  .nav { align-items: flex-start; }
  .user-panel-nav {
    min-width: 0;
    flex-wrap: wrap;
  }
  .user-panel-nav > .row,
  .user-panel-nav > .row > div,
  .user-panel-nav > div:last-child {
    min-width: 0;
  }
  .user-panel-nav > div:last-child { max-width: 100%; }
  .user-panel-nav .badge,
  .user-panel-nav .small {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .user-panel-nav .badge { white-space: normal; }
  .top-row { grid-template-columns: minmax(0, 1fr) auto; }
  .top-spark { display: none; }
  .filter-chips { width: 100%; }
  .filter-chips .chip { flex: 1; }
  .codex-intro { min-height: 0; padding: 19px; }
  .codex-collector-error { align-items: stretch; flex-wrap: wrap; }
  .codex-collector-error span { flex: 1 1 180px; }
  .codex-collector-error .btn { width: 100%; margin-left: 0; }
  .codex-quota-card { min-height: 232px; padding: 20px; }
  .codex-quota-value { font-size: 45px; }
  .codex-context-card { padding: 15px; }
  .codex-chart-head, .codex-chart-overview, .codex-chart-foot { padding-right: 17px; padding-left: 17px; }
  .codex-chart-overview { gap: 7px; }
  .codex-chart-stat { min-height: 54px; padding: 8px 9px; }
  .codex-chart-stat strong { font-size: 17px; }
  .codex-quota-chart { min-width: 920px; }
}

/* User workspace: daily tasks first, advanced controls on demand. */
.user-workspace { max-width: 1120px; }
.user-workspace [id] { scroll-margin-top: 110px; }
.user-workspace .user-panel-nav {
  position: sticky; top: 12px; z-index: 8;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.user-workspace .user-panel-nav > .row { min-width: 0; flex: 1; }
.user-workspace .user-panel-nav .small, .panel-section-heading p { overflow-wrap: anywhere; }
.panel-section-heading > div { min-width: 0; }
.panel-nav-links { display: flex; gap: 6px; }
.panel-nav-links a { padding: 10px 14px; border-radius: 999px; color: var(--text-muted); font-size: 13px; }
.panel-nav-links a:hover { color: var(--text-strong); background: var(--surface-2); }
.panel-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 36px 0 28px; }
.panel-eyebrow { margin: 0 0 10px; color: var(--text-muted); font-size: 11px; letter-spacing: .1em; }
.panel-intro h1, .panel-intro h2 { margin: 0; color: var(--text-strong); font-size: clamp(28px, 4vw, 40px); letter-spacing: -.045em; font-weight: 650; line-height: 1.2; }
.panel-intro p:last-child { margin: 12px 0 0; }
.panel-refresh-control { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.panel-overview { padding: 28px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.panel-overview .card { padding: 0; background: transparent; border: 0; box-shadow: none; }
.panel-overview .card.stat { min-height: 92px; }
.panel-overview > .card { padding-top: 22px; border-top: 1px solid var(--line); border-radius: 0; }
.panel-overview .accent-bar { display: none; }
.user-workspace > .import-assistant { margin-top: 28px; }
.user-workspace .import-head .section-title { margin-bottom: 8px; font-size: 22px; letter-spacing: -.03em; }
.user-workspace .import-selected { background: var(--surface-2); border: 0; padding: 20px; }
.panel-disclosure { margin-top: 20px; padding: 22px 26px; border: 1px solid var(--hairline); border-radius: 20px; background: var(--surface); }
.panel-disclosure > summary { display: flex; width: 100%; gap: 12px; padding: 0; color: var(--text-strong); font-size: 15px; }
.panel-disclosure > summary small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.panel-disclosure > .card { padding: 22px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.panel-disclosure > summary::before { order: 2; margin-left: auto; flex-shrink: 0; }
.panel-section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.panel-section-heading p { margin: 8px 0 0; }
.panel-links-disclosure { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.panel-links-disclosure .card { background: var(--surface-2); box-shadow: none; }
.panel-links-disclosure .section-title { margin-bottom: 12px; }
.user-workspace .profile-qr-panel .qr-wrap { width: 244px; max-width: 100%; min-height: 244px; align-items: center; justify-content: center; }
.purchase-plan button:disabled { cursor: not-allowed; }
.panel-toast { position: fixed; bottom: 24px; left: 50%; z-index: 90; max-width: calc(100vw - 32px); width: max-content; padding: 12px 20px; border-radius: 16px; background: #1d1d1f; color: white; font-size: 13px; box-shadow: var(--shadow-md); opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.panel-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.panel-copy-dialog input { font-size: 16px; }
.purchase-kind-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.purchase-kind-nav [aria-current="page"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.purchase-steps { display: flex; flex-wrap: wrap; gap: 12px 28px; list-style-position: inside; padding: 0; margin: 0 0 28px; color: var(--text-muted); font-size: 13px; }
.purchase-notice { color: var(--text-muted); background: var(--surface); border-color: var(--line); }
.purchase-notice::before { content: none; }
.purchase-resume { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.purchase-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.purchase-plan { display: flex; flex-direction: column; }
.purchase-plan h2 { margin: 10px 0 0; font-size: 40px; line-height: 1.15; letter-spacing: -.045em; color: var(--text-strong); }
.purchase-plan h2 span { font-size: 18px; font-weight: 500; }
.purchase-plan form { margin-top: auto; padding-top: 14px; }
.purchase-plan .field-help { margin-bottom: 0; }
.purchase-price { margin: 16px 0 8px; color: var(--text-strong); font-size: 32px; letter-spacing: -.04em; font-weight: 650; font-variant-numeric: tabular-nums; }
.purchase-amount { margin: 16px 0 8px; color: var(--text-strong); font-size: 26px; font-weight: 550; font-variant-numeric: tabular-nums; }
.purchase-explanation { margin: 24px 4px; line-height: 1.8; }
.purchase-current { margin-bottom: 24px; }
.purchase-order-summary { display: flex; flex-wrap: wrap; gap: 24px 60px; margin: 24px 0; }
.purchase-payment-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: center; gap: 36px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.purchase-qr img { display: block; width: 100%; max-width: 300px; height: auto; border-radius: 14px; }
.purchase-qr p { text-align: center; }
.purchase-claim h3 { margin: 0 0 12px; color: var(--text-strong); font-size: 20px; }
.purchase-claim p { line-height: 1.8; }
.purchase-action-notice { margin: 20px 0; padding: 18px 20px; border: 2px solid #dc2626; border-radius: 14px; background: #fff1f2; color: #991b1b; }
.purchase-action-notice strong { font-size: 22px; }
.purchase-action-notice p { margin: 8px 0 0; line-height: 1.7; }
.purchase-claim .purchase-submit { min-height: 56px; padding: 14px 18px; font-size: 18px; font-weight: 800; white-space: normal; background: #b91c1c; color: #fff; }
.purchase-claim .purchase-submit:hover { background: #991b1b; }
.purchase-reference { margin-top: 20px; }
.purchase-reference summary { cursor: pointer; line-height: 1.6; color: var(--text-muted); }
.purchase-reference label { margin-top: 12px; }
.purchase-order-hint { padding: 18px 20px; border-radius: 14px; background: var(--surface-2); color: var(--text-muted); }
.purchase-order-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); color: var(--text-strong); }
.purchase-order-row:last-child { border: 0; padding-bottom: 0; }
.purchase-order-row > span { min-width: 0; }
.purchase-order-row small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.purchase-order-state { text-align: right; }
@media (max-width: 720px) {
  .panel-intro { align-items: flex-start; flex-direction: column; gap: 16px; margin: 28px 0 20px; }
  .panel-refresh-control { justify-content: flex-start; }
  .panel-overview { padding: 20px; }
  .panel-overview .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .panel-overview .card.stat { min-height: 76px; }
  .panel-disclosure { padding: 20px; }
  .user-workspace .profile-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-workspace .profile-link:last-child { grid-column: 1 / -1; }
  .user-workspace .profile-link { min-height: 80px; }
  .user-workspace .import-selected { align-items: stretch; flex-direction: column; gap: 16px; }
  .user-workspace .import-actions { justify-content: flex-start; }
  .user-workspace #profile-copy { width: 100%; }
  .purchase-plans { grid-template-columns: 1fr; }
  .purchase-payment-grid { grid-template-columns: 1fr; gap: 20px; }
  .purchase-qr { justify-self: center; width: min(300px, 100%); }
}
@media (max-width: 420px) {
  .user-workspace .user-panel-nav { padding: 12px; gap: 8px; }
  .panel-nav-links { gap: 0; }
  .panel-nav-links a { padding: 10px 8px; font-size: 12px; }
  .panel-overview .v { font-size: 24px; }
  .panel-overview .v.big { font-size: 28px; }
}

/* Mobile account group headings. */
@media (max-width: 720px) {
  .users-table tbody tr.user-group-heading { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .users-table .user-group-heading th { display: block; padding: 18px 16px 12px; background: transparent; border-top: 0; }
  .users-table tr.user-group-heading + tr[data-user] { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Generated connectivity artwork: decorative, responsive, no text overlay. */
.connectivity-art { display:block; width:100%; object-fit:cover; object-position:center; border-radius:18px; background:#f5f5f7; }


.panel-art { width:200px; height:132px; flex-shrink:0; margin-left:auto; }
.sidebar-art { height:112px; margin:0 0 16px; }
@media (max-width:600px) {

  .panel-intro .panel-art { width:100%; height:144px; margin:0; order:3; }
}

/* User guide and responsive user navigation. */
.user-layout { display: grid; grid-template-columns: 220px minmax(0, 1120px); gap: 36px; max-width: 1440px; margin: 0 auto; padding: 24px 32px; align-items: start; }
.user-layout .user-workspace { width: 100%; min-width: 0; padding: 0; margin: 0; }
.user-sidebar { position: sticky; top: 28px; max-height: calc(100vh - 56px); overflow-y: auto; padding: 18px 10px; }
.user-sidebar-brand { display: flex; align-items: center; gap: 12px; color: var(--text-strong); font-weight: 650; margin-bottom: 30px; padding: 0 10px; }
.user-sidebar-brand small { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); margin-top: 5px; }
.user-sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.user-sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--text-muted); font-size: 14px; }
.user-sidebar nav a:hover, .user-sidebar nav a:focus-visible { background: var(--accent-soft); color: var(--accent); }
.user-sidebar nav svg { width: 18px; height: 18px; }
.user-sidebar nav .user-nav-sub { padding-left: 44px; font-size: 13px; }
.user-nav-caption { padding: 22px 14px 8px; font-size: 11px; color: var(--text-muted); }
.user-sidebar-note { margin: 30px 14px 0; font-size: 12px; line-height: 1.9; color: var(--text-muted); }
.user-guide { margin-top: 28px; padding: 32px; }
.guide-heading, .guide-article-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.guide-heading h2 { font-size: clamp(24px, 3vw, 32px); margin: 0; letter-spacing: -.04em; }
.guide-heading p { margin-bottom: 0; }
.guide-prepare { background: var(--accent-soft); border-radius: 16px; padding: 20px 24px; margin: 26px 0 20px; }
.user-guide p { line-height: 1.85; overflow-wrap: anywhere; }
.guide-prepare p { margin: 8px 0 0; font-size: 14px; }
.guide-platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.guide-platforms a { padding: 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--text-strong); }
.guide-platforms a:hover { background: var(--surface-2); border-color: var(--accent); }
.guide-platforms span { display: block; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.guide-article { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.guide-article h3 { margin: 10px 0; font-size: 22px; letter-spacing: -.025em; }
.guide-steps { list-style: none; counter-reset: guide-step; padding: 0; margin: 24px 0 0; }
.guide-steps > li { counter-increment: guide-step; position: relative; padding-left: 44px; margin-bottom: 26px; }
.guide-steps > li::before { content: counter(guide-step, decimal-leading-zero); position: absolute; left: 0; top: -3px; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 650; }
.guide-steps p, .guide-other-grid p { font-size: 14px; color: var(--text-muted); margin: 8px 0 16px; }
.user-guide figure { margin: 18px 0 0; }
.user-guide figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.user-guide figcaption, .guide-source { font-size: 12px; line-height: 1.7; color: var(--text-muted); margin-top: 10px; }
.guide-phone-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
.guide-other-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.guide-other-grid h4 { margin-bottom: 8px; }
#guide-faq details { padding: 16px 0; border-bottom: 1px solid var(--line); }
#guide-faq summary { cursor: pointer; font-size: 14px; font-weight: 550; }
#guide-faq details p { color: var(--text-muted); font-size: 14px; margin-bottom: 0; }
@media (min-width: 1101px) { .user-layout .panel-nav-links { display: none; } }
@media (max-width: 1100px) {
  .user-layout { display: block; padding: 20px; }
  .user-sidebar { display: none; }
  .user-layout .user-workspace { margin: auto; }
}
@media (max-width: 600px) {
  .user-layout { padding: 12px; }
  .user-guide { padding: 20px 16px; }
  .user-layout .user-panel-nav { flex-wrap: wrap; }
  .user-layout .panel-nav-links { width: 100%; justify-content: space-between; }
  .user-layout .panel-nav-links a { padding: 8px 14px; }
  .user-workspace [id] { scroll-margin-top: 150px; }
  .guide-platforms { grid-template-columns: 1fr; gap: 8px; }
  .guide-platforms a { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 14px; }
  .guide-platforms span { margin: 0; }
  .guide-phone-layout, .guide-other-grid { grid-template-columns: 1fr; gap: 8px; }
  .guide-phone { max-width: 240px; justify-self: center; }
  .guide-prepare { padding: 16px; }
  .guide-steps > li { padding-left: 38px; }
}

/* Full-page generated artwork with a quiet center for authentication. */
body.connection-auth-page { background:#eef3f9; isolation:isolate; }
body.connection-auth-page::before { content:""; position:fixed; inset:0; z-index:-1; pointer-events:none; background:url('/static/auth-background-v1.png') center / cover no-repeat; }
.connection-auth-page > main { min-height:100svh; display:flex; align-items:center; justify-content:center; padding:40px 0; box-sizing:border-box; }
.connection-auth-page .home-wrap { margin:0 auto; padding-bottom:0; }
.connection-auth-page .auth-card { background:rgba(255,255,255,.92); border:1px solid rgba(255,255,255,.95); box-shadow:0 24px 80px rgba(45,79,124,.14); backdrop-filter:none; }
@media (max-width:600px) {
  .connection-auth-page > main { padding:24px 0; }
  .connection-auth-page .auth-card { padding:28px 24px; }
}

/* One workspace page at a time; preserve hidden controls and modal state. */
.user-workspace [data-workspace-page][hidden], .user-guide [hidden] { display: none !important; }
.workspace-heading { margin: 28px 0 22px; }
.workspace-heading h2 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.03em; }
.workspace-heading > a { font-size: 13px; }
.user-sidebar nav a[aria-current="page"], .panel-nav-links a[aria-current="page"], .guide-platforms a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.user-guide .guide-platforms { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.user-workspace [data-workspace-page="guide"] > .user-guide { margin-top: 24px; }
@media (max-width: 700px) { .user-guide .guide-platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); } .user-guide .guide-platforms a { display: block; } .user-guide .guide-platforms span { margin-top: 6px; } }

/* Keep navigation anchored independently of the current page height. */
html:has(.user-layout) { scrollbar-gutter: stable; }
.user-layout .user-sidebar { position: fixed; top: 20px; bottom: 20px; left: max(24px, calc((100% - 1440px) / 2 + 32px)); width: 220px; max-height: none; padding: 16px 10px; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.user-layout .user-workspace { grid-column: 2; }
.user-sidebar-brand { margin-bottom: 10px; }
.user-sidebar nav a { min-height: 44px; color: var(--text-strong); }
.user-sidebar .user-nav-caption { padding-top: 12px; }
.user-sidebar .user-sidebar-note { margin-top: 16px; }
.user-menu-toggle, .user-menu-close, .user-menu-backdrop { display: none; }
@media (max-width: 1100px) {
  .user-menu-toggle, .user-menu-close { display: inline-flex; flex-shrink: 0; }
  .user-menu-close { margin: 0 0 16px; }
  .user-layout .user-sidebar { display: none; left: 12px; top: 12px; bottom: 12px; width: min(290px, calc(100vw - 32px)); z-index: 101; }
  .user-layout .user-sidebar.is-open { display: block; }
  .user-menu-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 100; border: 0; border-radius: 0; background: rgba(15,23,42,.4); cursor: pointer; }
  body.user-menu-open { overflow: hidden; }
  .user-layout .user-panel-nav { align-items: center; }
}

/* UI refresh: original CSS inspired by React Bits Aurora, Aceternity Bento
   Grid and Uiverse button treatments. See docs/ui-design-sources.md. */
body.landing-page::before {
  background: radial-gradient(ellipse at 78% 20%, #dbeafe 0, transparent 48%),
    radial-gradient(ellipse at 12% 62%, #e7e9ff 0, transparent 45%), #f7f9fc;
}
.landing-page > main { display: block; padding: 0; }
.landing-wrap { width: min(1200px, 100%); margin: auto; padding: 0 40px; }
.landing-nav { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #dfe5ef; }
.landing-brand { display: flex; align-items: center; gap: 12px; color: #192940; font-size: 20px; font-weight: 720; letter-spacing: -.04em; }
.landing-brand .app-logo { width: 36px; height: 36px; border-radius: 11px; font-size: 21px; }
.landing-tag { padding-left: 16px; border-left: 1px solid #ccd5e3; font-size: 12px; letter-spacing: .02em; color: #64748b; font-weight: 400; }
.landing-admin { display: inline-flex; align-items: center; gap: 8px; color: #485871; font-size: 13px; padding: 10px 0; }
.landing-hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 24px; padding: 82px 0 72px; }
.landing-eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .18em; color: #526b94; margin: 0 0 24px; }
.landing-copy h1 { font-size: clamp(44px, 5.4vw, 68px); line-height: 1.2; font-weight: 730; letter-spacing: -.06em; color: #172b48; margin: 0; }
.landing-copy h1 span { color: #346fd0; }
.landing-description { font-size: 16px; line-height: 1.9; color: #586982; margin: 24px 0 30px; }
.landing-cta { min-height: 50px; min-width: 170px; justify-content: space-between; gap: 28px; border-radius: 13px; background: linear-gradient(115deg, #246bd5, #345bc7); box-shadow: 0 8px 20px #2765cc28; }
.landing-hint { font-size: 12px; color: #65748a; margin: 15px 0 0; }
.landing-visual { position: relative; min-width: 0; min-height: 360px; display: grid; place-items: center; isolation: isolate; }
.landing-visual img { width: 100%; height: auto; border-radius: 50%; mix-blend-mode: multiply; }
.landing-orbit { position: absolute; width: 92%; aspect-ratio: 1; border: 1px solid #779bce26; border-radius: 50%; z-index: -1; }
.orbit-two { width: 72%; border-style: dashed; transform: rotate(-18deg); }
.landing-chip { position: absolute; display: flex; align-items: center; gap: 10px; padding: 13px 17px; background: #fffffff2; border: 1px solid #e5ebf5; border-radius: 14px; box-shadow: 0 14px 40px #3e5e8a12; font-size: 12px; color: #385278; }
.landing-chip svg { color: #3473d2; }
.chip-top { top: 12px; right: 3%; }
.chip-bottom { bottom: 8px; left: 0; }
.landing-bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.landing-feature { position: relative; padding: 26px; min-width: 0; border: 1px solid #e0e7f2; border-radius: 20px; background: linear-gradient(145deg, #ffffffed, #f5f8ffee); transition: border-color 180ms, box-shadow 180ms; }
.feature-icon { display: grid; place-items: center; width: 40px; height: 40px; background: #eaf1ff; color: #3369bb; border: 1px solid #dce7fb; border-radius: 12px; margin-bottom: 24px; }
.landing-feature h2 { margin: 0 0 9px; color: #213654; font-size: 17px; font-weight: 650; }
.landing-feature p { margin: 0; color: #5d6e84; font-size: 13px; line-height: 1.8; }
.feature-index { position: absolute; right: 24px; top: 28px; color: #70829a; font: 11px var(--font-mono); }
.landing-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 38px; padding: 24px 0; border-top: 1px solid #dfe5ef; color: #64748b; font-size: 11px; letter-spacing: .05em; }
.connection-auth-page .login-card { border-top: 3px solid #7c9ee7; box-shadow: 0 24px 80px #2d4f7c1c; }
.connection-auth-page .login-card input:focus { border-color: #4e7ed3; box-shadow: 0 0 0 4px #4e7ed31a; }
.user-workspace .panel-overview { background: radial-gradient(ellipse at right top, #eaf2ff, transparent 65%), #fff; border-color: #dae5f5; }
.has-shell .hero-stats > .card.stat { border-color: #dfe7f2; background: linear-gradient(145deg, #fff, #f4f8ff); }
.user-workspace .profile-link.selected { background: #edf4ff; border-color: #7298d6; box-shadow: 0 3px 12px #346fd010; }
.landing-page a:focus-visible { outline: 3px solid #225cc0; outline-offset: 5px; }
@media (hover: hover) and (pointer: fine) {
  .landing-feature:hover { border-color: #a5bfe7; box-shadow: 0 10px 30px #42669912; }
  .landing-cta:hover { background: linear-gradient(115deg, #205cb6, #294caa); box-shadow: 0 12px 25px #2765cc35; }
  .landing-cta svg { transition: transform 180ms ease; }
  .landing-cta:hover svg { transform: translate(2px, -2px); }
}
@media (prefers-reduced-motion: no-preference) {
  .landing-copy, .landing-bento { animation: landing-arrive 260ms ease both; }
  .landing-bento { animation-delay: 100ms; }
  .landing-chip { animation: landing-arrive 300ms ease both; }
}
@keyframes landing-arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
  .landing-wrap { padding: 0 22px; }
  .landing-nav { min-height: 80px; }
  .landing-tag { display: none; }
  .landing-hero { grid-template-columns: 1fr; gap: 30px; padding: 48px 0 36px; }
  .landing-copy h1 { font-size: clamp(42px, 9vw, 62px); }
  .landing-visual { min-height: 250px; width: min(430px, 100%); margin: 0 auto; }
  .landing-visual img { max-height: 300px; object-fit: contain; }
  .landing-orbit { width: 75%; }
  .orbit-two { width: 58%; }
  .landing-chip { padding: 10px 12px; font-size: 11px; }
  .landing-bento { grid-template-columns: 1fr; gap: 12px; }
  .landing-feature { display: flex; gap: 16px; padding: 22px; }
  .feature-icon { flex-shrink: 0; margin: 0; }
  .feature-index { display: none; }
  .landing-footer { flex-wrap: wrap; margin-top: 24px; }
}

/* Shared console finish: navigation, data surfaces and operational forms. */
body.has-shell {
  --bg: #f4f6fa;
  --surface-2: #f4f7fc;
  --hairline: #e3e9f2;
  --line: #dce4ef;
  --text-strong: #14263f;
  --text-muted: #52617b;
  --text-faint: #63748a;
  --shadow-sm: 0 4px 18px rgba(40, 66, 105, .035);
}
.has-shell .sidebar { background: #fff; border-right-color: #e2e8f0; scrollbar-width: thin; overscroll-behavior: contain; }
.has-shell .sidebar-brand { padding-bottom: 18px; }
.has-shell .sidebar-brand .logo { background: linear-gradient(145deg, #367ee6, #3156b4); border-color: #ffffff70; box-shadow: 0 5px 13px #305ec82b; }
.has-shell .sidebar-brand-copy small { color: #617799; letter-spacing: .1em; }
.has-shell .sidebar-section { color: #6a7890; font-size: 10px; padding: 16px 12px 6px; letter-spacing: .08em; }
.has-shell .sidebar-link { min-height: 42px; padding: 9px 12px; font-size: 13px; font-weight: 500; }
.has-shell .sidebar-link:hover { color: #285ea8; background: #edf3fd; }
.has-shell .sidebar-link.active { background: #ecf2ff; color: #2555bd; border-color: transparent; box-shadow: none; font-weight: 650; }
.has-shell .sidebar-link.active::before { content: none; }
.has-shell .sidebar-art { border: 1px solid #e0e8f4; border-radius: 14px; opacity: .85; }
.has-shell .topbar { background: rgba(255,255,255,.96); border-bottom-color: #e2e8f0; backdrop-filter: none; }
.has-shell .page-title { font-size: 24px; letter-spacing: -.035em; }
.has-shell .page-title small { margin-top: 6px; font-size: 12px; }
.has-shell .content { padding-top: 28px; max-width: 1600px; margin-inline: auto; }
.has-shell .content > .card, .has-shell .content > .grid > .card:not(.health-bad):not(.health-ok) { border-color: #e0e7f1; }
.has-shell .hero-stats > .card.stat { min-height: 136px; padding: 24px; background: #fff; }
.has-shell .hero-stats > .card.stat:first-child { background: #edf3ff; border-color: #d5e2fc; }
.has-shell .stat .v { color: #233e63; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.has-shell .card-head { border-bottom-color: #e3eaf4; }
.has-shell .users-card { border-color: #dbe5f3; box-shadow: 0 8px 32px #2c4b7308; }
.has-shell .users-list-heading { padding-top: 28px; padding-bottom: 22px; }
.has-shell .account-group-filter { min-height: 58px; background: #f7f9fc; border-color: #e3e9f2; border-radius: 12px; }
.has-shell .account-group-filter.active { color: #245dab; background: #eaf2ff; border-color: #83a7dc; box-shadow: inset 0 0 0 1px #83a7dc25; }
.has-shell .account-group-filter.active span { color: #245dab; }
.has-shell .users-card > .card-head { background: #f8faff; }
.has-shell .filter-chips .chip { min-height: 36px; background: #fff; border-color: #dbe4f1; }
.has-shell .filter-chips .chip.active { background: #2c65bb; border-color: #2c65bb; box-shadow: 0 3px 8px #3165b51a; }
.has-shell .table thead th { background: #f3f7fd; color: #516781; font-size: 11px; letter-spacing: .035em; }
.has-shell .table tbody td { color: #3b506a; }
.has-shell .user-group-heading th { background: #f5f8fd; border-top-color: #dce6f3; }
.has-shell .user-group-title { color: #304b71; }
.has-shell .table tbody tr:hover { background: #f5f9ff; }
.has-shell .btn:not(.secondary):not(.ghost):not(.danger-btn):not(.copied) { background: #3265d2; border-color: #3265d2; color: #fff; box-shadow: 0 3px 8px #24468114; }
.has-shell .btn.secondary { background: #fff; border-color: #d6e1f0; color: #3b5577; }
.has-shell .btn.secondary:hover { background: #edf4ff; border-color: #a6bee2; }
.has-shell .btn.ghost { color: #355b90; }
.has-shell .inline-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.has-shell .inline-form select, .has-shell .inline-form textarea,
.has-shell .user-filter-input, .has-shell .cycle-config-form input { background: #f8faff; border-color: #cad7e8; min-height: 42px; }
.has-shell .inline-form input:focus, .has-shell .inline-form select:focus,
.has-shell .inline-form textarea:focus, .has-shell .user-filter-input:focus,
.has-shell .cycle-config-form input:focus { background: #fff; border-color: #5682c7; box-shadow: 0 0 0 3px #5682c71c; }
.has-shell .inline-form input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-glow); }
.has-shell .inline-form label { font-size: 12px; letter-spacing: 0; }
.has-shell .field-help { line-height: 1.7; }
.has-shell .create-account-choice { border-radius: 14px; background: #fafcff; }
.has-shell .create-account-choice:has(input:checked) { background: #edf4ff; border-color: #6893d1; }
.has-shell .create-account-summary { background: #edf3fd; color: #456184; padding: 16px; }
.has-shell .edit-dialog { border-color: #d5e1f1; border-radius: 22px; box-shadow: 0 30px 100px #18396130; }
.has-shell .dialog-head { padding-bottom: 18px; border-bottom: 1px solid #e2eaf5; margin-bottom: 20px; }
.has-shell .dialog-actions { background: #f7faff; border-top-color: #dfe8f4; }
.has-shell details > summary { border-radius: 10px; }
.has-shell details > summary:focus-visible { outline: 3px solid #447ac7; outline-offset: 4px; }
.has-shell .chart-panel { border-color: #dfe7f3; }
.user-layout { --text-strong: #14263f; --text-muted: #52617b; --line: #dce4ef; }
.user-layout .user-sidebar { background: #fff; border: 1px solid #e1e8f3; border-radius: 20px; box-shadow: 0 8px 30px #23395d05; }
.user-layout .user-sidebar-brand { margin-top: 6px; }
.user-layout .user-sidebar nav a { min-height: 44px; }
.user-layout .user-sidebar nav a[aria-current="page"] { background: #ecf2ff; color: #2555bd; font-weight: 600; }
.user-layout .user-panel-nav { border-color: #dfe7f3; box-shadow: 0 5px 20px #34547b06; }
.user-layout .panel-disclosure, .user-layout .import-assistant,
.user-layout .user-guide, .user-layout .purchase-plan { border-color: #dfe7f3; box-shadow: 0 5px 22px #34547b06; }
.user-layout .guide-platforms a { background: #f9fbff; border-color: #dce6f4; }
.user-layout .guide-platforms a:hover { background: #edf4ff; border-color: #94b2dc; }
@media (max-width: 880px) {
  .has-shell .sidebar { background: #f8fbff; }
  .has-shell .content { padding-top: 20px; }
  .has-shell .sidebar-toggle { background: #eef4ff; border-color: #d4e1f4; color: #3264a8; }
}
@media (max-width: 720px) {
  .has-shell .page-title { font-size: 20px; }
  .has-shell .hero-stats > .card.stat { min-height: 120px; padding: 18px; }
  .has-shell .users-table tbody tr[data-user] { border-color: #dce6f4; box-shadow: 0 4px 15px #34547b06; }
  .has-shell .account-group-filter { min-height: 60px; padding: 12px; }
  .has-shell .btn.btn-sm { min-height: 40px; }
  .has-shell .edit-dialog { border-radius: 18px; }
  .has-shell .dialog-head { flex-wrap: wrap; gap: 12px; }
  .has-shell .cycle-config-form { row-gap: 8px; }
}

/* User center: task shortcuts, a calm overview and clearer import steps. */
.user-layout { gap: 28px; padding-top: 28px; }
.user-layout .user-workspace { --text-faint: #63758e; --surface-2: #f3f7fd; }
.user-layout .user-sidebar-brand .app-logo,
.user-workspace .user-panel-nav .app-logo { background: linear-gradient(145deg, #4083e2, #3156b4); box-shadow: 0 4px 12px #3156b424; }
.user-workspace .user-panel-nav { background: #fcfdfff2; border-radius: 18px; padding: 16px 20px; }
.user-workspace .panel-nav-links a { border-radius: 10px; }
.user-workspace .panel-nav-links a[aria-current="page"] { color: #245ba8; background: #eaf2ff; font-weight: 650; }
.user-workspace .panel-intro { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: center; gap: 12px 24px; margin: 24px 0 20px; padding: 30px; background: radial-gradient(ellipse at right top, #e0edff, transparent 72%), #f9fbff; border: 1px solid #dce7f6; border-radius: 24px; overflow: hidden; }
.user-workspace .panel-intro h2 { font-size: clamp(28px, 3.2vw, 38px); color: #213e66; }
.user-workspace .panel-eyebrow { color: #5277a9; font-size: 11px; letter-spacing: .14em; }
.user-workspace .panel-intro .panel-art { grid-column: 2; grid-row: 1 / 3; width: 190px; height: 142px; border-radius: 18px; mix-blend-mode: multiply; margin: 0; }
.user-workspace .panel-refresh-control { justify-content: flex-start; gap: 12px; }
.user-quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.user-quick-actions.has-usage-detail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.user-quick-actions a { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 20px 16px; background: #fff; border: 1px solid #dfe7f4; border-radius: 16px; color: #25436c; transition: background 180ms, border-color 180ms; }
.user-quick-actions a:hover { background: #f4f8ff; border-color: #91b0de; }
.user-action-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: #eaf2ff; border-radius: 11px; color: #346bc1; }
.user-quick-actions strong { display: block; font-size: 14px; font-weight: 650; }
.user-quick-actions small { display: block; color: #627690; font-size: 11px; margin-top: 5px; line-height: 1.6; }
.user-action-arrow { margin-left: auto; color: #587aa8; }
.user-workspace .panel-overview { padding: 26px; background: #fff; border-radius: 22px; }
.user-workspace .panel-overview .hero-stats { gap: 12px; }
.user-workspace .panel-overview .card.stat { padding: 18px; min-height: 112px; border: 1px solid #e5ecf5; background: #f7faff; border-radius: 16px; }
.user-workspace .panel-overview .card.stat:nth-child(3) { background: #eaf3ff; border-color: #d1e1f7; }
.user-workspace .panel-overview .stat .k { color: #536c8b; font-size: 12px; }
.user-workspace .panel-overview .stat .v { color: #234b80; font-size: clamp(23px, 2.7vw, 31px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.user-workspace .panel-overview .bar { height: 10px; background: #eaf0f8; }
.user-workspace .panel-overview > .card { margin-top: 22px; padding-top: 24px; }
.user-workspace .panel-overview [data-role="txrx"] + .small { padding: 12px 14px; background: #f5f8fd; border-radius: 10px; line-height: 1.8; }
.user-workspace .panel-overview > .card > .row:last-child { gap: 14px; flex-wrap: wrap; }
.user-workspace .workspace-heading { margin: 26px 0 24px; padding: 0 4px; }
.user-workspace .workspace-heading h2 { color: #234268; font-size: 30px; }
.user-workspace .import-assistant { padding: 28px; border-radius: 22px; border-color: #dae6f5; }
.user-workspace .profile-links { gap: 12px; }
.user-workspace .profile-link { padding: 18px 14px; min-height: 100px; background: #f9fbff; border-color: #dce7f5; border-radius: 14px; }
.user-workspace .profile-link small { font-size: 12px; line-height: 1.7; }
.user-workspace .profile-link.selected { background: #eaf2ff; border-color: #779ed5; box-shadow: inset 0 0 0 1px #779ed52b; color: #234e87; }
.user-workspace .import-selected { margin-top: 24px; padding: 22px; border: 1px solid #dce7f5; background: #f2f7ff; border-radius: 16px; }
.user-workspace #profile-selected-title { font-size: 19px; margin: 6px 0; color: #284d7e; }
.user-workspace #profile-copy { min-height: 46px; background: linear-gradient(115deg, #2e73d7, #345bb9); border-color: #3267c2; box-shadow: 0 4px 12px #3267c21c; }
.user-workspace .profile-qr-panel { margin-top: 18px; padding: 18px; background: #fafcff; border: 1px solid #e0e9f6; border-radius: 16px; }
.user-workspace .panel-disclosure { padding: 24px; background: #fbfdff; }
.user-workspace .panel-account { padding: 30px; border-color: #dce7f5; border-radius: 22px; background: radial-gradient(ellipse at top right, #edf4ff, transparent 65%), #fff; }
.user-workspace .panel-account .panel-section-heading { align-items: flex-start; gap: 20px; }
.user-workspace .panel-account .section-title { font-size: 24px; }
.user-workspace .user-guide { padding: 30px; border-radius: 22px; }
.user-workspace .guide-prepare { background: #edf4ff; border: 1px solid #d9e7fa; }
.user-workspace .guide-platforms a { min-height: 92px; padding: 20px 16px; border-radius: 15px; font-weight: 650; }
.user-workspace .guide-platforms span { font-weight: 400; line-height: 1.7; }
.usage-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 18px; }
.usage-detail-toolbar .poll-status { min-height: 32px; }
.usage-detail-stats { gap: 12px; }
.usage-detail-stats .card.stat { min-width: 0; padding: 20px; border: 1px solid #e5ecf5; background: #f7faff; border-radius: 16px; }
.usage-detail-stats .card.stat:nth-child(2) { background: #edf5ff; border-color: #d6e5f8; }
.usage-detail-stats .v { color: #234b80; font-size: clamp(23px, 2.7vw, 31px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.usage-detail-stats .small { margin-top: 8px; line-height: 1.7; }
.usage-detail-chart-card, .usage-detail-table-card { padding: 24px; border-color: #dce7f5; border-radius: 20px; background: #fff; }
.usage-detail-chart { margin-top: 18px; padding-bottom: 4px; }
.usage-detail-chart .hourly-bars { min-width: 680px; }
.usage-detail-table { min-width: 520px; }
.usage-detail-table th, .usage-detail-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-detail-table th:not(:first-child), .usage-detail-table td:not(:first-child) { text-align: right; }
.usage-detail-table tbody tr:hover { background: var(--surface-2); }
.usage-detail-table tbody th { color: var(--text-strong); font-weight: 550; }
.usage-detail-error { margin-top: 14px; }
.usage-detail-error[hidden] { display: none; }
#usage .workspace-heading { margin: 14px 0 12px; }
#usage .workspace-heading h2 { font-size: 22px; margin: 0; }
#usage .workspace-heading p { margin: 4px 0 0; }
#usage .usage-detail-toolbar { margin: 0 0 10px; flex-direction: row; align-items: center; flex-wrap: wrap; }
#usage .usage-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; width: 100%; gap: 12px; align-items: center; }
.filter-toolbar .user-filter-input { width: 100%; max-width: none; }
.filter-toolbar .filter-chips { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
.filter-toolbar .user-sort-control { grid-column: 2; grid-row: 1; }
.filter-toolbar #filter-count { grid-column: 3; grid-row: 1; }
.user-sort-control { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.user-sort-control select { width: auto; min-width: 130px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); }
.message-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.message-filters label { display: flex; flex-direction: column; min-width: 0; gap: 6px; color: var(--text-muted); font-size: 12px; }
.message-filters input, .message-filters select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.message-filters input:focus-visible, .message-filters select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.business-record > .badge { margin-right: 10px; }
@media (max-width: 600px) {
  .message-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .message-filters > label:first-child { grid-column: 1 / -1; }
}
#usage .usage-detail-stats { gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#usage .usage-detail-stats .card.stat { padding: 12px 14px; min-height: 0; border-radius: 12px; }
#usage .usage-detail-stats .v { font-size: 23px; line-height: 1.35; }
#usage .usage-detail-stats .small { font-size: 11px; margin-top: 4px; }
#usage .usage-detail-chart-card, #usage .usage-detail-table-card { padding: 14px 18px; border-radius: 12px; margin-top: 12px; }
#usage .panel-section-heading { gap: 8px; margin: 0; }
#usage .section-title { font-size: 13px; }
#usage .panel-section-heading .small { font-size: 11px; margin: 4px 0 0; }
#usage .usage-detail-chart { margin-top: 8px; }
.usage-hour-grid-scroll { margin-top: 10px; }
.usage-hour-grid { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 10px; font-variant-numeric: tabular-nums; }
.usage-hour-grid th, .usage-hour-grid td { padding: 8px 4px; text-align: center; white-space: nowrap; border: 2px solid white; }
.usage-hour-grid th { color: var(--text-muted); background: var(--surface-2); font-weight: 550; }
.usage-hour-grid th:first-child { position: sticky; left: 0; z-index: 1; min-width: 86px; }
.usage-hour-grid .usage-hour-empty { color: var(--text-faint); background: var(--surface-2); }
.usage-direction-details { margin-top: 12px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.usage-direction-details > summary { cursor: pointer; font-size: 12px; }
.usage-direction-details > .scroll-x { max-height: 360px; overflow-y: auto; }
#usage .usage-detail-table { font-size: 11px; }
#usage .usage-detail-table th, #usage .usage-detail-table td { padding: 6px 10px; }
#usage .usage-detail-table thead { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
@media (max-width: 760px) {
  #usage .usage-detail-stats .card.stat { padding: 10px 8px; }
  #usage .usage-detail-stats .v { font-size: 18px; }
  #usage .usage-detail-chart-card, #usage .usage-detail-table-card { padding: 12px; }
}
.purchase-plans .purchase-plan { border-color: #dce7f5; border-radius: 22px; background: radial-gradient(ellipse at top right, #eef5ff, transparent 65%), #fff; }
.purchase-plan .purchase-price { color: #285aa1; }
.purchase-kind-nav .btn { min-height: 44px; border-radius: 12px; }
.purchase-kind-nav [aria-current="page"] { background: #eaf2ff; color: #295ea9; border-color: #8cabd8; }
.purchase-steps { padding: 18px 22px; background: #edf4ff; border: 1px solid #dce7f5; border-radius: 14px; color: #456487; }
.user-quick-actions a:focus-visible { outline: 3px solid #3471c6; outline-offset: 4px; }
@media (max-width: 760px) {
  .user-layout { gap: 0; padding-top: 14px; }
  .user-workspace .user-panel-nav { padding: 12px; }
  .user-workspace .panel-intro { grid-template-columns: minmax(0, 1fr) 86px; padding: 22px 18px; gap: 14px 10px; border-radius: 20px; }
  .user-workspace .panel-intro h2 { font-size: 27px; line-height: 1.35; }
  .user-workspace .panel-intro .panel-art { grid-row: 1; width: 86px; height: 100px; order: initial; }
  .user-workspace .panel-refresh-control { grid-column: 1 / -1; }
  .user-quick-actions, .user-quick-actions.has-usage-detail { grid-template-columns: 1fr; gap: 9px; margin-bottom: 18px; }
  .user-quick-actions a { padding: 14px 16px; border-radius: 14px; }
  .user-quick-actions small { margin-top: 3px; }
  .user-workspace .panel-overview { padding: 16px; }
  .user-workspace .panel-overview .hero-stats { gap: 10px; }
  .user-workspace .panel-overview .card.stat { padding: 14px 12px; min-height: 100px; }
  .user-workspace .panel-overview .stat .v { font-size: 24px; }
  .user-workspace .import-assistant, .user-workspace .panel-account, .user-workspace .user-guide { padding: 20px 16px; }
  .user-workspace .profile-link { padding: 14px; min-height: 96px; }
  .user-workspace .import-selected { padding: 16px; }
  .user-workspace .panel-disclosure { padding: 20px 16px; }
  .user-workspace .guide-platforms a { padding: 16px 12px; min-height: 92px; }
  .user-workspace .workspace-heading h2 { font-size: 26px; }
  .usage-detail-toolbar { align-items: flex-start; flex-direction: column; margin-right: 0; margin-left: 0; }
  .usage-detail-chart-card, .usage-detail-table-card { padding: 20px 16px; }
}

/* Session-authenticated user tools share the panel's readable mobile spacing. */
.user-aux-wrap { max-width: 960px; }
.disconnect-form { display: grid; gap: 16px; }
.disconnect-form label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.disconnect-form input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
.disconnect-form .btn { justify-self: start; max-width: 100%; white-space: normal; }
.export-options { list-style: none; padding: 0; margin: 16px 0 0; }
.export-option { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.export-option > div { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.export-option p { margin: 6px 0 0; }
.export-command { white-space: pre-wrap; overflow-wrap: anywhere; }
.user-aux-header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 24px; }
.user-aux-header h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); }
.user-aux-page .card { margin-bottom: 16px; }
.user-aux-page h1, .user-aux-page h2, .user-aux-page p,
.user-aux-page small, .user-aux-page summary { overflow-wrap: anywhere; }
.user-aux-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.user-aux-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; }
.session-list { list-style: none; padding: 0; margin: 0; }
.session-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.session-row:last-child { border-bottom: 0; }
.session-details { min-width: 0; overflow-wrap: anywhere; }
.session-details small { display: block; margin-top: 6px; }
.user-account-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.user-account-tools .btn { white-space: normal; text-align: center; }
.user-workspace .btn, .user-aux-page .btn { min-height: 44px; }
.user-workspace .scroll-x, .user-aux-page .scroll-x { min-width: 0; }
.user-quick-actions a > span:not(.user-action-icon):not(.user-action-arrow) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .user-aux-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .user-aux-page .card { padding: 20px 16px; }
  .session-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .user-account-tools { grid-template-columns: 1fr; }
}

/* Administrative support pages use the same compact controls as the console. */
.business-page .card { margin-bottom: 16px; }
.business-page h2, .business-page h3, .business-page p, .business-page small,
.diagnostics-page p, .verification-page p { overflow-wrap: anywhere; }
.business-record p { white-space: pre-wrap; }
.business-record > .inline-form { margin-top: 12px; }
.business-order { padding: 18px 0; border-bottom: 1px solid var(--line); }
.business-order:last-child { padding-bottom: 0; border-bottom: 0; }
.business-order h3 { margin: 0; font-size: 14px; }
.business-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); align-items: end; gap: 12px; margin-top: 16px; }
.business-form label { min-width: 0; margin: 0; }
.business-form .btn { justify-self: start; }
.reminder-form select { min-height: 44px; }
#reminder-settings summary { min-height: 44px; }
.stacked-form { display: grid; gap: 12px; max-width: 620px; }
.stacked-form label { min-width: 0; margin: 0; }
.stacked-form label > input, .stacked-form label > select, .stacked-form label > textarea,
.business-form label > input { margin-top: 6px; min-width: 0; }
.stacked-form .btn { justify-self: start; }
.stacked-form textarea, .has-shell .inline-form.stacked-form textarea { min-height: 140px; resize: vertical; }
.verification-details { display: grid; grid-template-columns: minmax(100px, 170px) minmax(0, 1fr); gap: 8px 18px; margin: 18px 0 0; font-size: 12px; }
.verification-details dt { color: var(--text-muted); }
.verification-details dd { margin: 0; overflow-wrap: anywhere; }
.totp-qr svg { display: block; max-width: 100%; height: auto; }
.purchase-workspace .panel-intro { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 720px) {
  .filter-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .filter-toolbar .user-filter-input { grid-column: 1 / -1; grid-row: 1; }
  .filter-toolbar .user-sort-control { grid-column: 1; grid-row: 2; }
  .filter-toolbar #filter-count { grid-column: 2; grid-row: 2; }
  .filter-toolbar .filter-chips { grid-row: 3; }
  .has-shell .filter-chips .chip { min-height: 40px; }
  .password-toggle { min-height: 44px; inset-block: 0; font-size: 14px; }
  .has-shell .btn, .has-shell .btn.btn-sm, .has-shell .sidebar-toggle, .has-shell .sidebar-close,
  .has-shell .sidebar-link { min-height: 44px; }
  .has-shell .inline-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .has-shell .inline-form select, .has-shell .inline-form textarea { min-height: 44px; }
  .business-form { grid-template-columns: 1fr; }
  .business-form .btn, .stacked-form .btn { justify-self: stretch; }
  .verification-details { grid-template-columns: minmax(80px, 100px) minmax(0, 1fr); gap: 8px 12px; }
  .sidebar { height: 100dvh; }
  .sidebar-brand, .sidebar-footer { flex-shrink: 0; }
  .sidebar-nav { flex-shrink: 0; }
  body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  body .inline-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  body select, body textarea, body .code-area,
  body .inline-form select, body .inline-form textarea,
  .has-shell .inline-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .has-shell .inline-form select, .has-shell .inline-form textarea,
  .has-shell .user-filter-input, .has-shell .cycle-config-form input { font-size: 16px; }
  #health-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #health-live-grid .card.stat { min-height: 100px; gap: 5px; padding: 14px 12px; overflow-wrap: anywhere; }
  #health-live-grid .k { margin: 0; letter-spacing: 0; }
  #health-live-grid .v { font-size: 16px; line-height: 1.35; }
  .has-shell .poll-status-button, .has-shell .filter-chips .chip,
  .codex-range-switch button { min-height: 44px; }
}
.support-page { min-width: 0; }
.support-page .section-title { overflow-wrap: anywhere; }
.support-form, .support-form label, .support-search label { display: grid; gap: 8px; min-width: 0; }
.support-form { gap: 16px; }
.support-form input, .support-form textarea, .support-form select, .support-search input { width: 100%; min-width: 0; box-sizing: border-box; }
.support-page input:not([type="hidden"]), .support-page textarea, .support-page select { padding: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; }
.support-form textarea, .support-page textarea[readonly] { resize: vertical; min-height: 120px; width: 100%; box-sizing: border-box; }
.support-form .btn { justify-self: start; }
.support-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.support-filters .btn, .support-page button, .support-page input, .support-page select { min-height: 44px; }
.support-search { display: flex; align-items: end; gap: 12px; }
.support-search label { flex: 1; }
.support-list, .support-events { list-style: none; margin: 12px 0 0; padding: 0; }
.support-list li + li { border-top: 1px solid var(--line); }
.support-list a { display: grid; gap: 6px; padding: 16px 0; overflow-wrap: anywhere; }
.support-list span, .support-event-meta { font-size: 13px; color: var(--text-muted); }
.support-event { padding: 14px; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; }
.support-event-admin { background: var(--surface-2, #f3f5f8); }
.support-event-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.support-event p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
.diagnostic-freshness { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 540px) {
  .support-search { align-items: stretch; flex-direction: column; }
  .support-form .btn { justify-self: stretch; }
  .support-filters .btn { flex: 1 1 auto; }
}
.sidebar-nav .sidebar-link { scroll-margin-block: 12px; }
/* Sensitive-operation verification keeps the original form in place. */
.sensitive-dialog {
  box-sizing: border-box;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 1px solid var(--border, #dce2eb);
  border-radius: 18px;
  color: var(--text, #172033);
  background: var(--surface, #fff);
  box-shadow: 0 24px 80px rgba(24, 38, 60, .2);
  overflow: auto;
}
.sensitive-dialog::backdrop { background: rgba(24, 38, 60, .35); }
.sensitive-dialog p { overflow-wrap: anywhere; }
.sensitive-dialog input { box-sizing: border-box; width: 100%; min-width: 0; }
.sensitive-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sensitive-actions .btn { flex: 1; min-height: 44px; }

/* Purchase catalog and the prominent user-panel purchase entry. */
.purchase-workspace{max-width:1160px}
.purchase-kind-nav{display:flex;gap:8px;flex-wrap:wrap;background:#eaf0f7;padding:6px;border-radius:16px;width:fit-content;margin:22px 0}
.purchase-kind-nav a{border:0!important;border-radius:12px;padding:11px 22px;color:#526279!important;background:transparent!important;font-weight:700}
.purchase-kind-nav a[aria-current=page]{background:#fff!important;color:#1d4ed8!important;box-shadow:0 2px 8px #10244212}
.purchase-service{padding:26px;border:1px solid #d8e4f3;border-radius:20px;background:linear-gradient(130deg,#f1f6ff,#f8fcfc);margin:16px 0 24px}
.purchase-service h2{font-size:24px;margin:3px 0 9px;color:#17263d}
.purchase-service p{color:#526279;line-height:1.7;margin:0}
.purchase-service-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px;margin-top:22px}
.purchase-service-grid strong{display:block;color:#223552;font-size:15px;margin-bottom:6px}
.purchase-service-grid span{display:block;color:#62728a;font-size:13px;line-height:1.65}
.purchase-service .purchase-service-note{font-size:12px;margin-top:18px;color:#75849a}
.purchase-catalog-group{margin:24px 0 32px}
.purchase-catalog-heading{display:flex;justify-content:space-between;align-items:baseline;gap:16px;margin-bottom:14px}
.purchase-catalog-heading h2{margin:0;font-size:22px}.purchase-catalog-heading p{margin:0;font-size:13px;color:#68798d}
.purchase-plans{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.purchase-plans.addon-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.catalog-plan{display:flex;flex-direction:column;position:relative;padding:24px!important;min-width:0;border:1px solid #dde5ee;border-radius:20px;box-shadow:0 8px 26px #203a5c08}
.catalog-plan.is-recommended{border:2px solid #5888e9;background:linear-gradient(180deg,#f6f9ff,#fff 50%);box-shadow:0 10px 30px #2c67d812}
.purchase-plan-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}
.purchase-plan-heading .panel-eyebrow{margin:0}.purchase-plan-badge{background:#e3edff;color:#245dc5;border-radius:20px;padding:4px 9px;font-size:11px;font-weight:750}
.catalog-plan h3{font-size:23px;line-height:1.3;margin:15px 0 8px}.purchase-plan-description{font-size:13px;color:#65758a;line-height:1.7;min-height:44px;margin:0 0 15px}
.catalog-plan .purchase-price{font-size:36px;line-height:1.2;font-weight:800;letter-spacing:-1px;margin:4px 0;color:#17263d}.catalog-plan .purchase-price span{font-size:12px;font-weight:500;letter-spacing:0;color:#738297;margin-left:8px;white-space:nowrap}
.purchase-grant{display:flex;flex-wrap:wrap;gap:7px;align-items:baseline;margin:8px 0 14px;color:#225ac2}.purchase-grant strong{font-size:20px}.purchase-grant span{font-size:11px;color:#738297}
.purchase-benefits{list-style:none;padding:0;margin:8px 0 18px;display:grid;gap:10px;color:#42536b;font-size:13px;line-height:1.6}.purchase-benefits li{display:flex;gap:8px}.purchase-benefits li span{color:#2b9b7b;font-weight:800;flex-shrink:0}
.purchase-plan-footer{margin-top:auto}.purchase-plan-rule{font-size:11px;line-height:1.8;color:#75849a;margin:0 0 14px}.catalog-plan .btn{min-height:44px;border-radius:12px}.purchase-unavailable{font-size:11px;line-height:1.6;color:#7e6c53;margin:9px 0 0}
.purchase-rules-disclosure{border:1px solid #dfe6ee;border-radius:14px;padding:12px 16px;margin:12px 0;color:#58697d;font-size:13px;line-height:1.7}.purchase-rules-disclosure summary{cursor:pointer;font-weight:700;color:#30435d}.purchase-rules-disclosure p{margin:9px 0}
.panel-purchase-prompt{display:flex;align-items:center;justify-content:space-between;gap:20px;width:100%;padding:22px 24px;border-radius:16px;border:1px solid #bfd3fa;background:linear-gradient(120deg,#edf4ff,#f7faff);box-shadow:0 8px 22px #2866c50b}
.panel-purchase-prompt h3{font-size:20px;color:#193660;margin:0 0 6px}.panel-purchase-prompt p{margin:0;color:#526c90;font-size:13px;line-height:1.7}.panel-purchase-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;flex-shrink:0}.panel-purchase-actions .btn{min-height:46px;padding:12px 24px;background:#245fc4;color:#fff;border-radius:12px;font-weight:750}.panel-purchase-actions a.small{color:#315989}
@media(max-width:960px){.purchase-service-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-plans.addon-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.catalog-plan{padding:20px!important}}
@media(max-width:640px){.purchase-plans,.purchase-plans.addon-grid{grid-template-columns:1fr}.purchase-service{padding:20px}.purchase-service-grid{gap:18px 14px}.purchase-service h2{font-size:21px}.purchase-kind-nav{width:100%;gap:2px}.purchase-kind-nav a{flex:1;text-align:center;padding:10px 6px;font-size:13px}.purchase-catalog-heading{display:block}.purchase-catalog-heading p{margin-top:6px}.panel-purchase-prompt{align-items:stretch;flex-direction:column;padding:19px;gap:14px}.panel-purchase-actions{width:100%}.panel-purchase-actions .btn{flex:1;text-align:center}.purchase-plan-description{min-height:0}}

.user-quick-actions .user-buy-quick{background:#edf4ff;border:1px solid #bcd2f6}.user-quick-actions .user-buy-quick strong{color:#225dc1}.user-quick-actions .user-buy-quick .user-action-icon{background:#dce9ff;color:#225dc1}

.user-quick-actions .user-buy-quick{grid-column:1 / -1}.user-buy-quick .user-action-arrow{margin-left:auto}

.purchase-workspace .panel-intro{min-height:0;padding:18px 24px;margin-bottom:12px}.purchase-workspace .panel-intro h1{font-size:30px;line-height:1.3;margin:5px 0 8px}.purchase-workspace .purchase-steps{padding:12px 16px;margin:12px 0}.purchase-service{padding:18px 22px;margin:12px 0 16px}.purchase-service h2{font-size:20px;margin:2px 0 5px}.purchase-service-tags{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.purchase-service-tags span{font-size:12px;padding:4px 10px;background:#fff;border:1px solid #dce7f5;border-radius:20px;color:#365677}.purchase-service-details summary{cursor:pointer;color:#42658e;font-size:12px;font-weight:650}.purchase-service-details .purchase-service-grid{margin-top:16px}

/* Tool pages (messages, support) framed by the user-centre sidebar. */
.user-aux-layout .user-aux-header { flex-wrap: nowrap; }
@media (max-width: 1100px) {
  .user-aux-layout .user-aux-wrap { max-width: none; }
}

/* Admin dashboard: whole-server traffic, VPN vs other services. */
.server-traffic-card { display: grid; gap: 16px; }
.server-traffic-card h2 { margin-bottom: 4px; }
.server-traffic-periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.server-traffic-period { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); min-width: 0; }
.server-traffic-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--text-muted); }
.server-traffic-total strong { color: var(--text-strong); font-size: 22px; font-variant-numeric: tabular-nums; }
.server-traffic-bar { display: flex; height: 10px; margin: 12px 0 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.server-traffic-bar .vpn, .server-traffic-part.vpn i { background: var(--accent); }
.server-traffic-bar .other, .server-traffic-part.other i { background: #8a97ab; }
.server-traffic-period dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.server-traffic-part dt { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.server-traffic-part i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.server-traffic-part dd { margin: 4px 0 0; display: grid; gap: 2px; }
.server-traffic-part dd strong { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.server-traffic-part dd small { color: var(--text-faint); font-size: 12px; overflow-wrap: anywhere; }
.server-traffic-card > p { margin: 0; }
@media (max-width: 760px) {
  .server-traffic-periods { grid-template-columns: minmax(0, 1fr); }
}
