:root {
  color-scheme: dark;
  --ink: #edf4f7;
  --muted: #8fa2ad;
  --muted-2: #647985;
  --bg: #071018;
  --bg-soft: #0b1720;
  --surface: rgba(15, 29, 39, 0.84);
  --surface-solid: #0f1d27;
  --line: rgba(143, 174, 189, 0.14);
  --line-strong: rgba(143, 174, 189, 0.26);
  --cyan: #62dfca;
  --cyan-2: #2d9f91;
  --gold: #e9bc68;
  --red: #f27078;
  --blue: #6ea8ff;
  --warning: #f2a95d;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -20%, rgba(31, 116, 110, 0.2), transparent 34%),
    radial-gradient(circle at 100% 20%, rgba(71, 99, 142, 0.14), transparent 30%),
    var(--bg);
  font-family:
    Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: 25%;
  left: -200px;
  background: var(--cyan);
}

.ambient-two {
  right: -180px;
  bottom: 10%;
  background: var(--blue);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 24, 0.82);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(98, 223, 202, 0.34);
  border-radius: 14px;
  color: var(--cyan);
  background: rgba(98, 223, 202, 0.08);
  font-size: 24px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 27, 37, 0.7);
}

.nav-tab,
.segmented button {
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-tab {
  padding: 9px 16px;
  font-size: 13px;
}

.nav-tab:hover,
.nav-tab.is-active,
.segmented button:hover,
.segmented button.is-active {
  color: var(--ink);
  background: rgba(98, 223, 202, 0.11);
}

.health-pill {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.health-pill span {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--warning);
  box-shadow: 0 0 16px var(--warning);
}

.health-pill.is-ok span {
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

main {
  width: min(1380px, calc(100% - 40px));
  min-height: calc(100vh - 180px);
  margin: 0 auto;
}

.page-panel {
  display: none;
  padding: 56px 0 84px;
  animation: reveal 260ms ease;
}

.page-panel.is-active {
  display: block;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: end;
  gap: 40px;
  min-height: 410px;
  padding: clamp(36px, 6vw, 78px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(13, 34, 44, 0.96), rgba(8, 19, 27, 0.9)),
    var(--surface-solid);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  top: -38%;
  right: -4%;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(98, 223, 202, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(98, 223, 202, 0.018),
    0 0 0 140px rgba(98, 223, 202, 0.014);
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 16px 0 22px;
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 680;
  line-height: 1.04;
  letter-spacing: -0.055em;
}

h1 em {
  color: var(--cyan);
  font-style: normal;
}

.hero-copy > p,
.page-intro > div > p {
  max-width: 680px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.primary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border 160ms ease,
    background 160ms ease;
}

.primary-button {
  border: 1px solid var(--cyan);
  color: #05231f;
  background: var(--cyan);
  font-weight: 740;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.ghost-button:hover {
  border-color: rgba(98, 223, 202, 0.5);
}

.wide {
  width: 100%;
}

.hero-metric {
  position: relative;
  z-index: 1;
  padding: 26px;
  border: 1px solid rgba(233, 188, 104, 0.2);
  border-radius: 20px;
  background: rgba(233, 188, 104, 0.055);
}

.hero-metric > span {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.hero-metric strong {
  display: block;
  margin: 12px 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: clamp(20px, 2.1vw, 30px);
  font-weight: 570;
  line-height: 1.45;
}

.hero-metric p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.section-heading,
.page-intro,
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  margin: 64px 0 22px;
}

.section-heading h2,
.page-intro h1 {
  margin: 6px 0 0;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.035em;
}

.section-heading > p {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
}

.prediction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.prediction-card {
  position: relative;
  min-height: 292px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.18);
}

.prediction-card::after {
  position: absolute;
  right: -80px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(98, 223, 202, 0.1), transparent 65%);
  content: "";
}

.prediction-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.lottery-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lottery-name strong {
  font-size: 19px;
}

.lottery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(98, 223, 202, 0.55);
}

.prediction-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.prediction-issue {
  margin-top: 6px;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
}

.ball-section {
  position: relative;
  z-index: 1;
  margin-top: 34px;
}

.ball-label {
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 11px;
}

.ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.ball {
  display: grid;
  width: clamp(38px, 4vw, 48px);
  height: clamp(38px, 4vw, 48px);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.ball-primary {
  color: #071018;
  background: linear-gradient(145deg, #f19c7c, #ec6878);
}

.prediction-card.ssq .ball-primary {
  background: linear-gradient(145deg, #fb8a8e, #e85264);
}

.ball-secondary {
  color: #06111e;
  background: linear-gradient(145deg, #8ec8ff, #5d91f3);
}

.prediction-footer {
  position: absolute;
  z-index: 1;
  right: 28px;
  bottom: 24px;
  left: 28px;
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 11px;
}

.skeleton-card {
  min-height: 292px;
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.025) 20%, rgba(255, 255, 255, 0.07) 40%, rgba(255, 255, 255, 0.025) 60%)
      0 0 / 200% 100%,
    var(--surface);
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(11, 23, 32, 0.66);
}

.mini-metric {
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}

.mini-metric:last-child {
  border-right: 0;
}

.mini-metric span,
.subtle-label {
  color: var(--muted-2);
  font-size: 11px;
}

.mini-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.surface-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 46px rgba(0, 0, 0, 0.14);
}

.dashboard-grid > .surface-card,
.analysis-grid > .surface-card,
.evolution-layout > .surface-card,
.admin-grid > .surface-card {
  padding: 26px;
}

.card-title-row {
  align-items: flex-start;
}

.card-title-row h3 {
  margin: 6px 0 0;
  font-size: 20px;
}

.icon-box,
.step-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--cyan);
  background: rgba(98, 223, 202, 0.06);
  font-size: 12px;
}

