:root {
  color-scheme: dark;
  font-family: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --bg: #050d1c;
  --surface: #0a1629;
  --surface-raised: #0f1d33;
  --surface-soft: #13233b;
  --line: #20324e;
  --line-strong: #315277;
  --text: #f6f9ff;
  --muted: #a2b0c7;
  --dim: #71819d;
  --cyan: #1ed6e8;
  --blue: #3d7bff;
  --green: #24c78c;
  --red: #ff667a;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

section[id] { scroll-margin-top: 88px; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 88% 2%, rgba(30, 214, 232, .07), transparent 25rem),
    linear-gradient(145deg, #040b18 0%, #071225 45%, #050c19 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

button, a { font: inherit; }

button { color: inherit; }

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid rgba(49, 82, 119, .52);
  background: rgba(5, 13, 28, .9);
  backdrop-filter: blur(16px);
}

.wordmark {
  color: var(--text);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .18em;
  text-decoration: none;
}

.topbar__context {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(36, 199, 140, .11);
}

.dashboard {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.page-head h1 {
  margin: 2px 0 6px;
  font-size: clamp(29px, 3vw, 40px);
  font-weight: 560;
  letter-spacing: -.02em;
}

.page-head p:not(.eyebrow), .section-title p { margin: 0; color: var(--muted); }

.eyebrow, .card-heading__label {
  margin: 0;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
}

.amount-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 208px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #091326;
}

.amount-switch__button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 140ms, color 140ms;
}

.amount-switch__button.is-active {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.section-title > div { display: flex; align-items: center; gap: 10px; }
.section-title__bar { width: 3px; height: 25px; background: var(--cyan); box-shadow: 0 0 18px rgba(30,214,232,.55); }
.section-title h2 { margin: 0; font-size: 20px; font-weight: 600; }
.section-title p { font-size: 12px; }

.period-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.period-card {
  position: relative;
  min-height: 238px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(16, 31, 54, .98), rgba(7, 19, 37, .98));
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms, background-color 160ms;
}

.period-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cyan);
  content: "";
  opacity: 0;
  transition: opacity 160ms;
}

.period-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.period-card.is-active { border-color: rgba(30, 214, 232, .74); background: linear-gradient(145deg, #102a43, #07182d); box-shadow: inset 0 0 0 1px rgba(30,214,232,.18), 0 12px 36px rgba(0,0,0,.18); }
.period-card.is-active::before { opacity: 1; }

.period-card__top, .period-card__compare, .period-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.period-card__period { color: var(--text); font-size: 16px; font-weight: 650; }
.period-card__date { margin-left: 6px; color: var(--dim); font-size: 11px; font-weight: 450; }
.period-card__state { color: var(--cyan); font-size: 11px; }
.period-card__amount { display: block; margin: 22px 0 18px; font-size: clamp(25px, 2.5vw, 34px); font-weight: 760; line-height: 1; letter-spacing: -.025em; }
.period-card__compare { margin-top: 10px; padding-top: 13px; border-top: 1px solid rgba(49,82,119,.45); }
.period-card__compare span:first-child { color: var(--muted); font-size: 12px; }
.period-card__compare strong { display: block; margin-top: 3px; color: var(--text); font-size: 14px; }

.trend {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}
.trend.is-up { background: rgba(36,199,140,.14); color: #58e0ae; }
.trend.is-down { background: rgba(255,102,122,.13); color: #ff8797; }

.period-card__foot { margin-top: 14px; padding: 9px 10px; border-radius: 5px; background: rgba(30,214,232,.08); color: #9dddea; font-size: 11px; }

.analysis-panel {
  margin-top: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(14, 27, 48, .96), rgba(8, 18, 34, .98));
}

.dimension-tabs {
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #081326;
}

.dimension-tab, .sort-controls button {
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 140ms, border-color 140ms, background-color 140ms;
}
.dimension-tab:hover, .sort-controls button:hover { color: var(--text); }
.dimension-tab.is-active { border-color: rgba(30,214,232,.55); background: linear-gradient(110deg, rgba(30,214,232,.2), rgba(61,123,255,.22)); color: var(--text); box-shadow: 0 0 20px rgba(30,214,232,.09); }

.analysis-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 18px;
}
.analysis-intro h2 { margin: 5px 0 0; font-size: 26px; font-weight: 620; }
.analysis-totals { display: flex; gap: 34px; }
.analysis-totals > div { min-width: 128px; }
.analysis-totals span { display: block; color: var(--dim); font-size: 11px; }
.analysis-totals strong { display: block; margin-top: 2px; font-size: 20px; }

.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, .65fr); gap: 14px; }
.chart-card, .focus-card { border: 1px solid var(--line); border-radius: 7px; background: rgba(7, 17, 33, .76); }
.chart-card { min-height: 374px; padding: 22px; }
.card-heading, .table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.card-heading h3, .table-toolbar h3 { margin: 3px 0 0; font-size: 17px; font-weight: 600; }
.chart-note { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--dim); font-size: 10px; }
.chart-note__line { width: 18px; border-top: 1px dashed var(--cyan); }

