:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --ink: #17202a;
  --muted: #68737f;
  --line: #dfe4e8;
  --direct: #2563eb;
  --direct-soft: #dbe7ff;
  --senior: #d97706;
  --senior-soft: #ffead0;
  --focus: #0f766e;
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button, select, a { font: inherit; }

[hidden] { display: none !important; }

.topbar {
  height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-block,
.account-block,
.panel-heading,
.legend-note {
  display: flex;
  align-items: center;
}

.brand-block { gap: 12px; }
.account-block { gap: 12px; color: var(--muted); font-size: 13px; }

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #18222d;
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 26px;
}

.brand-mark.small { width: 36px; height: 36px; font-size: 20px; }

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 19px; line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.3; }

.divider { width: 1px; height: 18px; background: var(--line); }

.text-button {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

main {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.filter-band {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(170px, .75fr) minmax(220px, 1fr);
  gap: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

label { display: grid; gap: 7px; }
label span { color: var(--muted); font-size: 12px; font-weight: 600; }

select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

select:focus { border-color: var(--focus); box-shadow: 0 0 0 2px rgba(15, 118, 110, .12); }

.chart-panel {
  margin-top: 16px;
  padding: 20px 20px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-heading { min-height: 44px; justify-content: space-between; gap: 20px; }
.section-kicker { margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.chart { width: 100%; height: 390px; }

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  background: #eef1f4;
  border-radius: 6px;
}

.segmented button {
  min-width: 76px;
  height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.segmented button.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(25, 35, 45, .12); }
.segmented button:disabled { cursor: default; opacity: .35; }

.legend-note { gap: 16px; color: var(--muted); font-size: 12px; }
.legend-note span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.direct { background: var(--direct); }
.dot.senior { background: var(--senior); }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(380px, 100%);
  padding: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.login-panel .brand-mark { margin: 0 auto 20px; }
.login-panel h1 { font-size: 26px; }
.login-copy { margin: 10px 0 28px; color: var(--muted); font-size: 14px; }

.primary-button {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  color: #fff;
  background: #18222d;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
}

.error-state {
  position: fixed;
  inset: auto 24px 24px;
  max-width: 420px;
  margin-left: auto;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  color: #7f1d1d;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 13px;
}

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 68px; padding: 14px 18px; align-items: flex-start; }
  .account-block { align-items: flex-end; flex-direction: column; gap: 3px; }
  .account-block .divider, #userName { display: none; }
  main { width: calc(100% - 24px); padding-top: 12px; }
  .filter-band { grid-template-columns: 1fr; gap: 12px; }
  .chart-panel { padding: 16px 12px 10px; }
  .panel-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .chart { height: 360px; }
  .segmented { width: 100%; }
  .segmented button { width: 100%; }
}
