/* Chi Family Design System v2, travel theme as "چی بگیرم؟" (lajevard of Isfahan, saffron, anar on kahgel ground).
   Glass only for the control layer (header, composer, sheets, progress card); results and prices sit on paper. */
/* Self-hosted variable fonts (OFL, see fonts/): Estedad first, Vazirmatn as the fallback face. */
@font-face {
  font-family: "Estedad";
  src: url("fonts/Estedad-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --accent: oklch(0.42 0.15 266);
  --deep: oklch(0.32 0.14 266);
  --wash: oklch(0.95 0.03 266);
  --tint: oklch(0.93 0.04 266 / .75);
  --ring: oklch(0.42 0.15 266 / .22);
  --glow: oklch(0.42 0.15 266 / .32);
  --grad: linear-gradient(165deg, oklch(0.56 0.15 266), oklch(0.42 0.15 266) 55%, oklch(0.34 0.14 266));
  --grad-text: linear-gradient(165deg, var(--accent), var(--deep));
  --saffron: oklch(0.82 0.16 80);
  --saffron-grad: linear-gradient(170deg, oklch(0.88 0.13 85), oklch(0.81 0.16 78));
  --saffron-bg: oklch(0.95 0.05 85);
  --saffron-ink: oklch(0.42 0.09 70);
  --anar: oklch(0.53 0.19 28);
  --warn-bg: oklch(0.95 0.03 28);
  --warn-ink: oklch(0.48 0.18 28);
  --kahgel: oklch(0.94 0.018 75);
  --ink: oklch(0.24 0.02 30);
  --muted: oklch(0.42 0.02 30);
  --faint: oklch(0.50 0.015 30);
  --hair: rgba(60, 30, 30, .08);
  --paper: rgba(255, 255, 255, .88);
  --sunk: oklch(0.97 0.008 75);
  --field:
    radial-gradient(60% 70% at 85% 10%, oklch(0.75 0.15 266 / .35), transparent 70%),
    radial-gradient(50% 60% at 10% 90%, oklch(0.85 0.14 80 / .30), transparent 70%),
    oklch(0.95 0.02 266 / .6);
  --ground: color-mix(in srgb, oklch(0.95 0.02 266) 60%, oklch(0.94 0.018 75)); /* field base over kahgel, for the composer fade */
  --gr: max(16px, env(safe-area-inset-right));
  --gl: max(16px, env(safe-area-inset-left));
  --font: "Estedad", "Vazirmatn", Tahoma, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--kahgel);
  color: var(--ink);
  font: 400 16px/1.75 var(--font);
}
/* Screen ground: the v2 "field" recipe in the app hue. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--field);
}
button, input, textarea { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }
a { color: var(--accent); -webkit-tap-highlight-color: transparent; }
a:hover { color: var(--deep); }
[hidden] { display: none !important; }
textarea::placeholder, input::placeholder { color: var(--faint); opacity: 1; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; box-shadow: 0 0 0 2px var(--ink) !important; }
.ask textarea:focus-visible { box-shadow: none !important; }
@media (min-width: 601px) { .narrow-only { display: none !important; } }

/* Glass: the control layer only. */
.top, .ask, .panel, .working {
  background: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 12px 32px rgba(60, 30, 30, .10);
}

/* Lucide icons: icons/<name>.svg through a mask, colored by currentColor. */
.ic {
  display: inline-block; flex: none;
  width: 1.1em; height: 1.1em; vertical-align: -.2em;
  background: currentColor;
  -webkit-mask: var(--m) center/contain no-repeat;
  mask: var(--m) center/contain no-repeat;
}
.i-plus { --m: url(icons/plus.svg); }
.i-sparkles { --m: url(icons/sparkles.svg); }
.i-send-horizontal { --m: url(icons/send-horizontal.svg); transform: scaleX(-1); } /* points right: flip for RTL */
.i-map-pin { --m: url(icons/map-pin.svg); }
.i-wallet { --m: url(icons/wallet.svg); }
.i-locate-fixed { --m: url(icons/locate-fixed.svg); }
.i-store { --m: url(icons/store.svg); }
.i-external-link { --m: url(icons/external-link.svg); }
.i-triangle-alert { --m: url(icons/triangle-alert.svg); }
.i-thumbs-up { --m: url(icons/thumbs-up.svg); }
.i-thumbs-down { --m: url(icons/thumbs-down.svg); }
.i-chevron-left { --m: url(icons/chevron-left.svg); } /* points left = forward in RTL */
.i-hotel { --m: url(icons/hotel.svg); }
.i-key-round { --m: url(icons/key-round.svg); }
.i-bed-double { --m: url(icons/bed-double.svg); }
.i-waves { --m: url(icons/waves.svg); }
.i-plane { --m: url(icons/plane.svg); }
.i-train-front { --m: url(icons/train-front.svg); }
.i-bus { --m: url(icons/bus.svg); }
.i-luggage { --m: url(icons/luggage.svg); }
.i-stethoscope { --m: url(icons/stethoscope.svg); }
.i-clock { --m: url(icons/clock.svg); }
.i-calendar-days { --m: url(icons/calendar-days.svg); }
.i-armchair { --m: url(icons/armchair.svg); }
.i-users { --m: url(icons/users.svg); }
.i-plane-takeoff { --m: url(icons/plane-takeoff.svg); }
.i-plane-landing { --m: url(icons/plane-landing.svg); }

