:root {
  --ink: #19324a;
  --ink-soft: #5d6872;
  --paper: #f6f3ec;
  --card: #fffdf8;
  --line: #ded8cc;
  --accent: #de725d;
  --accent-dark: #af493a;
  --gold: #f5c46a;
  --mint: #dcefe9;
  --blue-wash: #e4edf4;
  --shadow: 0 16px 40px rgba(25, 50, 74, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; padding-bottom: 92px; }
.topbar { max-width: 1080px; margin: 0 auto; padding: 24px 24px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; background: var(--ink); display: grid; place-items: center; box-shadow: 0 8px 16px rgba(25,50,74,.15); }
.brand-mark::after { content: ""; width: 22px; height: 10px; border-top: 4px solid var(--gold); border-bottom: 4px solid var(--gold); transform: skewX(-24deg); }
.brand h1 { font-size: 18px; margin: 0; letter-spacing: .04em; }
.brand p { margin: 3px 0 0; font-size: 12px; color: var(--ink-soft); }
.privacy-pill { font-size: 12px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: rgba(255,253,248,.7); }

main { max-width: 1080px; margin: 0 auto; padding: 12px 24px 40px; }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 22px; align-items: stretch; margin: 10px 0 26px; }
.hero-copy { padding: 26px 4px 18px; }
.eyebrow { color: var(--accent-dark); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 750; margin: 0 0 12px; }
.hero h2 { font-size: clamp(30px, 5vw, 56px); line-height: 1.03; letter-spacing: -.04em; margin: 0; max-width: 630px; }
.hero-copy > p:not(.eyebrow) { color: var(--ink-soft); max-width: 560px; font-size: 16px; line-height: 1.75; margin: 18px 0 0; }
.hero-note { border: 1px solid #e2d4bb; background: #fff7e7; border-radius: 26px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; min-height: 230px; }
.hero-note p { line-height: 1.65; margin: 0; }
.hero-note small { display: block; color: var(--ink-soft); line-height: 1.6; margin-top: 18px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.card h3, .card h4 { margin: 0; letter-spacing: -.02em; }
.card h3 { font-size: 17px; }
.card h4 { font-size: 15px; }
.muted { color: var(--ink-soft); }
.small { font-size: 12px; line-height: 1.6; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 28px 0 13px; }
.section-head h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.section-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13px; }

.stat { min-height: 138px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-value { font-size: 38px; line-height: 1; letter-spacing: -.06em; margin-top: 20px; }
.stat-label { color: var(--ink-soft); font-size: 13px; }
.stat.accent { background: var(--ink); color: #fffdf8; border-color: var(--ink); }
.stat.accent .stat-label { color: #cdd9e3; }
.stat.mint { background: var(--mint); border-color: #c4e0d7; }

.button { border: 0; border-radius: 13px; min-height: 44px; padding: 11px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(222,114,93,.4); outline-offset: 2px; }
.button.primary { background: var(--accent); color: white; box-shadow: 0 8px 18px rgba(222,114,93,.22); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: var(--ink); color: white; }
.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button.soft { background: var(--blue-wash); color: var(--ink); }
.button.danger { background: #fbe4df; color: #92382d; }
.button.small-button { min-height: 36px; padding: 8px 11px; font-size: 12px; border-radius: 10px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.quick-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.quick-link:first-child { border-top: 0; padding-top: 0; }
.quick-link:last-child { padding-bottom: 0; }
.quick-link strong { display: block; font-size: 14px; }
.quick-link span { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 4px; }
.arrow { color: var(--accent-dark); font-size: 20px; }

.form-card { max-width: 760px; margin: 12px auto 0; }
.form-card h2 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.form-intro { color: var(--ink-soft); line-height: 1.65; margin: 10px 0 22px; }
.field { margin: 20px 0; }
.field label, .field legend { font-size: 14px; font-weight: 750; display: block; margin-bottom: 8px; }
.field legend { padding: 0; }
.field textarea, .field input[type="text"], .field input[type="date"] { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; background: #fffefa; color: var(--ink); }
.field textarea { min-height: 106px; resize: vertical; line-height: 1.65; }
.field textarea::placeholder, .field input::placeholder { color: #a2a7a9; }
.field-hint { color: var(--ink-soft); font-size: 12px; line-height: 1.55; margin: 7px 0 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; border: 1px solid var(--line); border-radius: 11px; padding: 11px 10px; color: var(--ink-soft); text-align: center; font-size: 13px; min-height: 42px; }
.choice input:checked + span { border-color: var(--accent); color: var(--accent-dark); background: #fff0ec; box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + span { outline: 3px solid rgba(222,114,93,.35); outline-offset: 2px; }
.voice-box { background: #eef4f7; border: 1px solid #d8e6ee; border-radius: 18px; padding: 16px; }
.voice-box h3 { margin: 0; font-size: 15px; }
.voice-box p { margin: 7px 0 13px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.voice-status { display: flex; align-items: center; gap: 8px; color: var(--accent-dark); font-size: 13px; font-weight: 700; margin: 10px 0; }
.record-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(222,114,93,.16); }
.timer { font-variant-numeric: tabular-nums; font-size: 22px; letter-spacing: .04em; }
audio { width: 100%; height: 40px; margin: 5px 0 8px; }
.form-actions { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.notice { padding: 13px 15px; border-radius: 13px; background: #fff7e7; border: 1px solid #e7d6b4; color: #69522b; font-size: 13px; line-height: 1.6; }
.notice.danger { background: #fff0ec; border-color: #f1c8bf; color: #79352c; }
.notice + .notice { margin-top: 10px; }
.empty { text-align: center; padding: 38px 18px; color: var(--ink-soft); }
.empty h3 { color: var(--ink); margin: 0 0 8px; }

.entry-list { display: grid; gap: 13px; }
.entry-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 17px; }
.entry-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.entry-head time { color: var(--ink-soft); font-size: 12px; }
.entry-fact { font-size: 16px; line-height: 1.65; margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; color: var(--ink); background: var(--blue-wash); }
.chip.warm { background: #fff0d4; }
.chip.mint { background: var(--mint); }
.entry-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entry-detail { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.entry-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-item { background: #faf8f2; border-radius: 12px; padding: 11px; }
.detail-item b { display: block; font-size: 11px; color: var(--ink-soft); margin-bottom: 5px; }
.detail-item span { font-size: 13px; line-height: 1.5; }

.map-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.role-list { display: grid; gap: 8px; margin-top: 15px; }
.role-row { background: #faf8f2; border-radius: 13px; padding: 11px 12px; }
.role-row-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.role-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; }
.bar { height: 7px; border-radius: 999px; background: #e2e0d8; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar:last-child i { background: var(--ink); }
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; margin: 15px 0; }
.range-row label { font-size: 13px; }
.range-row output { width: 32px; text-align: center; font-weight: 750; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(650px, calc(100% - 24px)); padding: 8px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; background: rgba(25,50,74,.96); border-radius: 18px; box-shadow: 0 15px 40px rgba(25,50,74,.25); backdrop-filter: blur(12px); }
.bottom-nav a { color: #b8c6d2; border-radius: 12px; padding: 9px 5px; text-align: center; font-size: 11px; }
.bottom-nav a span { display: block; font-size: 19px; line-height: 1; margin-bottom: 4px; }
.bottom-nav a.active { color: white; background: rgba(255,255,255,.14); }

.footer-note { text-align: center; max-width: 720px; margin: 26px auto 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(12px); opacity: 0; pointer-events: none; background: var(--ink); color: white; padding: 11px 15px; border-radius: 999px; font-size: 12px; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .topbar, main { padding-left: 16px; padding-right: 16px; }
  .hero, .map-layout, .grid-2 { grid-template-columns: 1fr; }
  .hero-copy { padding-top: 10px; }
  .hero-note { min-height: 0; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 13px; min-height: 110px; }
  .stat-value { font-size: 30px; margin-top: 14px; }
  .stat-label { font-size: 11px; }
  .entry-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .privacy-pill { display: none; }
  .grid { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
}

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