/* ============================================================
   Trippee — app styles. Component system ported from the reference
   mockup (cards, pills, badges, suggested-fare gradient, route track,
   stars, profile tiles, rewarded-ad overlay) and extended for the
   real multi-screen app (guided tour, toast, empty/loading states).
   Palette lives in tokens.css.
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 50% -10%, #16604597, transparent),
    linear-gradient(160deg, #0B3226, #123f2f);
  color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100dvh; min-height: 0; padding: 10px 10px 12px; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- App switcher (outside the phone) ---------- */
.switcher {
  display: inline-flex; background: rgba(255,255,255,.12); flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.18);
  padding: 5px; border-radius: 999px; margin-bottom: 12px; backdrop-filter: blur(6px);
}
.switcher button {
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  color: #CDE9DA; background: transparent; border: 0; cursor: pointer;
  padding: 9px 20px; border-radius: 999px; transition: .2s;
}
.switcher button.active { background: #fff; color: var(--pine-700); }

/* ---------- Phone frame ----------
   Fixed at a true iPhone aspect ratio (19.5:9 → 440×953). The whole frame
   is scaled down as one unit (--phone-scale, set by fitPhone() in app.js) to
   fit any window, so it always reads as a phone — never a square — while the
   440px-wide layout inside stays pixel-perfect. The negative margin removes
   the empty space the top-anchored scale-down would otherwise leave. */
.phone {
  width: 440px; height: 953px; flex: 0 0 auto;
  transform: scale(var(--phone-scale, 1));
  transform-origin: top center;
  margin-bottom: calc((var(--phone-scale, 1) - 1) * 953px);
  background: var(--sand);
  border-radius: 52px; position: relative; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 0 0 12px #0d0f12, inset 0 0 0 14px #2b2f33;
}
.notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 26px; background: #0d0f12; border-radius: 0 0 16px 16px; z-index: 60; }
.statusbar { position: absolute; top: 0; left: 0; right: 0; height: 48px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; font-size: 13px; font-weight: 600; color: var(--pine-900); }
.statusbar .glyphs { display: inline-flex; gap: 6px; align-items: center; }

/* screen viewport, sits under status bar and above tab bar */
.viewport { position: absolute; inset: 48px 0 76px; overflow: hidden; }
.app { display: none; height: 100%; }
.app.active { display: block; }

.screen { position: absolute; inset: 0; overflow-y: auto; padding: 8px 20px 24px;
  display: none; animation: slide .32s ease both; }
.screen.active { display: block; }
@keyframes slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- Logo (puffy lowercase t) ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo .mark { width: 34px; height: 34px; flex: 0 0 34px; }
.logo .name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--pine-700); }
.logo.light .name { color: #fff; }

/* ---------- Reusable bits ---------- */
h1 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.45; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; }

.field { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.field .dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }
.field .dot.a { background: var(--mint-300); box-shadow: 0 0 0 4px var(--mint-100); }
.field .dot.b { background: var(--pine-700); box-shadow: 0 0 0 4px var(--mint-100); }
.field input { border: 0; outline: 0; font-family: var(--font); font-size: 15px;
  width: 100%; background: transparent; color: var(--ink); }
.field label { display: block; font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.field .col { flex: 1; }

.btn { width: 100%; border: 0; cursor: pointer; font-family: var(--font); font-weight: 700;
  font-size: 16px; padding: 16px; border-radius: 16px; color: #fff;
  background: var(--pine-700); transition: .18s; box-shadow: var(--shadow); }
.btn:hover { background: var(--pine-900); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--pine-700); box-shadow: none;
  border: 1.5px solid var(--line); }