/* Booking card parts: provider badge, kind chip on the photo, facts band, date tile, cross-site row. */
.store-badge { display: inline-flex; gap: .3em; align-items: center; width: fit-content; padding: .1em .6em; border-radius: 999px;
  background: var(--wash); color: var(--deep); font-size: .8rem; font-weight: 600; }
.kind-chip {
  position: absolute; bottom: 10px; right: 10px;
  display: flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; color: var(--deep);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(0, 0, 0, .12);
}
.sub { margin: 0; display: flex; align-items: flex-start; gap: 4px; font-size: .88rem; line-height: 1.6; color: var(--muted); }
.sub .ic { margin-top: .25em; width: 14px; height: 14px; }
/* Facts: the provider's rows on a lajevard wash, two across. */
.facts {
  margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 16px; background: var(--wash); overflow: hidden;
}
.facts div { display: flex; flex-direction: column; padding: 7px 12px; line-height: 1.5; box-shadow: 0 0 0 .5px rgba(255, 255, 255, .9); }
.facts dt { font-size: .74rem; color: var(--muted); }
.facts dd { margin: 0; font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.when {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  border-radius: 16px; padding: 8px 12px; background: var(--sunk); line-height: 1.5;
  box-shadow: inset 0 0 0 1px rgba(60, 30, 30, .06);
}
.when-k { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); }
.when-k .ic { width: 13px; height: 13px; color: var(--accent); }
.when strong { font-size: .9rem; font-weight: 700; }
.ticket-row.solo { grid-template-columns: minmax(0, 1fr); }
.price.na { min-height: 64px; }
.price-na { font-size: .95rem; font-weight: 800; line-height: 1.5; }
.alt-row { display: flex; justify-content: space-between; gap: .5rem; margin-block: .5rem; padding: .5rem .75rem;
  border-radius: 14px; background: var(--sunk); font-size: .85rem; text-decoration: none; color: inherit; }
.alt-row strong { color: var(--deep); white-space: nowrap; }

/* Ticket card (ResultCard spec, isTicket): no photo; the route panel, fact chips and other vehicles the same day. */
.trip { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 12px; border-radius: 22px; background: var(--wash); }
.trip-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.trip-line { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--deep); }
.trip-line .ic { width: 16px; height: 16px; }
.seats { display: flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 1px 10px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn-ink); }
.seats .ic { width: 12px; height: 12px; }
.trip-route { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.trip-end { display: flex; flex-direction: column; line-height: 1.3; }
.trip-end.arr { align-items: flex-end; text-align: end; }
.trip-end strong { font-size: 26px; font-weight: 900; }
.trip-end span { font-size: .82rem; color: var(--muted); }
.trip-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.trip-dur { font-size: .72rem; color: var(--muted); }
.trip-date { font-size: .72rem; font-weight: 700; color: var(--deep); }
.trip-dash { position: relative; align-self: stretch; height: 2px; margin-block: 9px; border-radius: 2px;
  background: repeating-linear-gradient(to left, var(--accent) 0 6px, transparent 6px 10px); }
.trip-dot { position: absolute; top: -9px; left: 50%; margin-left: -10px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--deep); box-shadow: 0 0 0 1px var(--ring); }
.trip-dot .ic { width: 12px; height: 12px; }
.trip-dot.flip .ic { transform: scaleX(-1); }
.trip-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.trip-fact { display: flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 10px; font-size: .78rem; white-space: nowrap;
  background: oklch(0.96 0.008 75); box-shadow: inset 0 0 0 1px rgba(60, 30, 30, .06); }
.trip-fact .ic { width: 13px; height: 13px; color: var(--muted); }
.modes { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 16px; background: var(--sunk);
  box-shadow: inset 0 0 0 1px rgba(60, 30, 30, .06); }