.rule-list {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.rule-list li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.rule-list li:last-child {
  border-bottom: 0;
}

.rule-list b {
  color: var(--gold);
  font-size: 13px;
}

.rule-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.status-tag {
  padding: 5px 9px;
  border-radius: 99px;
  font-size: 10px;
}

.status-neutral {
  color: var(--cyan);
  background: rgba(98, 223, 202, 0.1);
}

.status-warning {
  color: var(--warning);
  background: rgba(242, 169, 93, 0.11);
}

.audit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.audit-row:last-child {
  border-bottom: 0;
}

.audit-row span {
  color: var(--muted);
  font-size: 12px;
}

.audit-row strong {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
}

.task-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.task-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.task-item:last-child {
  border-bottom: 0;
}

.task-item > span:first-child,
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
}

.task-item.is-failed > span:first-child {
  background: var(--red);
}

.task-item b {
  display: block;
  font-size: 12px;
  font-weight: 620;
}

.task-item small {
  color: var(--muted-2);
  font-size: 10px;
}

.task-item time {
  color: var(--muted-2);
  font-size: 10px;
}

.empty-state {
  color: var(--muted-2);
  font-size: 12px;
}

.page-intro {
  align-items: end;
  margin-bottom: 36px;
}

.page-intro h1 {
  margin-bottom: 12px;
}

.page-intro > div > p {
  margin-bottom: 0;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
}

.segmented button {
  min-width: 90px;
  padding: 9px 14px;
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.analysis-metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 29, 39, 0.66);
}

.analysis-metric span {
  color: var(--muted-2);
  font-size: 11px;
}

.analysis-metric strong {
  display: block;
  margin-top: 6px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 20px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.frequency-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 7px;
  margin-top: 24px;
}

.frequency-cell {
  position: relative;
  display: grid;
  min-height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.015);
}

.frequency-cell::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--height);
  background: linear-gradient(180deg, transparent, rgba(98, 223, 202, var(--alpha)));
  content: "";
}

.frequency-cell b {
  z-index: 1;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
}

.frequency-cell small {
  z-index: 1;
  color: var(--muted-2);
  font-size: 9px;
}

.frequency-cell.level-0::after { --height: 4%; --alpha: 0.04; }
.frequency-cell.level-1::after { --height: 10%; --alpha: 0.08; }
.frequency-cell.level-2::after { --height: 20%; --alpha: 0.12; }
.frequency-cell.level-3::after { --height: 30%; --alpha: 0.16; }
.frequency-cell.level-4::after { --height: 40%; --alpha: 0.20; }
.frequency-cell.level-5::after { --height: 50%; --alpha: 0.25; }
.frequency-cell.level-6::after { --height: 60%; --alpha: 0.30; }
.frequency-cell.level-7::after { --height: 70%; --alpha: 0.36; }
.frequency-cell.level-8::after { --height: 80%; --alpha: 0.42; }
.frequency-cell.level-9::after { --height: 90%; --alpha: 0.48; }
.frequency-cell.level-10::after { --height: 100%; --alpha: 0.56; }

.card-footnote {
  margin: 18px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
}

.chart-wrap {
  min-height: 250px;
  margin-top: 16px;
}

.chart-wrap svg {
  width: 100%;
  height: 250px;
  overflow: visible;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10px;
}

