[hidden] { display: none !important; }
:root {
  --leaf: #1f3d2b;
  --moss: #3f7a4f;
  --fern: #5fa36e;
  --sun: #f2c14e;
  --paper: #f5f2e8;
  --ink: #1d2320;
  --muted: #5f6b63;
  --line: #e2dccb;
  --shadow: 0 1px 2px rgba(31, 61, 43, 0.06), 0 8px 24px rgba(31, 61, 43, 0.07);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 22rem at 110% -10%, rgba(242, 193, 78, 0.22), transparent 60%),
    radial-gradient(40rem 20rem at -20% 0%, rgba(95, 163, 110, 0.18), transparent 60%),
    var(--paper);
}
main { max-width: 32rem; margin: 0 auto; padding: max(1rem, env(safe-area-inset-top)) 1rem 3rem; }
a { color: var(--moss); }

/* Hero */
.hero { padding: 0.75rem 0 0.25rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand img { border-radius: 12px; box-shadow: var(--shadow); }
.hero h1 { margin: 0; font-size: 2.1rem; color: var(--leaf); letter-spacing: -0.03em; }
.lede { margin: 0.5rem 0 0.75rem; color: var(--muted); font-size: 1.05rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill { font-size: 0.8rem; padding: 0.3rem 0.6rem; border-radius: 999px; background: rgba(31, 61, 43, 0.08); color: var(--leaf); font-weight: 600; }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: 1.1rem; padding: 1.1rem; margin-top: 1rem; box-shadow: var(--shadow); }
.card.subtle { background: rgba(255, 255, 255, 0.55); box-shadow: none; font-size: 0.95rem; color: var(--muted); }

/* Form */
.field { display: block; border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.field > label, legend { display: block; font-weight: 650; margin-bottom: 0.45rem; font-size: 0.95rem; }
small { font-weight: 400; color: var(--muted); }
input:not([type]), input[type="text"] {
  width: 100%; font: inherit; padding: 0.75rem 0.85rem; border: 1px solid var(--line);
  border-radius: 0.75rem; background: #fcfbf7; color: var(--ink); min-height: 2.9rem;
}
input:focus-visible { outline: 3px solid rgba(95, 163, 110, 0.45); border-color: var(--fern); }
.inline { display: flex; gap: 0.5rem; }
.inline input { flex: 1; min-width: 0; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 0.45rem 0 0; }
.hint:empty { display: none; }
.center { text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.chips span {
  display: inline-flex; align-items: center; min-height: 2.6rem; padding: 0.45rem 0.9rem; border: 1px solid var(--line);
  border-radius: 999px; background: #fcfbf7; cursor: pointer; user-select: none; font-size: 0.95rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.chips span:active { transform: scale(0.97); }
.chips input:checked + span { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.chips input:focus-visible + span { outline: 3px solid var(--sun); }

/* Buttons */
button {
  font: inherit; padding: 0.75rem 1rem; border-radius: 0.8rem; border: 1px solid var(--leaf);
  background: #fff; color: var(--leaf); cursor: pointer; min-height: 2.9rem;
}
button small { color: inherit; opacity: 0.75; display: block; font-size: 0.78rem; }
button.primary { background: var(--leaf); color: #fff; width: 100%; font-weight: 650; }
button.primary:disabled { opacity: 0.6; }
button.ghost { border-color: var(--line); color: var(--muted); background: #fcfbf7; }
button.small { padding: 0.5rem 0.75rem; font-size: 0.85rem; white-space: nowrap; }
button.big { font-size: 1.15rem; padding: 1rem; margin-top: 1rem; background: var(--moss); border-color: var(--moss); border-radius: 1rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.row button { flex: 1 1 11rem; }

/* Model status */
.model-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; color: var(--leaf); }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #c9c2ad; }
.dot.on { background: #3fb45f; box-shadow: 0 0 0 4px rgba(63, 180, 95, 0.18); }
.dot.busy { background: var(--sun); animation: pulse 1s infinite; }
.dot.off { background: #d38b5d; }
@keyframes pulse { 50% { opacity: 0.35; } }
.muted { color: var(--muted); }
progress { width: 100%; margin-top: 0.6rem; accent-color: var(--moss); height: 0.5rem; }

/* Result */
.result h2 { margin: 0.15rem 0 0.25rem; font-size: 1.5rem; color: var(--leaf); letter-spacing: -0.02em; }
.source { margin: 0; font-size: 0.8rem; color: var(--moss); font-weight: 600; }
.why { margin: 0 0 0.9rem; color: var(--muted); font-style: italic; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 1rem; }
.steps li { counter-increment: s; position: relative; padding: 0.1rem 0 0.75rem 2.4rem; line-height: 1.45; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: #e8f1e6; color: var(--leaf); font-weight: 700; display: grid; place-items: center; font-size: 0.9rem;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 0.83rem; top: 1.9rem; bottom: 0.2rem; width: 2px; background: #e8f1e6; }
.result h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }
.result h3 small { font-size: 0.78rem; }
.spot { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.spot li { background: #f3f8f1; border: 1px solid #dfeadb; border-radius: 0.8rem; padding: 0.6rem 0.7rem; font-size: 0.86rem; line-height: 1.35; }
.spot b { display: block; color: var(--leaf); font-size: 0.92rem; margin-bottom: 0.15rem; }
.spot span { color: var(--muted); }
.tip { background: #fbf4dc; border-radius: 0.8rem; padding: 0.7rem 0.8rem; margin: 0 0 0.8rem; line-height: 1.45; }
.tip:empty { display: none; }
.bring { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; font-size: 0.9rem; }
.bring:empty { display: none; }
.bring b { margin-right: 0.25rem; }
.bring span { background: #f1eee4; padding: 0.25rem 0.6rem; border-radius: 999px; }
.stream { white-space: pre-wrap; font: 0.78rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0.4rem 0 0; color: #36513f; background: #f4f7f2; border-radius: 0.6rem; padding: 0.7rem; max-height: 14rem; overflow: auto; }
.small-text { font-size: 0.85rem; margin: 0.5rem 0 0; }
details { margin-top: 0.8rem; font-size: 0.85rem; color: var(--muted); }
summary { cursor: pointer; }
.pending { display: none !important; }

footer { margin-top: 2rem; font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* Outside mode: deliberately plain, dark and calm. */
body:has(#outside-view:not([hidden])), body:has(#card-view:not([hidden])) { background: var(--leaf); color: #eef3ec; }
#outside-view, #card-view { min-height: 100vh; text-align: center; }
.go-label { margin-top: 1.5rem; font-size: 1.05rem; opacity: 0.8; }
.ring-wrap { position: relative; width: min(70vw, 17rem); aspect-ratio: 1; margin: 1rem auto; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--sun); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(3rem, 15vw, 4.5rem); font-weight: 750; font-variant-numeric: tabular-nums; }
.timer.done { font-size: 1.8rem; color: var(--sun); }
.out-title { margin: 0 0 1rem; font-size: 1.3rem; }
.out-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; text-align: left; }
.out-cols section { background: rgba(255, 255, 255, 0.06); border-radius: 1rem; padding: 0.8rem; }
.out-cols h3 { margin: 0 0 0.4rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: #cfdccc; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { margin: 0.15rem 0; font-size: 1rem; }
.checklist label { display: flex; gap: 0.5rem; align-items: center; min-height: 2.4rem; cursor: pointer; }
.checklist input { width: 1.25rem; height: 1.25rem; accent-color: var(--sun); flex: none; }
.checklist input:checked + span { text-decoration: line-through; opacity: 0.6; }
.mini-steps { text-align: left; font-size: 0.88rem; opacity: 0.7; padding-left: 1.2rem; margin-top: 1rem; line-height: 1.45; }
.back-note { text-align: left; margin-top: 1.25rem; }
.back-note small { color: #cfdccc; }
.back-note input { background: rgba(255, 255, 255, 0.95); }
#outside-view button.primary, #card-view button.primary { background: var(--sun); border-color: var(--sun); color: var(--ink); }
#outside-view button.ghost, #card-view button.ghost { color: #cfdccc; border-color: #5d7b66; background: transparent; }
.card-head { margin: 1.5rem 0 1rem; font-size: 1.4rem; }
.walk-card { width: 100%; max-width: 24rem; height: auto; border-radius: 1.1rem; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
#card-view .hint { color: #cfdccc; }

@media (max-width: 360px) {
  .spot, .out-cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
