:root {
  color-scheme: light;
  --ink: #102539;
  --muted: #536676;
  --paper: #f0f4f6;
  --line: #dce5e9;
  --teal: #0a6658;
  --blue: #125b83;
  --orange: #a93616;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #1672a3; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.page-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-content { display: flex; justify-content: space-between; align-items: center; min-height: 66px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 800; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #a6f4d5; background: #153647; font-size: 21px; }
nav { display: flex; flex-wrap: wrap; gap: 12px 25px; font-size: .875rem; color: var(--muted); font-weight: 650; }
nav a:hover { color: var(--teal); }

.hero { isolation: isolate; position: relative; overflow: hidden; margin-block: 30px 24px; min-height: 257px; border-radius: 22px; color: #fff; background: radial-gradient(ellipse at 80% 0%, #255b60, transparent 57%), linear-gradient(112deg, #112734 25%, #17434b); }
.hero-content { position: relative; z-index: 1; max-width: 64%; padding: 52px 40px 47px; }
.hero h1 { font-size: clamp(2.15rem, 4.6vw, 4rem); line-height: 1.14; font-weight: 850; letter-spacing: -.065em; }
.hero h1 span { color: #a7edcf; }
.hero p { margin-top: 18px; color: #d7e8e9; line-height: 1.65; }
.ball-art { position: absolute; width: 408px; height: 250px; top: 5px; right: 20px; pointer-events: none; }
.orbit { position: absolute; width: 362px; height: 128px; top: 65px; right: 9px; border-radius: 50%; border: 1px solid #bffde643; transform: rotate(-24deg); }
.orbit-inner { width: 305px; height: 154px; top: 52px; right: 40px; border-color: #bffde624; }
.art-ball { position: absolute; display: grid; place-items: center; border-radius: 50%; box-shadow: 8px 15px 23px #04162172; font-style: normal; background: radial-gradient(circle at 32% 25%, var(--light), var(--base) 59%, var(--shade) 88%); }
.art-ball b { display: grid; place-items: center; width: 60%; height: 60%; border-radius: 50%; background: #f6f8e9; color: #102b31; font-family: ui-monospace, monospace; font-size: var(--type); letter-spacing: -.07em; box-shadow: inset -3px -3px 8px #3b4f4836; }
.art-ball.small { width: 57px; height: 57px; left: 52px; top: 108px; transform: rotate(-20deg); --type: 17px; --light: #a3eafa; --base: #49aec1; --shade: #1b6274; }
.art-ball.large { width: 138px; height: 138px; left: 119px; top: 57px; transform: rotate(-15deg); --type: 46px; --light: #d8ffe0; --base: #8ddcb1; --shade: #347861; }
.art-ball.medium { width: 90px; height: 90px; right: 54px; top: 36px; transform: rotate(19deg); --type: 29px; --light: #ffd2ac; --base: #f7835c; --shade: #974229; }

.toolbar, .card-heading, .results-heading, .table-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toolbar { margin-bottom: 18px; }
.segments { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #e6edf0; }
.segments button { min-height: 42px; min-width: 94px; padding: 6px 14px; border-radius: 8px; border: 0; background: transparent; font-weight: 700; color: var(--muted); white-space: nowrap; }
.segments button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.demo-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .875rem; }
.demo-label span { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #b66a22; }

.dashboard { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 23px; scroll-margin-top: 14px; }
h2 { font-size: 1.3rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
.meta, .muted { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.muted { margin-top: 5px; }

table { width: 100%; border-collapse: collapse; margin-top: 15px; text-align: left; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid #e8eef0; padding: 10px 7px; }
th { font-size: .875rem; color: var(--muted); font-weight: 600; background: #f4f7f8; white-space: nowrap; }
td { font-size: .875rem; }
td:first-child { font-weight: 700; }
td:nth-child(2) { color: var(--muted); white-space: nowrap; }
.balls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ball { display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #fce9e0; color: var(--orange); font-size: .78rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.back .ball { color: var(--blue); background: #e0f1fa; }
.table-footer { margin-top: 14px; }
.secondary { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font-size: .875rem; font-weight: 650; }
.secondary:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.secondary:disabled { color: var(--muted); opacity: .55; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
#picker-form { margin-top: 17px; }
.span-two { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .875rem; font-weight: 650; }
input, select { width: 100%; min-height: 44px; padding: 8px 11px; border: 1px solid #cbd8de; border-radius: 9px; background-color: #fbfcfd; color: var(--ink); font-size: 1rem; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, #536676 50%), linear-gradient(135deg, #536676 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.primary { width: 100%; min-height: 46px; border: 0; border-radius: 9px; color: #fff; background: var(--teal); margin-top: 15px; font-weight: 750; }
.primary:hover { background: #074f43; }
.form-note, .form-error { margin-top: 10px; font-size: .875rem; line-height: 1.5; color: var(--muted); }
.form-error { color: #a33027; }
.results { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 13px; }
.results ol { margin: 8px 0 0; padding-left: 24px; }
.results li { border-bottom: 1px solid #e8eef0; padding: 8px 0; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.combination { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; vertical-align: middle; }
.combination .meta { margin-left: 2px; }

.stats { grid-column: 1 / -1; }
.stats-heading { align-items: start; }
.window-label { white-space: nowrap; }
.stats-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 18px; }
.stats-panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 15px; }
.stats-panel h3 { margin-bottom: 7px; }
.stats-table { margin-top: 0; }
.stats-table th, .stats-table td { padding: 6px; }
.stats-table th:last-child, .stats-table td:last-child { text-align: right; }
.frequency { display: grid; grid-template-columns: minmax(0, 1fr) 2ch; align-items: center; gap: 7px; }
.track { height: 7px; border-radius: 999px; background: #eaf0f2; }
.bar { display: block; height: 100%; border-radius: inherit; background: #33758b; }
.heat-hot .bar { background: #c7582a; }
.heat-cold .bar { background: #6276a8; }
.heat-hot .heat-label { color: var(--orange); }
.heat-cold .heat-label { color: #43568b; }
.page-footer { padding-block: 24px 36px; color: var(--muted); font-size: .875rem; }

@media (max-width: 1020px) {
  .shell { width: calc(100% - 40px); }
  .dashboard { grid-template-columns: 1fr 1fr; gap: 15px; }
  .card { padding: 16px; }
  .ball-art { transform: scale(.85); transform-origin: center right; right: 0; }
}

@media (max-width: 805px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .hero-content { max-width: 70%; padding-left: 25px; }
  .ball-art { transform: scale(.65); }
}

@media (max-width: 580px) {
  .shell { width: calc(100% - 24px); }
  .header-content { min-height: 58px; }
  nav { column-gap: 11px; }
  .hero { min-height: auto; border-radius: 16px; margin-block: 17px 15px; }
  .hero-content { max-width: 85%; padding: 28px 16px; }
  .hero h1 { letter-spacing: -.055em; }
  .hero h1 span { display: block; }
  .hero p { max-width: 245px; margin-top: 10px; }
  .ball-art { top: -10px; right: -27px; opacity: .6; transform: scale(.32); }
  .toolbar { align-items: start; margin-bottom: 12px; }
  .demo-label { padding-top: 6px; }
  .segments button { min-width: 0; padding-inline: 10px; }
  .card { border-radius: 13px; padding: 12px; }
  th, td { padding: 8px 3px; }
  .stats-columns { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .stats-heading { flex-wrap: wrap; }
}

@media (max-width: 370px) {
  .brand { gap: 5px; }
  .ball { width: 24px; height: 24px; }
  td { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
