/* =========================================================
   Old Muscat Tourism — PWA
   Clean modern app aesthetic. One font. Simple geometry.
   ========================================================= */

:root {
  --paper:    #F7F4EE;
  --paper-2:  #EFE9DD;
  --ink:      #16110D;
  --ink-2:    #2F2620;
  --ink-3:    #6E6258;
  --muted:    #9A8E80;
  --line:     rgba(22,17,13,0.08);
  --copper:   #C45D2E;
  --copper-2: #A04416;
  --ember:    #E89A5C;
  --linen:    #FFFDF9;
  --night:    #16110D;

  --font: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --phone-w: 412px;
  --phone-h: 880px;
  --phone-radius: 48px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

* {
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

html {
  background: #0a0807;
  color-scheme: light;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--ink);
  background: transparent;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, [contenteditable], .bubble, p, h1, h2, h3, h4, h5 {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

button, a {
  font-family: inherit;
  cursor: pointer;
  -webkit-user-drag: none;
}
a { color: inherit; text-decoration: none; }
img { -webkit-user-drag: none; user-select: none; }

/* =========================================================
   Phone frame on desktop, full-bleed on mobile
   ========================================================= */
.device {
  position: relative;
  margin: 0 auto;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app {
  position: relative;
  width: 100%;
  max-width: var(--phone-w);
  height: 100dvh;
  max-height: var(--phone-h);
  background: var(--paper);
  border-radius: var(--phone-radius);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  isolation: isolate;
  box-shadow:
    inset 0 0 0 1px rgba(22,17,13,0.04),
    0 0 0 8px rgba(0,0,0,0.04),
    0 30px 80px -20px rgba(0,0,0,0.5);
}

@media (max-width: 480px) {
  html { background: var(--paper); }
  .device { padding: 0; height: 100dvh; }
  .app {
    border-radius: 0;
    max-width: none;
    max-height: none;
    box-shadow: none;
    padding-top: env(safe-area-inset-top);
  }
  .device-notch { display: none; }
  .status-bar { display: none !important; }
  .app-bar { padding-top: 12px; }
}

.device-notch {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 32px;
  background: #0a0807;
  border-radius: 24px;
  z-index: 10;
  pointer-events: none;
}

/* Boot banner — shows until JS init succeeds. Helps diagnose blank screen. */
#boot-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  font: 500 12px/1.4 var(--font), system-ui, sans-serif;
  text-align: center;
  z-index: 99999;
  letter-spacing: 0.02em;
}

/* =========================================================
   Status bar (faux iOS — desktop only)
   ========================================================= */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  background: transparent;
  position: relative;
  z-index: 5;
  direction: ltr;
}
.status-icons { display: inline-flex; align-items: center; gap: 6px; }
.battery {
  width: 24px; height: 11px; border: 1px solid currentColor; border-radius: 3px;
  position: relative; padding: 1px; opacity: 0.85;
}
.battery::after {
  content: ''; position: absolute; right: -3px; top: 3px; width: 2px; height: 5px;
  background: currentColor; border-radius: 0 1px 1px 0;
}
.battery-fill { display: block; height: 100%; width: 80%; background: currentColor; border-radius: 1px; }

/* =========================================================
   App bar
   ========================================================= */
.app-bar {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 12px;
  padding: 8px 18px 14px;
  position: relative;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 36px;
}
.brand-mark img {
  height: 30px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  display: block;
}
.brand-label { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--muted);
}
.appbar-title {
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  color: var(--ink);
  transition: transform .15s var(--ease), background .15s;
  backdrop-filter: blur(10px);
  font-size: 18px;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.ghost { border-color: transparent; background: transparent; }

.lang-btn {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  width: auto;
  padding: 0 14px;
  height: 32px;
  border-radius: var(--r-pill);
}

/* =========================================================
   Tab bar
   ========================================================= */
.tab-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: rgba(247,244,238,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 5;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.02em;
  font-weight: 500;
  position: relative;
}
.tab svg { width: 22px; height: 22px; transition: transform .15s var(--ease); }
.tab[aria-current="page"] { color: var(--copper); }
.tab:active svg { transform: scale(0.92); }

.tab-center { transform: translateY(-12px); }
.tab-bubble {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--paper);
  box-shadow:
    0 10px 26px -8px rgba(196,93,46,0.5),
    0 4px 10px rgba(0,0,0,0.2);
}
.tab-center svg { width: 22px; height: 22px; }
.tab-center[aria-current="page"] .tab-bubble { background: var(--copper); }
.tab-center span { display: none; }

/* =========================================================
   Views
   ========================================================= */
.view-container {
  position: relative;
  overflow: hidden;
}
.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
  scroll-behavior: smooth;
  padding-bottom: 24px;
}
.view[data-active="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.view::-webkit-scrollbar { width: 0; }

/* =========================================================
   HERO — clean, no animation, one big gradient image
   ========================================================= */
.hero {
  position: relative;
  margin: 4px 16px 20px;
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  height: 360px;
  background:
    radial-gradient(ellipse 100% 60% at 50% 110%, rgba(232,154,92,0.55), transparent 60%),
    linear-gradient(170deg, #1a0f08 0%, #4a1f0e 35%, #c45d2e 75%, #f0a560 100%);
  color: var(--linen);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
}

.hero::after {
  /* film grain */
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
  mix-blend-mode: overlay;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-kicker { color: rgba(255,253,249,0.7); }

.hero-title {
  font-weight: 600;
  margin: 10px 0 0;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--linen);
}

.hero-amp { display: none; }

.hero-sub {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,253,249,0.85);
  max-width: 32ch;
}

.hero-cta {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--ink);
  color: var(--linen);
  transition: transform .12s var(--ease), background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-accent {
  background: var(--copper);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(196,93,46,0.55);
}
.btn-accent:active { background: var(--copper-2); }
.btn-ghost {
  background: rgba(255,255,255,0.14);
  color: var(--linen);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(8px);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-small { padding: 8px 14px; font-size: 12px; }
.btn-lg { padding: 14px 20px; font-size: 14px; }

/* =========================================================
   Sections
   ========================================================= */
.section { padding: 22px 16px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-num { display: none; }
.section-title {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
  color: var(--ink);
}
.section-title em {
  font-style: normal;
  color: var(--copper);
}
.section-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--copper);
}

/* Horizontal rail */
.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 16px 8px;
  margin: 0 -16px;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { height: 0; }

/* Tour poster (rail) */
.tour-poster {
  flex: 0 0 75%;
  scroll-snap-align: start;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  height: 320px;
  color: var(--linen);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  isolation: isolate;
  background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.7) 100%);
  cursor: pointer;
  transition: transform .2s var(--ease-out);
}
.tour-poster:active { transform: scale(0.98); }
.tour-poster::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient, linear-gradient(160deg, #c45d2e, #1A1614));
  z-index: -1;
}
.tour-poster .badge {
  position: absolute;
  top: 14px; left: 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.tour-poster .tour-numeral { display: none; }
.tour-poster h3 {
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.tour-poster .tour-meta {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255,253,249,0.85);
  font-weight: 500;
}
.tour-poster .tour-meta::before { display: none; }

/* =========================================================
   Chips (categories)
   ========================================================= */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--linen);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  font-family: var(--font);
  transition: all .15s var(--ease);
}
.chip:active { transform: scale(0.96); }
.chip.active, .chip[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.chip-num { display: none; }

/* =========================================================
   Postcard grid
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.postcard {
  border-radius: var(--r-md);
  padding: 14px;
  height: 160px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--linen);
  cursor: pointer;
  isolation: isolate;
  transition: transform .15s var(--ease-out);
}
.postcard:active { transform: scale(0.97); }
.postcard::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient, linear-gradient(160deg, #c45d2e, #1A1614));
  z-index: -1;
}
.postcard-num { display: none; }
.postcard h4 {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.postcard small {
  font-size: 11px;
  opacity: 0.8;
  font-weight: 500;
}

/* =========================================================
   Paper card (note from guide)
   ========================================================= */
.section-cta { padding-bottom: 22px; }
.paper-card {
  border-radius: var(--r-lg);
  padding: 22px;
  background: var(--linen);
  border: 1px solid var(--line);
  position: relative;
}
.paper-card::after { display: none; }
.paper-title {
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  margin: 8px 0 8px;
  max-width: 18ch;
  letter-spacing: -0.015em;
}
.paper-title em { font-style: normal; color: var(--copper); }
.paper-body {
  font-size: 14px;
  color: var(--ink-3);
  margin: 0 0 16px;
  max-width: 36ch;
  line-height: 1.55;
}

/* =========================================================
   Footer
   ========================================================= */
.footer-card {
  margin: 22px 16px 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.footer-card h4 {
  font-weight: 600;
  font-size: 17px;
  margin: 4px 0 8px;
  letter-spacing: -0.01em;
}
.footer-card p {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 4px 0;
  line-height: 1.6;
}
.footer-contact {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

/* =========================================================
   Tours page
   ========================================================= */
.tours-head { padding: 8px 16px 16px; }
.page-title {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.025em;
  margin: 4px 0 6px;
  line-height: 1.1;
}
.page-title em { font-style: normal; color: var(--copper); }
.page-sub {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0 0 14px;
  max-width: 40ch;
  line-height: 1.5;
}

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 4px 16px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar .chip { flex: 0 0 auto; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r-pill);
  background: var(--linen);
  border: 1px solid var(--line);
}
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.search input::placeholder { color: var(--muted); }

.tour-list {
  padding: 4px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--linen);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.tour-card:active { transform: scale(0.98); }
.tour-card-art {
  border-radius: var(--r-sm);
  height: 100%;
  min-height: 100px;
  background: var(--gradient, linear-gradient(160deg, #c45d2e, #1A1614));
  position: relative;
  overflow: hidden;
}
.tour-card-art .pin {
  position: absolute;
  bottom: 8px; left: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--linen);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.tour-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.tour-card-cat {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  font-weight: 700;
}
.tour-card-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 4px 0 4px;
  color: var(--ink);
}
.tour-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.tour-card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.4; }
.tour-card-foot {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 6px;
}
.price {
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.price small {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-left: 4px;
  font-weight: 600;
}
.tour-cta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--copper);
}

/* =========================================================
   Tour detail
   ========================================================= */
.detail-hero {
  position: relative;
  height: 280px;
  margin: 4px 16px 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: var(--linen);
}
.detail-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient, linear-gradient(180deg, #c45d2e, #1A1614));
  z-index: -2;
}
.detail-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.6) 100%);
  z-index: -1;
}
.detail-cat {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,253,249,0.85);
  font-weight: 700;
}
.detail-title {
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 6px 0 10px;
}
.detail-title em { font-style: normal; font-weight: 500; opacity: 0.85; font-size: 0.6em; display: block; margin-top: 2px; }
.detail-meta {
  display: flex; gap: 10px; font-size: 12.5px; color: rgba(255,253,249,0.9);
}

