:root {
  --bg: #eef3ee;
  --ink: #12241c;
  --muted: #66756e;
  --forest: #1b5e42;
  --forest-2: #134833;
  --line: #d7e2da;
  --card: #ffffff;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -10%, #dcead9 0%, transparent 55%),
    radial-gradient(700px 380px at 110% 0%, #f3ead6 0%, transparent 50%),
    var(--bg);
}
.skip {
  position: absolute; left: -999px; top: 8px;
  background: #fff; color: var(--ink); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 12px; z-index: 20; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 28px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; color: #eaf4ec;
  background: linear-gradient(160deg, #1f6b4a, #10281e);
}
.brand strong { display: block; font-family: Manrope, Inter, sans-serif; font-size: 14px; }
.brand span { font-size: 12px; color: var(--muted); }
.pill, a.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 650;
  background: #fff; border: 1px solid var(--line); color: inherit; text-decoration: none;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #b42318; }
.pill.is-on i { background: #1b7f4e; box-shadow: 0 0 0 4px rgba(27, 127, 78, .16); }
.pill.is-on { color: var(--forest); }
.hero {
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 24px;
  align-items: end; margin-bottom: 22px;
}
.kicker {
  margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--forest); font-weight: 700;
}
.hero h1 {
  margin: 0 0 10px; font-family: Manrope, Inter, sans-serif;
  font-size: clamp(26px, 4vw, 42px); letter-spacing: -.03em; line-height: 1.18;
}
.hero p { margin: 0; color: var(--muted); max-width: 54ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-weight: 650; font-size: 13px;
}
.steps span { color: var(--forest); font-size: 11px; letter-spacing: .08em; }
.banner-error, .banner-warn, .form-error {
  padding: 12px 14px; border-radius: 12px; margin: 0 0 16px;
}
.banner-error, .form-error {
  background: #fdecec; color: #8a2e28; border: 1px solid #f3c9c6;
}
.banner-warn {
  background: #fff6e8; color: #7a4b12; border: 1px solid #f0d7b0;
}
.layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; }
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: 0 18px 40px rgba(16, 40, 30, .06);
}
.panel-head h2, .result-panel h2 { margin: 0 0 4px; font-size: 20px; }
.panel-head p, .empty p, .summary, .hint { margin: 0; color: var(--muted); font-size: 14px; }
.drop {
  margin-top: 16px; border: 1.5px dashed #c5d5cb; border-radius: 16px;
  min-height: 240px; background: #f7faf7; cursor: pointer;
  display: grid; place-items: center; overflow: hidden;
}
.drop:hover, .drop.is-over, .drop:focus-visible { border-color: var(--forest); background: #eef6f1; outline: none; }
.drop-idle { text-align: center; padding: 28px 16px; color: var(--muted); }
.drop-icon {
  width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 16px;
  display: grid; place-items: center; background: #e7f3ec; color: var(--forest);
}
.drop-idle strong { display: block; color: var(--ink); margin-bottom: 4px; }
.preview { margin: 0; width: 100%; }
.preview img { width: 100%; height: 240px; object-fit: cover; display: block; }
.preview figcaption {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; background: #fff;
}
.preview small { display: block; color: var(--muted); }
.actions { display: flex; gap: 10px; margin-top: 14px; }
.primary, .ghost {
  font: inherit; border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 700;
}
.primary {
  flex: 1; border: 0; color: #fff;
  background: linear-gradient(180deg, #227455, var(--forest-2));
}
.primary:focus-visible, .ghost:focus-visible { outline: 3px solid rgba(27, 94, 66, .28); outline-offset: 2px; }
.primary:disabled, .ghost:disabled { opacity: .45; cursor: not-allowed; }
.primary.is-busy .idle-label, .busy-label { display: none; }
.primary.is-busy .busy-label { display: inline; }
.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.result-panel { min-height: 360px; }
.has-result { animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.grade-kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.badge {
  display: inline-block; margin: 14px 0 16px; border-radius: 999px;
  padding: 5px 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #fff;
  background: #1b7f4e;
}
.grade-standard .badge { background: #3d5a80; }
.grade-basic .badge { background: #c27b14; }
.grade-reject .badge, .grade-non_tea .badge { background: #b42318; }
.meter { margin: 8px 0 18px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar { height: 10px; background: #e7eee8; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--forest); border-radius: inherit; }
.hint { margin-top: 8px; }
.odds { margin: 0 0 16px; }
.odds > p { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.odd { display: grid; grid-template-columns: 92px 1fr 52px; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.odd span { color: var(--muted); font-weight: 700; }
.odd div { height: 8px; background: #e7eee8; border-radius: 999px; overflow: hidden; }
.odd i { display: block; height: 100%; background: #9bb5a6; }
.odd.is-win i { background: var(--forest); }
.odd strong { text-align: right; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.facts div { background: #f6f8f6; border-radius: 12px; padding: 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 750; }
.empty { display: grid; place-items: center; text-align: center; min-height: 280px; padding: 24px; }
.tips {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px;
}
.tips article {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.tips strong { display: block; margin-bottom: 4px; font-size: 13px; }
.tips span { color: var(--muted); font-size: 13px; }
.legend {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 16px;
}
.legend-item {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.legend-item span {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .08em;
  color: #fff; background: #1b7f4e; border-radius: 999px; padding: 3px 8px; margin-bottom: 8px;
}
.legend-item.is-standard span { background: #3d5a80; }
.legend-item.is-basic span { background: #c27b14; }
.legend-item.is-reject span, .legend-item.is-non_tea span { background: #b42318; }
.legend-item strong { display: block; font-size: 13px; margin-bottom: 4px; }
.legend-item small { color: var(--muted); font-size: 12px; }
.legend-item.is-hit { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(27, 94, 66, .12); }
footer { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: center; }
.overlay {
  position: fixed; inset: 0; background: rgba(18, 36, 28, .42);
  display: grid; place-items: center; color: #fff; z-index: 30; text-align: center;
}
.overlay[hidden] { display: none; }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 980px) {
  .hero, .layout, .legend, .tips { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .has-result, .spinner { animation: none; }
}