.modes-k { font-size: .78rem; font-weight: 700; color: var(--muted); }
.mode { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.mode .ic { width: 16px; height: 16px; color: var(--deep); }
.mode span { flex: 1; min-width: 0; }
.mode strong { font-weight: 700; white-space: nowrap; }
.mode-thumb { display: grid; place-items: center; color: var(--deep); box-shadow: inset 0 0 0 1px var(--wash); }
.mode-thumb .ic { width: 28px; height: 28px; }

/* Mascot چیچی: shapes come from app.js, colors and motion from here. */
.chichi { display: block; overflow: visible; flex: none; }
.m-shadow { fill: rgba(60, 30, 30, .16); }
.m-g0 { stop-color: oklch(0.90 0.13 88); }
.m-g1 { stop-color: oklch(0.82 0.16 80); }
.m-g2 { stop-color: oklch(0.74 0.16 68); }
.m-line { fill: none; stroke: var(--ink); stroke-linecap: round; }
.m-line.m-shine { stroke: rgba(255, 255, 255, .55); }
.m-ink { fill: var(--ink); }
.m-stroke { stroke: var(--ink); stroke-linejoin: round; }
.m-cheek { fill: oklch(0.72 0.14 25 / .45); }
.m-ball { fill: var(--accent); }
.m-ball-shine { fill: rgba(255, 255, 255, .45); }
.m-bubble { fill: rgba(255, 255, 255, .95); stroke: var(--accent); stroke-width: 1.6; }
.m-spark { fill: var(--accent); }
.m-drop { fill: oklch(0.82 0.07 230); }
.m-body { transform-box: view-box; transform-origin: 60px 156px; }
.m-dot { transform-box: view-box; transform-origin: 60px 140px; }
.m-blink, .m-bubble, .m-spark, .m-drop { transform-box: fill-box; transform-origin: center; }
.m-blink { animation: m-blink 3.2s ease-in-out infinite; }
.s-idle .m-blink { animation-duration: 4s; }
.s-found .m-blink { animation: none; }
.s-idle .m-body { animation: m-breathe 3s ease-in-out infinite; }
.s-thinking .m-body { animation: m-sway 2.4s ease-in-out infinite; }
.s-searching .m-body { animation: m-lean 1.6s ease-in-out infinite; }
.s-found .m-body { animation: m-jump 1s ease-in-out 3; }
.s-error .m-body { transform: rotate(9deg) translate(2px, 4px) scale(1, .96); }
.s-thinking .m-pupil { animation: m-lookup 2.4s ease-in-out infinite; }
.s-searching .m-pupil { animation: m-scan 1.2s ease-in-out infinite; }
.s-error .m-pupil { transform: translateY(2px); }
.s-idle .m-dot { animation: m-bob 3s ease-in-out infinite; }
.s-thinking .m-dot { animation: m-bob 2.4s ease-in-out infinite; }
.s-searching .m-dot { animation: m-roll 1.6s ease-in-out infinite; }
.s-found .m-dot { animation: m-jump 1s ease-in-out .08s 3; }
.s-error .m-dot { transform: translate(20px, 6px); }
.m-bubble { animation: m-bubble 2.4s ease-in-out infinite; }
.m-bubble.b1 { animation-delay: .3s; }
.m-bubble.b2 { animation-delay: .6s; }
.m-spark { animation: m-spark 1s ease-in-out 3; }
.m-spark.k1 { animation-delay: .3s; }
.m-spark.k2 { animation-delay: .6s; }
.m-drop { animation: m-drop 2s ease-in infinite; }
@keyframes m-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .97); } }
@keyframes m-sway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes m-lean { 0%, 100% { transform: rotate(-5deg) translateX(-3px); } 50% { transform: rotate(5deg) translateX(3px); } }
@keyframes m-jump { 0%, 100% { transform: translateY(0) scale(1.07, .9); } 15% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(-24px) scale(.96, 1.05); } 75% { transform: translateY(0) scale(1.05, .94); } }
@keyframes m-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.08); } }
@keyframes m-lookup { 0%, 35% { transform: translate(2.2px, -2.6px); } 50%, 85% { transform: translate(-1px, -3px); } 100% { transform: translate(2.2px, -2.6px); } }
@keyframes m-scan { 0%, 100% { transform: translateX(-2.8px); } 50% { transform: translateX(2.8px); } }
@keyframes m-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes m-roll { 0%, 100% { transform: translateX(-12px) rotate(-180deg); } 50% { transform: translateX(12px) rotate(180deg); } }
@keyframes m-bubble { 0% { transform: translateY(6px) scale(.2); opacity: 0; } 30% { opacity: 1; } 70% { transform: translateY(-6px) scale(1); opacity: 1; } 100% { transform: translateY(-12px) scale(1.1); opacity: 0; } }
@keyframes m-spark { 0%, 100% { transform: scale(.3) rotate(0deg); opacity: 0; } 40% { transform: scale(1) rotate(45deg); opacity: 1; } 80% { opacity: 0; } }
@keyframes m-drop { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.page {
  max-width: 860px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  /* Landscape phones with a notch (viewport-fit=cover): keep content clear of it. */
  padding-inline: var(--gr) var(--gl); /* RTL: start = right */
  padding-top: max(10px, env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px;
  padding: 0 20px; min-height: 44px;
  font-weight: 700; white-space: nowrap;
  background: var(--grad-text); color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), inset 0 -2px 4px rgba(0, 0, 0, .2), 0 6px 16px var(--glow);
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost, .glass-btn {
  background: rgba(255, 255, 255, .7); color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--hair), 0 4px 12px rgba(60, 30, 30, .08);
}
.btn.small { min-height: 40px; padding: 0 14px; font-size: 13px; }
.btn.danger { background: var(--anar); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .4); }
.btn.danger-ghost {
  background: rgba(255, 255, 255, .7); color: oklch(0.45 0.17 28);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px oklch(0.53 0.19 28 / .3);
}
.glass-btn {
  display: flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px;
  font-weight: 700; font-size: .88rem; white-space: nowrap;
}
.btn.fill {
  display: flex; margin-top: 6px; white-space: normal; text-align: start; height: auto; padding-block: 6px;
  color: oklch(0.45 0.17 28); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px oklch(0.53 0.19 28 / .35);
}

