:root {
  color-scheme: light;
  --paper: #f4efe6;
  --paper-deep: #e9dfcf;
  --ink: #17324d;
  --muted: #6d7b86;
  --teal: #176b87;
  --teal-dark: #0d526d;
  --coral: #e9785d;
  --line: rgba(23, 50, 77, 0.12);
  --white: #fffdf9;
  --green: #398267;
  --shadow: 0 30px 80px rgba(23, 50, 77, 0.13);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 50, 77, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 50, 77, 0.022) 1px, transparent 1px),
    var(--paper);
  background-size: 26px 26px;
  overflow-x: hidden;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
svg { width: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:where(button, a, input, textarea):focus-visible { outline: 3px solid rgba(233,120,93,.72); outline-offset: 3px; }

.ambient { position: fixed; border-radius: 999px; pointer-events: none; filter: blur(2px); opacity: .56; }
.ambient-a { width: 34rem; height: 34rem; top: -18rem; right: -12rem; background: radial-gradient(circle, rgba(233,120,93,.22), transparent 68%); }
.ambient-b { width: 34rem; height: 34rem; bottom: -20rem; left: -14rem; background: radial-gradient(circle, rgba(23,107,135,.18), transparent 68%); }

.shell { position: relative; width: min(1120px, calc(100% - 40px)); min-height: 100svh; margin: 0 auto; display: flex; flex-direction: column; }
.brandbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; color: var(--white); background: var(--ink); border-radius: 11px 11px 11px 4px; transform: rotate(-2deg); }
.brand-mark svg { width: 23px; transform: rotate(2deg); }
.secure-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(255,253,249,.54); backdrop-filter: blur(10px); }
.secure-pill i { width: 7px; height: 7px; border-radius: 50%; background: #4aa17d; box-shadow: 0 0 0 4px rgba(74,161,125,.12); }

.request-layout { flex: 1; display: grid; grid-template-columns: minmax(0, .9fr) minmax(430px, .72fr); align-items: center; gap: clamp(60px, 9vw, 130px); padding: 35px 0 55px; }
.request-layout > *, .owner-grid > * { min-width: 0; }
.hero-copy { max-width: 590px; padding-bottom: 10px; }
.eyebrow { margin: 0 0 18px; color: var(--coral); font-size: 12px; line-height: 1; font-weight: 900; letter-spacing: .19em; text-transform: uppercase; }
.hero-copy h1, .owner-heading h1 { margin: 0; font-family: ui-serif, "Songti SC", "STSong", Georgia, serif; font-size: clamp(48px, 5.5vw, 78px); font-weight: 700; line-height: 1.12; letter-spacing: -.055em; text-wrap: balance; }
.lede, .owner-heading > p:last-child { max-width: 470px; margin: 25px 0 0; color: var(--muted); font-size: 17px; line-height: 1.8; }
.trust-row { display: flex; gap: 24px; margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.trust-row span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 750; }
.trust-row svg { width: 19px; color: var(--teal); }

.action-card { position: relative; padding: 31px; border: 1px solid rgba(255,255,255,.86); border-radius: 26px 26px 26px 9px; background: rgba(255,253,249,.88); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.action-card { width: 100%; max-width: 100%; }
.action-card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(23,50,77,.045); border-radius: 18px; pointer-events: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.step-label { margin: 0 0 7px; color: var(--teal); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.card-head h2 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: -.025em; }
.signal { display: flex; align-items: flex-end; gap: 2px; height: 20px; color: var(--green); }
.signal i { display: block; width: 3px; border-radius: 2px; background: currentColor; }
.signal i:nth-child(1) { height: 6px; opacity: .45; }
.signal i:nth-child(2) { height: 10px; opacity: .7; }
.signal i:nth-child(3) { height: 14px; }

.quick-messages { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip, .reply-chip { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; transition: .18s ease; }
.chip:hover, .reply-chip:hover { border-color: rgba(23,107,135,.42); color: var(--teal); }
.chip.active, .reply-chip.active { border-color: var(--teal); color: var(--white); background: var(--teal); box-shadow: 0 7px 16px rgba(23,107,135,.17); }
.field-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: var(--ink); font-size: 12px; font-weight: 800; }
.field-label span { color: #9aa4aa; font-weight: 500; }
.textarea-wrap { position: relative; }
textarea, .text-input { width: 100%; border: 1px solid var(--line); outline: 0; border-radius: 13px; background: rgba(244,239,230,.54); color: var(--ink); transition: .18s ease; }
textarea { min-height: 95px; resize: vertical; padding: 13px 14px 27px; line-height: 1.6; font-size: 14px; }
.text-input { height: 46px; padding: 0 13px; margin-bottom: 15px; font-size: 13px; }
textarea:focus, .text-input:focus { border-color: rgba(23,107,135,.62); background: var(--white); box-shadow: 0 0 0 4px rgba(23,107,135,.08); }
.char-count { position: absolute; right: 11px; bottom: 9px; color: #a0a8ad; font-size: 10px; }

.location-row { position: relative; z-index: 1; width: 100%; display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: transparent; text-align: left; cursor: pointer; transition: .18s ease; }
.location-row:hover { border-color: rgba(23,107,135,.42); background: rgba(23,107,135,.025); }
.location-row.selected { border-color: rgba(57,130,103,.5); background: rgba(57,130,103,.055); }
.location-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--teal); background: rgba(23,107,135,.09); }
.location-icon svg { width: 19px; }
.location-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
.location-copy strong { font-size: 12px; }
.location-copy small { overflow: hidden; color: #8b969e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.toggle { flex: 0 0 auto; width: 34px; height: 20px; padding: 2px; border-radius: 99px; background: #d8d9d5; transition: .2s; }
.toggle i { display: block; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.location-row.selected .toggle { background: var(--green); }
.location-row.selected .toggle i { transform: translateX(14px); }

.turnstile-mount { min-height: 65px; margin: 4px 0 14px; }
.form-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; color: #a33d2c; background: rgba(233,120,93,.11); font-size: 12px; line-height: 1.5; }
.primary-button, .secondary-button { position: relative; z-index: 1; width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 11px; border-radius: 14px; cursor: pointer; font-weight: 850; text-decoration: none; transition: transform .16s ease, background .16s ease, opacity .16s ease; }
.primary-button { border: 0; color: white; background: var(--ink); box-shadow: 0 12px 25px rgba(23,50,77,.18); }
.primary-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .66; transform: none; }
.primary-button svg { width: 18px; }
.consent-note { margin: 11px 0 0; color: #9aa2a7; font-size: 10px; text-align: center; }

.result-card { width: min(590px, 100%); margin: auto; padding: 48px 52px 42px; border: 1px solid rgba(255,255,255,.82); border-radius: 32px 32px 32px 10px; background: rgba(255,253,249,.88); box-shadow: var(--shadow); text-align: center; backdrop-filter: blur(20px); }
.result-icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 25px; border-radius: 24px 24px 24px 8px; color: white; }
.result-icon.waiting { background: var(--teal); animation: soft-pulse 2.4s infinite; }
.result-icon.confirmed { background: var(--green); }
.result-icon.error-icon { background: var(--coral); font-size: 30px; font-weight: 800; }
.result-icon svg { width: 34px; }
@keyframes soft-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(23,107,135,.2); } 50% { box-shadow: 0 0 0 14px rgba(23,107,135,0); } }
.result-card h1 { margin: 0; font-family: ui-serif, "Songti SC", "STSong", Georgia, serif; font-size: clamp(32px, 5vw, 48px); letter-spacing: -.045em; }
.result-text { max-width: 430px; margin: 15px auto 28px; color: var(--muted); line-height: 1.75; }
.delay-panel { margin: 0 0 26px; padding: 19px; border: 1px solid rgba(233,120,93,.18); border-radius: 16px; background: rgba(233,120,93,.055); }
.countdown-wrap { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.countdown-wrap strong { min-width: 96px; color: var(--coral); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 35px; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.countdown-label { color: var(--muted); font-size: 11px; font-weight: 800; }
.delay-panel > p { max-width: 400px; margin: 11px auto 17px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.delay-actions { display: grid; gap: 8px; }
.delay-actions .secondary-button { min-height: 45px; background: var(--white); }
.text-button { border: 0; padding: 6px; color: #90989d; background: transparent; cursor: pointer; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--coral); }
.progress-track { display: flex; align-items: flex-start; margin: 28px 0 30px; }
.progress-step { flex: 0 0 63px; display: flex; flex-direction: column; align-items: center; gap: 7px; color: #a4aaae; font-size: 10px; }
.progress-step i { width: 12px; height: 12px; border: 3px solid var(--white); border-radius: 50%; background: #c9cdcf; box-shadow: 0 0 0 1px #c9cdcf; }
.progress-step.done { color: var(--green); font-weight: 800; }
.progress-step.done i { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.progress-line { flex: 1; height: 1px; margin-top: 6px; background: #d8dbdc; }
.progress-line.active { background: var(--green); }
.owner-reply { margin: 0 0 20px; padding: 17px; border: 1px solid rgba(57,130,103,.2); border-radius: 14px; background: rgba(57,130,103,.06); text-align: left; }
.owner-reply span { display: block; margin-bottom: 5px; color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.owner-reply strong { font-size: 14px; }
.owner-reply a { display: block; margin-top: 8px; color: var(--teal); font-size: 12px; font-weight: 750; text-decoration: none; }
.result-actions { display: grid; gap: 10px; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: transparent; font-size: 13px; }
.secondary-button:hover { border-color: rgba(23,107,135,.45); background: rgba(23,107,135,.04); }
.secondary-button svg { width: 17px; color: var(--teal); }
.call-button { background: var(--green); }
.expiry-text { margin: 18px 0 0; color: #9ba3a7; font-size: 10px; }

footer { min-height: 60px; display: flex; align-items: center; justify-content: center; gap: 8px; color: rgba(23,50,77,.5); font-size: 10px; letter-spacing: .02em; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 20; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 99px; color: white; background: rgba(23,50,77,.94); box-shadow: 0 10px 35px rgba(23,50,77,.25); font-size: 12px; transform: translateX(-50%); }

.owner-page { background-color: #e9e4db; }
.owner-shell { width: min(1020px, calc(100% - 40px)); }
.owner-grid { flex: 1; display: grid; grid-template-columns: .78fr minmax(430px, .74fr); align-items: center; gap: clamp(55px, 8vw, 110px); padding: 40px 0 60px; }
.owner-heading h1 { font-size: clamp(46px, 5.2vw, 70px); }
.owner-card { min-height: 420px; }
.owner-loading { min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--muted); font-size: 13px; }
.spinner { width: 30px; height: 30px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.request-meta { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 22px; }
.request-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--coral); font-size: 15px; font-weight: 800; }
.request-meta div { min-width: 0; }
.request-meta small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.request-meta strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.request-meta time { color: #9aa2a7; font-size: 10px; }
.map-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 13px; border: 1px solid rgba(23,107,135,.16); border-radius: 14px; color: inherit; background: rgba(23,107,135,.045); text-decoration: none; }
.map-preview > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.map-preview strong { font-size: 12px; }
.map-preview small { color: var(--muted); font-size: 10px; }
.map-preview .arrow { width: 16px; color: var(--muted); }
.map-preview.disabled { opacity: .62; }
.reply-options { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.reply-chip { padding: 7px 10px; font-size: 10px; }
.owner-done { min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.owner-done h2 { margin: 0 0 8px; font-family: ui-serif, "Songti SC", "STSong", Georgia, serif; font-size: 31px; }
.owner-done p { max-width: 300px; margin: 0; color: var(--muted); line-height: 1.7; }

@media (max-width: 850px) {
  .request-layout, .owner-grid { grid-template-columns: 1fr; gap: 38px; align-items: start; }
  .request-layout { padding-top: 28px; }
  .hero-copy, .owner-heading { max-width: 620px; }
  .hero-copy h1, .owner-heading h1 { font-size: clamp(43px, 10vw, 68px); }
  .action-card { width: min(580px, 100%); }
  .owner-grid { padding-top: 25px; }
}

@media (max-width: 560px) {
  .shell, .owner-shell { width: min(100% - 24px, 520px); }
  .brandbar { min-height: 72px; }
  .secure-pill { padding: 7px 10px; font-size: 10px; }
  .request-layout { gap: 30px; padding: 30px 0 35px; }
  .hero-copy { padding: 0 5px; }
  .hero-copy h1, .owner-heading h1 { font-size: clamp(40px, 13vw, 58px); line-height: 1.1; }
  .lede, .owner-heading > p:last-child { margin-top: 17px; font-size: 14px; line-height: 1.7; }
  .trust-row { margin-top: 22px; padding-top: 20px; }
  .action-card { padding: 23px 18px; border-radius: 22px 22px 22px 8px; }
  .card-head { margin-bottom: 20px; }
  .quick-messages { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .chip { flex: 0 0 auto; }
  .location-copy small { max-width: 230px; }
  .result-card { margin: 25px auto; padding: 40px 20px 30px; border-radius: 25px 25px 25px 8px; }
  .result-card h1 { font-size: 36px; }
  .progress-step { flex-basis: 56px; }
  .owner-heading { padding: 12px 5px 0; }
  .owner-grid { gap: 30px; padding: 18px 0 35px; }
  .request-meta time { display: none; }
  footer { flex-wrap: wrap; padding: 15px 0; }
}

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