:root {
  --ink: #1c140f;
  --muted: #6e6258;
  --line: rgba(28, 20, 15, 0.14);
  --paper: #fbf7f1;
  --coral: #e23b2f;
  --gold: #a86712;
  --serif: "Source Sans 3", "Segoe UI", sans-serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f6f0e6;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(40px, 7vw, 76px); }
h2 { font-size: 28px; }
p { margin: 0; }
a { color: #9d1c14; }
button, input, select, textarea { font: inherit; color: inherit; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold); }

.logo { font-family: var(--sans); font-style: normal; font-weight: 700; font-size: 28px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.fine { color: var(--muted); font-size: 15px; line-height: 1.45; }
.lede, .lead { font-size: 18px; color: #3f342c; max-width: 40rem; }

.site { max-width: 1080px; margin: 0 auto; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.site-nav { display: flex; align-items: center; gap: 12px; flex: none; }
.site-nav a { color: inherit; text-decoration: none; }
.site-nav .btn { white-space: nowrap; flex: none; line-height: 1; }

.hero, .band, .split, .prices, .colophon { max-width: 1080px; margin: 0 auto; padding: 12px 20px 28px; }
.hero { display: grid; gap: 28px; padding-top: 12px; }
.hero-copy { display: flex; flex-direction: column; gap: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.preview { background: #1c140f; color: #f8f1e8; border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.preview h2 { font-size: 36px; }
.preview-zone { color: #f0c27a; }
.preview-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.preview-list li { display: flex; flex-direction: column; border-top: 1px solid rgba(248, 241, 232, 0.14); padding-top: 8px; }
.preview-list span { color: #c8b8a8; font-size: 13px; }

.band, .split, .prices { display: grid; gap: 14px; }
.band article, .price, .checks li, .card-page, .person, .empty { background: #fffdf9; border-radius: 22px; }
.band article, .price { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { padding: 12px 14px; }
.amount { font-family: var(--serif); font-size: 42px; margin: 6px 0; }
.amount small { font-family: var(--sans); font-size: 14px; }
.price ul { margin: 0; padding-left: 18px; }
.price-focus { background: #1c140f; color: #f8f1e8; }
.prices-intro { display: flex; flex-direction: column; gap: 8px; }
.colophon { color: var(--muted); padding-bottom: 48px; }

.card-page { width: min(480px, calc(100% - 28px)); margin: 8px auto 40px; padding: 22px 18px 28px; display: flex; flex-direction: column; gap: 12px; }
.card-page h1 { font-size: 42px; }
.legal { width: min(760px, calc(100% - 32px)); margin: 8px auto 48px; display: flex; flex-direction: column; gap: 14px; }
.legal h1 { font-size: clamp(34px, 5vw, 48px); }
.legal h2 { font-size: 22px; }
.legal section { background: #fffdf9; border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.legal ul { margin: 0; padding-left: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 18px; border-radius: 999px; border: 1px solid transparent; text-decoration: none; font-weight: 600; cursor: pointer; background: transparent; }
.btn-primary { background: var(--coral); color: #fffaf7; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-danger { border-color: var(--coral); color: var(--coral); background: transparent; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.preview .btn { pointer-events: none; }

label, .stack { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 14px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.id-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.id-switch-label { font-size: 14px; color: var(--muted); font-weight: 600; }
.id-switch-links { display: flex; align-items: center; gap: 6px; }
.id-switch-links button { border: 0; background: transparent; padding: 0; font-size: 15px; color: var(--muted); cursor: pointer; text-decoration: none; }
.id-switch-links button.is-active { color: var(--coral); font-weight: 700; }
.id-switch-sep { color: var(--muted); }
.phone-row { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }
.phone-dial { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: #5c5148; display: grid; place-items: center; cursor: pointer; }
.password-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-off { display: none; }
.password-toggle.is-visible .eye-on { display: none; }
.password-toggle.is-visible .eye-off { display: block; }
textarea { min-height: 88px; resize: vertical; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-error { color: #9d1c14; font-size: 13px; font-weight: 500; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 450; }
.check input { flex: none; width: 20px; height: 20px; min-width: 20px; margin-top: 2px; }
#confirm-dialog { border: 0; border-radius: 20px; padding: 20px; width: min(380px, calc(100% - 32px)); background: #fffdf9; color: var(--ink); }
#confirm-dialog::backdrop { background: rgba(28, 20, 15, 0.46); }
#confirm-dialog p { font-size: 18px; font-weight: 600; line-height: 1.35; }
.confirm-actions { display: flex; gap: 8px; margin-top: 16px; }
.confirm-actions .btn { flex: 1; }

.choices { display: grid; gap: 8px; }
.choice { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; cursor: pointer; }
.choice span { font-weight: 600; }
.choice small { grid-column: 2; color: var(--muted); }
.choice input { width: 18px; height: 18px; margin-top: 2px; }
.choice:has(input:checked), .choice.is-picked, .choice:focus-within { border-color: var(--coral); background: #fff1ec; }
.choice-btn { width: 100%; text-align: left; }
.search-map { height: 240px; border-radius: 18px; overflow: hidden; background: #e7dccb; }
.search-map .leaflet-control-attribution { font-size: 11px; }

body.section-app { background: #e7dccb; height: 100dvh; overflow: hidden; }
.phone { width: min(440px, 100%); height: 100dvh; margin: 0 auto; background: var(--paper); display: flex; flex-direction: column; overflow: hidden; }
.appbar { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 6px; flex: none; }
.where, .where-line { color: var(--muted); }
.appmain { flex: 1; min-height: 0; overflow: auto; padding: 8px 16px 24px; }
.phone h1 { font-size: 40px; }
.tabbar { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); background: #fffaf4; border-top: 1px solid var(--line); }
.tabbar a { position: relative; text-align: center; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; padding: 12px 4px calc(12px + env(safe-area-inset-bottom)); }
.tabbar a.is-active { color: var(--coral); font-weight: 600; }
.badge { position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--coral); color: white; font-size: 11px; line-height: 16px; }
.notices { flex: none; display: flex; flex-direction: column; gap: 8px; }
.notices:empty { display: none; }
.notice { margin: 0 16px; padding: 12px 14px; border-radius: 14px; background: #fff1ec; border: 1px solid #f0c2b8; color: inherit; text-decoration: none; font-weight: 600; }

.person { padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 12px 30px rgba(70, 36, 12, 0.05); }
.person-link { text-decoration: none; color: inherit; }
.person-top { display: flex; gap: 12px; align-items: center; }
.person h2 { font-size: 26px; }
.mono { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: white; font-family: var(--serif); font-size: 24px; flex: none; }
.tone-0 { background: #e23b2f; }
.tone-1 { background: #1d6b45; }
.tone-2 { background: #a86712; }
.tone-3 { background: #2f5d8c; }
.tone-4 { background: #7a3e6d; }
.prompt { font-family: var(--sans); font-style: normal; font-weight: 400; font-size: 18px; line-height: 1.4; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { background: #f4e7d4; border-radius: 999px; padding: 4px 8px; font-size: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions form { flex: 1; }
.row-actions .btn { width: 100%; font-size: 16px; line-height: 1.2; padding-left: 12px; padding-right: 12px; text-wrap: balance; }
.note, .empty { background: #fff6e8; border-radius: 16px; padding: 12px 14px; }
.place { background: #1c140f; color: #f8f1e8; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.place .kicker { color: #f0c27a; }
.back { text-decoration: none; font-size: 14px; }

.thread { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; padding-right: 2px; }
.bubble { margin: 0; max-width: 85%; border-radius: 16px; padding: 8px 12px; }
.bubble time { display: block; font-size: 11px; opacity: 0.7; }
.is-mine { align-self: flex-end; background: #1c140f; color: #fff; }
.is-theirs { align-self: flex-start; background: #fff; }
.is-system { align-self: center; max-width: 100%; background: transparent; color: var(--muted); text-align: center; font-size: 15px; padding: 0; }
.composer { display: flex; gap: 8px; align-items: center; }
.composer input { flex: 1; }
.safety { background: #fff; border-radius: 16px; padding: 12px; }
.safety summary { cursor: pointer; font-weight: 600; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 8px; }
.demo-form { border-top: 1px solid var(--line); padding-top: 8px; }

.flash { margin: 0 16px 8px; padding: 10px 12px; border-radius: 12px; background: #e5f6ec; }
.flash-info { background: #fff1d2; }
.flash-wrap { width: min(720px, calc(100% - 28px)); margin: 0 auto 8px; }

@media (max-width: 640px) {
  .site { padding: 12px 16px; }
  .logo { font-size: 24px; }
  .site-nav { gap: 10px; }
  .site-nav .btn { min-height: 36px; padding: 8px 12px; font-size: 15px; }
}
@media (max-width: 400px) {
  .site { padding: 12px; gap: 8px; }
  .logo { font-size: 22px; }
  .site-nav { gap: 8px; }
  .site-nav a:not(.btn) { font-size: 15px; }
  .site-nav .btn { min-height: 34px; padding: 7px 10px; font-size: 14px; }
}
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; align-items: center; padding-top: 28px; padding-bottom: 48px; }
  .band, .prices { grid-template-columns: repeat(3, 1fr); }
  .prices-intro { grid-column: 1 / -1; }
  .split { grid-template-columns: 1.2fr 0.8fr; align-items: start; }
  body.section-app { overflow: auto; }
  .phone { height: calc(100dvh - 28px); margin-top: 14px; border-radius: 28px; box-shadow: 0 24px 60px rgba(70, 36, 12, 0.12); }
  .tabbar { border-radius: 0 0 28px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
