:root {
  --bg: #fff8ef; --card: #ffffff; --ink: #1f2a44; --muted: #6b7280; --line: #f0e6d8;
  --sun: #ff8a3d; --sun2: #ffc145; --accent: #1f2a44; --ok: #3ea72d; --warn: #e53210;
  --radius: 18px; --shadow: 0 6px 24px rgba(31, 42, 68, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}
.hero {
  background: radial-gradient(120% 90% at 85% 0%, #ffd56b 0%, #ff9a4a 45%, #ff7a3d 100%);
  color: #fff; padding: 28px 20px 46px; border-radius: 0 0 28px 28px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.brand h1 { margin: 0; font-size: 28px; letter-spacing: 2px; line-height: 1; }
.tag { margin: 2px 0 0; opacity: .9; font-weight: 600; font-size: 14px; }
.lead { margin: 16px 0 0; font-size: 18px; font-weight: 500; max-width: 32ch; }
main { max-width: 560px; margin: -26px auto 0; padding: 0 14px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 16px; margin-bottom: 14px;
}
h2 { font-size: 18px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 14px;
}
.small { font-size: 13px; }
.muted { color: var(--muted); }
.seg { display: flex; background: #f6efe6; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg-btn {
  flex: 1; border: 0; background: transparent; padding: 9px 8px; border-radius: 9px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.chip.active { border-color: var(--sun); background: #fff1e6; color: #b4500f; }
.q { border: 0; padding: 0; margin: 0 0 14px; }
.q legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.q .chips { margin: 0; }
.q .chip { font-size: 13px; padding: 7px 11px; }
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type {
  border: 2px solid var(--line); border-radius: 14px; background: #fff; padding: 10px 6px 8px;
  font: inherit; cursor: pointer; text-align: center; color: var(--ink);
}
.type .sw { display: block; width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 6px; border: 1px solid rgba(0,0,0,.08); }
.type b { display: block; font-size: 15px; }
.type span.d { display: block; font-size: 11px; color: var(--muted); line-height: 1.25; }
.type.active { border-color: var(--sun); background: #fff6ee; }
.sw1 { background: #f7e1d0; } .sw2 { background: #eecaae; } .sw3 { background: #d9a77f; }
.sw4 { background: #b67d52; } .sw5 { background: #8a5632; } .sw6 { background: #4d2e1b; }
.result-line { margin: 12px 0 0; font-weight: 600; min-height: 1.2em; }
.result-line .pill { background: #fff1e6; color: #b4500f; border-radius: 999px; padding: 3px 10px; margin-right: 6px; }
.hint { margin-top: 10px; }
.hint summary { cursor: pointer; font-size: 14px; font-weight: 600; color: #b4500f; padding: 4px 0; }
.hint[open] summary { margin-bottom: 8px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fffdfa; color: var(--ink); margin-top: 4px;
}
input:focus, select:focus { outline: none; border-color: var(--sun); }
.row { display: flex; gap: 8px; align-items: stretch; }
.row input { margin-top: 0; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.btn {
  border: 0; border-radius: 14px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer;
}
.btn.secondary { background: #f6efe6; color: var(--ink); }
.btn.primary { background: linear-gradient(135deg, var(--sun2), var(--sun)); color: #fff; box-shadow: 0 6px 18px rgba(255,138,61,.35); }
.btn.primary:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.big { font-size: 18px; padding: 16px; margin: 4px 0 16px; }
.or { text-align: center; position: relative; margin: 12px 0; font-size: 12px; color: var(--muted); }
.or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { background: #fff; padding: 0 8px; position: relative; }
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li button {
  width: 100%; text-align: left; border: 0; background: #fffaf3; border-radius: 10px; padding: 9px 12px;
  margin-bottom: 6px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink);
}
.uv-status { margin-top: 14px; padding: 12px; border-radius: 14px; background: #fffaf3; font-size: 14px; display: flex; gap: 12px; align-items: center; }
.uv-dot { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; }
.result-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.uv-badge {
  flex: none; width: 70px; height: 70px; border-radius: 50%; color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 26px; font-weight: 800; line-height: 1;
}
.uv-badge small { font-size: 11px; font-weight: 700; letter-spacing: 1px; margin-top: 2px; }
.eyebrow { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.result-head h2 { margin: 2px 0 0; font-size: 22px; }
.big-stats { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.stat { background: #fffaf3; border-radius: 16px; padding: 12px; }
.stat.main { background: linear-gradient(135deg, #fff1db, #ffe1cc); }
.stat .label { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat .value { margin: 4px 0 0; font-size: 26px; font-weight: 800; }
.stat.main .value { font-size: 34px; color: #c2410c; }
.alert { border-radius: 14px; padding: 11px 12px; margin-top: 10px; font-size: 14px; display: flex; gap: 10px; }
.alert .i { flex: none; font-size: 18px; line-height: 1.2; }
.alert.ok { background: #eaf7e6; color: #1f5f16; }
.alert.warn { background: #fdecea; color: #8a1c0c; }
.alert.info { background: #eef3ff; color: #1f3a7a; }
.chart-wrap { margin-top: 18px; }
#chart svg { width: 100%; height: auto; display: block; }
.windows { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.windows li { padding: 6px 0; border-top: 1px solid var(--line); }
.windows li:first-child { border-top: 0; }
#r-how p { margin: 6px 0; }
#r-how code { background: #f6efe6; padding: 1px 5px; border-radius: 6px; font-size: 12px; }
.disclaimer { max-width: 560px; margin: 8px auto 30px; padding: 0 22px; font-size: 13px; color: #4b5563; }
.disclaimer a { color: #b4500f; }
@media (min-width: 700px) { .hero { text-align: center; } .brand { justify-content: center; } .lead { margin-left: auto; margin-right: auto; } }
.stat .value.long { font-size: 22px; }
.stat.main .value.long { font-size: 26px; }