/* Header: floating glass pill */
.top {
  position: sticky; top: max(10px, env(safe-area-inset-top)); z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 14px 6px 6px; border-radius: 999px;
}
.top.scrolled { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 14px 34px rgba(60, 30, 30, .16); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tile {
  flex: none; width: 40px; height: 40px;
  border-radius: 12px 12px 4px 12px;
  background: var(--grad);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .55), inset 0 -2px 5px rgba(0, 0, 0, .25);
  display: grid; place-items: center;
}
.tile span { font-weight: 800; font-size: 28px; line-height: 1; color: var(--saffron); }
.brand h1 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.brand .q { color: var(--accent); }
body:not(.has-thread) #newChat { display: none; }
#newChat { flex: none; }

/* Home */
.thread { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-block: 12px 20px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 16px; text-align: center; }
.hero-mascot { display: grid; place-items: center; min-height: 112px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .7); color: var(--deep);
  font-size: .82rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--ring);
}
.hero h2 { margin: 0; font-size: clamp(1.9rem, 5vw, 2.75rem); font-weight: 800; line-height: 1.35; }
.hero p { margin: 0; max-width: 46ch; color: var(--muted); font-size: .95rem; line-height: 1.8; text-wrap: pretty; }
.hero p.mcp { font-size: .82rem; font-weight: 700; color: var(--deep); }
.try { align-self: stretch; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; text-align: start; }
.try-label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.suggest { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.sugg {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 12px; border: 0; border-radius: 22px;
  text-align: start; background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(60, 30, 30, .06), 0 6px 16px rgba(60, 30, 30, .06);
}
.sugg:hover { background: rgba(255, 255, 255, .92); }
.sugg:disabled { opacity: .55; cursor: not-allowed; }
.sugg-ic {
  flex: none; width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center; background: var(--wash); color: var(--deep);
}
.sugg-ic .ic { width: 22px; height: 22px; }
.sugg-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.sugg-tag { font-size: .78rem; font-weight: 700; color: var(--deep); }
.sugg-q { font-size: .95rem; font-weight: 500; }
.sugg > .ic { color: var(--faint); width: 18px; height: 18px; }

/* Thread */
.log { display: flex; flex-direction: column; gap: 16px; }
.log:empty { display: none; }
.msg-user {
  align-self: flex-start;
  max-width: 85%;
  background: var(--grad-text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 22px 22px 6px 22px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .4), 0 6px 16px var(--glow);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.answer { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 84px; }
.answer-head { display: flex; align-items: center; gap: 10px; }
.found-mascot { flex: none; display: grid; place-items: center; min-width: 34px; }
.answer-head-text { display: flex; flex-direction: column; gap: 0; min-width: 0; line-height: 1.55; }
.count { margin: 0; font-size: .98rem; font-weight: 400; }
.count strong { font-weight: 800; }
.sort-note { margin: 0; font-size: .8rem; color: var(--muted); }
.sort-note .ic { margin-inline-end: 4px; }
.stale { margin: 0; font-size: .82rem; color: var(--saffron-ink); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.reply {
  background: var(--paper);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--hair), 0 8px 24px rgba(60, 30, 30, .08);
  border-radius: 28px;
  padding: 14px 20px;
  overflow-wrap: anywhere;
}
.reply.lead { margin-bottom: 14px; }
.reply p { margin: 0 0 .6em; }
.reply ul, .reply ol { margin: 0 0 .6em; padding-inline-start: 1.3em; }
.reply-text > :last-child, .empty-text > :last-child { margin-bottom: 0; }
.ask-back { display: flex; align-items: center; gap: 12px; }
.ask-back-mascot { flex: none; display: grid; place-items: center; min-width: 40px; }
.reply.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px; }
.empty-title { font-size: 1.05rem; font-weight: 700; }
.empty-text { max-width: 40ch; font-size: .9rem; color: var(--muted); text-wrap: pretty; }
.relax { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }

/* Result cards: paper, never glass */
.options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.options > .card.best { margin-top: 10px; }
.next-label { font-size: .82rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.card { position: relative; min-width: 0; }
.card.big {
  display: flex; flex-direction: column; gap: 12px;
  padding: 8px 8px 14px; border-radius: 30px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 2px var(--hair), 0 14px 34px rgba(60, 30, 30, .12);
}
.card.big.best { box-shadow: 0 0 0 2px var(--accent), 0 14px 34px rgba(60, 30, 30, .12); }
.top-tag {
  position: absolute; top: -13px; right: 22px; z-index: 2;
  background: var(--grad-text); color: #fff;
font-size: .78rem; font-weight: 700; line-height: 1;
  padding: 7px 12px; border-radius: 999px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .4), 0 4px 10px var(--glow);
}
.photo { position: relative; overflow: hidden; background: var(--wash); }
.photo.lg { aspect-ratio: 16 / 10; border-radius: 22px; }
.photo.sm { flex: none; width: 72px; height: 72px; border-radius: 18px; }
.thumb { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.ph {
  display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, var(--wash) 0 10px, #fff 10px 20px);
  color: var(--accent);
}
.thumb.ph .ic { width: 28px; height: 28px; }
/* No photo (flights, doctors): a short patterned band carries the kind icon instead of a big empty frame. */
.photo.lg.none { aspect-ratio: auto; height: 76px; }
.photo.lg .thumb.ph .ic { width: 34px; height: 34px; }
.eta-chip {
  position: absolute; bottom: 10px; right: 10px;
  display: flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .82rem; font-weight: 700;
  background: rgba(255, 255, 255, .75);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(0, 0, 0, .12);
}
.off-chip {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 800;
  background: var(--saffron-grad); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6);
}
.card-body { display: flex; flex-direction: column; gap: 12px; padding-inline: 10px; min-width: 0; }
.head { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card h3 { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.5; }
.vendor { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.vendor-ic { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--wash); color: var(--deep); }
.vendor-ic .ic { width: 13px; height: 13px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: .84rem; color: var(--muted); }
.meta strong { font-weight: 600; color: var(--ink); }
.stars { font-weight: 700; color: oklch(0.48 0.10 70); }
.meta .votes { font-weight: 400; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: .78rem; font-weight: 700;
  padding: 1px 10px; border-radius: 999px;
  background: var(--saffron-bg); color: var(--saffron-ink);
}
.badge.svc { background: var(--wash); color: var(--deep); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.why { margin: 0; font-size: .9rem; line-height: 1.65; text-wrap: pretty; }
.why strong { display: inline-flex; align-items: center; gap: 4px; color: var(--deep); font-weight: 700; }
.warnbox {
  margin: 0; font-size: .85rem; line-height: 1.65;
  background: var(--warn-bg); color: oklch(0.40 0.15 28);
  border-radius: 14px; padding: 8px 12px;
}
.warnbox p { margin: 0; }
.warnbox .ic { margin-inline-end: 6px; vertical-align: -.22em; }

/* The price ticket: saffron, the one loud thing on a card. */
.ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
.price {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--saffron-grad);
  border-radius: 16px; padding: 8px 12px; text-align: center;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 4px 12px oklch(0.75 0.15 75 / .35);
}
.price::before, .price::after {
  content: ""; position: absolute; top: 50%; width: 12px; height: 12px;
  margin-top: -6px; border-radius: 50%; background: #fff;
}
.price::before { right: -6px; }
.price::after { left: -6px; }
.price del { display: block; font-size: .8rem; line-height: 1.4; color: oklch(0.40 0.07 70); }
.price-line { line-height: 1.25; }
.price-final { font-size: 22px; font-weight: 900; }
.price-unit { font-size: .75rem; font-weight: 500; }
.price-note { display: block; font-size: .72rem; line-height: 1.5; color: oklch(0.36 0.06 70); }
.breakdown {
  margin: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  font-size: .78rem; background: var(--sunk); border-radius: 16px; padding: 8px 10px;
  box-shadow: inset 0 0 0 1px rgba(60, 30, 30, .06);
}
.breakdown div { display: flex; justify-content: space-between; gap: 6px; }
.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; white-space: nowrap; }
.breakdown .total { border-top: 1px solid rgba(60, 30, 30, .1); margin-top: 2px; padding-top: 3px; font-weight: 700; }
.order {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; border-radius: 999px; font-weight: 700; font-size: .95rem; text-align: center;
  background: var(--grad-text); color: #fff; text-decoration: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), 0 6px 16px var(--glow);
}
.order:hover { color: #fff; filter: brightness(1.08); }
.order .ic { width: 16px; height: 16px; }
/* Components with their own shadow: keep it and add the focus halo (D2). */
.handoff { margin: -6px 0 0; font-size: .75rem; line-height: 1.6; text-align: center; color: var(--faint); }
.no-url { text-align: center; font-size: .8rem; color: var(--muted); padding: 4px 0; }

/* Compact cards (rank 2+) */
.card.compact {
  border-radius: 24px; background: var(--paper);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(60, 30, 30, .07), 0 6px 18px rgba(60, 30, 30, .08);
}
.mini {
  display: flex; align-items: center; gap: 12px;
  min-height: 88px; padding: 8px 8px 8px 12px; border-radius: 24px;
  color: inherit; text-decoration: none;
}
a.mini:hover { color: inherit; background: rgba(255, 255, 255, .6); }
.mini-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-title { font-size: .94rem; font-weight: 700; line-height: 1.5; }
.mini-sub { font-size: .8rem; line-height: 1.55; color: var(--muted); }
.mini-meta { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: .78rem; line-height: 1.6; color: var(--muted); }
.mini-diff {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  margin-top: 2px; padding: 0 8px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; background: var(--wash); color: var(--deep);
}
.mini-diff .ic { width: 12px; height: 12px; }
.mini-price { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.35; }
.mini-price strong { font-size: 1rem; font-weight: 900; }
.mini-price span { max-width: 11ch; font-size: .72rem; line-height: 1.45; text-align: end; color: var(--muted); }
.mini > .ic { color: var(--faint); width: 18px; height: 18px; }
.card.compact > .warnbox { margin: 0 12px 10px; }
.mini-more { padding: 0 14px 6px; }
.mini-more summary { display: flex; align-items: center; min-height: 40px; font-size: .82rem; font-weight: 700; color: var(--accent); cursor: pointer; }
.mini-more .why { margin-bottom: 8px; }
.mini-more .facts { margin-bottom: 8px; }

/* Feedback + refine chips (refine sits last, next to the composer) */
.feedback { order: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.feedback-note { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; inline-size: 100%; }
.feedback-note textarea {
  flex: 1 1 220px; border: 0; border-radius: 18px; padding: 8px 14px; background: rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--hair); resize: vertical;
}
.refine { order: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.refine-label { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--muted); }
.refine-label::after { content: ":"; }
.refine-chips { display: contents; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 0 14px; min-height: 40px;
  font-size: .88rem; background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--hair);
}
.chip:hover { background: rgba(255, 255, 255, .95); }
.chip:disabled { opacity: .5; cursor: not-allowed; }
.chip.tint { background: var(--tint); color: var(--deep); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 1px var(--ring); }
.chip.fb { width: 40px; padding: 0; border-radius: 50%; }
.chip.fb .ic { width: 18px; height: 18px; }

/* Agent progress card: glass frame, paper inside */
.working { border-radius: 22px; padding: 8px; }
.working-in {
  display: flex; flex-direction: column; gap: 12px;
  border-radius: 18px; padding: 16px 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(60, 30, 30, .05);
}
.working-head { display: flex; align-items: center; gap: 12px; }
.working-head strong { font-weight: 700; line-height: 1.5; font-size: .95rem; }
.working-mascot { flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--wash); }
.elapsed { margin-inline-start: auto; flex: none; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: .9rem; line-height: 1.6; color: var(--faint); }
.step-dot {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; box-shadow: inset 0 0 0 2px rgba(60, 30, 30, .15);
}
.step-dot::after {
  content: ""; width: 10px; height: 10px; background: #fff; opacity: 0;
  -webkit-mask: url(icons/circle-check.svg) center/contain no-repeat;
  mask: url(icons/circle-check.svg) center/contain no-repeat;
}
.steps .done, .steps .active { color: var(--ink); }
.steps .done .step-dot { background: var(--accent); box-shadow: none; }
.steps .done .step-dot::after { opacity: 1; }
.steps .active { font-weight: 700; }
.steps .active .step-dot { background: var(--saffron); box-shadow: 0 0 0 0 oklch(0.82 0.16 80 / .6); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 8px oklch(0.82 0.16 80 / 0); } }
.working-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--hair); padding-top: 8px;
}
.working-foot span { font-size: .8rem; color: var(--muted); }
.cancel { border: 0; border-radius: 999px; background: none; color: oklch(0.50 0.19 28); font-weight: 700; font-size: .88rem; min-height: 40px; padding: 0 12px; }