.btn.ghost:hover { background: #fff; }
.btn:disabled { background: #c7d3cc; cursor: not-allowed; box-shadow: none; }
.btn.mint { background: var(--mint-300); color: var(--pine-900); }
.btn.mint:hover { background: #7ad3a7; }

.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--mint-100);
  color: var(--pine-700); font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 999px; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: #F0EEE4;
  color: var(--ink); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.pill.w { background: #F3E8F5; color: #7A3D86; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }

.avatar { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 46px;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
  color: #fff; font-size: 17px; }
.stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; }
.price { font-size: 22px; font-weight: 800; color: var(--pine-700); letter-spacing: -.02em; }
.price small { font-size: 12px; color: var(--muted); font-weight: 600; }

.suggested { background: linear-gradient(135deg, var(--pine-700), var(--pine-500));
  color: #fff; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
.suggested .lbl { font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  opacity: .82; font-weight: 600; }
.suggested .big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.suggested .glow { position: absolute; right: -30px; top: -30px; width: 130px; height: 130px;
  background: radial-gradient(circle, var(--mint-300), transparent 70%); opacity: .5; }

.route-mini { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.route-mini .ln { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 3px; }
.track i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint-300); }
.track b { width: 2px; height: 16px; background: var(--line); display: block; }
.track i.end { background: var(--pine-700); }

.newtag { display: inline-block; background: var(--pine-700); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  letter-spacing: .05em; margin-bottom: 12px; }
.offer { position: relative; animation: pop .4s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; }

.review { background: #FAFAF6; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.5; }
.review .who { font-weight: 700; font-size: 13px; margin-bottom: 2px; }

/* illustrated portrait avatars */
.portrait { border-radius: 16px; overflow: hidden; flex: 0 0 auto; display: block;
  box-shadow: 0 3px 10px rgba(11,50,38,.12); }
.portrait.big { border-radius: 26px; margin: 2px auto 12px; box-shadow: 0 10px 26px rgba(11,50,38,.18); }

/* bio "about me" tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.tile { background: #FAFAF6; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.tile .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--mint-100);
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.tile .ic svg { width: 17px; height: 17px; stroke: var(--pine-700); }
.tile .lbl { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; }
.tile .val { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin-top: 1px; }
.bio { font-size: 14.5px; line-height: 1.6; color: #3a4740; }
.bio + .bio { margin-top: 10px; }
.quote { font-size: 13px; color: var(--pine-700); font-style: italic;
  border-left: 3px solid var(--mint-300); padding-left: 12px; margin-top: 6px; }

.bidbox { display: flex; align-items: center; background: var(--card); border: 2px solid var(--pine-500);
  border-radius: 16px; padding: 6px 14px; margin: 14px 0; }
.bidbox .cur { font-size: 26px; font-weight: 800; color: var(--pine-700); }
.bidbox input { border: 0; outline: 0; font-size: 30px; font-weight: 800; width: 100%;
  font-family: var(--font); color: var(--ink); background: transparent; letter-spacing: -.02em; }
.chips { display: flex; gap: 8px; margin-bottom: 6px; }
.chip { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--pine-700); transition: .15s; }
.chip:hover { border-color: var(--pine-500); background: var(--mint-100); }
.chip.active { border-color: var(--pine-500); background: var(--mint-100); }

.success { display: flex; flex-direction: column; align-items: center; text-align: center;
  justify-content: center; height: 100%; gap: 6px; padding: 20px; }
.check { width: 88px; height: 88px; border-radius: 50%; background: var(--mint-100);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
  animation: pop .45s ease both; }
.map { height: 150px; border-radius: 16px; margin-bottom: 16px; position: relative; overflow: hidden;
  background:
    linear-gradient(0deg, rgba(11,50,38,.06), rgba(11,50,38,.06)),
    repeating-linear-gradient(90deg, #e9ebe3 0 22px, #eef0e8 22px 44px),
    repeating-linear-gradient(0deg, #e9ebe3 0 22px, #eef0e8 22px 44px);
  border: 1px solid var(--line); }
.map .path { position: absolute; left: 14%; top: 70%; width: 70%; height: 2px; background: var(--pine-700);
  transform-origin: left; transform: rotate(-24deg); box-shadow: 0 0 0 3px rgba(28,122,87,.15); }
.map .p1, .map .p2 { position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 3px solid #fff; }
.map .p1 { background: var(--mint-300); left: 13%; top: 69%; }
.map .p2 { background: var(--pine-700); right: 16%; top: 38%; }

/* ---------- Tab bar ---------- */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 76px; background: #fff;
  border-top: 1px solid var(--line); display: flex; z-index: 40; padding-bottom: 6px; }
.tabbar button { flex: 1; background: transparent; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--font); font-size: 10.5px; font-weight: 600; color: var(--muted); }
.tabbar button svg { width: 23px; height: 23px; }
.tabbar button.active { color: var(--pine-700); }
.tabbar button.active svg { stroke: var(--pine-700); }

.topbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 18px; }
.backbtn { background: #fff; border: 1px solid var(--line); width: 38px; height: 38px;
  border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--pine-700); line-height: 1; }

.note { font-size: 11.5px; color: #BFE4D2; text-align: center; max-width: 390px; margin-top: 18px; line-height: 1.6; }

/* loading + empty states */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 0; color: var(--muted); gap: 12px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--pine-500); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.waiting-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint-300); margin-right: 6px; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* toggle switch */
.switch { position: relative; width: 46px; height: 27px; border-radius: 999px; border: 0;
  background: var(--line); cursor: pointer; transition: .2s; flex: 0 0 46px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--pine-500); }
.switch.on::after { transform: translateX(19px); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
