:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #fff;
  --surface-soft: #f8faff;
  --sidebar: #f0f4f8;
  --line: #e3e8ef;
  --line-strong: #ccd5df;
  --ink: #182633;
  --muted: #73808d;
  --faint: #9aa7b3;
  --blue: #2f6bf2;
  --blue-deep: #1f52d5;
  --blue-soft: #edf3ff;
  --green: #22956c;
  --green-soft: #e9f8f1;
  --orange: #d77b23;
  --orange-soft: #fff3e7;
  --purple: #7e62d8;
  --purple-soft: #f2efff;
  --red: #cf554d;
  --red-soft: #fff0ef;
  --shadow: 0 8px 28px rgba(34, 52, 74, .055);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 0; min-height: 100%; }
body { margin: 0; min-width: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid rgba(47, 107, 242, .35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.titlebar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px 0 26px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-lockup, .titlebar-right, .header-actions, .summary-card-top, .summary-foot, .panel-header, .panel-header-actions, .panel-footer-link, .groups-table-footer, .status-foot, .status-heading, .quick-action, .modal-header, .modal-actions, .breadcrumb, .health-foot { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-symbol { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 8px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0; box-shadow: 0 5px 11px rgba(47,107,242,.23); }
.brand-title { color: #1c2d3e; font-size: 17px; font-weight: 760; letter-spacing: 0; }
.brand-subtitle { margin-top: 2px; color: var(--muted); font-size: 12px; }
.titlebar-right { gap: 16px; color: var(--muted); }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; color: #4d6580; background: #f1f5f9; border: 1px solid #e3e9f0; border-radius: 5px; font-size: 12px; font-weight: 650; }
.demo-dot { width: 6px; height: 6px; border-radius: 50%; background: #6c88a4; }
.demo-badge.live { color: #397460; background: var(--green-soft); border-color: #cde8dc; }
.demo-badge.live .demo-dot { background: var(--green); }
.titlebar-divider { width: 1px; height: 18px; background: var(--line); }
.titlebar-hint { font-size: 12px; }
.titlebar-hint strong { margin-left: 4px; color: #405366; font-weight: 700; }
.window-button { width: 30px; height: 30px; border: 0; border-radius: 5px; color: #8997a4; background: transparent; font-weight: 800; letter-spacing: 0; }
.window-button:hover { background: var(--surface-soft); color: var(--blue); }
.account-menu-wrap { position: relative; }
.account-menu { position: absolute; z-index: 20; top: 35px; right: 0; min-width: 132px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 10px 26px rgba(34,52,74,.14); }
.account-menu[hidden] { display: none; }
.account-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 5px; color: #526779; background: transparent; text-align: left; font-size: 12px; }
.account-menu button:hover { color: var(--blue); background: var(--blue-soft); }

.workspace { display: block; min-height: calc(100vh - 68px); }
.sidebar { display: flex; flex-direction: column; justify-content: space-between; background: var(--sidebar); border-right: 1px solid var(--line); }
.sidebar-top { padding: 24px 14px; }
.add-site-button { width: 100%; height: 39px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--blue); border-radius: 6px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 720; box-shadow: 0 4px 10px rgba(47,107,242,.15); transition: background .15s, transform .15s; }
.add-site-button:hover { background: var(--blue-deep); transform: translateY(-1px); }
.button-icon { font-size: 20px; font-weight: 350; line-height: 1; }
.main-nav { margin-top: 27px; }
.nav-label { padding: 0 12px 9px; color: #9aa8b5; font-size: 11px; letter-spacing: 0; }
.nav-item, .settings-link { width: 100%; height: 39px; display: flex; align-items: center; gap: 11px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: #607080; text-align: left; font-size: 13px; font-weight: 600; }
.nav-item + .nav-item { margin-top: 3px; }
.nav-item:hover, .settings-link:hover { background: rgba(255,255,255,.74); color: var(--blue); }
.nav-item.active { color: var(--blue); background: #e5edff; box-shadow: inset 3px 0 0 var(--blue); }
.nav-icon { width: 17px; color: currentColor; font-size: 18px; line-height: 1; text-align: center; }
.nav-count { margin-left: auto; color: #9aa9b7; font-size: 11px; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-count { color: var(--blue); }
.sidebar-bottom { padding: 0 14px 18px; }
.sidebar-status { padding: 14px 13px 12px; border: 1px solid #dce5ed; border-radius: 7px; background: rgba(255,255,255,.55); }
.status-heading { gap: 7px; color: #316b5e; font-size: 12px; font-weight: 750; }
.status-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #37af80; box-shadow: 0 0 0 3px rgba(55,175,128,.13); }
.status-copy { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.status-progress { height: 4px; margin-top: 12px; overflow: hidden; border-radius: 2px; background: #dce8e6; }
.status-progress span { display: block; width: 74%; height: 100%; border-radius: inherit; background: #45ae87; }
.status-foot { justify-content: space-between; margin-top: 8px; color: var(--faint); font-size: 11px; }
.status-foot strong { color: #557366; font-size: 12px; font-variant-numeric: tabular-nums; }
.settings-link { margin-top: 17px; color: #697987; }
.sidebar-version { margin-top: 21px; color: #a4afba; font-size: 11px; }
.sidebar-version span { margin-left: 5px; color: #8998a6; }

.main-content { max-width: 1536px; width: 100%; margin: 0 auto; padding: 24px 30px 28px; overflow: hidden; }
.header-add-site { min-height: 34px; }
.content-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 19px; }
.breadcrumb { gap: 8px; color: #8a99a6; font-size: 12px; }
.breadcrumb-slash { color: #c4cdd6; }
.breadcrumb strong { color: #526575; font-weight: 650; }
h1, h2, p { margin: 0; }
h1 { margin-top: 9px; color: #1d2d3c; font-size: 22px; line-height: 1.18; letter-spacing: 0; font-weight: 760; }
.header-description { margin-top: 5px; color: var(--muted); font-size: 12px; }
.header-actions { gap: 10px; padding-top: 5px; }
.icon-action { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #7b8b99; font-size: 21px; }
.icon-action:hover { border-color: #b9c9e7; color: var(--blue); background: var(--blue-soft); }
.notification-action i { position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border: 1px solid #fff; border-radius: 50%; background: #ef7169; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #dce7ff; color: #4c6db6; font-size: 12px; font-weight: 780; }

.overview-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.summary-card { min-height: 112px; padding: 13px 14px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.summary-card-top { justify-content: space-between; }
.summary-label { color: #728290; font-size: 12px; font-weight: 650; }
.summary-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 760; }
.summary-icon-green { color: var(--green); background: var(--green-soft); font-size: 13px; }
.summary-icon-purple { color: var(--purple); background: var(--purple-soft); }
.summary-icon-orange { color: var(--orange); background: var(--orange-soft); font-size: 18px; }
.summary-value { display: flex; align-items: baseline; gap: 3px; margin-top: 9px; color: #1e3040; }
.summary-value > span:first-child { color: #5a6c7d; font-size: 13px; font-weight: 650; }
.summary-value strong { font-size: 24px; line-height: 1; letter-spacing: 0; font-weight: 760; font-variant-numeric: tabular-nums; }
.summary-unit { color: #8795a2; font-size: 12px; font-weight: 620; }
.summary-foot { gap: 6px; margin-top: 10px; color: #97a2ad; font-size: 10px; }
.summary-foot .mini-link { margin-left: auto; }
.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: #3e94a4; font-weight: 700; }
.status-text-green { color: var(--green); font-weight: 700; }
.mini-link, .plain-link { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap; }
.mini-link:hover, .plain-link:hover { color: var(--blue-deep); text-decoration: underline; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.19fr) minmax(360px, .81fr); gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.panel-header { justify-content: space-between; padding: 19px 20px 16px; }
.panel-header h2 { color: #253746; font-size: 15px; font-weight: 750; }
.panel-header p { margin-top: 5px; color: #96a2ad; font-size: 11px; }
.panel-action, .ghost-button { min-height: 29px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border-radius: 5px; font-size: 11px; font-weight: 720; }
.panel-action { border: 1px solid #b9ccf9; color: var(--blue); background: var(--blue-soft); }
.panel-action:hover { border-color: var(--blue); background: #e1eaff; }
.panel-action span, .ghost-button span { font-size: 17px; line-height: .5; font-weight: 400; }
.ghost-button { border: 1px solid var(--line); background: #fff; color: #637587; }
.ghost-button:hover { border-color: #b9ccf9; color: var(--blue); background: var(--blue-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.sites-layout, .groups-panel { min-width: 0; }
.sites-panel { min-height: 298px; }
.sites-list { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 0 20px 20px; }
.site-unit { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); align-items: stretch; gap: 20px; padding: 16px; border: 1px solid #e3e8ef; border-radius: 8px; background: #fbfcfe; transition: border-color .18s, box-shadow .18s, background .18s; }
.site-unit.is-low-balance { border-color: #efc3a9; background: #fffaf6; box-shadow: 0 5px 18px rgba(211, 119, 56, .09); }
.site-unit-main { min-width: 0; display: flex; flex-direction: column; }
.site-unit-head, .site-identity, .site-unit-actions, .site-unit-label { display: flex; align-items: center; }
.site-unit-head { justify-content: space-between; gap: 12px; }
.site-identity { gap: 10px; min-width: 0; }
.site-identity-copy { min-width: 0; }
.site-name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.site-low-balance-badge { flex: 0 0 auto; padding: 3px 6px; border-radius: 4px; color: #b7652c; background: #fff0e4; font-size: 10px; font-weight: 750; }
.site-url-line { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 3px; min-width: 0; }
.site-unit-balance { margin-top: 17px; padding: 12px; border-radius: 6px; background: #f1f5ff; }
.site-unit-balance small, .site-unit-label { color: #82909c; font-size: 11px; }
.site-unit-balance strong { display: block; margin-top: 4px; color: #243f58; font-size: 23px; }
.site-unit-groups { min-width: 0; margin-top: 0; padding: 12px; border: 1px solid #e1e7ef; border-radius: 6px; background: #fff; }
.site-unit-label { justify-content: space-between; font-weight: 700; }
.site-group-monitor-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.site-group-monitor { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 7px 9px; border: 1px solid #edf0f4; border-radius: 5px; background: #fbfcfe; }
.site-group-monitor-copy { min-width: 0; }
.site-group-monitor-copy strong { display: block; overflow: hidden; color: #3a5265; font-size: 12px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.site-group-monitor-copy small { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 4px; overflow: hidden; color: #98a5af; font-size: 10px; line-height: 1.25; }
.site-group-monitor-copy small b { color: #5665b2; font-weight: 750; }
.site-group-monitor-copy small .multiplier-diagnostic { max-width: 100%; overflow: hidden; color: #a07d61; text-overflow: ellipsis; white-space: nowrap; }
.site-group-monitor-copy small em.group-warning-mark { display: inline-grid; width: 13px; height: 13px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #a85c26; background: #ffead8; font-size: 10px; font-style: normal; font-weight: 800; }
.site-group-monitor-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #cf6b62; }
.site-group-monitor-dot.online { background: #35a875; }
.site-group-monitor-dot.warning { background: #e7a248; }
.site-group-more { margin-top: 8px; color: #98a5af; font-size: 10px; text-align: right; }
.site-group-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.site-group-chip { padding: 5px 7px; border: 1px solid #dfe6f0; border-radius: 4px; color: #536a7e; background: #fff; font-size: 11px; }
.site-group-chip b { margin-left: 4px; color: #5665b2; }
.site-empty-groups { color: #a3adb7; font-size: 11px; }
.site-unit-actions { gap: 6px; margin-top: 16px; }
.site-unit-actions .panel-action, .site-unit-actions .ghost-button { min-height: 30px; }
.site-unit-actions .low-balance-topup { border-color: #e9b38d; color: #b55e2e; background: #fff0e4; }
.site-unit-actions .low-balance-topup:hover { border-color: #d98752; color: #93471f; background: #ffe6d4; }
.site-manage-actions { display: inline-flex; align-items: center; gap: 6px; }
.icon-action-button { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 5px; color: #697d8c; background: #fff; font-size: 18px; line-height: 1; }
.icon-action-button:hover { border-color: #b9ccf9; color: var(--blue); background: var(--blue-soft); }
.icon-action-button.site-login-btn { font-size: 20px; }
.icon-action-button.danger-icon-action { color: #b56b67; }
.icon-action-button.danger-icon-action:hover { border-color: #efc2bf; color: var(--red); background: var(--red-soft); }
.summary-icon-health { color: #2f966f; background: var(--green-soft); font-size: 14px; }
.health-summary-foot { gap: 5px; }
.health-window { color: #9aa7b1; white-space: nowrap; }
.health-summary-status { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: #8997a3; white-space: nowrap; }
.health-summary-status > span { display: inline-flex; align-items: center; gap: 3px; }
.health-summary-status strong { color: #506375; font-weight: 750; }
.health-summary .legend-dot { width: 6px; height: 6px; }
.site-row { display: grid; grid-template-columns: 33px minmax(0,1fr) auto auto auto; align-items: center; gap: 11px; min-height: 58px; border-bottom: 1px solid #edf0f4; }
.site-row:last-child { border-bottom: 0; }
.site-logo { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 7px; font-size: 12px; font-weight: 800; }
.site-logo.blue { color: #4772cf; background: #e8efff; }
.site-logo.purple { color: #765fc0; background: #f0edff; }
.site-logo.orange { color: #bf7838; background: #fff0e4; }
.site-name { color: #2d4050; font-size: 13px; font-weight: 720; }
.site-url { max-width: 240px; margin-top: 0; overflow: hidden; color: #9aa6b1; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.site-status { display: flex; align-items: center; gap: 5px; justify-self: end; color: #5d7780; font-size: 11px; font-weight: 650; }
.site-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #35a875; }
.site-status-dot.warning { background: #e7a248; }
.site-status-dot.offline { background: #cf6b62; }
.site-balance { margin-left: 0; color: #334d62; font-size: 13px; font-weight: 740; font-variant-numeric: tabular-nums; }
.site-balance.is-low { color: #c55c2d; }
.site-balance small { margin-right: 2px; color: #82909c; font-size: 11px; font-weight: 500; }
.site-threshold { color: #9aa7b1; font-size: 10px; white-space: nowrap; }
.site-threshold.is-low { color: #bb6d35; font-weight: 700; }
.site-account { max-width: 240px; overflow: hidden; color: #718291; font-size: 11px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.site-row-actions { display: flex; gap: 5px; margin-left: 15px; opacity: 1; }
.row-icon-btn { width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #788997; }
.row-icon-btn:hover { color: var(--blue); border-color: #b9ccf9; background: var(--blue-soft); }
.row-icon-btn.key-action { color: #6f63bd; }
.row-icon-btn.key-action:hover { color: #5e4bb0; border-color: #c9c1f3; background: var(--purple-soft); }
.row-icon-btn.danger-action { color: #b56b67; }
.row-icon-btn.danger-action:hover { color: var(--red); border-color: #efc2bf; background: var(--red-soft); }
.panel-footer-link { justify-content: space-between; padding: 11px 20px 15px; }
.update-note { color: #a4adb7; font-size: 11px; }

.health-panel { min-height: 298px; }
.period-label { padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; color: #6e7e8b; font-size: 11px; font-weight: 700; }
.period-label span { margin-left: 3px; color: #a2adb6; font-size: 13px; }
.health-chart-wrap { display: grid; grid-template-columns: 91px minmax(0, 1fr); align-items: center; gap: 13px; padding: 4px 20px 14px; }
.health-score { padding-top: 5px; text-align: center; }
.health-score strong { color: #275e88; font-size: 32px; line-height: 1; letter-spacing: 0; font-weight: 760; }
.health-score > span { color: #6c8ea8; font-size: 16px; font-weight: 700; }
.health-score small { display: block; margin-top: 8px; color: #9aa7b1; font-size: 10px; }
.health-chart { position: relative; min-width: 0; height: 144px; padding-top: 2px; }
.health-chart svg { position: relative; z-index: 2; width: 100%; height: 116px; overflow: visible; }
.chart-grid { position: absolute; top: 6px; right: 0; bottom: 31px; left: 0; display: flex; flex-direction: column; justify-content: space-between; }
.chart-grid i { display: block; height: 1px; background: #edf1f5; }
.chart-line { fill: none; stroke: #62a6d8; stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: rgba(98,166,216,.08); stroke: none; }
.chart-point { fill: #fff; stroke: #4f9bcf; stroke-width: 2; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 2px; color: #adb7c0; font-size: 9px; white-space: nowrap; }
.health-foot { justify-content: space-around; margin: 0 20px; padding: 13px 0 15px; border-top: 1px solid #edf0f4; color: #8997a3; font-size: 11px; }
.health-foot span { display: inline-flex; align-items: center; gap: 5px; }
.health-foot strong { color: #506375; font-weight: 750; }
.legend-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.legend-dot.healthy { background: #43ad84; }.legend-dot.warn { background: #e3a246; }.legend-dot.offline { background: #d17a72; }

.groups-panel { margin-bottom: 0; }
.groups-header { padding-bottom: 17px; }
.panel-header-actions { gap: 8px; }
.groups-table-wrap { overflow-x: auto; padding: 0 20px; }
.groups-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.groups-table th { height: 34px; border-top: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; color: #91a0ad; text-align: left; font-size: 11px; font-weight: 650; }
.groups-table th:nth-child(1) { width: 21%; }.groups-table th:nth-child(2) { width: 16%; }.groups-table th:nth-child(3) { width: 10%; }.groups-table th:nth-child(4) { width: 16%; }.groups-table th:nth-child(5) { width: 13%; }.groups-table th:nth-child(6) { width: 12%; }.groups-table th:nth-child(7) { width: 12%; }
.groups-table td { height: 53px; border-bottom: 1px solid #f0f2f5; color: #5d6d7b; font-size: 12px; vertical-align: middle; }
.groups-table tbody tr:last-child td { border-bottom: 0; }
.group-name-cell { color: #2a3f51; font-weight: 720; }.group-name-cell small { display: block; margin-top: 4px; color: #a4afb8; font-weight: 500; }
.group-site-cell { color: #647786; }.group-site-cell small { display: block; margin-top: 4px; color: #a2adb7; font-size: 10px; }
.multiplier { display: block; color: #5665b2; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.actual-multiplier, .first-token-latency { display: block; margin-top: 3px; color: #8a9aa7; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.actual-multiplier.is-mismatch { color: #b45f2f; }
.actual-multiplier.is-unknown { color: #8a9aa7; }
.multiplier-diagnostic { color: #a07d61; font-weight: 600; }
.multiplier-warning { display: inline-block; margin-top: 3px; padding: 2px 4px; border-radius: 3px; color: #a85c26; background: #fff0e4; font-size: 9px; font-weight: 700; white-space: nowrap; }
.multiplier-warning.multiplier-error { color: #b33b3b; background: #ffe7e7; }
.latency { display: inline-flex; align-items: center; gap: 6px; color: #526a7b; font-weight: 700; font-variant-numeric: tabular-nums; }
.latency-bar { width: 36px; height: 4px; overflow: hidden; border-radius: 2px; background: #edf0f4; }.latency-bar i { display: block; height: 100%; border-radius: inherit; background: #63b293; }.latency-bar i.warning { background: #e5a147; }
.request-count { color: #596e80; font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 4px; font-size: 10px; font-weight: 720; }.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }.status-pill.online { color: #29936d; background: var(--green-soft); }.status-pill.warning { color: #bd7a26; background: var(--orange-soft); }.status-pill.offline { color: #c76058; background: var(--red-soft); }
.group-actions { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.group-actions .group-key-disable-button, .group-actions .group-key-enable-button { color: #687b8b; font-size: 14px; }
.group-actions .group-key-disable-button:hover, .group-actions .group-key-disable-button.is-active { border-color: #e6b2a7; color: #b34d43; background: #fff4f2; }
.group-actions .group-key-enable-button:hover, .group-actions .group-key-enable-button.is-active { border-color: #a9d9c2; color: #2b8c67; background: #f1fbf6; }
.group-menu-button { font-size: 20px; }
.groups-table-footer { justify-content: space-between; padding: 12px 20px 14px; border-top: 1px solid #edf0f4; color: #9ba7b2; font-size: 11px; }.table-refresh { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; }.table-refresh b { color: #5665b2; font-weight: 700; }.table-refresh .plain-link { font-size: 11px; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.activity-panel, .quick-panel { min-height: 218px; }
.activity-list { height: 320px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 0 20px 13px; scroll-behavior: auto; }
.activity-entry { display: grid; grid-template-columns: 25px 1fr auto; gap: 10px; align-items: center; min-height: 48px; border-top: 1px solid #f0f2f5; scroll-snap-align: start; }.activity-entry:first-child { border-top: 0; }
.activity-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 13px; }.activity-icon.green { color: var(--green); background: var(--green-soft); }.activity-icon.orange { color: var(--orange); background: var(--orange-soft); }.activity-icon.purple { color: #7256b8; background: #f0ecff; }
.activity-title { color: #425666; font-size: 12px; font-weight: 650; }.activity-title strong { color: #2e4455; font-weight: 760; }.activity-time { color: #adb7bf; font-size: 10px; white-space: nowrap; }
.quick-actions { padding: 0 20px; }.quick-action { width: 100%; min-height: 44px; gap: 10px; padding: 0 11px; border: 1px solid #ebeff4; border-radius: 6px; background: #fbfcfe; color: #4b6071; text-align: left; }.quick-action + .quick-action { margin-top: 7px; }.quick-action:hover { border-color: #c4d3f5; background: var(--blue-soft); }.quick-action-icon { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 5px; color: var(--blue); background: #e7eeff; font-size: 17px; }.redeem-action .quick-action-icon { color: var(--purple); background: var(--purple-soft); }.add-group-action .quick-action-icon { color: var(--orange); background: var(--orange-soft); }.quick-action strong { display: block; color: #43596b; font-size: 12px; font-weight: 720; }.quick-action small { display: block; margin-top: 2px; color: #a1acb6; font-size: 10px; }.quick-action b { margin-left: auto; color: #a4b1bc; font-size: 16px; font-weight: 400; }.security-note { display: flex; gap: 7px; margin: 13px 20px 15px; color: #a0abb4; font-size: 10px; line-height: 1.45; }.security-note > span:first-child { color: #7ba4d0; font-size: 14px; }

/* Dialogs live outside the dashboard flow so adding a site never pushes the
   page content around.  Keep the hidden attribute authoritative: a modal is
   only visible while its backdrop is open and explicitly selected. */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(24, 38, 51, .48); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.site-two-factor-backdrop { z-index: 110; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(620px, calc(100vw - 56px)); max-height: min(760px, calc(100vh - 56px)); overflow: auto; border: 1px solid #dce4ed; border-radius: 11px; background: var(--surface); box-shadow: 0 24px 70px rgba(23, 39, 58, .24), 0 3px 12px rgba(23, 39, 58, .08); color: var(--ink); animation: modal-in .18s ease-out; }
.modal[hidden] { display: none; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { justify-content: space-between; gap: 18px; padding: 21px 24px 16px; border-bottom: 1px solid #edf1f5; }
.modal-kicker { display: block; color: #7890a3; font-size: 11px; font-weight: 750; letter-spacing: .04em; }
.modal-header h2 { margin-top: 5px; color: #213545; font-size: 20px; line-height: 1.25; font-weight: 760; }
.modal-close { width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid transparent; border-radius: 6px; color: #8796a3; background: transparent; font-size: 23px; font-weight: 350; line-height: 1; }
.modal-close:hover { border-color: #dce5ef; color: #536b7f; background: #f5f8fb; }
.modal-form { padding: 20px 24px 24px; }
.modal-form > label, .form-two > label { display: flex; flex-direction: column; gap: 7px; color: #536777; font-size: 12px; font-weight: 700; }
.modal-form > label + label, .modal-form > .form-two, .modal-form > .checkbox-line, .modal-form > .form-note { margin-top: 15px; }
.modal-form input:not([type="checkbox"]), .modal-form select { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #d5dee8; border-radius: 6px; color: #2e4355; background: #fff; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.modal-form input:not([type="checkbox"]):hover, .modal-form select:hover { border-color: #b9c9d9; }
.modal-form input:not([type="checkbox"]):focus, .modal-form select:focus { border-color: #6f98ee; box-shadow: 0 0 0 3px rgba(47, 107, 242, .11); outline: 0; }
.modal-form input::placeholder { color: #aab5bf; }
.field-hint { margin-top: -2px; color: #9aa7b2; font-size: 10px; font-weight: 500; line-height: 1.4; }
.modal-form input[readonly] { color: #6f8190; background: #f7f9fb; }
.form-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.site-preferences { align-items: end; }
.site-remember-line { min-height: 39px; padding-bottom: 1px; }
.checkbox-line { position: relative; display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; color: #647787 !important; font-size: 12px !important; font-weight: 600 !important; cursor: pointer; }
.checkbox-line input { position: absolute; width: 1px !important; height: 1px !important; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; opacity: 0; }
.fake-checkbox { width: 16px; height: 16px; flex: 0 0 auto; border: 1px solid #bdcbd8; border-radius: 4px; background: #fff; box-shadow: inset 0 1px 1px rgba(26, 49, 70, .04); }
.checkbox-line input:checked + .fake-checkbox { border-color: var(--blue); background: var(--blue); box-shadow: none; }
.checkbox-line input:checked + .fake-checkbox::after { display: block; width: 8px; height: 4px; margin: 4px 0 0 3px; border-bottom: 2px solid #fff; border-left: 2px solid #fff; content: ""; transform: rotate(-45deg); }
.checkbox-line input:focus-visible + .fake-checkbox { outline: 2px solid rgba(47, 107, 242, .35); outline-offset: 2px; }
.form-note { display: flex; gap: 7px; color: #8a99a6; font-size: 11px; line-height: 1.5; }
.form-note > span:first-child { width: 15px; height: 15px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #6c8fc4; background: #edf3ff; font-size: 11px; font-weight: 800; }
.modal-actions { justify-content: flex-end; gap: 8px; margin-top: 21px; padding-top: 16px; border-top: 1px solid #edf1f5; }
.secondary-modal-button, .primary-modal-button { min-width: 82px; height: 36px; padding: 0 14px; border-radius: 6px; font-size: 12px; font-weight: 720; }
.secondary-modal-button { border: 1px solid #d6e0e9; color: #617485; background: #fff; }
.secondary-modal-button:hover { border-color: #b9c9d9; color: #425b70; background: #f7f9fb; }
.primary-modal-button { border: 1px solid var(--blue); color: #fff; background: var(--blue); box-shadow: 0 4px 10px rgba(47, 107, 242, .16); }
.primary-modal-button:hover { border-color: var(--blue-deep); background: var(--blue-deep); }
.modal-form.is-pending { opacity: .9; }
.modal-form.is-pending input, .modal-form.is-pending select { background: #f7f9fb; }
.multiplier-preview { display: flex; align-items: baseline; gap: 9px; margin-top: 16px; padding: 12px 13px; border: 1px solid #e0e7f0; border-radius: 6px; background: #f8faff; }
.multiplier-preview span { color: #8392a0; font-size: 11px; }
.multiplier-preview strong { color: #5665b2; font-size: 17px; }
.multiplier-preview small { margin-left: auto; color: #a0acb7; font-size: 10px; }
.group-api-key-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 15px; }
.group-api-key-field > label { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: #536777; font-size: 12px; font-weight: 700; }
.group-test-button { min-height: 39px; white-space: nowrap; }
.group-model-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 15px; }
.group-model-field > label { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: #536777; font-size: 12px; font-weight: 700; }
.group-model-button { min-height: 39px; white-space: nowrap; }
.group-test-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; margin-top: 12px; padding: 10px 12px; border: 1px solid #dce9e2; border-radius: 6px; color: #507462; background: #f4fbf7; font-size: 11px; font-variant-numeric: tabular-nums; }
.group-test-result.is-mismatch { border-color: #f0d2bc; color: #a65d2f; background: #fff7f0; }
.group-test-result.is-error { border-color: #f2c5c5; color: #b33b3b; background: #fff3f3; }
.group-test-result.is-unknown { border-color: #dfe7e3; color: #6f8179; background: #f7faf8; }
.group-test-result-title { flex: 1 0 100%; font-weight: 750; }
.group-test-result .multiplier-diagnostic { flex: 1 0 100%; color: #8a6c54; }
.group-test-result[hidden] { display: none; }
.compact-modal { width: min(460px, calc(100vw - 56px)); }
.amount-presets { display: flex; gap: 7px; margin-top: 11px; }
.amount-presets button { height: 28px; padding: 0 10px; border: 1px solid #dce4ec; border-radius: 5px; color: #637787; background: #fff; font-size: 11px; font-weight: 650; }
.amount-presets button:hover { border-color: #b9ccf9; color: var(--blue); background: var(--blue-soft); }
.payment-hint, .redeem-rate { display: flex; align-items: center; gap: 7px; margin-top: 15px; color: #7e909f; font-size: 11px; }
.payment-hint > span { color: var(--green); font-size: 13px; }
.redeem-key-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.redeem-key-field > label { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: #536777; font-size: 12px; font-weight: 700; }
.redeem-key-field .ghost-button { min-height: 39px; white-space: nowrap; }
.redeem-rate { justify-content: space-between; padding: 11px 12px; border: 1px solid #e3def7; border-radius: 6px; background: #fbfaff; }
.redeem-rate strong { color: #6a5bb5; font-weight: 750; }

.key-modal { width: min(520px, 100%); }
.key-modal-body { padding: 19px 23px 22px; }
.key-description { color: #718391; font-size: 12px; line-height: 1.55; }
.key-value-card { margin-top: 15px; padding: 14px; border: 1px solid #e0e6ef; border-radius: 7px; background: #f8faff; }
.key-value-label { display: block; color: #8c9aa8; font-size: 11px; font-weight: 650; }
.key-value-card code { display: block; margin-top: 8px; overflow: hidden; color: #344b61; font-family: Consolas, "SFMono-Regular", monospace; font-size: 13px; font-weight: 650; letter-spacing: .15px; text-overflow: ellipsis; white-space: nowrap; }
.key-full-value { width: 100%; height: 35px; margin-top: 8px; padding: 0 9px; border: 1px solid #d5deeb; border-radius: 5px; color: #344b61; background: #fff; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.key-full-value[hidden] { display: none; }
.key-value-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.key-value-actions .ghost-button, .key-value-actions .panel-action { min-height: 30px; }
.key-security-note { margin-top: 13px; color: #9aa6b0; font-size: 11px; line-height: 1.45; }
.login-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(245,247,251,.98); }
.login-screen[hidden] { display: none; }
.login-card { width: min(390px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 18px 48px rgba(34,52,74,.14); }
.login-symbol { margin-bottom: 18px; }
.login-card h1 { margin: 0; font-size: 24px; }
.login-card p { margin: 9px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-card label { display: block; margin-top: 14px; color: #53687a; font-size: 12px; font-weight: 650; }
.login-card input { width: 100%; height: 40px; margin-top: 7px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); }
.login-button { width: 100%; min-height: 40px; margin-top: 20px; }
.login-card small { display: block; margin-top: 13px; color: var(--faint); font-size: 11px; text-align: center; }
.login-error { margin-top: 12px; padding: 9px 10px; border: 1px solid #f1ccc9; border-radius: 5px; color: #9f514c; background: #fff3f2; font-size: 12px; }
.login-error[hidden] { display: none; }

@media (max-width: 1200px) { .main-content { padding: 28px 25px; }.site-url { max-width: 160px; } }
@media (max-width: 900px) { html, body { min-width: 0; }.main-content { padding: 23px 18px; }.overview-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }.content-grid, .lower-grid { grid-template-columns: 1fr; }.site-unit { grid-template-columns: 1fr; gap: 12px; }.site-unit-groups { margin-top: 0; }.titlebar { padding: 0 18px; }.titlebar-hint, .titlebar-divider { display: none; } }
@media (max-width: 560px) { .site-group-monitor-list { grid-template-columns: 1fr; }.redeem-key-field { grid-template-columns: 1fr; }.redeem-key-field .ghost-button { width: 100%; } }

