:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --text: #1f1b18;
  --muted: #6d655e;
  --line: #e7dfd6;
  --accent: #d63b25;
  --accent-ink: #ffffff;
  --accent-soft: #fbe6e1;
  --shadow: 0 1px 2px rgb(60 30 10 / 6%), 0 8px 24px rgb(60 30 10 / 8%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1716;
    --surface: #25211f;
    --text: #f3eee9;
    --muted: #a99f97;
    --line: #3a3431;
    --accent: #ff6a52;
    --accent-ink: #1a1716;
    --accent-soft: #3a2420;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
}
.bar h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .02em; }
.logo {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 20px; line-height: 1;
}

main {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}
.view { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* intro */
#intro { text-align: center; padding-top: 12vh; }
.lead { font-size: 26px; font-weight: 800; line-height: 1.4; margin: 0 0 32px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 18px; }

/* buttons */
button {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 14px;
  min-height: 48px; padding: 0 18px;
  transition: transform .08s, filter .15s;
}
button:active { transform: scale(.97); }
.primary { background: var(--accent); color: var(--accent-ink); }
.secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--line); }
.big {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 64px; font-size: 19px; border-radius: 18px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
.big svg { width: 24px; height: 24px; fill: currentColor; }
.wide { width: 100%; margin-top: 20px; }
button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; }

/* loading */
#loading { text-align: center; padding-top: 18vh; color: var(--muted); }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 18px;
  border: 4px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* result */
.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 20px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.label { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.zip {
  margin: 4px 0 2px;
  font-size: clamp(44px, 14vw, 60px);
  font-weight: 800;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}
.zip .mark { color: var(--accent); font-size: .6em; margin-right: .12em; vertical-align: .12em; }
.addr { margin: 0; font-size: 18px; font-weight: 700; word-break: break-all; }
.note {
  margin: 12px 0 0; padding: 8px 12px; border-radius: 10px;
  background: var(--accent-soft); font-size: 13px; text-align: left;
}
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.actions button { font-size: 15px; padding: 0 8px; }

.meta { margin: 16px 4px 0; font-size: 14px; }
.meta div { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.meta dt { color: var(--muted); flex: 0 0 5.5em; }
.meta dd { margin: 0; word-break: break-all; }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.links a {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; border-radius: 12px;
  color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: none;
  background: var(--accent-soft);
}

#others-wrap h2 { font-size: 15px; margin: 26px 4px 0; }
.sub { margin: 2px 4px 8px; color: var(--muted); font-size: 12px; }
.others { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.others li + li { border-top: 1px solid var(--line); }
.others button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; color: var(--text); border-radius: 0; text-align: left;
  padding: 10px 16px; min-height: 52px; font-weight: 400;
}
.others .z { font-weight: 800; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.others .t { flex: 1; font-size: 14px; word-break: break-all; }
.others .d { color: var(--muted); font-size: 12px; flex: 0 0 auto; }

/* error */
#error { text-align: center; padding-top: 10vh; }
.err-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 30px; font-weight: 800;
}
.err-title { font-size: 19px; font-weight: 800; margin: 0 0 8px; }
.err-body { color: var(--muted); font-size: 14px; text-align: left; white-space: pre-line; margin: 0; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer {
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  color: var(--muted); font-size: 11px; text-align: center;
}
footer p { margin: 2px 0; }
footer a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* about / FAQ */
.about {
  width: 100%; max-width: 480px; margin: 24px auto 0; padding: 20px 16px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.about h2 { font-size: 17px; margin: 0 0 8px; }
.about h3 { font-size: 15px; margin: 22px 0 6px; }
.about p { margin: 0 0 8px; color: var(--muted); }
.about ol { margin: 0 0 8px; padding-left: 1.4em; color: var(--muted); }
.about li { margin: 2px 0; }
.about details {
  background: var(--surface); border-radius: 12px; margin: 8px 0;
  box-shadow: var(--shadow);
}
.about summary {
  cursor: pointer; padding: 12px 16px; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: "+"; color: var(--accent); font-weight: 800; }
.about details[open] summary::after { content: "−"; }
.about details p { padding: 0 16px 12px; margin: 0; }
