:root {
  --o1: #FF7A00; --o2: #FF4500; --o: #FF6A00; --o-soft: #FFF1E6; --o-line: #FFD5B8;
  --ink: #1A1A1F; --ink2: #55555E; --mut: #8A8A93; --line: #ECECEF; --bg: #F7F7F8; --card: #fff;
  --ok: #138A4B; --ok-bg: #E7F6EE; --warn: #9A6200; --warn-bg: #FFF4D6; --bad: #B42318; --bad-bg: #FDECEA;
  --r: 16px; --shadow: 0 1px 2px rgba(20,20,30,.06), 0 4px 14px rgba(20,20,30,.05);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Inter", sans-serif; }
a { color: var(--o); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; margin-bottom: 8px; }
small { display: block; color: var(--mut); font-size: 13px; }
.muted { color: var(--mut); } .small { font-size: 13px; } .center { text-align: center; } .grow { flex: 1; min-width: 0; }
.grow strong, .grow small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }

/* header + tabs */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 18px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { width: 32px; height: 32px; border-radius: 9px; }
.content { padding: 14px 14px calc(90px + var(--safe-b)); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: center; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs a { position: relative; flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; color: var(--mut); font-size: 11.5px; font-weight: 600; }
.tabs a.on { color: var(--o); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--o2); color: #fff; font-size: 10.5px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

.ic { width: 22px; height: 22px; flex: none; } .ic.tiny { width: 15px; height: 15px; vertical-align: -3px; } .ic.fill { fill: currentColor; }
.iconbtn { border: 0; background: transparent; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); cursor: pointer; }
.iconbtn.pri { background: linear-gradient(135deg, var(--o1), var(--o2)); color: #fff; }
.sos { border: 0; background: var(--bad); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .04em; padding: 7px 11px; border-radius: 10px; cursor: pointer; }

/* cards + lists */
.card { display: block; background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); color: inherit; margin-bottom: 12px; }
a.card:active { transform: scale(.99); }
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); margin: 18px 2px 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--ink2); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: #F1F1F4; color: var(--ink2); text-transform: capitalize; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.pri { background: var(--o-soft); color: #B84A00; text-transform: none; }
.stars { color: var(--ink); font-weight: 700; font-size: 13px; white-space: nowrap; } .stars .ic { color: #FFB000; }
.empty { text-align: center; color: var(--mut); padding: 28px 16px; background: #fff; border-radius: var(--r); border: 1px dashed var(--line); }
.fine { font-size: 12.5px; color: var(--mut); margin: 12px 4px; }
.kv { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0 0; } .kv span { color: var(--ink2); }
.bio { color: var(--ink2); margin: 10px 0 0; }
.quote { margin: 8px 0 0; padding: 10px 12px; background: var(--bg); border-radius: 12px; color: var(--ink2); font-size: 14px; }
.review { margin: 6px 0; color: #FFB000; } .review span { color: var(--ink2); }
.contrib { border: 1px solid var(--o-line); background: linear-gradient(180deg, #fff, var(--o-soft)); }

/* avatars */
.av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.av-d { background: linear-gradient(135deg, var(--o1), var(--o2)); color: #fff; } .av-r { background: #2B2B33; color: #fff; } .av-c { background: var(--o-soft); color: var(--o); }
.av.sm { width: 28px; height: 28px; font-size: 11px; } .av.lg { width: 54px; height: 54px; font-size: 17px; } .av.xl { width: 76px; height: 76px; font-size: 24px; margin: 4px auto 10px; }
.members { display: flex; flex-wrap: wrap; gap: 10px; } .member { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 13px 18px; border-radius: 14px; background: linear-gradient(135deg, var(--o1), var(--o2)); color: #fff; box-shadow: 0 6px 16px rgba(255,90,0,.25); }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: var(--bad); box-shadow: none; } .btn.danger.ghost { background: #fff; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad-bg); }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btnrow { display: flex; gap: 8px; margin-top: 12px; } .btnrow .btn { flex: 1; padding: 11px; }
.cta { position: sticky; bottom: calc(66px + var(--safe-b)); display: flex; gap: 8px; padding: 10px 0; } .cta .btn { flex: 1; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 12px; } label small { display: inline; }
input, select { display: block; width: 100%; margin-top: 5px; font: inherit; font-size: 16px; color: var(--ink); padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--mut) 50%), linear-gradient(135deg, var(--mut) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input:focus, select:focus { outline: none; border-color: var(--o); box-shadow: 0 0 0 3px var(--o-soft); }
.search { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; } .search label:nth-child(3) { grid-column: 1 / -1; } .search .btn { grid-column: 1 / -1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.days { border: 0; padding: 0; margin: 0 0 12px; display: flex; gap: 6px; flex-wrap: wrap; } .days legend { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.day { margin: 0; } .day input { display: none; } .day span { display: block; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13px; }
.day input:checked + span { background: var(--o-soft); border-color: var(--o); color: #B84A00; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; } .check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; appearance: auto; accent-color: var(--o); }

/* route */
.routemap { width: 100%; height: auto; display: block; }
.stops { list-style: none; margin: 6px 0 0; padding: 0; display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--ink2); }
.stops li { flex: 1; text-align: center; } .stops li.first { text-align: left; font-weight: 700; color: var(--ink); } .stops li.last { text-align: right; font-weight: 700; color: var(--ink); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 70px; }
.msg { display: flex; align-items: flex-end; gap: 8px; } .msg.me { justify-content: flex-end; }
.bubble { max-width: 78%; background: #fff; padding: 9px 12px; border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow); }
.bubble b { display: block; font-size: 12px; color: var(--o); } .bubble small { font-size: 11px; margin-top: 2px; }
.msg.me .bubble { background: linear-gradient(135deg, var(--o1), var(--o2)); color: #fff; border-radius: 16px 16px 4px 16px; } .msg.me small { color: rgba(255,255,255,.8); }
.composer { position: fixed; left: 0; right: 0; bottom: calc(58px + var(--safe-b)); display: flex; gap: 8px; padding: 8px 12px; background: var(--bg); max-width: 560px; margin: 0 auto; }
.composer input { margin: 0; border-radius: 99px; }

/* profile plans */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.plan { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; } .plan b, .plan span { display: block; } .plan span { color: var(--ink2); font-size: 13px; }
.plan.on { border-color: var(--o); background: var(--o-soft); }

/* welcome */
.welcome { padding: calc(24px + var(--safe-t)) 16px 40px; }
.hero { text-align: center; padding: 24px 0 18px; }
.hero-logo { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 14px 34px rgba(255,80,0,.3); }
.hero h1 { font-size: 34px; margin-top: 14px; font-weight: 900; letter-spacing: -.03em; }
.hero p { margin: 2px 0 0; color: var(--ink2); font-size: 17px; }
.note { background: var(--o-soft); box-shadow: none; border: 1px solid var(--o-line); font-size: 14px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: #fff; padding: 12px; border-radius: 14px; margin-bottom: 8px; box-shadow: var(--shadow); font: inherit; color: inherit; cursor: pointer; }

/* sheet + toast */
.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(10,10,15,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 560px; background: #fff; border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + var(--safe-b)); animation: up .2s; }
.sheet h2 { display: flex; align-items: center; gap: 8px; color: var(--bad); margin-bottom: 6px; }
#toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 30; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(40px); } }
