:root {
  color-scheme: light;
  --canvas: #f5f5f2;
  --surface: #fff;
  --surface-soft: #f9faf8;
  --ink: #202521;
  --muted: #737a74;
  --faint: #9da39d;
  --line: #e7e9e5;
  --green: #168c70;
  --green-strong: #11765f;
  --green-soft: #e9f6f1;
  --blue: #38688e;
  --blue-soft: #edf3f7;
  --amber: #b27719;
  --amber-soft: #fff7e7;
  --red: #b84642;
  --red-soft: #fff1f0;
  --metric-today: #168c70;
  --metric-today-soft: #e9f6f1;
  --metric-week: #3975a5;
  --metric-week-soft: #edf4fa;
  --metric-total: #ad6d1e;
  --metric-total-soft: #fff5e8;
  --metric-requests: #16858b;
  --metric-requests-soft: #e9f6f6;
  --shadow-soft: 0 2px 8px rgba(29, 43, 34, .045);
  --shadow-raised: 0 9px 24px rgba(29, 43, 34, .09);
  --sidebar-width: 244px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); font-size: 15px; }
button, input { font: inherit; }
button { color: inherit; }
.app { min-height: 100vh; }
[hidden] { display: none !important; }
.sidebar { width: var(--sidebar-width); position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column; padding: 26px 16px 20px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; min-height: 50px; padding: 0 9px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 8px; }
.brand-mark svg { width: 18px; height: 18px; }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-size: 15px; font-weight: 650; }
.brand-copy small, .eyebrow, .side-label, .page-footer { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; letter-spacing: 0; }
.brand-copy small { color: var(--faint); font-size: 10px; }
.side-label { margin: 36px 10px 10px; color: var(--faint); }
.side-label-settings { margin-top: 32px; }
.nav-link { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 11px; color: #626962; text-decoration: none; background: transparent; border: 0; border-radius: 6px; text-align: left; cursor: pointer; transition: background-color .16s ease, color .16s ease; }
.nav-link svg { width: 18px; height: 18px; }
.nav-link:hover { background: var(--surface-soft); color: var(--ink); }
.nav-link.active { background: var(--green-soft); color: var(--green-strong); font-weight: 600; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 13px; }
.check-chip { display: flex; gap: 10px; align-items: center; min-height: 42px; padding: 9px 11px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.check-chip strong { display: block; margin-top: 3px; color: #454c46; font-size: 12px; font-weight: 600; }
.live-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--green); }
.main-column { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 38px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.breadcrumbs { color: #343b35; font-size: 13px; }
.breadcrumbs span { padding: 0 8px; color: #bdc1bd; }
.topbar-right { display: flex; align-items: center; gap: 17px; color: var(--muted); font-size: 12px; }
.topbar-divider { height: 17px; border-left: 1px solid var(--line); }
.user-indicator { display: flex; align-items: center; gap: 8px; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; color: var(--green-strong); background: var(--green-soft); border-radius: 50%; font-size: 12px; font-weight: 700; }
.clock { font-variant-numeric: tabular-nums; }
.content { width: min(1960px, 100%); margin: 0 auto; padding: 34px 40px 26px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { color: #858d86; font-size: 11px; font-weight: 600; }
.page-heading h1 { margin: 7px 0 6px; font-size: 28px; line-height: 1.25; font-weight: 650; }
.page-heading p, .section-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; gap: 8px; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button svg { width: 16px; height: 16px; }
.button:disabled { opacity: .55; cursor: wait; }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-strong); box-shadow: 0 3px 9px rgba(17, 118, 95, .18); transform: translateY(-1px); }
.button-secondary { color: #4d554e; background: #fff; border-color: #dfe2de; }
.button-secondary:hover { background: var(--surface-soft); border-color: #cbd2cc; transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .nav-link:focus-visible, .icon-button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(57, 117, 165, .35); outline-offset: 2px; }
.button.loading svg { animation: rotate 1s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.status-banner { display: flex; align-items: center; gap: 12px; min-height: 52px; margin: -6px 0 18px; padding: 10px 14px; border: 1px solid #d7e5eb; border-radius: 6px; color: var(--blue); background: var(--blue-soft); }
.status-banner[data-type="warning"] { color: var(--amber); background: var(--amber-soft); border-color: #f1e2c1; }
.status-banner[data-type="neutral"] { color: #626962; background: #f0f1ef; border-color: var(--line); }
.status-banner > svg { width: 17px; height: 17px; flex: 0 0 17px; }
.status-banner > span { display: grid; gap: 2px; flex: 1; }
.status-banner strong { font-size: 13px; }
.status-banner small { color: inherit; opacity: .84; font-size: 12px; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--green-strong); text-decoration: none; font-size: 12px; font-weight: 600; }
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 12px; height: 12px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric, .panel, .chart-section { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-soft); }
.metric { min-width: 0; min-height: 154px; padding: 18px 19px 15px; border-top: 3px solid var(--metric-today); animation: surface-enter .46s cubic-bezier(.2,.7,.25,1) both; transition: border-color .18s ease, box-shadow .2s ease, transform .2s ease; }
.metric:nth-child(2) { border-top-color: var(--metric-week); animation-delay: .05s; }
.metric:nth-child(3) { border-top-color: var(--metric-total); animation-delay: .1s; }
.metric:nth-child(4) { border-top-color: var(--metric-requests); animation-delay: .15s; }
.metric-today .metric-header > svg { color: var(--metric-today); background: var(--metric-today-soft); }
.metric-week .metric-header > svg { color: var(--metric-week); background: var(--metric-week-soft); }
.metric-total .metric-header > svg { color: var(--metric-total); background: var(--metric-total-soft); }
.metric-requests .metric-header > svg { color: var(--metric-requests); background: var(--metric-requests-soft); }
.metric-today .metric-value { color: var(--metric-today); }
.metric-week .metric-value { color: var(--metric-week); }
.metric-total .metric-value { color: var(--metric-total); }
.metric-requests .metric-value { color: var(--metric-requests); }
@media (hover: hover) and (pointer: fine) {
  .metric:hover, .panel:hover, .chart-section:hover { box-shadow: var(--shadow-raised); transform: translateY(-2px); }
}
.metric-header, .metric-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-header { color: #626962; font-size: 13px; font-weight: 550; }
.metric-header small { color: var(--faint); font-size: 11px; font-weight: 400; }
.metric-header > svg { width: 32px; height: 32px; padding: 7px; flex: 0 0 32px; color: #909991; background: var(--surface-soft); border-radius: 6px; }
.metric-value { margin: 17px 0 13px; overflow-wrap: anywhere; font-size: 28px; line-height: 1.2; font-weight: 650; font-variant-numeric: tabular-nums; transition: color .18s ease; }
.metric-footer { min-height: 18px; color: var(--muted); }
.metric-footer-stack { align-items: flex-start; flex-direction: column; gap: 3px; }
.metric-caption { font-size: 11px; }
.change-pill { max-width: 140px; overflow: hidden; color: var(--green-strong); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.change-pill.negative { color: var(--red); }
.chart-section { margin-top: 18px; padding: 21px 22px 17px; animation: surface-enter .48s .12s cubic-bezier(.2,.7,.25,1) both; transition: box-shadow .2s ease, transform .2s ease; }
.section-heading, .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-heading h2, .panel-heading h2 { margin: 5px 0 4px; font-size: 18px; font-weight: 650; }
.section-heading p { font-size: 12px; }
.chart-meta { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 11px; }
.legend { display: flex; align-items: center; gap: 6px; }
.legend span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chart-frame { display: grid; grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 260px; margin-top: 16px; overflow: hidden; }
.chart-y-labels { display: flex; min-height: 0; flex-direction: column; justify-content: space-between; padding: 4px 9px 24px 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.chart-y-labels span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chart-plot { position: relative; min-width: 0; min-height: 0; overflow: hidden; padding-bottom: 21px; }
.chart-plot svg { width: 100%; height: calc(100% - 21px); overflow: hidden; }
.chart-area { opacity: 0; animation: area-reveal .75s .12s ease-out forwards; }
.chart-plot svg.chart-reveal { clip-path: inset(0 100% 0 0); animation: chart-wipe .85s cubic-bezier(.22,.75,.3,1) forwards; }
.chart-line { stroke-linecap: round; stroke-linejoin: round; }
.chart-empty { position: absolute; inset: 25px 0 36px; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.chart-x-labels { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.lower-grid { display: grid; grid-template-columns: minmax(240px, .76fr) minmax(320px, 1.24fr); gap: 13px; margin-top: 14px; }
.panel { min-width: 0; min-height: 230px; padding: 19px 20px; animation: surface-enter .48s .18s cubic-bezier(.2,.7,.25,1) both; transition: box-shadow .2s ease, transform .2s ease; }
.panel-heading { align-items: center; margin-bottom: 12px; }
.state-badge { padding: 5px 8px; color: var(--amber); background: var(--amber-soft); border-radius: 4px; font-size: 11px; }
.state-badge.good { color: var(--green-strong); background: var(--green-soft); }
.state-badge.bad { color: var(--red); background: var(--red-soft); }
.status-list { margin: 0; }
.status-list > div { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #f0f1ee; font-size: 12px; }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; color: #394039; font-weight: 550; font-variant-numeric: tabular-nums; text-align: right; }
.activity-count { color: var(--muted); font-size: 11px; }
.event-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.event-list li:not(.empty-activity) { min-height: 43px; display: flex; align-items: center; gap: 10px; border-top: 1px solid #f0f1ee; }
.event-indicator { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 5px; }
.event-indicator.error { color: var(--amber); background: var(--amber-soft); }
.event-indicator svg { width: 15px; height: 15px; }
.event-body { min-width: 0; display: grid; gap: 2px; flex: 1; }
.event-body strong { overflow: hidden; color: #454b45; font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.event-body small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.event-list time { flex: 0 0 auto; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.empty-activity { display: grid; min-height: 100px; place-items: center; color: var(--faint); font-size: 12px; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 15px 2px 0; color: var(--faint); font-size: 11px; }
.footer-divider { padding: 0 4px; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--canvas); }
.login-form { width: min(360px, 100%); display: grid; gap: 11px; padding: 25px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.login-form .brand-mark { margin-bottom: 2px; }
.login-form h1 { margin: 0 0 6px; font-size: 24px; }
.login-form label, .settings-form label { color: #515851; font-size: 12px; font-weight: 600; }
input { width: 100%; height: 40px; padding: 0 11px; color: var(--ink); background: #fff; border: 1px solid #dfe2de; border-radius: 5px; outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,140,112,.11); }
.full-width { width: 100%; margin-top: 3px; }
.form-error, .form-message { min-height: 17px; margin: 0; color: var(--green-strong); font-size: 12px; }
.form-message.error { color: var(--red); }
.settings-dialog { width: min(440px, calc(100% - 24px)); max-height: min(720px, calc(100% - 24px)); padding: 20px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 48px rgba(20,32,24,.16); }
.settings-dialog::backdrop { background: rgba(24,31,25,.35); }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.dialog-top h2 { margin: 4px 0 0; font-size: 19px; }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.icon-button svg { width: 15px; height: 15px; }
.settings-form { display: grid; gap: 9px; }
.field-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.reauthorize-block { display: grid; gap: 9px; margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); }
.reauthorize-block > div { display: grid; gap: 4px; }
.reauthorize-block strong { font-size: 13px; }
.reauthorize-block > div span { color: var(--muted); font-size: 12px; }
.reauthorize-block .button { justify-self: start; }
.pairing-code { padding: 10px; color: var(--green-strong); background: var(--green-soft); border: 1px solid #d8ebe3; border-radius: 5px; font: 12px ui-monospace, monospace; overflow-wrap: anywhere; user-select: all; }
.field-note code { padding: 2px 4px; color: #3b4840; background: #f1f2ef; border-radius: 3px; }
.toast { position: fixed; right: 20px; bottom: 18px; z-index: 10; max-width: min(460px, calc(100% - 40px)); padding: 12px 15px; color: #fff; background: #27312a; border-radius: 5px; opacity: 0; transform: translateY(5px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; font-size: 12px; }
.toast.visible { opacity: 1; transform: translateY(0); }
@keyframes surface-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes chart-wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes area-reveal { to { opacity: 1; } }
@media (min-width: 1600px) { .content { padding-top: 42px; } }
@media (max-width: 1199px) { .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1050px) { :root { --sidebar-width: 205px; } .content { padding-right: 24px; padding-left: 24px; } .topbar { padding-right: 24px; padding-left: 24px; } .metric { padding-right: 17px; padding-left: 17px; } .metric-value { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }
