:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Andaman Limestone & Coastal Teal Light Palette */
  --bg: hsl(80, 14%, 96%);
  --bg-elev: hsl(0, 0%, 100%);
  --bg-soft: hsl(84, 16%, 92%);
  --bg-teal-soft: hsl(176, 45%, 94%);
  --bg-amber-soft: hsl(34, 88%, 94%);
  --bg-rose-soft: hsl(6, 78%, 95%);
  --bg-sage-soft: hsl(146, 42%, 93%);

  --text: hsl(192, 32%, 13%);
  --text-muted: hsl(192, 14%, 38%);
  --text-faint: hsl(192, 10%, 54%);

  --border: hsl(178, 16%, 84%);
  --border-strong: hsl(178, 18%, 70%);

  --primary: hsl(180, 79%, 24%);
  --primary-hover: hsl(180, 82%, 19%);
  --primary-fg: hsl(0, 0%, 100%);

  --accent: hsl(24, 78%, 46%);
  --accent-fg: hsl(0, 0%, 100%);

  --success: hsl(152, 68%, 32%);
  --warning: hsl(34, 88%, 42%);
  --danger: hsl(4, 72%, 48%);

  --shadow-sm: 0 1px 2px rgba(14, 34, 38, 0.06);
  --shadow-md: 0 6px 20px rgba(14, 34, 38, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg: hsl(192, 24%, 9%);
  --bg-elev: hsl(192, 22%, 13%);
  --bg-soft: hsl(192, 18%, 18%);
  --bg-teal-soft: hsl(180, 38%, 16%);
  --bg-amber-soft: hsl(34, 42%, 16%);
  --bg-rose-soft: hsl(6, 40%, 17%);
  --bg-sage-soft: hsl(150, 34%, 15%);

  --text: hsl(80, 14%, 94%);
  --text-muted: hsl(184, 12%, 72%);
  --text-faint: hsl(184, 10%, 54%);

  --border: hsl(190, 18%, 22%);
  --border-strong: hsl(190, 20%, 32%);

  --primary: hsl(174, 62%, 42%);
  --primary-hover: hsl(174, 66%, 48%);
  --primary-fg: hsl(192, 30%, 9%);

  --accent: hsl(28, 86%, 56%);
  --accent-fg: hsl(192, 30%, 9%);

  --success: hsl(152, 58%, 48%);
  --warning: hsl(36, 90%, 56%);
  --danger: hsl(4, 76%, 62%);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trip-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.trip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 195px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
}

.trip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chev { font-size: 11px; color: var(--text-muted); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.actor-pill, .sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}

.actor-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.actor-pill[data-actor="Radhika"] .actor-avatar {
  background: var(--accent);
  color: var(--accent-fg);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.sync-dot.is-offline { background: var(--warning); }
.sync-dot.is-syncing { background: var(--primary); opacity: 0.6; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
}
.icon-btn:hover, .trip-pill:hover, .actor-pill:hover, .sync-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}

/* Desktop Nav */
.desktop-nav {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px 8px;
  gap: 6px;
}

.nav-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-tab.is-active {
  background: var(--primary);
  color: var(--primary-fg);
}

.badge-warn {
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
}

/* Swap Banner */
.swap-banner {
  position: sticky;
  top: 49px;
  z-index: 38;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 9px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow-md);
}

.swap-banner-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.swap-banner-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Now Strip */
.now-strip {
  max-width: 1200px;
  width: calc(100% - 24px);
  margin: 10px auto 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-teal-soft);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.now-strip-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 240px;
}