/* Error: anar box */
.failed {
  display: flex; flex-direction: column; gap: 10px;
  background: oklch(0.95 0.03 28 / .85); color: oklch(0.36 0.13 28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 0 0 1px oklch(0.53 0.19 28 / .25);
  border-radius: 22px; padding: 14px 16px;
}
.failed p { margin: 0; }
.failed-head { display: flex; align-items: center; gap: 12px; }
.failed-mascot { flex: none; display: grid; place-items: center; min-width: 40px; }
.failed-title { font-weight: 800; }
.failed-msg { font-size: .9rem; }
.failed-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.failed-actions .btn { min-height: 40px; padding: 0 18px; font-size: .95rem; }

/* Composer: sticky bottom, thumb-reachable */
.composer {
  position: sticky; bottom: 0; z-index: 5;
  margin-inline: calc(-1 * var(--gr)) calc(-1 * var(--gl));
  padding: 24px var(--gl) max(12px, env(safe-area-inset-bottom)) var(--gr);
  background: linear-gradient(to top, var(--ground) calc(100% - 24px), transparent);
  display: flex; flex-direction: column; gap: 8px;
}
.context { display: flex; flex-wrap: wrap; gap: 8px; }
.route { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ctx {
  display: flex; align-items: center; gap: 6px;
  max-width: 100%; white-space: nowrap;
  border: 0; border-radius: 999px; padding: 0 14px; min-height: 40px;
  font-size: .88rem; background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--hair);
}
.ctx .ic { width: 16px; height: 16px; color: var(--muted); }
.ctx-k { flex: none; color: var(--muted); }
.ctx strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.ctx[aria-expanded="true"] { box-shadow: inset 0 1px 0 #fff, 0 0 0 2px var(--ring); }
.ctx.set { background: oklch(0.95 0.05 85 / .85); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px oklch(0.82 0.16 80 / .6); }
.ctx.set strong { color: var(--saffron-ink); }
/* No location yet: the chip asks to be picked. */
.ctx.unset { box-shadow: inset 0 0 0 1.5px var(--accent); }
.ctx.unset strong, .ctx.unset .ic { color: var(--accent); }
/* Service switch: segmented pill. Radios stay native for keyboard + screen readers. */
.switch {
  display: flex; flex: none; margin: 0; padding: 3px; min-width: 0;
  border: 0; border-radius: 999px; background: rgba(60, 30, 30, .06);
}
.switch label { position: relative; display: flex; cursor: pointer; }
/* The span is the pill, so the checked state works without :has() (older in-app browsers). */
.switch span {
  display: flex; align-items: center;
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  font-size: .88rem; font-weight: 600; white-space: nowrap; color: var(--muted);
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch label:hover span { color: var(--deep); }
.switch input:checked + span { background: #fff; color: var(--deep); box-shadow: 0 1px 4px rgba(60, 30, 30, .15); }
.switch input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 2px; box-shadow: 0 0 0 2px var(--ink); }
.switch:disabled { opacity: .55; }
.switch:disabled label { cursor: not-allowed; }

/* The bar: while an answer is coming a light ring turns around it, چیچی thinks beside the stop button. */
.ask-ring { position: relative; border-radius: 30px; padding: 2px; overflow: hidden; }
.ask-ring::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 200%; aspect-ratio: 1; margin: -100% 0 0 -100%;
  background: conic-gradient(from 0deg, var(--accent), var(--saffron), #fff, var(--accent), var(--saffron), var(--accent));
  opacity: 0; animation: spin 3s linear infinite;
}
.ask-ring.busy::before { opacity: 1; }
.ask-ring.busy { box-shadow: 0 8px 24px var(--glow); }
.ask-ring:focus-within { box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--saffron); }
.ask {
  position: relative;
  display: flex; gap: 8px; align-items: center;
  border-radius: 28px; padding: 6px;
  background: rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--hair), 0 10px 26px rgba(60, 30, 30, .12);
}
.ask-ring.busy .ask { background: rgba(255, 255, 255, .94); }
.ask textarea {
  flex: 1; min-width: 0;
  border: 0; background: transparent; resize: none;
  padding: 8px 12px; max-height: 9rem; line-height: 1.6; font-size: 16px;
}
.ask textarea:focus { outline: none; }
.ask-mascot { flex: none; width: 40px; height: 44px; display: grid; place-items: center; }
.send {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--grad-text); color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), 0 4px 12px var(--glow);
}
.send .ic { width: 18px; height: 18px; }
.send:disabled { opacity: .4; cursor: not-allowed; }
.send.stop { background: var(--ink); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25); }
.send.stop .ic { -webkit-mask: none; mask: none; width: 14px; height: 14px; border-radius: 6px; background: #fff; transform: none; }

/* Location / budget panels: inline glass cards above the composer on desktop, bottom sheets on phones */
dialog.panel {
  position: static;
  margin: 0 0 4px;
  padding: 0;
  width: auto;
  max-width: none;
  border-radius: 28px;
  color: var(--ink);
}
.panel-in { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.panel-in:focus { outline: none; }
.grab { display: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-head strong { font-weight: 800; }
.panel-close { border: 0; background: none; color: var(--muted); font-size: .88rem; padding: 6px 10px; border-radius: 999px; }
.geo {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border: 0; border-radius: 999px;
  background: var(--tint); color: var(--deep); font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 1px var(--ring);
}
.geo:disabled { opacity: .55; cursor: wait; }
.or { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--faint); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.cities-label { font-size: .85rem; color: var(--muted); margin-bottom: -4px; }
.cities { display: flex; flex-wrap: wrap; gap: 6px; }
.city, .preset {
  border: 0; border-radius: 999px; padding: 0 14px; min-height: 40px;
  font-size: .9rem; background: rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--hair);
}
.city:hover, .preset:hover { background: #fff; }
.preset[aria-pressed="true"] { background: var(--grad-text); color: #fff; font-weight: 700; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45); }
.loc-form { display: flex; gap: 8px; }
.panel input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 18px;
  padding: 7px 14px; background: rgba(255, 255, 255, .8); color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(60, 30, 30, .1);
}
.loc-form .btn { flex: none; }
.panel-status { margin: 0; font-size: .85rem; color: var(--muted); }
.panel-status:empty { display: none; }
.panel-status.bad { color: var(--warn-ink); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.custom { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }
.custom span { flex: none; }
.panel-note { margin: 0; font-size: .8rem; color: var(--muted); text-wrap: pretty; }
.btn.confirm { min-height: 52px; font-size: 1rem; }

/* Bottom sheet: app.js opens panels modal only on phones, portrait or landscape. */
dialog.panel:modal {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 36px 36px 0 0;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 -10px 40px rgba(60, 30, 30, .18);
  animation: sheet-up .25s ease-out;
}
dialog.panel::backdrop { background: rgba(60, 30, 30, .38); animation: fade-in .2s ease-out; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Phones */
@media (max-width: 600px) {
  .top { padding-right: 6px; }
  #newChat { min-height: 44px; }
  .hero { gap: 10px; padding-top: 8px; }
  .hero h2 { font-size: 2rem; }
  .suggest { grid-template-columns: 1fr; }
  .msg-user { max-width: 88%; padding: 9px 16px; font-size: .95rem; }
  .btn.small { min-height: 44px; }
  .photo.sm { width: 64px; height: 64px; border-radius: 16px; }
  .mini { padding-left: 10px; gap: 10px; }
  .mini > .ic { display: none; }
  .why { font-size: .88rem; }
  .answer { scroll-margin-top: 76px; }

  /* nowrap: a wrapping column flexbox sizes to the chips' full width and widens the page. */
  .refine { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; min-width: 0; }
  .refine-label { font-size: .8rem; font-weight: 700; }
  .refine-label::after { content: none; }
  .refine-chips {
    display: flex; gap: 8px; overflow-x: auto;
    margin-inline: calc(-1 * var(--gr)) calc(-1 * var(--gl));
    padding-inline: var(--gr) var(--gl); padding-bottom: 2px;
    scrollbar-width: none;
  }
  .refine-chips::-webkit-scrollbar { display: none; }
  .chip { min-height: 44px; white-space: nowrap; flex: none; }
  .chip.fb { width: 44px; }
  .relax .chip { white-space: normal; }

  .failed-actions .btn { flex: 1 1 0; min-height: 44px; }
  .working-in { padding: 14px; }
  .cancel { min-height: 44px; }

  .composer { padding-top: 20px; gap: 6px; }
  .context { gap: 6px; }
  .ctx { min-height: 44px; font-size: .85rem; }
  .ctx strong { max-width: 18ch; }
  /* Switch gets its own full-width row so location and budget stay on screen below it. */
  .switch { flex: 1 1 100%; }
  .switch label { flex: 1; }
  .switch span { flex: 1; justify-content: center; min-height: 40px; padding: 0 8px; font-size: .85rem; }
  #locChip { flex: 1 1 0; min-width: 0; }
  .route { flex: 1 1 100%; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gr)) calc(-1 * var(--gl)); padding-inline: var(--gr) var(--gl); }
  .route::-webkit-scrollbar { display: none; }
  .route .ctx { flex: none; }
  /* While typing, the keyboard takes half the screen: hide the context row (focus/blur toggle .typing). */
  .typing .context { display: none; }

  /* Bottom sheet content */
  .panel-in { padding: 10px 18px max(18px, env(safe-area-inset-bottom)); gap: 12px; }
  .grab { display: block; align-self: center; width: 40px; height: 4px; border-radius: 999px; background: rgba(60, 30, 30, .2); }
  .panel-head strong { font-size: 1.05rem; }
  .panel-close { min-height: 44px; }
  .geo { min-height: 52px; }
  .cities { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .city { border-radius: 14px; min-height: 44px; padding: 0 4px; }
  .panel input { min-height: 52px; padding: 0 16px; font-size: 16px; }
  .loc-form .btn { min-height: 52px; }
  .presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preset { border-radius: 16px; min-height: 48px; padding: 0 6px; }
  .panel-note { font-size: .78rem; line-height: 1.7; }
}

/* Desktop: big card gets photo beside the content, the next picks sit two across. */
@media (min-width: 760px) {
  .options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .options > .card.big, .options > .next-label { grid-column: 1 / -1; }
  .card.big { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0 14px; align-items: stretch; }
  .card.big .photo.lg { aspect-ratio: auto; min-height: 300px; }
  /* Without a photo the card stays one column: the band sits on top. */
  .card.big.noimg { display: flex; }
  .card.big.noimg .photo.lg { min-height: 0; }
  .card-body { padding-block: 6px 0; }
  .hero { padding-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
