:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #1d2a26;
  --muted: #66736e;
  --line: #e4ded2;
  --brand: #1f6f5c;
  --brand-2: #2b8a72;
  --brand-soft: #e3f1ec;
  --warm: #e9a23b;
  --warm-soft: #fdf1dc;
  --danger: #b4432f;
  --danger-soft: #fbe7e2;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(29, 42, 38, .06), 0 6px 18px rgba(29, 42, 38, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; letter-spacing: -.01em; margin: 0 0 8px; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; font-family: Inter, sans-serif; font-weight: 700; }
p { margin: 0 0 10px; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

.topbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.topbar .back { text-decoration: none; font-size: 22px; padding: 4px 8px 4px 0; color: var(--ink); }
.topbar h1, .topbar h2 { margin: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: Fraunces, serif; font-weight: 700; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand b { color: var(--brand); }
.brand-sm { font-size: 22px; }
.brand-lg { flex-direction: column; font-size: 34px; gap: 6px; }
.brand-lg img { width: 110px; height: 110px; }
.tagline { font-family: Fraunces, serif; font-size: 19px; color: var(--brand) !important; margin-top: 2px; }
.story { background: linear-gradient(180deg, #fff 0%, #fbf8f1 100%); }
.story-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.story-head img { width: 44px; height: 44px; }
.story-head h3 { margin: 0; font-family: Fraunces, serif; font-size: 20px; }
.story p { font-size: 15px; }
.story-sign { font-family: Fraunces, serif; font-weight: 700; color: var(--brand); font-size: 17px; }
.story-link { display: flex; align-items: center; gap: 12px; }
.story-link img { width: 44px; height: 44px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.link { display: block; text-decoration: none; color: inherit; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; }
.section-title h3 { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 13px 18px;
  font: 600 16px Inter, sans-serif; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; width: 100%; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.btn.warm { background: var(--warm); color: #2a1c05; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.small { padding: 8px 12px; font-size: 14px; width: auto; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 10px; }

label.f { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
label.f .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=tel], input[type=password], input[type=email], input[type=number], input[type=url],
input[type=datetime-local], select, textarea {
  width: 100%; font: 16px Inter, sans-serif; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: 14px; cursor: pointer; }
.chip-check input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); flex: none; }
.avatar.lg { width: 96px; height: 96px; }
.avatar.sm { width: 36px; height: 36px; }
.person { display: flex; align-items: center; gap: 12px; }
.person .name { font-weight: 700; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.badge.warm { background: var(--warm-soft); color: #8a5a10; }
.badge.grey { background: #eeebe4; color: var(--muted); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.st-requested, .st-quoted { background: var(--warm-soft); color: #8a5a10; }
.st-awaiting_payment, .st-payment_sent { background: #e6eefb; color: #2c5aa0; }
.st-confirmed, .st-in_progress, .st-delivered { background: var(--brand-soft); color: var(--brand); }
.st-bought { background: var(--brand-soft); color: var(--brand); }
.st-settling { background: var(--danger-soft); color: var(--danger); }
.st-completed { background: #e7f5e3; color: #2f7a22; }
.st-declined, .st-cancelled { background: #eeebe4; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin: 12px 0; }
.stats div { background: var(--bg); border-radius: 12px; padding: 10px 4px; }
.stats b { display: block; font-size: 20px; font-family: Fraunces, serif; }
.stats span { font-size: 12px; color: var(--muted); }

.trip-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.trip-store { font-family: Fraunces, serif; font-size: 20px; font-weight: 700; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv.total { font-weight: 700; font-size: 18px; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 10px; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.notice.risk { background: var(--warm-soft); border: 1px solid #f1d49d; }
.notice.risk b { display: block; margin-bottom: 4px; }
.notice.info { background: var(--brand-soft); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

.qr { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: 12px; }
.copyline { display: flex; gap: 8px; margin-top: 10px; }
.copyline input { font-size: 13px; }

.msgs { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px 0; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; background: var(--bg); font-size: 15px; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; }
.msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: 13px; text-align: center; max-width: 95%; }
.msg .who { font-size: 12px; font-weight: 700; opacity: .7; }
.msg .t { font-size: 11px; opacity: .6; margin-top: 2px; }
.sendbar { display: flex; gap: 8px; margin-top: 10px; }
.sendbar .btn { width: auto; }

.empty { text-align: center; color: var(--muted); padding: 22px 10px; }
.empty .big { font-size: 34px; }
.receipt { width: 100%; border-radius: 12px; margin-top: 8px; }
.photo-pick { display: flex; align-items: center; gap: 14px; }
.photo-pick .avatar { width: 80px; height: 80px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs a { flex: 1; max-width: 140px; text-align: center; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 0; }
.tabs a .ti { display: block; width: fit-content; margin: 0 auto; font-size: 21px; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.tabs a.on { color: var(--brand); }
.tabs a.on .ti { filter: none; opacity: 1; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; max-width: 90%; z-index: 20; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

.hero { text-align: center; padding: 24px 6px 8px; }
.hero p { color: var(--muted); }
.actions-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-action { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: var(--ink); }
.big-action .i { font-size: 26px; }
.big-action b { display: block; margin-top: 6px; }
.big-action span { font-size: 13px; color: var(--muted); }

.tiny { font-size: 11px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 12px; font: 500 14px Inter, sans-serif; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.leaving { color: var(--warm); color: #b06d0c; }
.item-row { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; background: #fcfbf8; }
.item-row.gone { opacity: .55; }
.item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.link-btn { background: none; border: 0; color: var(--danger); font: 600 13px Inter, sans-serif; cursor: pointer; padding: 2px 0; }
.items { margin: 10px 0 6px; border-top: 1px solid var(--line); }
.item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.item.gone b { text-decoration: line-through; color: var(--muted); }
.item .price { text-align: right; white-space: nowrap; font-weight: 600; }
.tabs a { position: relative; }
.tab-badge { position: absolute; top: 0; left: calc(50% + 6px); background: var(--danger); color: #fff; font: 700 10px Inter, sans-serif; border-radius: 999px; padding: 2px 5px; }
.alert.unread { border-left: 4px solid var(--brand); }