.now-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.now-clock {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.now-tz {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.now-content { min-width: 0; }
.now-headline {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.now-subline {
  font-size: 12px;
  color: var(--text-muted);
}

.now-strip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sim-select {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 12px;
  font-weight: 600;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
}

.tab-view { display: none; }
.tab-view.is-active { display: block; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Buttons & Chips */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}
.btn-sm { padding: 5px 10px; font-size: 12px; min-height: 30px; }
.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn-soft {
  background: var(--bg-elev);
  border-color: var(--border-strong);
  color: var(--primary);
}
.btn-ghost {
  background: transparent;
}
.btn-ghost:hover { background: var(--bg-soft); }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.seg-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.seg-btn.is-active {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.kpi-tile {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}
.kpi-val {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}
.kpi-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Filters */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.chip-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }

.chip, .chip-toggle {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.is-active, .chip-toggle.is-on {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}

.filter-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* 3-Col Phone Matrix (Max View) */
.matrix-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matrix-day {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.matrix-day-head {
  padding: 7px 10px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.matrix-day-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 13px;
}

.matrix-day-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.matrix-route {
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-teal-soft);
  border-bottom: 1px solid var(--border);
}

.matrix-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.matrix-cell {
  padding: 8px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  position: relative;
}
.matrix-cell:last-child { border-right: none; }
.matrix-cell.is-mid { background: var(--bg-teal-soft); }
.matrix-cell.is-done { opacity: 0.64; background: var(--bg-sage-soft); }
.matrix-cell.is-swap-src { outline: 2px solid var(--accent); outline-offset: -2px; }
.matrix-cell.is-swap-target { cursor: pointer; background: var(--bg-amber-soft); }

.cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.cell-win {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.prio-dot {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}
.prio-must { background: var(--bg-amber-soft); color: var(--accent); border: 1px solid rgba(201,100,34,0.25); }
.prio-high { background: var(--bg-teal-soft); color: var(--primary); }
.prio-nice { background: var(--bg-soft); color: var(--text-muted); }
.prio-opt { background: var(--bg-soft); color: var(--text-faint); }

.cell-title-btn {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.matrix-cell.is-done .cell-title-btn {
  text-decoration: line-through;
}

.cell-veg {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-top: 2px;
}

.mini-btn {
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  min-height: 26px;
}
.mini-btn.is-checked {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.mini-btn.is-swap {
  color: var(--accent);
}

/* Comfort Cards & Granular Days */
.days-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.day-card-head {
  padding: 12px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-num-badge {
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 800;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 8px;
}

.day-title-txt {
  font-weight: 800;
  font-size: 14.5px;
}
.day-hotel-txt {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.day-hotel-txt.is-warn {
  color: var(--warning);
  font-weight: 700;
}

.day-slots-list {
  display: flex;
  flex-direction: column;
  divide-y: 1px solid var(--border);
}

.slot-row {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slot-row:first-child { border-top: none; }
.slot-row.is-mid { background: var(--bg-teal-soft); }
.slot-row.is-done { background: var(--bg-sage-soft); }
.slot-row.is-swap-src { outline: 2px solid var(--accent); outline-offset: -2px; }

.slot-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.slot-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.win-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.cash-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-amber-soft);
  color: var(--warning);
  border: 1px solid rgba(201,100,34,0.25);
}

.slot-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}
.slot-row.is-done .slot-title { text-decoration: line-through; opacity: 0.78; }

.slot-zone-line {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.veg-pair-box {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.veg-pair-txt {
  font-size: 12.5px;
  flex: 1 1 200px;
}
.veg-pair-spot {
  font-weight: 700;
  color: var(--success);
}

.slot-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vibe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.vibe-btn {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 11.5px;
  cursor: pointer;
}
.vibe-btn.is-active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}

.slot-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Day Jump Strip */
.day-jump-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.day-jump-strip::-webkit-scrollbar { display: none; }
.jump-pill {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.jump-pill.is-warn { border-color: var(--warning); }
.jump-pill.is-complete { background: var(--bg-sage-soft); color: var(--success); border-color: var(--success); }

/* Swap Pool */
.pool-section {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
}
.pool-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.count-pill {
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}
.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}
.pool-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.pool-card.is-swap-src { outline: 2px solid var(--accent); }

/* Bookings & PIN Card */
.pin-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pin-form {
  display: flex;
  align-items: center;
  gap: 6px;
}
.input-sm {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 13px;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.booking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.booking-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.booking-card.is-action {
  background: var(--bg-amber-soft);
  border-color: var(--warning);
}
.booking-card.is-cancelled {
  opacity: 0.7;
}
.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
}

/* Veg & Field Kit */
.kit-stack, .os-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.chef-card-box {
  background: hsl(166, 72%, 18%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 10px;
}
.chef-thai-head {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
}
.chef-thai-list {
  margin: 0 0 10px 18px;
  padding: 0;
  font-size: 16px;
  line-height: 1.5;
}
.chef-eng {
  font-size: 12.5px;
  opacity: 0.9;
  border-top: 1px solid rgba(255,255,255,0.22);
  padding-top: 8px;
}

.conv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.input-full, .textarea-full {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
}
.textarea-full {
  min-height: 110px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Phone AI Bridge Studio */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.preset-btn {
  padding: 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.preset-btn.is-active {
  background: var(--bg-teal-soft);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.preset-title { font-size: 12.5px; font-weight: 800; }
.preset-desc { font-size: 11px; color: var(--text-muted); }

.ai-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Bottom Mobile Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.bottom-tab {
  border: none;
  background: transparent;
  padding: 5px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}
.bottom-tab.is-active {
  color: var(--primary);
  font-weight: 800;
}
.bt-ico { font-size: 17px; line-height: 1; }
.bt-lbl { font-size: 10.5px; font-weight: 700; }
.bt-badge {
  position: absolute;
  top: 2px;
  right: 16%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 999px;
}

/* Modal Sheet */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 20, 22, 0.56);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.modal-sheet {
  width: 100%;
  max-width: 580px;
  max-height: 88dvh;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.modal-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { margin: 0; font-size: 16px; font-weight: 800; }
.modal-body {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Toast */
.toast-area {
  position: fixed;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  width: min(92vw, 380px);
}
.toast {
  background: var(--text);
  color: var(--bg-elev);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  text-align: center;
}

@media (min-width: 768px) {
  .app-shell { padding-bottom: 32px; }
  .desktop-nav { display: flex; }
  .bottom-nav { display: none; }
  .swap-banner { top: 88px; }
  .trip-pill { max-width: 320px; }
  .modal-backdrop { align-items: center; }
  .toast-area { bottom: 20px; }
}

@media (max-width: 480px) {
  .topbar-row { padding: 8px 8px; gap: 6px; }
  .trip-brand { flex: 1 1 auto; min-width: 0; }
  .trip-pill { max-width: 100%; width: auto; min-width: 96px; padding: 5px 8px; font-size: 12.5px; }
  .topbar-actions { gap: 4px; }
  .actor-pill, .sync-pill { padding: 4px 7px; font-size: 11.5px; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matrix-cell { padding: 6px 5px; }
  .cell-title-btn { font-size: 11px; }
  .conv-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   Travel OS v2 Styles: Quick Trip Strip, 6-Tab Nav, Pack & Tasks,
   Smart AI Suggest Modal, Inline Slot Editing & App Permissions
   ============================================================ */

.quick-trip-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.quick-trip-strip::-webkit-scrollbar {
  display: none;
}

.trip-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft, var(--surface-2));
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
}
.trip-chip:hover {
  border-color: var(--teal);
}
.trip-chip.is-active {
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
}
.trip-chip-dates {
  font-size: 10.5px;
  opacity: 0.78;
  font-weight: 500;
}

/* 6-tab compact responsive mobile bottom nav */
.bottom-nav {
  grid-template-columns: repeat(6, 1fr);
}
.bottom-tab {
  padding: 6px 2px;
  min-width: 0;
}
.bottom-tab .bt-lbl {
  font-size: 9.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Inline ✨ AI Suggest / Edit buttons on itinerary slots & pool */
.slot-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 26px;
  padding: 3px 7px;
  border-radius: 8px;
  border: 1px solid rgba(13, 110, 110, 0.28);
  background: rgba(13, 110, 110, 0.08);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
[data-theme="dark"] .slot-ai-btn {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
  color: #5eead4;
}
.slot-ai-btn:hover {
  background: var(--teal);
  color: #ffffff;
}

/* Shared Packing & Action Tasks */
.pack-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.pack-progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 10px;
}
.pack-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #10b981);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.pack-cat-head {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 12px 0 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pack-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pack-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  transition: background-color 0.15s, border-color 0.15s;
}
.pack-row.is-packed {
  background: var(--surface-2);
  border-color: transparent;
}
.pack-row.is-packed .pack-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.6;
}
.pack-check-btn {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 7px;
  border: 2px solid var(--teal);
  background: transparent;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pack-row.is-packed .pack-check-btn {
  background: var(--teal);
  border-color: var(--teal);
}
.pack-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.pack-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.pack-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.todo-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.todo-row.is-high:not(.is-done) {
  border-left: 4px solid #e11d48;
  background: rgba(225, 29, 72, 0.04);
}
.todo-row.is-done {
  background: var(--surface-2);
  opacity: 0.72;
}
.todo-row.is-done .todo-title {
  text-decoration: line-through;
}
.todo-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.todo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.pill-prio-high {
  background: rgba(225, 29, 72, 0.14);
  color: #be123c;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
[data-theme="dark"] .pill-prio-high {
  color: #fda4af;
}

/* AI Suggestion Cards inside modal */
.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
}
.suggestion-card {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.suggestion-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.suggestion-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.suggestion-source {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(13, 110, 110, 0.12);
  color: var(--teal);
  white-space: nowrap;
}
.suggestion-why {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.suggestion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

/* Connected App Permission Toggle Switches */
.perm-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 10px 0;
}
.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.perm-info {
  flex: 1;
  min-width: 0;
}
.perm-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.perm-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
}
.perm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.perm-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.perm-slider {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background-color 0.2s;
  flex-shrink: 0;
}
.perm-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.perm-toggle input:checked + .perm-slider {
  background: var(--teal);
}
.perm-toggle input:checked + .perm-slider::after {
  transform: translateX(20px);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}
.feed-item {
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
}
.feed-item.is-conflict {
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.inline-form .input-sm {
  flex: 1 1 160px;
  min-width: 0;
}

.undo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(13, 110, 110, 0.1);
  border: 1px solid rgba(13, 110, 110, 0.3);
  margin-bottom: 10px;
  font-size: 12px;
}