.detail-body {
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-summary {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.6;
  border-left: 2px solid var(--copper);
  padding-left: 12px;
}
.detail-section h4 {
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.itinerary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.itinerary li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
}
.itinerary li:last-child { border-bottom: 0; }
.itinerary .day {
  font-size: 11px;
  color: var(--copper);
  letter-spacing: 0.05em;
  font-weight: 600;
}
.itinerary .day strong {
  display: block;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  line-height: 1;
}
.includes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  list-style: none;
  margin: 0; padding: 0;
}
.includes li {
  font-size: 12.5px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--linen);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
}
.includes li svg { width: 14px; height: 14px; color: var(--copper); flex: 0 0 auto; }

.book-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--paper) 75%, transparent);
  padding: 14px 16px 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.book-bar .price-block { display: flex; flex-direction: column; line-height: 1.1; }
.book-bar .price { font-size: 22px; }

/* =========================================================
   Chat
   ========================================================= */
.view-chat {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  height: 100%;
  padding-bottom: 0 !important;
}
.chat-head {
  display: grid;
  grid-template-columns: 44px 1fr 32px;
  gap: 12px;
  align-items: center;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.bot-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #C45D2E, #6F2A11);
  color: var(--linen);
  font-weight: 700;
  font-size: 22px;
  box-shadow: 0 6px 16px -8px rgba(196,93,46,0.55);
}
.bot-name {
  display: block;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.bot-status {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.bot-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #2C9F5E;
}

.chat-thread {
  overflow-y: auto;
  padding: 16px 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.bubble {
  max-width: 80%;
  padding: 10px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  animation: bubbleIn .25s var(--ease-out);
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bubble.bot {
  background: var(--linen);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  align-self: flex-start;
}
.bubble.user {
  background: var(--ink);
  color: var(--linen);
  border-bottom-right-radius: 6px;
  align-self: flex-end;
}
.bubble em {
  font-style: normal;
  font-weight: 600;
  color: var(--copper);
}
.bubble.user em { color: var(--ember); }
.bubble .typing {
  display: inline-flex; gap: 4px;
}
.bubble .typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: typing 1.2s ease-in-out infinite;
}
.bubble .typing span:nth-child(2) { animation-delay: .15s; }
.bubble .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.bubble-card {
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  align-self: flex-start;
  width: 80%;
  animation: bubbleIn .25s var(--ease-out);
}
.bubble-card .art {
  height: 100px;
  background: var(--gradient, linear-gradient(160deg, #c45d2e, #1A1614));
}
.bubble-card .body { padding: 10px 12px; }
.bubble-card h5 {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 4px;
  line-height: 1.2;
}
.bubble-card .meta {
  font-size: 11.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center;
}
.bubble-card .actions {
  display: flex; gap: 8px;
  padding: 0 12px 12px;
}

.chat-quickreplies {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 16px 8px;
  scrollbar-width: none;
}
.chat-quickreplies::-webkit-scrollbar { display: none; }
.quickreply {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--linen);
  color: var(--ink);
  font-size: 12.5px;
  font-family: var(--font);
  white-space: nowrap;
  transition: all .12s var(--ease);
}
.quickreply:active { transform: scale(0.97); background: var(--ink); color: var(--linen); }

.chat-composer {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 10px);
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.chat-composer input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--linen);
  font: inherit;
  font-size: 14px;
  outline: none;
  font-family: var(--font);
}
.chat-composer input:focus { border-color: var(--copper); }
.chat-composer input::placeholder { color: var(--muted); }
.send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--linen);
  border: 0;
  display: grid;
  place-items: center;
  transition: transform .12s var(--ease);
}
.send-btn:active { transform: scale(0.92); }