.chart-legend span {
  width: 18px;
  height: 2px;
  background: var(--cyan);
}

.hot-cold-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 22px;
}

.number-column > span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 11px;
}

.number-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.number-rank b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(98, 223, 202, 0.08);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
}

.number-rank small {
  color: var(--muted-2);
}

.performance-number {
  margin: 28px 0 7px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 48px;
  letter-spacing: -0.06em;
}

.performance-number small {
  color: var(--muted-2);
  font-size: 13px;
  letter-spacing: normal;
}

.performance-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.comparison-bar {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 48px;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 10px;
}

.bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.bar-track i {
  display: block;
  width: var(--width);
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.bar-track i.width-0 { width: 0; }
.bar-track i.width-1 { width: 10%; }
.bar-track i.width-2 { width: 20%; }
.bar-track i.width-3 { width: 30%; }
.bar-track i.width-4 { width: 40%; }
.bar-track i.width-5 { width: 50%; }
.bar-track i.width-6 { width: 60%; }
.bar-track i.width-7 { width: 70%; }
.bar-track i.width-8 { width: 80%; }
.bar-track i.width-9 { width: 90%; }
.bar-track i.width-10 { width: 100%; }

.bar-row.random .bar-track i {
  background: var(--gold);
}

.history-card {
  margin-top: 18px;
  padding: 26px;
}

.table-scroll {
  margin-top: 18px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 620;
  letter-spacing: 0.08em;
}

td {
  color: var(--muted);
  font-size: 12px;
}

td strong {
  color: var(--ink);
}

.table-balls {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  color: var(--ink);
}

.evolution-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 18px;
}

.principle-badge {
  padding: 12px 16px;
  border: 1px solid rgba(233, 188, 104, 0.2);
  border-radius: 14px;
  color: var(--gold);
  background: rgba(233, 188, 104, 0.06);
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 0;
  margin-top: 22px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-version {
  color: var(--cyan);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.timeline-item > span:last-child {
  color: var(--muted-2);
  font-size: 10px;
}

.expert-score {
  margin: 28px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.expert-score strong {
  display: block;
  margin-bottom: 5px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 42px;
}

.expert-score span,
.expert-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.formula-heading {
  margin-top: 48px;
}

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

.formula-card {
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 29, 39, 0.72);
}

.formula-card h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.formula {
  min-height: 38px;
  color: var(--cyan);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.formula-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.formula-card .warning {
  color: var(--gold);
}

.admin-key-box {
  min-width: min(460px, 100%);
}

.admin-key-box label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 11px;
}

.admin-key-box > div {
  display: flex;
  gap: 8px;
}

.admin-key-box input {
  flex: 1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: rgba(4, 13, 20, 0.62);
  transition: border 160ms ease;
}

input,
select {
  min-height: 43px;
  padding: 0 12px;
}

textarea {
  padding: 11px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(98, 223, 202, 0.56);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.plan-preview {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--cyan);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(20px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
}

footer p {
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  opacity: 0;
  color: var(--ink);
  background: #10212b;
  box-shadow: var(--shadow);
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: rgba(242, 112, 120, 0.45);
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-tabs {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: center;
  }

  .health-pill {
    grid-column: 2;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .task-card {
    grid-column: span 2;
  }

  .formula-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  main {
    width: min(100% - 24px, 1380px);
  }

  .site-header {
    gap: 10px;
    padding: 10px 14px;
  }

  .health-pill b,
  .brand small {
    display: none;
  }

  .nav-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .nav-tab {
    padding: 8px 11px;
    white-space: nowrap;
  }

  .page-panel {
    padding-top: 24px;
  }

  .hero {
    min-height: auto;
    padding: 30px 24px;
  }

  .hero::after {
    display: none;
  }

  h1 {
    font-size: 42px;
  }

  .prediction-grid,
  .analysis-grid,
  .evolution-layout,
  .admin-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-column: auto;
  }

  .metric-strip,
  .analysis-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .mini-metric:nth-child(2) {
    border-right: 0;
  }

  .mini-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .section-heading,
  .page-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .frequency-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .formula-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 72px 1fr;
  }

  .timeline-item > span:last-child {
    grid-column: 2;
  }

  .admin-key-box > div {
    align-items: stretch;
    flex-direction: column;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .metric-strip,
  .analysis-metrics {
    grid-template-columns: 1fr;
  }

  .mini-metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .frequency-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .prediction-footer {
    position: static;
    margin-top: 24px;
  }

  .prediction-card {
    min-height: auto;
  }
}