.bar-chart { display: grid; gap: 17px; margin-top: 28px; }
.bar-row { display: grid; grid-template-columns: minmax(78px, .35fr) 1fr minmax(92px, auto); align-items: center; gap: 13px; padding: 3px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.bar-row:hover, .bar-row.is-selected { background: rgba(30,214,232,.055); }
.bar-row__label { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.bar-row.is-selected .bar-row__label { color: var(--text); }
.bar-track { position: relative; height: 9px; border-radius: 2px; background: #132038; }
.bar-track::after { position: absolute; z-index: 2; top: -4px; bottom: -4px; left: var(--average-position); border-left: 1px dashed rgba(30,214,232,.72); content: ""; }
.bar-fill { display: block; width: var(--bar-width); height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--blue)); transform-origin: left; animation: bar-in 420ms cubic-bezier(.2,.75,.2,1) both; }
.bar-row__value { text-align: right; }
.bar-row__value strong { display: block; font-size: 13px; }
.bar-row__value span { color: var(--dim); font-size: 10px; }

.focus-card { position: relative; overflow: hidden; padding: 24px; background: linear-gradient(145deg, rgba(13,41,62,.9), rgba(8,20,38,.92)); }
.focus-card::after { position: absolute; top: -70px; right: -70px; width: 190px; height: 190px; border: 1px solid rgba(30,214,232,.12); border-radius: 50%; box-shadow: 0 0 0 28px rgba(61,123,255,.04), 0 0 0 56px rgba(30,214,232,.025); content: ""; }
.focus-card__overline { margin: 0 0 33px; color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.focus-card__rank { color: var(--line-strong); font-size: 44px; font-weight: 800; line-height: 1; }
.focus-card h3 { margin: 8px 0 1px; font-size: 20px; }
.focus-card > strong { display: block; font-size: 28px; }
.focus-card dl { display: grid; gap: 12px; margin: 30px 0 0; }
.focus-card dl div { display: flex; justify-content: space-between; gap: 16px; padding-top: 11px; border-top: 1px solid rgba(49,82,119,.45); }
.focus-card dt { color: var(--dim); font-size: 11px; }
.focus-card dd { margin: 0; font-size: 12px; font-weight: 650; }

.table-section { margin-top: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 7px; background: rgba(7,17,33,.76); }
.sort-controls { display: flex; align-items: center; gap: 3px; }
.sort-controls > span { margin-right: 5px; color: var(--dim); font-size: 10px; }
.sort-controls button { min-height: 34px; padding: 0 12px; font-size: 11px; }
.sort-controls button.is-active { border-color: var(--line-strong); background: var(--surface-soft); color: var(--text); }
.table-scroll { overflow-x: auto; margin-top: 18px; border: 1px solid rgba(32,50,78,.8); border-radius: 5px; }
table { width: 100%; min-width: 800px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 14px; border-bottom: 1px solid rgba(32,50,78,.7); text-align: right; white-space: nowrap; }
th { background: #0c192d; color: var(--dim); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
td { color: var(--muted); font-size: 12px; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
tbody tr { cursor: pointer; transition: background-color 140ms; }
tbody tr:hover, tbody tr.is-selected { background: rgba(30,214,232,.055); }
tbody tr.is-selected td:nth-child(2) { color: var(--cyan); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
.rank-cell { color: var(--dim); text-align: center; }
.positive { color: #58e0ae; }
.negative { color: #ff8797; }

@keyframes bar-in { from { transform: scaleX(.05); opacity: .25; } to { transform: scaleX(1); opacity: 1; } }

@media (max-width: 820px) {
  .topbar { padding: 0 18px; }
  .dashboard { width: min(100% - 28px, 1320px); padding-top: 28px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .amount-switch { min-width: 0; width: 100%; }
  .section-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .period-rail { display: flex; margin-right: -14px; overflow-x: auto; padding: 1px 14px 10px 1px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .period-card { min-width: min(82vw, 330px); scroll-snap-align: start; }
  .analysis-panel { padding: 18px; }
  .dimension-tabs { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
  .analysis-intro { align-items: flex-start; flex-direction: column; }
  .analysis-totals { width: 100%; gap: 12px; }
  .analysis-totals > div { flex: 1; min-width: 0; }
  .analysis-grid { grid-template-columns: 1fr; }
  .focus-card { min-height: 280px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .sort-controls { width: 100%; overflow-x: auto; }
  .sort-controls button { flex: 1; min-width: max-content; }
  .table-section { padding: 18px 0 0; overflow: hidden; }
  .table-toolbar { padding: 0 18px; }
  .table-scroll { border-right: 0; border-left: 0; border-radius: 0; }
  th:nth-child(2), td:nth-child(2) { position: sticky; z-index: 1; left: 0; background: #0c192d; }
  tbody tr.is-selected td:nth-child(2) { background: #102b3d; }
}

@media (max-width: 430px) {
  .topbar__context { max-width: 210px; text-align: right; }
  .page-head h1 { font-size: 29px; }
  .analysis-totals strong { font-size: 17px; }
  .chart-card { padding: 18px 14px; }
  .bar-row { grid-template-columns: 78px 1fr 78px; gap: 8px; }
  .bar-row__value strong { font-size: 11px; }
}

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

/* Extended dashboard system */
.section-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-nav a {
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--dim);
  font-size: 11px;
  text-decoration: none;
  transition: color 140ms, background-color 140ms;
}

.section-nav a:hover { background: rgba(30, 214, 232, .07); color: var(--text); }

.data-section {
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(12, 25, 46, .97), rgba(6, 15, 30, .98));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms ease-out, transform 320ms ease-out, border-color 160ms;
}

.data-section.is-visible { opacity: 1; transform: translateY(0); }
.data-section:hover { border-color: #29405f; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-head h2 { margin: 4px 0 3px; font-size: 25px; font-weight: 620; letter-spacing: -.015em; }
.section-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }

.summary-toggle,
.filter-chip,
.legend-key,
.demo-badge {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0a172b;
  color: var(--muted);
  font-size: 11px;
}

button.summary-toggle,
button.filter-chip,
button.legend-key { cursor: pointer; }

.summary-toggle:hover,
.filter-chip:hover,
.legend-key:hover { border-color: var(--line-strong); color: var(--text); }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(250px, 1.3fr);
  margin-bottom: 14px;
  border: 1px solid rgba(32, 50, 78, .75);
  border-radius: 6px;
  background: rgba(5, 14, 28, .72);
}

.summary-strip[hidden] { display: none; }
.summary-strip > * { margin: 0; padding: 14px 16px; border-right: 1px solid rgba(32, 50, 78, .65); }
.summary-strip > *:last-child { border-right: 0; }
.summary-strip span { display: block; color: var(--dim); font-size: 10px; }
.summary-strip strong { display: block; margin-top: 3px; font-size: 16px; }
.summary-strip p { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }

.chart-shell {
  overflow: hidden;
  padding: 18px 18px 8px;
  border: 1px solid rgba(32, 50, 78, .76);
  border-radius: 7px;
  background: rgba(4, 13, 27, .68);
}

.chart-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px 40px; }
.chart-legend--bottom { justify-content: center; margin: 8px 0 2px; }
.legend-key { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; opacity: .58; }
.legend-key i,
.filter-chip i,
.monthly-table th i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--key);
  box-shadow: 0 0 10px color-mix(in srgb, var(--key) 54%, transparent);
}
.legend-key.is-active,
.filter-chip.is-active { border-color: color-mix(in srgb, var(--cyan) 48%, var(--line)); color: var(--text); opacity: 1; }

.line-chart { display: block; width: 100%; height: auto; min-height: 270px; }
.grid-line { stroke: rgba(113, 128, 154, .18); stroke-width: 1; }
.axis-label { fill: #71819d; font-size: 11px; font-family: inherit; }
.chart-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2600;
  stroke-dashoffset: 2600;
  animation: line-draw 900ms cubic-bezier(.2,.75,.2,1) forwards;
}
.today-line { stroke: rgba(30, 214, 232, .42); stroke-width: 1; stroke-dasharray: 4 5; }
.today-label { fill: #80eaf3; font-size: 10px; font-weight: 700; }
.monthly-line { opacity: .55; transition: opacity 160ms, stroke-width 160ms; }
.monthly-line.is-highlighted { opacity: 1; stroke-width: 4.5; }

.filter-chips { display: flex; max-width: 58%; gap: 5px; overflow-x: auto; padding: 2px; }
.filter-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; }

.table-hint,
.demo-badge { display: inline-flex; align-items: center; color: var(--dim); }
.monthly-table-wrap { margin-top: 0; }
.monthly-table { min-width: 1080px; }
.monthly-table th:first-child,
.monthly-table td:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  background: #0c192d;
  text-align: left;
}
.monthly-table tbody th { color: var(--muted); font-size: 12px; }
.monthly-table tbody th i { display: inline-block; margin-right: 8px; }
.monthly-table tr.is-muted { opacity: .43; }
.monthly-table tr.is-selected { background: rgba(30, 214, 232, .08); }
.monthly-table tr.is-selected th:first-child { color: var(--cyan); background: #102b3d; }

.staff-layout {
  display: grid;
  grid-template-columns: minmax(220px, .52fr) minmax(0, 1.48fr);
  gap: 14px;
}

.staff-summary,
.staff-list {
  border: 1px solid rgba(32, 50, 78, .8);
  border-radius: 7px;
  background: rgba(5, 14, 28, .68);
}
.staff-summary { padding: 24px; }
.staff-summary > span { color: var(--dim); font-size: 11px; }
.staff-summary > strong { display: block; margin: 5px 0 24px; font-size: 28px; }
.staff-gauge { height: 8px; overflow: hidden; border-radius: 2px; background: var(--surface-soft); }
.staff-gauge i { display: block; width: 60%; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); animation: bar-in 620ms ease-out both; }
.staff-summary p { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.staff-summary p b { color: var(--text); }

.staff-list { overflow: hidden; margin: 0; padding: 0; list-style: none; }
.staff-list li {
  display: grid;
  grid-template-columns: 36px minmax(130px, .7fr) minmax(120px, 1fr) minmax(92px, auto);
  align-items: center;
  gap: 12px;
  min-height: 73px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(32, 50, 78, .65);
}
.staff-list li:last-child { border-bottom: 0; }
.staff-list li:hover { background: rgba(30, 214, 232, .045); }
.staff-rank { color: var(--line-strong); font-size: 18px; font-weight: 800; }
.staff-person strong, .staff-person span { display: block; }
.staff-person span, .staff-sub { color: var(--dim); font-size: 10px; }
.staff-bar { height: 7px; overflow: hidden; border-radius: 2px; background: #122139; }
.staff-bar i { display: block; width: var(--staff-width); height: 100%; background: linear-gradient(90deg, var(--cyan), var(--blue)); animation: bar-in 540ms ease-out both; }
.staff-metric { text-align: right; font-size: 13px; }
.staff-sub { grid-column: 2 / -1; margin-top: -12px; }

.marketing-section { border-color: rgba(30, 214, 232, .25); }
.demo-badge { border-color: rgba(255, 189, 85, .25); color: #f7cc7a; }
.funnel-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, .6fr); gap: 14px; }
.funnel,
.funnel-focus { border: 1px solid rgba(32, 50, 78, .8); border-radius: 7px; background: rgba(5, 14, 28, .68); }
.funnel { display: flex; align-items: stretch; gap: 5px; min-height: 270px; padding: 22px; }
.funnel-step {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  margin-top: var(--step-inset);
  min-width: 0;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(30, 214, 232, calc(.04 + var(--step, .02))), rgba(15, 29, 51, .76));
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transform: none;
  transition: transform 180ms, border-color 180ms, background-color 180ms;
}
.funnel-step:hover,
.funnel-step.is-active { border-color: rgba(30, 214, 232, .64); background: linear-gradient(180deg, rgba(30, 214, 232, .16), rgba(11, 38, 57, .86)); transform: translateY(-3px); }
.funnel-step span { min-height: 34px; color: var(--text); font-size: 11px; }
.funnel-step strong { font-size: clamp(15px, 1.5vw, 22px); }
.funnel-step small { color: var(--dim); font-size: 9px; }
.funnel-focus { padding: 24px; background: linear-gradient(145deg, rgba(13, 41, 62, .9), rgba(8, 20, 38, .92)); }
.funnel-focus h3 { margin: 28px 0 2px; font-size: 20px; }
.funnel-focus > strong { font-size: 34px; }
.funnel-focus dl { display: grid; gap: 10px; margin: 28px 0 0; }
.funnel-focus dl div { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(49,82,119,.45); }
.funnel-focus dt { color: var(--dim); font-size: 10px; }
.funnel-focus dd { margin: 0; font-size: 12px; font-weight: 700; }

.site-footer {
  display: flex;
  width: min(1320px, calc(100% - 48px));
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
}
.site-footer span { color: var(--muted); font-weight: 800; letter-spacing: .14em; }
.site-footer p { margin: 0; }

.chat-widget {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  color-scheme: light;
  color: #102033;
}

.chat-panel {
  width: min(360px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  background: #ffffff;
  color: #102033;
  box-shadow: 0 20px 60px rgba(1, 8, 20, .34);
  animation: chat-open 180ms ease-out both;
}

.chat-panel[hidden], .chat-launcher[hidden],
.chat-answer[hidden], .chat-waiting[hidden], .chat-error[hidden], .chat-error button[hidden] { display: none; }

.chat-panel__header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px 12px 16px;
  border-bottom: 1px solid #e5e9ef;
  background: #ffffff;
  color: #102033;
}

.chat-panel__eyebrow {
  display: block;
  color: #18899a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
}

.chat-panel__header h2 {
  margin: 2px 0 0;
  color: #102033;
  font-size: 17px;
  line-height: 1.25;
}

.chat-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #d8dee7;
  border-radius: 5px;
  background: #f1f4f7;
  color: #39485a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 140ms, background-color 140ms, transform 140ms;
}

.chat-close:hover { border-color: #aeb8c5; background: #e8edf2; color: #102033; transform: translateY(-1px); }
.chat-close:focus-visible, .chat-launcher:focus-visible, .chat-form input:focus-visible,
.chat-form button:focus-visible, .chat-error button:focus-visible { outline: 2px solid #18899a; outline-offset: 2px; }

.chat-panel__body {
  min-height: 116px;
  padding: 14px 16px;
  background: #ffffff;
  color: #102033;
}

.chat-intro {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #e3e8ee;
  border-radius: 5px;
  background: #f6f8fb;
  color: #5c6978;
  font-size: 12px;
}

.chat-answer {
  margin: 10px 0 0;
  padding: 11px;
  border: 1px solid #c8e5e9;
  border-radius: 5px;
  background: #eef8fa;
  color: #102033;
  font-size: 13px;
  white-space: pre-wrap;
}

.chat-waiting {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid #e3e8ee;
  border-radius: 5px;
  background: #f6f8fb;
  color: #475569;
  font-size: 12px;
}

.chat-waiting span { margin-right: 3px; color: #475569; }
.chat-waiting i { width: 5px; height: 5px; border-radius: 50%; background: #18899a; animation: chat-wait 720ms ease-in-out infinite alternate; }
.chat-waiting i:nth-child(3) { animation-delay: 120ms; }
.chat-waiting i:nth-child(4) { animation-delay: 240ms; }

.chat-error {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #f0c8c2;
  border-radius: 5px;
  background: #fff4f2;
  color: #b42318;
}
.chat-error p { margin: 0; color: #b42318; font-size: 12px; }
.chat-error button {
  min-height: 36px;
  margin-top: 8px;
  padding: 0 11px;
  border: 1px solid #d8a7a0;
  border-radius: 4px;
  background: #ffffff;
  color: #8f1d14;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.chat-error button:hover { border-color: #b42318; background: #fff9f8; color: #6f160f; }

.chat-form {
  padding: 12px 16px 16px;
  border-top: 1px solid #e5e9ef;
  background: #f1f4f8;
  color: #102033;
}
.chat-form label { display: block; margin-bottom: 6px; color: #39485a; font-size: 10px; font-weight: 700; }
.chat-form__row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 7px; background: transparent; }
.chat-form input {
  min-width: 0;
  height: 44px;
  padding: 0 11px;
  border: 1px solid #cdd5df;
  border-radius: 5px;
  background: #ffffff;
  color: #102033;
  caret-color: #18899a;
}
.chat-form input::placeholder { color: #7b8794; opacity: 1; }
.chat-form input:disabled { background: #e8edf2; color: #697586; }
.chat-form button {
  height: 44px;
  padding: 0 10px;
  border: 1px solid #102033;
  border-radius: 5px;
  background: #102033;
  color: #ffffff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: background-color 140ms, transform 140ms;
}
.chat-form button:hover { background: #1b344f; color: #ffffff; transform: translateY(-1px); }
.chat-form button:disabled { border-color: #ccd3dc; background: #ccd3dc; color: #ffffff; cursor: wait; transform: none; }

.chat-launcher {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #d8dee7;
  border-radius: 7px;
  background: #ffffff;
  color: #102033;
  box-shadow: 0 12px 34px rgba(1, 8, 20, .3);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 140ms, transform 140ms;
}
.chat-launcher span { margin-right: 5px; color: #18899a; }
.chat-launcher:hover { border-color: #18899a; background: #ffffff; color: #102033; transform: translateY(-2px); }

@keyframes chat-open { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes chat-wait { from { opacity: .35; transform: translateY(1px); } to { opacity: 1; transform: translateY(-1px); } }

@keyframes line-draw { to { stroke-dashoffset: 0; } }

@media (max-width: 1020px) {
  .section-nav { display: none; }
  .summary-strip { grid-template-columns: repeat(3, 1fr); }
  .summary-strip p { grid-column: 1 / -1; border-top: 1px solid rgba(32, 50, 78, .65); }
  .staff-layout, .funnel-layout { grid-template-columns: 1fr; }
  .funnel { min-height: 240px; }
}

@media (max-width: 680px) {
  .topbar { gap: 12px; }
  .topbar__context { margin-left: auto; }
  .data-section { padding: 18px 14px; }
  .section-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .section-head h2 { font-size: 22px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-strip > * { border-bottom: 1px solid rgba(32, 50, 78, .65); }
  .summary-strip p { grid-column: 1 / -1; }
  .filter-chips { width: calc(100% + 14px); max-width: none; margin-right: -14px; padding-right: 14px; scroll-snap-type: x mandatory; }
  .filter-chip { min-height: 42px; scroll-snap-align: start; }
  .chart-shell { margin: 0 -6px; padding: 12px 6px 4px; }
  .chart-legend { margin-left: 30px; }
  .legend-key { min-height: 40px; }
  .line-chart { min-height: 220px; }
  .staff-list li { grid-template-columns: 34px minmax(110px, 1fr) minmax(82px, auto); }
  .staff-bar { grid-column: 2 / -1; grid-row: 2; }
  .staff-sub { grid-column: 2 / -1; margin-top: 0; }
  .funnel { flex-direction: column; min-height: auto; padding: 12px; }
  .funnel-step {
    min-height: 68px;
    width: var(--funnel-width);
    flex: none;
    margin-top: 0;
    transform: none;
  }
  .funnel-step:hover,
  .funnel-step.is-active { transform: translateX(3px); }
  .funnel-step span { min-height: 0; }
  .funnel-step strong { font-size: 18px; }
  .site-footer { width: calc(100% - 28px); align-items: flex-start; flex-direction: column; }
  .chat-widget { right: 12px; bottom: 12px; left: 12px; }
  .chat-panel { width: 100%; max-height: calc(100dvh - 24px); }
  .chat-launcher { float: right; min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  .chart-line { stroke-dasharray: none; stroke-dashoffset: 0; }
  .chat-panel, .chat-waiting i { animation: none; }
  .chat-close:hover, .chat-launcher:hover, .chat-form button:hover { transform: none; }
}