/* =========================================================
   Checkout
   ========================================================= */
.checkout-head { padding: 8px 16px 16px; }
.checkout-summary {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--linen);
  border: 1px solid var(--line);
}
.checkout-summary .art {
  border-radius: var(--r-sm);
  background: var(--gradient, linear-gradient(160deg, #c45d2e, #1A1614));
  min-height: 80px;
}
.checkout-summary h4 {
  font-weight: 600;
  font-size: 16px;
  margin: 2px 0 4px;
  line-height: 1.2;
}
.checkout-summary .sub { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; }

.field-group {
  margin: 0 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-group h4 {
  font-weight: 700;
  font-size: 16px;
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.field input, .field select {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--linen);
  font: inherit;
  font-size: 14.5px;
  outline: none;
  font-family: var(--font);
}
.field input:focus, .field select:focus {
  border-color: var(--copper);
  background: #fff;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.card-preview {
  margin: 0 16px 14px;
  padding: 20px;
  border-radius: var(--r-lg);
  height: 180px;
  background:
    radial-gradient(circle at 20% 0%, rgba(232,154,92,0.25), transparent 50%),
    linear-gradient(135deg, #16110D, #3A2A22 60%, #5A3F30);
  color: var(--linen);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  direction: ltr !important;
}
.card-preview::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,154,92,0.45), transparent 70%);
}
.card-chip {
  width: 32px; height: 24px;
  border-radius: 4px;
  background: linear-gradient(135deg, #C9A878, #8B6240);
  z-index: 1;
}
.card-num {
  font-size: 17px;
  letter-spacing: 0.18em;
  font-weight: 600;
  z-index: 1;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: end;
  font-size: 11px;
  z-index: 1;
}
.card-brand { font-weight: 800; font-size: 16px; letter-spacing: 0.04em; }

.pay-section {
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pay-total {
  font-weight: 700;
  font-size: 26px;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.pay-total small {
  display: block;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.pay-hold {
  --progress: 0;
  position: relative;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--copper);
  border: 0;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 12px 28px -8px rgba(196,93,46,0.55),
    0 2px 6px rgba(0,0,0,0.12);
  transition: transform .15s var(--ease);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pay-hold:active { transform: scale(0.96); }
.pay-hold svg.lock { width: 26px; height: 26px; transition: opacity .2s; }
.pay-hold .ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background:
    conic-gradient(var(--copper) calc(var(--progress) * 1%), rgba(196,93,46,0.2) 0);
  z-index: -1;
  -webkit-mask: radial-gradient(circle, transparent 46px, #000 47px);
          mask: radial-gradient(circle, transparent 46px, #000 47px);
}
.pay-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
}
.pay-label em { font-style: normal; font-weight: 700; color: var(--copper); }
.pay-tip {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* =========================================================
   Success
   ========================================================= */
.success-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.success-stamp {
  width: 110px; height: 110px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--copper);
  margin-bottom: 22px;
  box-shadow: 0 14px 30px -10px rgba(196,93,46,0.6);
  animation: stampIn .5s var(--ease-out) backwards;
}
.success-stamp::before, .success-stamp::after { display: none; }
.success-stamp svg {
  width: 50px; height: 50px;
  color: #fff;
}
@keyframes stampIn {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.success-title em { font-style: normal; }
.success-sub {
  color: var(--ink-3);
  margin: 0 0 22px;
  font-size: 14px;
  max-width: 28ch;
}
.success-ticket {
  margin-top: 22px;
  width: 100%;
  max-width: 320px;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  text-align: left;
}
.success-ticket .row {
  display: flex; justify-content: space-between;
  font-size: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.success-ticket .row:last-child { border-bottom: 0; }
.success-ticket .row span:first-child {
  color: var(--muted);
  font-weight: 500;
}
.success-ticket .row strong {
  font-weight: 700;
  font-size: 13px;
}

.confetti {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: -1;
}
.confetti span {
  position: absolute;
  width: 8px; height: 12px;
  background: var(--c, var(--copper));
  top: -20px;
  animation: fall var(--d, 3s) linear forwards;
}
@keyframes fall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* =========================================================
   Trips
   ========================================================= */
.trip-card {
  margin: 0 16px 10px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--linen);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
}
.trip-card .art {
  border-radius: var(--r-sm);
  min-height: 70px;
  background: var(--gradient, linear-gradient(160deg, #c45d2e, #1A1614));
}
.trip-card h4 {
  font-weight: 600;
  font-size: 15px;
  margin: 2px 0 2px;
  letter-spacing: -0.005em;
}
.trip-card .when {
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--copper);
  font-weight: 600;
}
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-3);
}
.empty h4 {
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.empty p { font-size: 13.5px; margin: 0 0 16px; }

/* =========================================================
   Toast (install)
   ========================================================= */
.toast {
  position: absolute;
  left: 16px; right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 90px);
  background: var(--ink);
  color: var(--linen);
  border-radius: var(--r-md);
  padding: 14px 14px 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  box-shadow: 0 14px 36px -10px rgba(0,0,0,0.45);
  z-index: 50;
  animation: toastIn .25s var(--ease-out);
}
@keyframes toastIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.toast-body strong { display: block; font-weight: 700; font-size: 14.5px; }
.toast-body small  { display: block; font-size: 12px; opacity: 0.75; margin-top: 3px; line-height: 1.4; }
.toast .icon-btn {
  color: var(--linen);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  font-size: 18px;
  width: 32px;
  height: 32px;
}

/* iOS-mode toast — bigger, with share-arrow */
.toast.ios {
  bottom: calc(env(safe-area-inset-bottom) + 22px);
  grid-template-columns: 1fr auto;
  padding: 16px;
  background: linear-gradient(160deg, #16110D, #2A211D);
  border: 1px solid rgba(196,93,46,0.4);
}
.toast.ios .toast-body strong { font-size: 15px; }
.toast.ios .toast-body small  { font-size: 12.5px; opacity: 0.9; margin-top: 6px; line-height: 1.5; }
.toast.ios #install-btn { display: none; }
.toast.ios .ios-arrow {
  position: absolute;
  left: 50%;
  bottom: -36px;
  transform: translateX(-50%);
  width: 24px;
  height: 32px;
  color: var(--copper);
  animation: bounce 1.4s ease-in-out infinite;
}
.toast:not(.ios) .ios-arrow { display: none; }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(7px); }
}

/* =========================================================
   RTL — Arabic layout
   ========================================================= */
:root[dir="rtl"] .send-btn svg,
:root[dir="rtl"] .back-btn svg { transform: scaleX(-1); }
:root[dir="rtl"] .btn svg { transform: scaleX(-1); }
:root[dir="rtl"] body { font-family: var(--font); }
:root[dir="rtl"] .tab span { letter-spacing: 0; text-transform: none; }
:root[dir="rtl"] .hero-title { text-align: right; font-size: 32px; }
:root[dir="rtl"] .hero-sub, :root[dir="rtl"] .hero-kicker { text-align: right; }
:root[dir="rtl"] .detail-summary { border-left: 0; border-right: 2px solid var(--copper); padding-left: 0; padding-right: 12px; }
:root[dir="rtl"] .itinerary li { grid-template-columns: 1fr 56px; }
:root[dir="rtl"] .itinerary li > div:first-child { order: 2; text-align: left; }
:root[dir="rtl"] .itinerary li > div:last-child { order: 1; }
:root[dir="rtl"] .bubble.user { border-radius: 18px 18px 6px 18px; }
:root[dir="rtl"] .bubble.bot  { border-radius: 18px 18px 18px 6px; }
:root[dir="rtl"] .chat-composer { grid-template-columns: 44px 1fr; }
:root[dir="rtl"] .chat-composer input { text-align: right; }

@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 480px) {
    .app { padding-top: env(safe-area-inset-top); }
  }
}
