:root {
  --ink: #203431;
  --muted: #7a8782;
  --green: #286b55;
  --lime: #d9eab7;
  --bg: #f5f6f2;
  --line: #e2e7e0;
  --dark: #172c28;
  --red: #b74f42;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
a { color: var(--green); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; line-height: 1.4; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12px; line-height: 1.65; }
.number, .metric-value, td, .funnel-count, .usage-count, .status-count { font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 550; }
.btn:hover:not(:disabled) { background: #edf2e9; }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover:not(:disabled) { background: #205b48; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; color: inherit; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--dark); color: var(--lime); }
.brand-mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 500; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); padding: 22px max(28px, calc((100vw - 1240px) / 2)); background: #fff; }
.account { display: flex; align-items: center; gap: 16px; min-width: 0; }
.account span { max-width: 35ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.dashboard { max-width: 1296px; margin: 0 auto; padding: 36px 28px 48px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading p { margin-top: 10px; max-width: 65ch; }
.dashboard-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; flex-shrink: 0; }
.periods { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #edf1e9; }
.periods button { min-height: 34px; padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 550; }
.periods button[aria-pressed="true"] { background: #fff; color: var(--green); }
.periods button:hover { color: var(--green); }
.report-meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 20px; }
.scope-note { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; }
.scope-note strong { font-size: 12px; font-weight: 550; }
.data-notice { margin: 0 0 24px; padding: 14px 18px; border: 1px solid #dce6d6; border-radius: 10px; background: #edf3e7; font-size: 12px; color: #4e6653; line-height: 1.7; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.metric-value { display: block; margin: 10px 0 5px; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; font-weight: 650; overflow-wrap: anywhere; }
.metric small { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); }
.activity-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.activity-summary div { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 8px; }
.activity-summary dt { color: var(--muted); font-size: 12px; }
.activity-summary dd { margin: 0; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-heading .sub { margin-top: 7px; max-width: 70ch; }
.panel + .dashboard-grid { margin-top: 24px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.dashboard-grid + .dashboard-grid { margin-top: 24px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-mark { width: 10px; height: 10px; border-radius: 3px; background: #c7d0c2; }
.legend-mark.active { background: var(--green); }
.daily-chart { min-width: 0; width: 100%; }
.daily-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-dasharray: 4 5; }
.chart-label { fill: var(--muted); font-size: 11px; }
.chart-bar { fill: #c7d0c2; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: var(--green); stroke: #fff; stroke-width: 1.5; }
.chart-empty { display: grid; place-items: center; min-height: 180px; padding: 24px; border-radius: 8px; background: #f7f9f5; color: var(--muted); text-align: center; font-size: 13px; }
.daily-details { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.daily-details summary { width: fit-content; cursor: pointer; color: var(--green); font-size: 12px; font-weight: 550; }
.table-scroll { max-width: 100%; overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); text-align: left; font-weight: 500; }
th, td { padding: 11px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 0; }
th:not(:first-child), td:not(:first-child) { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
.funnel-list, .usage-list, .status-list { display: grid; gap: 20px; }
.funnel-row-head, .usage-row, .status-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 13px; }
.funnel-row-head span:first-child, .usage-row > div, .status-row-head span:first-child { min-width: 0; overflow-wrap: anywhere; }
.funnel-count, .usage-count, .status-count { flex-shrink: 0; font-weight: 600; }
.funnel-count small, .usage-count small, .status-count small { color: var(--muted); font-size: 11px; font-weight: 400; }
.meter { height: 6px; margin-top: 9px; border-radius: 4px; overflow: hidden; background: #edf1e9; }
.meter span { display: block; height: 100%; max-width: 100%; border-radius: 4px; background: var(--green); }
.usage-row { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.usage-row:last-child { padding-bottom: 0; border: 0; }
.usage-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-summary { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.status-summary strong { display: block; margin-bottom: 4px; font-size: 18px; }
.footnote { margin-top: 24px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.error { padding: 14px 16px; margin-bottom: 20px; border: 1px solid #ead9d5; border-radius: 8px; color: var(--red); background: #fff9f7; font-size: 13px; }
.error p + .btn { margin-top: 12px; }
.boot-state { display: grid; place-items: center; min-height: 70dvh; padding: 24px; color: var(--muted); }
.boot-error { max-width: 460px; margin: 20dvh auto 0; padding: 28px; }
.boot-error h1 { margin-bottom: 12px; font-size: 24px; }
.boot-error button { margin-top: 20px; }
.login-shell { display: grid; place-items: center; min-height: 100dvh; padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); }
.login-card { width: min(100%, 420px); padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.login-card .brand { margin-bottom: 34px; }
.login-card h1 { font-size: 25px; }
.login-card > .sub { margin: 12px 0 26px; }
.login-sso { display: grid; gap: 12px; }
.login-sso > .btn { width: 100%; text-align: center; }
.login-providers { display: grid; gap: 10px; }
.login-provider { min-height: 46px; gap: 12px; justify-content: flex-start; padding-inline: 18px; }
.login-provider-mark { width: 22px; flex-shrink: 0; color: var(--ink); font-size: 18px; font-weight: 650; text-align: center; }
.login-session-link { min-height: 36px; padding: 5px 10px; border-color: transparent; color: var(--green); font-size: 12px; }
.login-alternative { margin: 24px 0 18px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.login-auth-error { margin: 0 0 20px; }
.login-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.field input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d6dfd1; border-radius: 8px; color: var(--ink); background: #fff; font-size: 15px; }
.login-error { margin: 0; color: var(--red); font-size: 12px; line-height: 1.6; }
.login-error:empty { display: none; }
.login-footnote { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.skeleton { display: block; background: #edf1e9; border-radius: 6px; }
.skeleton-value { width: 85px; height: 36px; margin-top: 12px; }
.skeleton-label { height: 12px; width: 65%; }
.loading-panel { height: 290px; }
.loading-panel .skeleton { height: 160px; margin-top: 24px; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .page-heading { flex-direction: column; gap: 20px; }
  .metrics { gap: 12px; }
  .metric { padding: 18px; }
  .topbar { padding: 18px 24px; }
  .dashboard-grid { gap: 16px; }
}
@media (max-width: 620px) {
  .topbar { padding: max(16px,env(safe-area-inset-top)) 20px 16px; align-items: flex-start; gap: 16px; }
  .brand { font-size: 19px; gap: 10px; }
  .brand-mark { width: 34px; height: 34px; }
  .account { justify-content: flex-end; }
  .account span { display: none; }
  .account .btn { min-height: 36px; padding: 6px 11px; font-size: 12px; }
  .dashboard { padding: 28px 18px max(32px, env(safe-area-inset-bottom)); }
  .dashboard-controls { gap: 10px; width: 100%; justify-content: space-between; }
  .periods button { padding: 6px 10px; font-size: 12px; }
  .dashboard-controls > .btn { padding: 8px 11px; font-size: 12px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { padding: 17px; }
  .metric-value { font-size: 28px; }
  .metric-label { font-size: 11px; }
  .metric small { font-size: 10px; }
  .activity-summary { gap: 10px; }
  .activity-summary div { display: block; }
  .activity-summary dt { font-size: 11px; }
  .activity-summary dd { margin-top: 6px; }
  .panel { padding: 20px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .data-notice { padding: 12px 14px; }
  .login-card { padding: 26px; }
  th, td { padding: 10px 5px; font-size: 11px; }
}
