/* ============================================================
   MyTrips — main.css
   Single source of truth. Inter for everything, Playfair
   Display ONLY for the app logo wordmark.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700&display=swap');

/* ── Design tokens ────────────────────────────────────────── */
:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --purple-50:  #EEEDFE;
  --purple-200: #AFA9EC;
  --purple-600: #534AB7;
  --purple-800: #3C3489;
  --purple-900: #26215C;

  --teal-50:  #E1F5EE;
  --teal-600: #0F6E56;
  --teal-800: #085041;

  --coral-50:  #FAECE7;
  --coral-600: #993C1D;

  --amber-50:  #FAEEDA;
  --amber-600: #854F0B;

  --green-50:  #EAF3DE;
  --green-600: #3B6D11;
  --green-800: #27500A;

  --red-50:  #FCEBEB;
  --red-600: #A32D2D;

  --blue-50:  #E6F1FB;
  --blue-600: #185FA5;
  --blue-800: #0C447C;

  --gray-50:  #F7F7F5;
  --gray-100: #EFEFEC;
  --gray-200: #DDDDD8;
  --gray-400: #9B9B95;
  --gray-600: #5F5E5A;
  --gray-800: #2C2C2A;
  --gray-900: #18181A;

  --bg:        #F7F7F5;
  --surface:   #FFFFFF;
  --border:    rgba(0,0,0,0.10);
  --border-md: rgba(0,0,0,0.18);
  --text:      #18181A;
  --text-muted:#5F5E5A;
  --text-faint:#9B9B95;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

  --transition: 0.18s ease;
  --sidebar-w:  260px;
  --topbar-h:   56px;
  --bottom-nav-h: 74px;
}

/* ── Reset + global font ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;    /* prevent any element from making the page wider than the screen */
  width: 100%;
}

/* ONE font family everywhere — no exceptions */
body, input, select, textarea, button, label,
h1, h2, h3, h4, h5, h6, p, span, div, a, li {
  font-family: var(--font);
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

/* Logo wordmark only — the single use of a decorative font */
.logo-wordmark {
  font-family: 'Georgia', serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a { color: var(--purple-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; }

/* ── Auth screens ─────────────────────────────────────────── */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(145deg, var(--purple-900) 0%, #7b71ed 100%);
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo-plate {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  background: #d5d3ed; border-radius: var(--radius-lg);
  margin-bottom: 10px;
}
.auth-logo-img { display: block; width: auto; border-radius: var(--radius-lg); }
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.auth-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px; margin-bottom: 22px; gap: 3px;
}
.auth-tab {
  flex: 1; padding: 8px; text-align: center;
  font-size: 13px; font-weight: 500;
  border-radius: 7px; border: none;
  background: transparent; color: var(--text-muted);
  transition: var(--transition);
}
.auth-tab.active { background: var(--purple-600); color: #fff; }

.biometric-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: var(--radius-md);
  border: 1px solid var(--border-md);
  background: var(--gray-50);
  font-size: 14px; font-weight: 500; color: var(--text);
  margin-top: 12px; transition: var(--transition);
}
.biometric-btn:hover { background: var(--gray-100); }
.biometric-btn img { width: 20px; }

.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0; font-size: 12px; color: var(--text-faint);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── App shell ────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 14px;
  padding-top: 11px;
  background: var(--purple-50);
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--purple-600);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo .logo-mark img { width: 16px; filter: brightness(0) invert(1); }
.sidebar-logo .logo-wordmark { font-size: 17px; }

.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; border: none;
  background: transparent; width: 100%; text-align: left;
  transition: var(--transition);
}
.nav-item:hover { background: var(--gray-50); color: var(--text); }
.nav-item.active { background: var(--purple-50); color: var(--purple-600); }
.nav-item img { width: 18px; opacity: 0.55; }
.nav-item.active img { opacity: 1; }

.sidebar-footer { padding: 14px 20px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--purple-600);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .uname  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .uemail { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { background: none; border: none; padding: 4px; color: var(--text-faint); font-size: 18px; }
.logout-btn:hover { color: var(--red-600); }

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1; margin-left: var(--sidebar-w);
  min-height: 100vh; display: flex; flex-direction: column;
  padding-top: var(--topbar-h);
}
.topbar {
  background: var(--purple-50); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: var(--topbar-h);
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 8px;
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 60;
}
.topbar-left {
  grid-column: 1; justify-self: start;
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%;
}
.topbar-center {
  grid-column: 2; justify-self: center;
  display: flex; align-items: center; gap: 6px;
  pointer-events: none;
}
.topbar-center > * { pointer-events: auto; }
#topbar-actions {
  grid-column: 3; justify-self: end;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.topbar-title {
  font-size: 16px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
/* topbar-wide-title: used on Payments and Itinerary — title gets all
   remaining space; right-side items (export icon, year selector) are auto. */
.topbar-wide-title { grid-template-columns: 1fr auto auto; }
.topbar-wide-title .topbar-title { max-width: none; }
.topbar-icon  { width: 19px; height: 19px; opacity: 0.75; flex-shrink: 0; }
.header-back-btn {
  display: inline-flex; align-items: center; gap: 5px;
  flex-shrink: 0;
  height: 32px; padding: 0 12px 0 8px;
  border: 1.5px solid var(--border-md);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.header-back-btn:hover { background: var(--gray-50); border-color: var(--text-muted); }
.header-back-chevron {
  width: 14px; height: 14px;
  transform: rotate(180deg);
  flex-shrink: 0;
}
.topbar-back-sep {
  width: 1px; height: 22px; flex-shrink: 0;
  background: var(--border-md);
  margin: 0 2px 0 4px;
}
.hamburger    { display: none; background: none; border: none; padding: 6px; font-size: 20px; line-height: 1; color: var(--text); }
.page { padding: 28px; flex: 1; }

/* page section header */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 10px;
}
.page-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-header p  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
/* Used on Trips: title/subtitle removed (already shown in topbar), just the action button remains */
.page-header-action-only { justify-content: flex-end; }
#calendar-container { margin-top: 2px; }

/* ── Trips grid ───────────────────────────────────────────── */
.trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.trip-card {
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.trip-card:hover { box-shadow: var(--shadow-md); }
.trip-highlight-flash {
  animation: trip-highlight-flash-anim 1.6s ease-out;
}
@keyframes trip-highlight-flash-anim {
  0%   { box-shadow: 0 0 0 3px var(--purple-600); }
  70%  { box-shadow: 0 0 0 3px var(--purple-600); }
  100% { box-shadow: var(--shadow-sm); }
}
/* Year-calendar trip bars sit inside a month card with overflow:hidden —
   an outward box-shadow ring near the card's own edge could get clipped,
   so this variant uses an INSET ring instead, which always stays fully
   within the bar's own box regardless of any ancestor's overflow setting. */
.yearcal-trip-bar.trip-highlight-flash {
  animation: trip-highlight-flash-inset-anim 1.6s ease-out;
}
@keyframes trip-highlight-flash-inset-anim {
  0%   { box-shadow: inset 0 0 0 2.5px #fff, inset 0 0 0 4.5px var(--purple-600); }
  70%  { box-shadow: inset 0 0 0 2.5px #fff, inset 0 0 0 4.5px var(--purple-600); }
  100% { box-shadow: none; }
}
.trip-card-banner {
  height: 60px; padding: 10px 12px 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: relative; cursor: pointer;
}
.trip-card-banner-main {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1;
}
.trip-card-title-row {
  display: flex; align-items: center; min-width: 0; flex: 1; overflow: hidden;
}
.trip-card-banner h3 {
  font-size: 16px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35); line-height: 1.2;
  letter-spacing: -0.01em;
  min-width: 0; flex: 1; overflow: hidden;
}
.trip-name-with-group {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 100%; min-width: 0;
}
.trip-name-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.trip-group-icon {
  width: 14px; height: 14px; flex-shrink: 0; opacity: 0.92;
}
.trip-card-banner .trip-group-icon { filter: brightness(0) invert(1); }
.cal-trip-name .trip-group-icon { filter: none; opacity: 0.55; }
.trip-type-icon-inline {
  width: 18px; height: 18px; opacity: 0.9; flex-shrink: 0;
  filter: brightness(0) invert(1);
}
.trip-card-actions {
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}
.trip-card-actions .btn-icon {
  width: 26px; height: 26px; background: rgba(255,255,255,0.18);
}
.trip-card-actions .btn-icon img { width: 13px; height: 13px; filter: brightness(0) invert(1); }
.trip-card-actions .btn-icon:hover { background: rgba(255,255,255,0.32); }
.trip-card-body { padding: 14px 16px 16px; }
.trip-dates { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.trip-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trip-meta  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trip-card-days-panel {
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  max-height: 320px;
  overflow-y: auto;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 99px;
}
.badge-purple { background: var(--purple-50); color: var(--purple-800); }
.badge-teal   { background: var(--teal-50);   color: var(--teal-800); }
.badge-amber  { background: var(--amber-50);  color: var(--amber-600); }
.badge-green  { background: var(--green-50);  color: var(--green-800); }
.badge-red    { background: var(--red-50);    color: var(--red-600); }
.badge-blue   { background: var(--blue-50);   color: var(--blue-800); }
.badge-gray   { background: var(--gray-100);  color: var(--gray-600); }
.badge-dark   { background: var(--gray-800);  color: #fff; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state img { width: 72px; margin: 0 auto 18px; opacity: 0.35; }
.empty-state h3  { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p   { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* ── Itineraries coming-soon placeholder ─────────────────── */
#view-calendar.page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h) - var(--bottom-nav-h, 0px) - 56px);
}
.itineraries-coming-soon {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.itineraries-coming-soon-img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.itineraries-coming-soon-text {
  margin: 18px auto 0;
  max-width: 340px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

/* ── Trip detail ──────────────────────────────────────────── */
.trip-header {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.trip-header-info { flex: 1; min-width: 200px; }
.trip-header-info h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.trip-detail-name-row {
  display: flex; align-items: center; gap: 10px;
}
.trip-detail-cover-thumb {
  width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover;
  flex-shrink: 0; border: 1px solid var(--border-md); display: none;
}
.trip-detail-cover-thumb[hidden] { display: none !important; }
.trip-detail-cover-thumb.trip-detail-cover-visible { display: block; }
.trip-header-info .meta { font-size: 13px; color: var(--text-muted); }
.trip-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.trip-import-lead {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.4;
}
.trip-import-file-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 13px;
}
.trip-import-file-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border, #e8e8ee);
}
.trip-import-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent, #6c5ce7);
  font-weight: 600;
}
.trip-import-result-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
}
.trip-import-result-icon-ok { filter: none; }
.trip-import-result-icon-err {
  /* keep alert-circle visible on light modal bg */
  filter: none;
}
.trip-import-result-list,
.trip-import-result-issues {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  font-size: 13px;
}
.trip-import-result-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border, #e8e8ee);
  line-height: 1.35;
}
.trip-import-result-date {
  font-weight: 600;
  margin-right: 4px;
  white-space: nowrap;
}
.trip-import-result-issues li {
  padding: 4px 0;
  color: var(--danger, #c0392b);
}

/* ── Day section ──────────────────────────────────────────── */
.day-section { margin-bottom: 20px; min-width: 0; overflow: hidden; }
.day-header {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0 10px 0;
  min-height: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 10px;
}
.day-date-block {
  text-align: center; min-width: 54px;
  background: var(--purple-50); border-radius: var(--radius-md);
  padding: 8px 6px; flex-shrink: 0;
}
.day-date-block .dow {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--purple-600);
}
.day-date-block .dom {
  font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.1;
}
.day-date-block .mon {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint); margin-top: 1px;
}
.day-location-wrap { flex: 1; min-width: 0; padding-top: 4px; }
.day-location-label {
  font-size: 17px; font-weight: 700; color: var(--text);
  line-height: 1.3; letter-spacing: -0.01em;
}
.location-placeholder { font-size: 14px; font-weight: 400; color: var(--text-faint); }
.day-notes { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Edit · Suggest · Add — horizontal row on the right of the day header,
   same purple-tint round icons as the date block. Suggest uses sparkle.svg
   (same icon as the trip-level Suggest button). */
.day-header-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; align-self: center;
}
.day-edit-fab, .day-add-fab, .day-suggest-fab {
  position: static;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--purple-50); border: 1px solid var(--purple-100, #ddd9fb);
  color: var(--purple-600);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: var(--transition);
}
.day-edit-fab img, .day-add-fab img { width: 14px; height: 14px; }
.day-suggest-fab img { width: 17px; height: 17px; }
.day-edit-fab:hover, .day-add-fab:hover, .day-suggest-fab:hover {
  background: var(--purple-600); color: #fff; border-color: var(--purple-600);
  transform: scale(1.06);
}
.day-edit-fab:hover img, .day-add-fab:hover img, .day-suggest-fab:hover img {
  filter: brightness(0) invert(1);
}

/* ── Activity cards ───────────────────────────────────────── */
.activity-cards {
  display: flex; flex-direction: column; gap: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--gray-200);
  margin-left: 27px;
  /* Prevent cards from overflowing the parent width */
  min-width: 0;
  overflow: hidden;
}
.activity-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 14px;
  display: flex; flex-direction: column; gap: 0;
  transition: var(--transition); cursor: pointer;
  /* Constrain to available width */
  min-width: 0;
  overflow: hidden;
}
.activity-card:hover { border-color: var(--border-md); box-shadow: var(--shadow-sm); }
.act-card-row {
  display: flex; align-items: flex-start; gap: 12px;
  min-width: 0; width: 100%;
}

.act-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  overflow: hidden;
}
.act-icon img { width: 17px; }
.act-icon.act-icon-photo {
  background: var(--gray-100);
  padding: 0;
}
.act-icon.act-icon-photo img.act-thumb-img,
.act-icon.act-icon-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.icon-flight      { background: var(--blue-50); }
.icon-train       { background: #FBEAF0; }
.icon-cruise      { background: var(--teal-50); }
.icon-bus         { background: var(--amber-50); }
.icon-hotel       { background: var(--green-50); }
.icon-beach       { background: #E0F4FB; }
.icon-tour        { background: var(--amber-50); }
.icon-walking_tour{ background: var(--purple-50); }
.icon-attraction  { background: var(--purple-50); }
.icon-museum      { background: var(--purple-50); }
.icon-restaurant  { background: var(--coral-50); }
.icon-food_tour   { background: var(--blue-50); }
.icon-transport   { background: var(--gray-100); }
.icon-car_rental  { background: var(--amber-50); }
.icon-free_time   { background: var(--teal-50); }
.icon-note        { background: var(--amber-50); }
.icon-other       { background: var(--gray-100); }

.act-body { flex: 1; min-width: 0; overflow: hidden; }
.act-time  { font-size: 11px; color: var(--text-faint); margin-bottom: 1px; }
.act-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; display: flex; align-items: center; gap: 4px; min-width: 0; }
.act-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.act-flight-no { font-weight: 700; color: var(--purple-700, #534AB7); }
.act-rating-badge {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
  font-size: 11px; font-weight: 700; color: var(--amber-600);
  background: var(--amber-50); padding: 1px 6px; border-radius: 99px;
  line-height: 1.6;
}
.act-sub   { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-travelers { font-size: 11px; color: var(--blue-800); margin-top: 2px; }
.act-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; max-width: 40%; }

.act-notes-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; margin: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--gray-50); color: var(--text-muted);
  cursor: pointer; flex-shrink: 0;
  transition: var(--transition);
}
.act-notes-toggle img { width: 14px; height: 14px; opacity: 0.7; }
.act-notes-toggle:hover {
  border-color: var(--purple-600); background: var(--purple-50); color: var(--purple-600);
}
.act-notes-toggle:hover img { opacity: 1; }
.activity-card.notes-open .act-notes-toggle {
  border-color: var(--purple-600); background: var(--purple-50); color: var(--purple-600);
}
.activity-card.notes-open .act-notes-toggle img { opacity: 1; }
.act-notes-panel {
  margin-top: 10px; padding: 10px 12px;
  background: var(--amber-50); border: 1px solid #F5E6A8;
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.45; color: var(--text);
  cursor: default;
}
.act-notes-line + .act-notes-line { margin-top: 4px; }
.act-notes-panel .itin-note-link { font-size: 12px; }

.act-card-toggles {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  flex-wrap: wrap;
}
.act-reminders-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  width: 28px; height: 28px; padding: 0; margin: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--gray-50); color: var(--text-muted);
  cursor: pointer; flex-shrink: 0;
  transition: var(--transition);
}
.act-reminders-toggle img { width: 14px; height: 14px; opacity: 0.7; }
.act-reminders-toggle:hover,
.act-reminders-toggle.has-reminders:hover {
  border-color: var(--purple-600); background: var(--purple-50); color: var(--purple-600);
}
.act-reminders-toggle:hover img { opacity: 1; }
.act-reminders-toggle.has-reminders {
  border-color: var(--border-md); background: var(--surface);
}
.activity-card.reminders-open .act-reminders-toggle {
  border-color: var(--purple-600); background: var(--purple-50); color: var(--purple-600);
}
.activity-card.reminders-open .act-reminders-toggle img { opacity: 1; }
.act-reminders-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: var(--purple-600); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
}
.act-reminders-panel {
  margin-top: 10px; padding: 10px 12px;
  background: var(--purple-50); border: 1px solid #D9D5F0;
  border-radius: var(--radius-sm);
  cursor: default;
}
.act-reminders-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.act-reminders-heading {
  font-size: 12px; font-weight: 700; color: var(--purple-800);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.act-reminders-list { display: flex; flex-direction: column; gap: 6px; }
.act-reminder-row {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  text-align: left; padding: 8px 10px; margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
  transition: var(--transition);
}
.act-reminder-row:hover { border-color: var(--purple-600); box-shadow: var(--shadow-sm); }
.act-reminder-type-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-50);
}
.act-reminder-type-icon img { width: 14px; height: 14px; opacity: 0.8; }
.act-reminder-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.act-reminder-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.act-reminder-meta { font-size: 11px; color: var(--text-muted); }
.act-reminder-comment {
  font-size: 12px; color: var(--text); line-height: 1.4; margin-top: 2px;
  white-space: pre-wrap;
}
.act-reminder-sent { font-size: 10px; font-weight: 600; }
.rem-type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.reminder-modal-footer { justify-content: flex-end; gap: 10px; }
.reminder-modal-footer #rem-delete-btn { margin-right: auto; }
.rem-activity-when {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}
.rem-timezone-autocomplete { position: relative; }
.rem-timezone-autocomplete > input[type="text"] { width: 100%; }
.rem-timezone-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 250;
  background: var(--surface); border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 240px; overflow-y: auto;
}
.rem-timezone-dd-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  text-align: left; padding: 9px 12px; margin: 0;
  border: none; border-bottom: 1px solid var(--border);
  background: transparent; cursor: pointer;
  transition: var(--transition);
}
.rem-timezone-dd-item:last-child { border-bottom: none; }
.rem-timezone-dd-item:hover { background: var(--purple-50); }
.rem-timezone-dd-label { font-size: 13px; font-weight: 500; color: var(--text); }
.rem-timezone-dd-meta { font-size: 11px; color: var(--text-faint); }
.rem-timezone-dd-empty {
  padding: 12px; font-size: 13px; color: var(--text-muted); text-align: center;
}
.reminders-date-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 18px 0 10px;
}
.reminders-date-heading:first-child { margin-top: 0; }
.reminder-list-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin: 0 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
}
.reminder-list-card:hover {
  border-color: var(--purple-600);
  box-shadow: var(--shadow-sm);
}
.reminder-list-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--purple-50);
}
.reminder-list-icon img { width: 17px; height: 17px; opacity: 0.85; }
.reminder-list-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.reminder-list-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.reminder-list-when { font-size: 12px; font-weight: 600; color: var(--purple-600); }
.reminder-list-trip { font-size: 12px; color: var(--text); font-weight: 500; }
.reminder-list-act { font-size: 12px; color: var(--text-muted); }
.reminder-list-comment {
  font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-top: 4px;
  white-space: pre-wrap;
}

/* ── Bookings page ────────────────────────────────────────── */
.bookings-tabs-anchor {
  min-height: 52px;
  margin-bottom: 20px;
}
#view-bookings .bookings-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
  position: fixed;
  top: var(--topbar-h);
  left: calc(var(--sidebar-w) + 28px);
  right: 28px;
  z-index: 55;
  margin-top: 3px;
}
#view-bookings .bookings-tabs::-webkit-scrollbar { display: none; }
.bookings-type-tab {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  padding: 0;
}
.bookings-type-tab img { width: 20px; height: 20px; opacity: 0.65; }
.bookings-type-tab:hover { background: var(--purple-50); border-color: var(--purple-200); }
.bookings-type-tab:hover img { opacity: 0.9; }
.bookings-type-tab-active {
  background: var(--purple-50);
  border-color: var(--purple-600);
  box-shadow: 0 0 0 1px var(--purple-600);
}
.bookings-type-tab-active img { opacity: 1; }

.bookings-trip-group { margin-bottom: 22px; }
.bookings-trip-heading {
  font-size: 13px; font-weight: 700; color: var(--purple-800); margin: 0 0 10px;
  background: var(--purple-50); padding: 9px 12px;
  border-radius: var(--radius-sm); border-left: 3px solid var(--purple-600);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px;
}
.bookings-trip-name { font-size: 14px; }
.bookings-trip-dates { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bookings-trip-cards { display: flex; flex-direction: column; gap: 8px; }

.bookings-card {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer;
  transition: var(--transition);
}
.bookings-card:hover {
  border-color: var(--purple-600);
  box-shadow: var(--shadow-sm);
}
.bookings-card-when {
  font-size: 12px; font-weight: 700; color: var(--purple-600); margin-bottom: 4px;
}
.bookings-card-title {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3;
}
.bookings-card-icon {
  width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; margin-top: 1px;
}
.bookings-card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 5px; font-size: 12px; color: var(--text-muted);
}
.bookings-card-seg { font-weight: 700; color: var(--text); }
.bookings-card-platform { font-weight: 500; }
.bookings-card-meta-sep { color: var(--text-faint); }
.bookings-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; flex-wrap: wrap;
}
.bookings-card-pay {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0;
}
.bookings-card-cost {
  font-size: 13px; font-weight: 700; color: var(--text);
}
.bookings-card-split { font-size: 10px; font-weight: 600; }
.bookings-card-travelers {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  min-width: 0;
}
.bookings-card-travelers img {
  width: 13px; height: 13px; opacity: 0.7; flex-shrink: 0;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 5px; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-md); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 400;
  background: var(--surface); color: var(--text);
  transition: var(--transition); appearance: none;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none; border-color: var(--purple-600);
  box-shadow: 0 0 0 3px rgba(83,74,183,0.12);
}
.act-date-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--border-md); border-radius: var(--radius-sm);
  background: var(--gray-50);
}
.act-date-row span { font-size: 14px; color: var(--text); font-weight: 500; }

/* ── Custom date picker popover ───────────────────────────────────────── */
.datepicker-pop {
  position: absolute; z-index: 3000;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  padding: 12px; width: 280px;
}
.datepicker-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 4px;
}
.datepicker-label {
  flex: 1; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--text);
  padding: 4px 6px; border-radius: var(--radius-sm, 6px);
  transition: var(--transition);
}
.datepicker-label:hover { background: var(--purple-50); color: var(--purple-600); }
.datepicker-nav {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: none;
  font-size: 18px; color: var(--text-muted); cursor: pointer; transition: var(--transition);
  flex-shrink: 0;
}
.datepicker-nav:hover:not(:disabled) { background: var(--purple-50); color: var(--purple-600); }
.datepicker-nav:disabled { opacity: 0.35; cursor: default; }
.datepicker-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 11px; font-weight: 700; color: var(--text-faint);
  text-align: center; margin-bottom: 4px;
}
.datepicker-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.datepicker-years {
  display: none;
  grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 4px 0 2px;
}
.datepicker-pop.datepicker-mode-years .datepicker-weekdays,
.datepicker-pop.datepicker-mode-years .datepicker-grid { display: none; }
.datepicker-pop.datepicker-mode-years .datepicker-years { display: grid; }
.datepicker-year {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm, 6px); padding: 10px 4px;
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: var(--transition);
}
.datepicker-year:hover { background: var(--purple-50); border-color: var(--purple-200, #c4b5fd); }
.datepicker-year-selected {
  background: var(--purple-600); color: #fff; border-color: var(--purple-600);
}
.datepicker-year-selected:hover { background: var(--purple-600); color: #fff; }
.datepicker-day {
  width: 100%; aspect-ratio: 1; border: none; background: none; border-radius: 50%;
  font-size: 13px; color: var(--text); cursor: pointer; transition: var(--transition);
}
.datepicker-day:hover:not(:disabled) { background: var(--purple-50); }
.datepicker-day:disabled { color: var(--text-faint); opacity: 0.4; cursor: not-allowed; }
.datepicker-day-other { color: var(--text-faint); }
.datepicker-day-today { font-weight: 700; color: var(--purple-600); box-shadow: inset 0 0 0 1.5px var(--purple-200); }
.datepicker-day-selected { background: var(--purple-600); color: #fff; font-weight: 700; }
.datepicker-day-selected:hover { background: #463e9e; }

/* ── Custom time picker popover ───────────────────────────────────────── */
.timepicker-pop {
  position: absolute; z-index: 3000;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  width: 160px; overflow: hidden;
}
.timepicker-cols { display: flex; height: 200px; }
.timepicker-col {
  flex: 1; overflow-y: auto; scroll-snap-type: y proximity;
  padding: 4px 0; border-right: 1px solid var(--border);
}
.timepicker-col:last-child { border-right: none; }
.timepicker-opt {
  display: block; width: 100%; padding: 7px 0; border: none; background: none;
  font-size: 14px; color: var(--text); cursor: pointer; text-align: center;
  scroll-snap-align: center; transition: var(--transition);
}
.timepicker-opt:hover { background: var(--purple-50); }
.timepicker-opt-selected { background: var(--purple-600); color: #fff; font-weight: 700; }
.timepicker-footer {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 8px 10px; border-top: 1px solid var(--border);
}
.timepicker-done-btn {
  border: none; background: none; font-size: 12px; font-weight: 600;
  color: var(--purple-600); cursor: pointer; padding: 4px 6px;
}
.timepicker-done-btn:hover { text-decoration: underline; }

.time-input-wrap {
  display: flex; align-items: stretch; gap: 6px;
  width: 100%;
}
.time-input-wrap input {
  flex: 1; min-width: 0; width: auto;
}
.timepicker-trigger {
  flex-shrink: 0; width: 36px; padding: 0;
  border: 1px solid var(--border-md); border-radius: var(--radius-sm);
  background: var(--gray-50); color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.timepicker-trigger:hover {
  background: var(--purple-50); border-color: var(--purple-200); color: var(--purple-600);
}
.timepicker-trigger svg { width: 15px; height: 15px; }
.form-row textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

.trip-name-cover-row {
  display: flex; align-items: center; gap: 8px;
}
.trip-name-input { flex: 1; min-width: 0; }
.trip-cover-slot {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.trip-cover-btn {
  width: 40px; height: 40px; padding: 0;
  background: var(--purple-600);
}
.trip-cover-btn img { width: 18px; height: 18px; filter: brightness(0) invert(1); opacity: 1; }
.trip-cover-btn:hover { background: var(--purple-800); }
.trip-cover-btn:disabled {
  background: var(--gray-200); opacity: 1; cursor: not-allowed;
  transform: none; box-shadow: none;
}
.trip-cover-btn:disabled img { filter: none; opacity: 0.45; }
.trip-cover-thumb {
  width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover;
  border: 1px solid var(--border-md); cursor: pointer; display: none;
}
.trip-cover-thumb[hidden] { display: none !important; }
.trip-cover-slot.has-thumb .trip-cover-btn { display: none; }
.trip-cover-slot.has-thumb .trip-cover-thumb:not([hidden]) { display: block; }
/* Activity notes: auto-resizing, no manual handle */
#act-notes {
  resize: none;
  min-height: 102px;  /* 4 lines @ 14px/1.5lh + 18px padding */
  max-height: 228px;  /* 10 lines — scrolls after this */
  overflow-y: hidden; /* JS switches to auto once content exceeds max */
  transition: none;   /* instant height change — no animation jank */
}
.form-cols   { display: grid; grid-template-columns: 1fr 1fr;     gap: 14px; }
.form-cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
/* Reminder modal: date needs room for YYYY-MM-DD; time is short + clock btn */
.form-cols.rem-datetime-cols {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.9fr);
}

.toggle-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }

/* ── Activity attachments ─────────────────────────────────── */
.attachment-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: 6px; background: var(--surface);
}
.attachment-item img.attachment-type-icon { width: 22px; height: 22px; flex-shrink: 0; opacity: 0.75; }
.attachment-item-name {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 500;
  color: var(--purple-600); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attachment-item-name:hover { text-decoration: underline; }
.attachment-item-size { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.attachment-item-thumb-btn {
  background: none; border: none; cursor: pointer; padding: 2px 6px;
  opacity: 0.45; flex-shrink: 0; font-size: 15px; line-height: 1;
  color: var(--text-faint); border-radius: 6px;
}
.attachment-item-thumb-btn:hover { opacity: 1; color: #b45309; background: #FFF7ED; }
.attachment-item-thumb-btn.is-thumb {
  opacity: 1; color: #b45309; background: #FFF7ED;
}
.attachment-item-delete {
  background: none; border: none; cursor: pointer; padding: 4px;
  opacity: 0.5; flex-shrink: 0; display: flex; align-items: center;
}
.attachment-item-delete:hover { opacity: 1; }
.attachment-item-delete img { width: 14px; height: 14px; }
.attachment-item-uploading { opacity: 0.6; }

.attachment-upload-btn {
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 7px; width: auto; min-height: 38px; padding: 8px 14px;
  border: 1px dashed #c5c2ef; border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2;
  letter-spacing: normal; text-transform: none;
  color: #1c156a; background: #eeedfe;
  cursor: pointer; margin: 0; transition: var(--transition);
  box-sizing: border-box; appearance: none; -webkit-appearance: none;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.attachment-upload-btn:hover { background: #e3e1fc; border-color: #a8a3e6; }
.attachment-upload-btn .attachment-upload-icon {
  width: 15px; height: 15px; flex-shrink: 0; display: block;
  color: inherit; /* same as button text (#1c156a) */
}
.attachment-upload-btn.disabled,
.attachment-upload-btn:disabled {
  opacity: 1;
  color: #7a76a8;
  background: #f4f3fb;
  border-color: #d8d6ee;
  pointer-events: none;
  cursor: not-allowed;
}
.act-attachment-actions {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 4px;
}
.act-attachment-actions .attachment-upload-btn { flex: 1 1 auto; min-width: 0; }
@media (max-width: 768px) {
  .act-attachment-actions {
    flex-direction: column; align-items: stretch;
  }
  .act-attachment-actions .attachment-upload-btn {
    width: 100%; flex: 0 0 auto;
  }
}
#act-image-search-modal { z-index: 1200; }

/* ── In-app image viewer (lightbox) ───────────────────────── */
#image-viewer-modal {
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#image-viewer-modal .image-viewer-modal {
  background: transparent;
  box-shadow: none;
  max-width: min(96vw, 960px);
  max-height: 92vh;
  overflow: hidden;
  width: auto;
  transform: none;
}
#image-viewer-modal.open .image-viewer-modal { transform: none; }
#image-viewer-modal .modal-header {
  background: var(--purple-600);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 12px;
  gap: 12px;
}
#image-viewer-modal .modal-header h3 {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
#image-viewer-modal .modal-close {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  flex-shrink: 0;
}
#image-viewer-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
#image-viewer-modal .modal-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(92vh - 44px);
  overflow: hidden;
}
#image-viewer-img {
  display: none;
  max-width: min(96vw, 960px);
  max-height: calc(92vh - 44px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}
.act-image-search-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 14px;
}
.act-image-search-row input {
  flex: 1; min-width: 0;
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-md);
  border-radius: var(--radius-md); font-size: 14px; background: var(--surface);
  color: var(--text);
}
.act-image-search-row input:focus {
  outline: none; border-color: var(--purple-400); box-shadow: 0 0 0 3px var(--purple-50);
}
.act-image-option.importing { opacity: 0.55; cursor: wait; }
.toggle-row label { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text); }
.toggle {
  width: 40px; height: 22px; border-radius: 99px;
  background: var(--gray-200); position: relative;
  cursor: pointer; border: none; transition: background var(--transition); flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  top: 3px; left: 3px; transition: left var(--transition); box-shadow: var(--shadow-sm);
}
.toggle.on { background: var(--purple-600); }
.toggle.on::after { left: 21px; }
.toggle:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Segmented toggle (2+ mutually exclusive options, e.g. Cards/List) ──── */
.segmented-toggle {
  display: inline-flex; background: var(--gray-100); border-radius: var(--radius-md);
  padding: 3px; gap: 2px;
}
.segmented-toggle-btn {
  border: none; background: none; cursor: pointer;
  padding: 6px 14px; border-radius: calc(var(--radius-md) - 2px);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: var(--transition);
}
.segmented-toggle-btn:hover { color: var(--text); }
.segmented-toggle-btn.active { background: var(--surface); color: var(--purple-600); box-shadow: var(--shadow-sm); }
.itin-view-mode-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.itin-view-mode-help {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--border-md, #d4d4d8);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: var(--transition);
}
.itin-view-mode-help:hover {
  color: var(--purple-600); border-color: var(--purple-300, #c4b5fd);
  background: var(--purple-50);
}
.itin-view-mode-help-block { margin-bottom: 14px; }
.itin-view-mode-help-block:last-child { margin-bottom: 0; }
.itin-view-mode-help-block h4 {
  margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--purple-600);
}
.itin-view-mode-help-block p {
  margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-muted);
}
@media (max-width: 768px) {
  .itin-view-mode-row { justify-content: flex-start; margin-top: 8px; }
  .itin-view-mode-row .segmented-toggle-btn { padding: 6px 10px; font-size: 12px; }
}

/* !!!highlighted!!! notes in itinerary view */
.note-highlight { background: #FFF176; font-weight: 700; border-radius: 2px; padding: 0 2px; }

/* Payment extra: amount due on its own row; due date + auto-pay share a line */
#act-payment-extra {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
#act-payment-extra .form-row { margin-bottom: 0; }
.act-payment-due-autopay-row { gap: 10px; grid-template-columns: 1fr 1fr auto; }
.act-auto-charge-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}
.act-auto-charge-row > label[for="act-auto-charge"] { text-align: center; }
.act-auto-charge-row .act-auto-charge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-bottom: 0;
  text-transform: none;
  cursor: pointer;
}
.act-auto-charge-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: none;
  pointer-events: none;
}
.act-auto-charge-box {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-md);
  background: var(--gray-50, #f4f4f5);
  display: block;
  position: relative;
  flex-shrink: 0;
}
.act-auto-charge-wrap input:checked + .act-auto-charge-box {
  background: var(--gray-100);
  border-color: var(--text-muted);
}
.act-auto-charge-wrap input:checked + .act-auto-charge-box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.act-auto-charge-wrap.is-disabled {
  cursor: default;
  opacity: 0.4;
  pointer-events: none;
}
.act-autopay-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
}

/* Credit cards (Settings + pending-payments autopay badge) */
.cc-exp-selects {
  display: flex;
  gap: 8px;
}
.cc-exp-selects select { flex: 1; min-width: 0; }
.cc-settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.cc-settings-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.cc-brand-icon {
  width: 48px;
  height: 32px;
  border-radius: 5px;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
}
.cc-brand-icon img {
  width: 48px;
  height: 32px;
  object-fit: contain;
  display: block;
}
.cc-type-grid {
  grid-template-columns: repeat(3, 1fr);
}
.cc-type-grid .type-btn img {
  width: 40px;
  height: 26px;
  opacity: 1;
  object-fit: contain;
}
.cc-type-grid .type-btn:hover img,
.cc-type-grid .type-btn.selected img { opacity: 1; }
.cc-settings-card-info { flex: 1; min-width: 0; }
.cc-settings-card-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.cc-settings-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.cc-settings-card-comment {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-settings-empty {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.pay-autopay-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: .01em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pay-autopay-brand {
  width: 28px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
  background: #fff;
}
.pay-autopay-badge-ok {
  background: var(--purple-50);
  color: var(--purple-800);
  border: 1px solid var(--purple-200, #ddd6fe);
}
.pay-autopay-badge-expired {
  background: var(--red-600, #e24b4a);
  color: #fff;
}
.pay-autocharge-icon {
  width: 18px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: 2px;
}
.pay-autopay-badge-expired .pay-autocharge-icon {
  filter: brightness(0) invert(1);
}
.payments-table td.payments-col-activity {
  overflow: visible;
  white-space: normal;
}

/* Activity type picker */
.type-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px;
}
.type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 5px 8px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  transition: var(--transition);
}
.type-btn img { width: 22px; opacity: 0.5; }
.type-btn:hover { border-color: var(--purple-200); background: var(--purple-50); color: var(--purple-800); }
.type-btn:hover img { opacity: 1; }
.type-btn.selected { border-color: var(--purple-600); background: var(--purple-50); color: var(--purple-800); font-weight: 600; }
.type-btn.selected img { opacity: 1; }

/* Trip type grid */
.trip-type-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.trip-type-grid .type-btn { font-size: 11px; padding: 12px 6px 10px; }
.trip-type-grid .type-btn img { width: 26px; margin-bottom: 2px; }

/* Colour swatches */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: var(--transition);
}
.swatch.selected { border-color: var(--gray-900); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent; transition: var(--transition);
  white-space: nowrap; line-height: 1.4;
}
.btn-primary   { background: var(--purple-600); color: #fff; }
.btn-primary:hover { background: var(--purple-800); }
.btn-teal      { background: var(--teal-600); color: #fff; }
.btn-teal:hover { background: var(--teal-800); }
.btn-secondary { background: var(--surface); border-color: var(--border-md); color: var(--text); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-cancel-tinted { background: var(--purple-50); }
.btn-cancel-tinted:hover { background: var(--purple-100, #ddd9fb); }
.btn-danger    { background: var(--red-50); color: var(--red-600); }
.btn-danger:hover { background: #F7C1C1; }
.btn-error-ok  { background: var(--red-600); color: #fff; }
.btn-error-ok:hover { background: #8A2424; }
.btn-ghost     { background: none; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--gray-100); color: var(--text); }

/* ── Error modal (Toast.error) — red, not the neutral confirm-modal look ──── */
.error-modal-icon {
  width: 32px; height: 32px; margin-bottom: 10px;
  filter: invert(28%) sepia(54%) saturate(1573%) hue-rotate(335deg) brightness(80%) contrast(95%);
}
.error-modal-title { color: var(--red-600); }
.push-notice-body {
  white-space: pre-wrap;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.45;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn img { width: 15px; }
.trip-header-actions .btn-inline-icon {
  width: 16px; height: 16px; margin-right: 2px; flex-shrink: 0;
}

/* Icon-only round action button — used where the icon alone is unambiguous
   (new trip "+", "Show" eye, "Print/PDF" printer) so the action reads as a
   clean, modern tap target instead of a wordy pill. */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: var(--radius-md);
  border: none; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  transition: var(--transition);
}
.btn-icon:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 4px 10px rgba(0,0,0,0.14); }
.btn-icon:active { transform: translateY(0) scale(0.98); }
.btn-icon img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.btn-icon.btn-secondary img { filter: none; opacity: 0.75; } /* dark icon on light background, not forced white */

/* Limited-show button: background matches the topbar (var(--purple-50)) per request, with a dark (not white-forced) icon */
.cal-limited-show-btn { background: var(--purple-50); }
.cal-limited-show-btn img { filter: none; opacity: 0.75; }
.cal-limited-show-btn:hover { background: var(--purple-100, #ddd9fb); }
.btn-icon.btn-icon-sm { width: 30px; height: 20px; }
.btn-icon.btn-icon-sm img { width: 13px; height: 13px; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
/* Toast.error() / Modal.confirm() open while another modal (e.g. document
   form) may still be open behind them — all .modal-backdrop share the same
   z-index, so paint order would otherwise just follow DOM position (these
   are declared early, so later modals would cover them). Force both above
   every other modal regardless of DOM order. */
#error-modal,
#confirm-modal,
#push-notice-modal { z-index: 1200; }
/* Image lightbox must stack above activity/document edit modals */
#image-viewer-modal { z-index: 1300; }
.modal {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 100%; max-width: 632px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); transform: translateY(20px); transition: transform 0.2s ease;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: var(--gray-100); border: none;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 14px; line-height: 1; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--gray-200); color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

.modal.modal-confirm { max-width: 380px; }
.modal-confirm .modal-body { text-align: center; padding: 28px 24px 20px; }
.modal-confirm p { font-size: 14px; color: var(--text-muted); margin-top: 6px; }

/* Settings modal */
.settings-section { margin-bottom: 24px; }
.settings-section h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 12px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-admin-btn { background: var(--purple-600); color: #fff !important; text-decoration: none; flex-shrink: 0; }
.settings-admin-btn:hover { background: var(--purple-800); }
.settings-row-label { font-size: 14px; font-weight: 500; }
.settings-row-desc  { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ── Friends page ─────────────────────────────────────────── */
/* ── Payments ──────────────────────────────────────────────── */
.payments-tabs-anchor {
  min-height: 50px;
  margin-bottom: 20px;
}
#view-payments .payments-tabs,
#view-travel-kit .payments-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px 6px 14px;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
  position: fixed;
  top: var(--topbar-h);
  left: calc(var(--sidebar-w) + 28px);
  right: 28px;
  z-index: 55;
  margin-top: 3px;
}
#view-travel-kit .payments-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#view-travel-kit .payments-tabs::-webkit-scrollbar { display: none; }
#view-travel-kit .payments-tab {
  white-space: nowrap;
  flex-shrink: 0;
}
.payments-tab-actions {
  margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.payments-tab-traveler-filter.on,
.payments-tab-my-cost.on,
#payments-cc-charges-btn.on,
.bookings-traveler-filter.on {
  background: var(--purple-800);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
}
.payments-cost-traveler-header {
  font-size: 15px; font-weight: 700; color: var(--purple-800);
  background: var(--purple-50); border: 1px solid var(--purple-200);
  border-radius: var(--radius-md); padding: 10px 14px; margin: -8px 0 16px;
}
.payments-grand-total {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--purple-600); color: #fff;
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.payments-grand-total-label { font-size: 13px; font-weight: 600; letter-spacing: .02em; opacity: 0.9; }
.payments-grand-total-amount { font-size: 20px; font-weight: 800; }
.trip-cost-traveler-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.trip-cost-traveler-option {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-md); padding: 10px 14px; cursor: pointer;
  font-size: 14px; font-weight: 500; text-align: left; transition: var(--transition);
}
.trip-cost-traveler-option:hover { border-color: var(--purple-300); background: var(--purple-50); }
.trip-cost-traveler-option.selected {
  border-color: var(--purple-600); background: var(--purple-50); color: var(--purple-800);
}
.trip-cost-traveler-option-you { font-size: 11px; font-weight: 600; color: var(--text-faint); margin-left: auto; }
#trip-cost-detail-view .payments-cost-traveler-header {
  max-width: 760px; margin: 0 auto 16px;
}
.payments-tab {
  border: none; background: none; cursor: pointer; padding: 10px 4px; margin-right: 20px;
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.payments-tab:hover { color: var(--text); }
.payments-tab-active { color: var(--purple-600); border-bottom-color: var(--purple-600); }

.payments-date-group { margin-bottom: 24px; }
.payments-date-heading {
  font-size: 13px; font-weight: 700; color: var(--purple-800); margin: 0 0 10px;
  background: var(--purple-50); padding: 7px 12px;
  border-radius: var(--radius-sm); border-left: 3px solid var(--purple-600);
}
.payments-date-heading-clickable {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer;
}
.payments-date-heading-main { min-width: 0; flex: 1; }
.payments-date-heading-clickable:hover { background: var(--purple-100, #ede9fe); }
.tcd-drill-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--purple-200, #ddd6fe);
  background: var(--surface);
  color: var(--purple-700, #5b21b6);
  font-size: 12px; font-weight: 700; line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}
.tcd-drill-btn img {
  width: 13px; height: 13px;
  filter: none;
  opacity: 0.85;
}
.tcd-drill-btn:hover,
.payments-date-heading-clickable:hover .tcd-drill-btn {
  background: var(--purple-600); color: #fff; border-color: var(--purple-600);
}
.tcd-drill-btn:hover img,
.payments-date-heading-clickable:hover .tcd-drill-btn img {
  filter: brightness(0) invert(1); opacity: 1;
}
.payments-trip-dates { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
.pay-act-icon { display: inline-flex; align-items: center; vertical-align: middle; margin-right: 5px; opacity: 0.55; }
.pay-act-icon img { width: 13px; height: 13px; }
.pay-act-platform { color: var(--text-muted); font-weight: 400; }
.payments-amount-cell { line-height: 1.35; }
.payments-amount-main.payments-amount-high { font-weight: 700; color: var(--amber-600); }
.payments-amount-home { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.payments-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.payments-table th, .payments-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; }
.payments-col-trip { width: 30%; }
.payments-col-activity { width: 45%; }
.payments-col-amount { width: 25%; }
.payments-table th { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; font-weight: 600; }
.payments-table tr:last-child td { border-bottom: none; }
.payments-traveler-breakdown {
  margin-top: 8px; margin-left: 16px; padding: 10px 14px;
  background: var(--gray-100); border-radius: var(--radius-md);
}
.payments-traveler-breakdown-label { font-size: 11px; font-weight: 700; color: var(--purple-600); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 6px; }
.payments-usd-total { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 8px; text-align: right; }
.payments-table-sub th, .payments-table-sub td { padding: 4px 8px; border-bottom: none; font-size: 12px; }

.cc-charges-list { display: flex; flex-direction: column; gap: 10px; }
.cc-charges-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.cc-charges-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}
.cc-charges-brand {
  width: 40px; height: 26px; flex-shrink: 0; overflow: hidden;
  border-radius: 4px; background: #fff; border: 1px solid var(--border);
}
.cc-charges-brand img { width: 40px; height: 26px; object-fit: contain; display: block; }
.cc-charges-card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cc-charges-item-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}
.cc-charges-stat { min-width: 0; }
.cc-charges-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.cc-charges-stat-amt {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.cc-charges-stat-amt .payments-amount-main { font-size: 13px; }
.cc-charges-amt-empty { color: var(--text-faint); font-weight: 500; }
.cc-charges-item-total {
  background: var(--gray-50, #f4f4f5);
}
.cc-charges-item-total .cc-charges-item-head {
  margin-bottom: 8px;
  font-weight: 700;
}
.cc-charges-item-total .cc-charges-stat-amt { font-weight: 700; }
.payments-grand-total.cc-charges-grand {
  flex-wrap: wrap;
  align-items: flex-start;
}
.cc-charges-grand-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  justify-content: flex-end;
  margin-left: auto;
}
.cc-charges-grand-stat { text-align: right; }
.cc-charges-grand-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  opacity: 0.8;
}
.cc-charges-grand-stat-amt { font-size: 18px; font-weight: 800; }
.cc-charges-grand-stat-amt.is-muted { font-size: 16px; font-weight: 700; opacity: 0.92; }

.friends-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.friend-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 14px;
  cursor: pointer; transition: var(--transition);
}
.friend-card:hover {
  border-color: var(--purple-200); box-shadow: 0 2px 8px rgba(83,74,183,0.08);
  transform: translateY(-1px);
}
.friend-card:focus-visible { outline: 2px solid var(--purple-600); outline-offset: 1px; }
/* Pending cards are clickable (open detail / shared trips); Invite/Cancel use stopPropagation */
.friend-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--purple-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.friend-avatar-pending { background: var(--amber-600, #B45309); }
.friend-card-info { flex: 1; min-width: 0; }
.friend-card-name  { font-size: 14px; font-weight: 600; }
.friend-card-email { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-card-last-used { margin-top: 5px; }
.friend-card-last-used .badge { font-size: 10px; font-weight: 500; padding: 2px 7px; white-space: nowrap; }
.friend-card-chevron { width: 16px; height: 16px; opacity: 0.3; flex-shrink: 0; }
.friend-card-pending-actions {
  display: flex; flex-direction: column; gap: 5px;
  flex-shrink: 0; align-items: stretch;
}

/* ── Documents cards (reuse friend-card layout) ─────────────── */
.doc-type-section-label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 18px 0 10px;
}
.doc-type-section-label:first-child { margin-top: 0; }
.doc-cards-grid { margin-bottom: 4px; }
.doc-card-icon {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  background: var(--purple-50, #f0eef9);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.doc-card-icon img {
  width: 18px; height: 18px;
  filter: invert(32%) sepia(45%) saturate(1200%) hue-rotate(220deg) brightness(90%);
}
.doc-card-icon-flag {
  background: #fff;
  border: 1px solid var(--border);
}
.doc-card-icon-flag img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: none;
}
.doc-card-name-country {
  font-weight: 400;
  color: var(--text-faint);
}
.doc-country-autocomplete { position: relative; }
.doc-country-autocomplete > input[type="text"] { width: 100%; }
.doc-country-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 250;
  background: var(--surface); border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 240px; overflow-y: auto;
}
.doc-country-dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  text-align: left; padding: 9px 12px; margin: 0;
  border: none; border-bottom: 1px solid var(--border);
  background: transparent; cursor: pointer;
  transition: var(--transition);
}
.doc-country-dd-item:last-child { border-bottom: none; }
.doc-country-dd-item:hover { background: var(--purple-50); }
.doc-country-dd-flag {
  width: 22px; height: 16px; object-fit: cover;
  border-radius: 2px; flex-shrink: 0;
  border: 1px solid var(--border);
}
.doc-country-dd-label { font-size: 13px; font-weight: 500; color: var(--text); }
.doc-country-dd-meta { font-size: 11px; color: var(--text-faint); margin-left: auto; }
.doc-country-dd-empty {
  padding: 12px; font-size: 13px; color: var(--text-muted); text-align: center;
}
.doc-card-desc {
  font-size: 12px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.doc-card-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 6px;
}
.doc-card-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  background: var(--purple-50, #f0eef9);
  color: var(--purple-800, #3C3489);
  border: 1px solid var(--purple-200, #c9c3f0);
  text-decoration: none;
  max-width: 100%;
  line-height: 1.2;
}
.doc-card-badge img {
  width: 12px; height: 12px; flex-shrink: 0;
  filter: invert(32%) sepia(45%) saturate(1200%) hue-rotate(220deg) brightness(90%);
}
.doc-card-badge span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-card-badge:hover {
  background: var(--purple-100, #e4e0f8);
  border-color: var(--purple-400, #8b82d9);
}
.doc-card-badge-whatsapp img {
  filter: none;
}
.doc-card-expires { margin-top: 5px; }
.doc-card-expires .badge { font-size: 10px; font-weight: 500; padding: 2px 7px; }
.doc-card-edit-btn {
  flex-shrink: 0;
  background: var(--gray-100);
  box-shadow: none;
}
.doc-card-edit-btn img {
  filter: none;
  opacity: 0.65;
}
.doc-card-edit-btn:hover {
  background: var(--purple-50);
  transform: none;
  box-shadow: none;
}
.doc-card-edit-btn:hover img { opacity: 1; }
.doc-card-edit-btn:active { transform: none; }
.badge-doc-expired {
  background: var(--red-600, #e24b4a);
  color: #fff;
}
.doc-file-hint, .doc-file-current {
  font-size: 12px; color: var(--text-faint); margin-top: 6px;
}
.doc-file-current { color: var(--text-muted, #5F5E5A); }
.doc-type-grid {
  grid-template-columns: repeat(4, 1fr);
}
.doc-file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.doc-file-preview-open {
  all: unset;
  cursor: pointer;
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border);
  background: var(--purple-50);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.doc-file-preview-open:hover { border-color: var(--purple-200); }
.doc-file-preview-open:focus-visible { outline: 2px solid var(--purple-600); outline-offset: 1px; }
.doc-file-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.doc-file-preview-icon {
  width: 32px;
  height: 32px;
  opacity: 0.85;
}
.doc-file-preview-remove {
  all: unset;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-md);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-file-preview-remove:hover { background: var(--red-50, #fcebeb); border-color: var(--red-200, #f3c1c1); }
.doc-file-preview-remove img { width: 12px; height: 12px; opacity: 0.55; }
.doc-file-preview-name {
  font-size: 12px;
  color: var(--text-faint);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-modal-footer {
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Memberships cards (reuse document card layout) ─────────── */
.mem-type-grid {
  grid-template-columns: repeat(5, 1fr);
}
.mem-card-icon {
  width: 70px; height: 70px; border-radius: 8px; flex-shrink: 0;
  background: var(--purple-50, #f0eef9);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.mem-card-icon img {
  width: 28px; height: 28px;
  filter: invert(32%) sepia(45%) saturate(1200%) hue-rotate(220deg) brightness(90%);
}
.mem-card-icon-photo {
  background: #fff;
  border: 1px solid var(--border);
}
.mem-card-icon-photo img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: none;
  padding: 6px;
  box-sizing: border-box;
}
.mem-card-company {
  font-size: 12px; color: var(--text-muted, #5F5E5A);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.mem-card-number {
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: var(--text, #1a1a1a);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 3px;
}

.friend-pending-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; width: 56px; padding: 5px 4px;
  border: 1px solid var(--border-md); border-radius: var(--radius-sm, 6px);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
}
.friend-pending-btn img { width: 14px; height: 14px; }
.friend-pending-btn span { font-size: 10px; font-weight: 600; line-height: 1; }
.friend-pending-btn:hover { background: var(--gray-50); border-color: var(--border); color: var(--text); }
.friend-pending-btn.friend-remove-btn:hover { color: var(--red-600); border-color: var(--red-600); }

.invite-share-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  background: var(--gray-100, #f3f4f6);
  border-radius: var(--radius-md);
}
.invite-share-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: var(--transition);
}
.invite-share-mode-btn.active {
  background: var(--surface);
  color: var(--purple-600);
  box-shadow: 0 1px 2px rgba(26, 26, 46, 0.08);
}
.invite-share-mode-btn:hover:not(.active) { color: var(--text); }

.invite-share-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.invite-share-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: var(--transition);
  font-size: 13px; font-weight: 600;
}
.invite-share-btn img { width: 22px; height: 22px; opacity: 0.75; }
.invite-share-btn:hover { background: var(--purple-50); border-color: var(--purple-200, #c4b5fd); }
.invite-share-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: -0.02em; color: #fff;
}
.invite-share-whatsapp .invite-share-glyph { background: #25D366; }
.invite-share-messenger .invite-share-glyph { background: #0084FF; }

/* Add to Home Screen guidance */
.a2hs-lead { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.45; }
.a2hs-steps {
  margin: 0; padding-left: 18px;
  font-size: 14px; color: var(--text); line-height: 1.55;
}
.a2hs-steps li { margin-bottom: 10px; }
.a2hs-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; font-weight: 700;
  vertical-align: middle; margin: 0 2px;
  border: 1px solid var(--border); background: var(--gray-50, #f5f5f5);
  color: var(--text);
}
.a2hs-chip-share {
  background: linear-gradient(180deg, #5ac8fa 0%, #007aff 100%);
  border-color: #007aff; color: #fff;
  box-shadow: 0 1px 2px rgba(0,122,255,0.25);
}
.a2hs-chip-menu {
  background: #111827; border-color: #111827; color: #fff;
  font-size: 16px; line-height: 1; min-width: 26px;
}

.friend-shared-trip-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--border);
}
.friend-shared-trip-row:last-child { border-bottom: none; }

/* ── Today view ──────────────────────────────────────────────── */
.today-trip-section { margin-bottom: 24px; }
.today-trip-heading {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; margin-bottom: 8px;
}

/* ── Back-to-list link on the Show Itinerary page ───────────── */
.itin-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; margin-bottom: 14px;
  font-size: 13px; font-weight: 600; color: var(--purple-600);
  cursor: pointer;
}
.itin-back-link:hover { color: var(--purple-800); text-decoration: underline; }
.itin-back-link-chevron { width: 13px; height: 13px; transform: rotate(180deg); }

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--gray-900); color: #fff;
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
  min-width: 220px; max-width: 340px;
  animation: toast-in 0.2s ease;
}
.toast.toast-success { background: var(--teal-800); }
.toast.toast-error   { background: var(--red-600); }
.toast img { width: 16px; filter: brightness(0) invert(1); flex-shrink: 0; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Sidebar overlay ──────────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 99;
}

/* ── Skeleton ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Copy pill ────────────────────────────────────────────── */
.copy-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 99px;
  border: 1px solid var(--border); cursor: pointer;
  color: var(--text-muted); background: var(--gray-50);
  transition: var(--transition);
}
.copy-pill:hover { border-color: var(--purple-600); color: var(--purple-600); }
.copy-pill img { width: 11px; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Calendar view ────────────────────────────────────────── */
.cal-trip-wrap {
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.cal-trip-wrap:hover { box-shadow: var(--shadow-md); }
.cal-trip-row {
  display: flex; align-items: center;
  background: var(--surface);
  cursor: pointer; transition: background var(--transition);
}
.cal-trip-row:hover { background: var(--gray-50); }
.cal-trip-row.cal-past { opacity: 0.65; }
.cal-trip-row.cal-now  { outline: 2px solid var(--purple-600); outline-offset: -2px; }
.cal-color-bar  { width: 9px; align-self: stretch; flex-shrink: 0; }
.cal-trip-icon  { width: 44px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cal-trip-icon img { width: 20px; opacity: 0.55; }
.cal-trip-info  { flex: 1; padding: 13px 10px; min-width: 0; }
.cal-trip-name  { font-size: 15px; font-weight: 600; }
.cal-trip-dates { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cal-trip-badges{ display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.cal-trip-actions { padding: 10px 14px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* ── Trips page: List view (alternative to Cards) ───────────────────────── */
.trips-list { display: flex; flex-direction: column; gap: 10px; }
.trip-list-wrap {
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.trip-list-row {
  display: flex; align-items: center; cursor: pointer;
  transition: background var(--transition);
}
.trip-list-row:hover { background: var(--gray-50); }
.trip-list-row.cal-past { opacity: 0.65; }
.trip-list-row.cal-now  { outline: 2px solid var(--purple-600); outline-offset: -2px; }
.trip-list-actions { padding: 10px 14px; flex-shrink: 0; }
.trip-list-actions .btn-icon { background: var(--gray-100); }
.trip-list-actions .btn-icon img { filter: none; opacity: 0.65; }
.trip-list-actions .btn-icon:hover { background: var(--purple-50); }
.trip-list-actions .btn-icon:hover img { opacity: 1; }
.trip-list-desc { margin-top: 4px; margin-bottom: 6px; }

/* Expandable days panel */
.cal-days-panel {
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  max-height: 360px;
  overflow-y: auto;
}
.cal-day-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  gap: 10px; transition: background var(--transition);
  cursor: pointer;
}
.cal-day-item:last-child { border-bottom: none; }
.cal-day-item:hover { background: var(--purple-50); }
.cal-day-today {
  background: var(--purple-50) !important;
  border-left: 3px solid var(--purple-600);
}
.cal-day-info  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.cal-day-date  { font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--text); }
.cal-day-hotel {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 220px; font-weight: 600;
}
.cal-day-hotel img { width: 12px; height: 12px; flex-shrink: 0; opacity: 0.85; }
.cal-day-hotel-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day-loc   { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day-count { font-size: 11px; color: var(--text-faint); flex-shrink: 0; white-space: nowrap; }

/* ── Print / Itinerary view ───────────────────────────────── */
/* ── Group-itinerary trip separator ──────────────────────────── */
.itin-trip-separator {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0 14px;
}
.itin-trip-separator::before,
.itin-trip-separator::after { content: ''; flex: 1; height: 1px; background: var(--border-md); }
/* Separator row inside the print-view table */
.itin-group-sep-row td { border-bottom: none; padding: 16px 0 8px; }
.itin-group-sep-row .itin-trip-separator { margin: 0 0 14px; }
.itin-trip-sep-inner {
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  text-align: left; padding: 8px 18px 8px 10px;
  background: var(--purple-50); border-radius: var(--radius-md);
  border: 1px solid var(--purple-200);
}
.itin-trip-sep-text {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
}
.itin-trip-sep-cover {
  width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover;
  flex-shrink: 0; border: 1px solid var(--border-md);
}
#itin-view-cover-thumb {
  width: 40px; height: 40px; display: none;
}
#itin-view-cover-thumb.itin-view-cover-visible { display: block; }
.itin-trip-sep-name  { font-size: 17px; font-weight: 700; color: var(--purple-800); }
.itin-trip-sep-dates { font-size: 13px; color: var(--text-muted); }
.itin-trip-sep-extra { margin: 6px 0 10px; padding: 0 8px; }
.itin-trip-sep-text-block {
  font-size: 13px; color: var(--text); line-height: 1.45;
  max-width: 560px; margin: 6px auto 0; padding: 9px 14px;
  background: var(--purple-50); border: 1px solid var(--purple-200);
  border-radius: var(--radius-md); text-align: left;
}
.itin-trip-sep-text-block strong { color: var(--purple-800); }

/* ── Trip description & comments (itinerary view + print/PDF header) ── */
.itin-trip-note-box {
  margin-top: 8px; padding: 9px 14px;
  background: var(--purple-50); border: 1px solid var(--purple-200);
  border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.45; color: var(--text);
  max-width: 560px; text-align: left;
}
.itin-trip-note-box + .itin-trip-note-box { margin-top: 6px; }
.itin-trip-note-box strong { color: var(--purple-800); }
.itin-trip-note-box-center { margin-left: auto; margin-right: auto; }

/* ── Activity rating display (itinerary view + print/PDF) ── */
.itin-act-rating-box {
  margin-top: 6px; padding: 7px 12px; max-width: 480px;
  background: var(--amber-50); border: 1px solid #E9D3A0;
  border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.45;
}
.itin-act-rating-stars { color: var(--gray-200); font-weight: 600; letter-spacing: 1px; }
.itin-act-rating-stars .rating-star { color: var(--gray-200); }
.itin-act-rating-stars .rating-star.filled { color: var(--amber-600); }
.itin-act-rating-num { font-weight: 600; color: var(--amber-600); margin-left: 5px; letter-spacing: normal; }
.itin-act-review-text { margin-top: 4px; color: var(--text); }

.act-rating-hr { border: none; border-top: 1px solid var(--amber-600); opacity: 0.35; margin: 4px 0 16px; }

/* ── Clickable 1-5 star rating input (rating modal + activity edit form) ── */
.star-rating-input { display: flex; gap: 10px; margin-top: 2px; }
.star-rating-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: none; cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius-sm); transition: var(--transition);
}
.star-rating-btn:hover { background: var(--amber-50); }
.star-rating-star { font-size: 26px; line-height: 1; color: var(--gray-200); }
.star-rating-num { font-size: 11px; font-weight: 700; color: var(--text-faint); }
.star-rating-btn.filled .star-rating-star,
.star-rating-btn.filled .star-rating-num { color: var(--amber-600); }

/* ── Rating prompt modal ── */
.rate-activity-subject { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.rate-activity-icon { width: 34px; height: 34px; flex-shrink: 0; }
.rate-activity-title { font-size: 15px; font-weight: 700; }
.rate-activity-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Trip Cost detail overlay ─────────────────────────────────── */
#trip-cost-detail-view {
  display: none;
  position: fixed; inset: 0; background: #fff; z-index: 1000;
  overflow-y: auto; padding: 0;
}
#trip-cost-detail-view.open { display: block; }
.tcd-content { max-width: 760px; margin: 0 auto; padding: 16px 10px 25px; }
#trip-cost-detail-view #tcd-traveler-header { margin: 12px 10px 0; }
.tcd-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--purple-600); }
.tcd-title  { font-size: 22px; font-weight: 700; color: var(--purple-900); margin: 0 0 4px; }
.tcd-dates  { font-size: 13px; color: var(--text-muted); margin: 0; }
.tcd-section-heading {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--purple-600); margin: 20px 0 8px;
}
.tcd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tcd-table th {
  background: var(--purple-600); color: #fff; padding: 8px 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  text-align: left;
}
.tcd-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tcd-table tr:last-child td { border-bottom: none; }
.tcd-col-icon { width: 32px; vertical-align: top; padding-left: 4px; padding-right: 2px; }
.tcd-col-activity { width: auto; }
.tcd-col-amount { text-align: right !important; white-space: nowrap; }
.tcd-table th.tcd-col-amount { width: 22%; }
.tcd-table th.tcd-col-icon { width: 32px; }
.tcd-act-icon { display: flex; align-items: flex-start; padding-top: 2px; opacity: 0.65; }
.tcd-act-icon img { width: 26px; height: 26px; }
.tcd-act-date { font-size: 11px; color: var(--text-faint); margin-bottom: 1px; }
.tcd-act-name { font-weight: 500; }
.tcd-act-status { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; margin-left: 5px; vertical-align: middle; }
.tcd-act-status-paid    { background: var(--green-50);  color: var(--green-800); }
.tcd-act-status-pending { background: var(--amber-50);  color: var(--amber-600); }
.tcd-act-status-partial { background: var(--amber-50);  color: var(--amber-600); }
.tcd-act-status-activity-day { background: var(--purple-50); color: var(--purple-800); }
.tcd-price { font-weight: 600; font-size: 13px; }
.tcd-home-equiv { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.tcd-act-travelers { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.tcd-split-row td { padding-top: 0; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.tcd-split-info { font-size: 12px; color: var(--text-muted); background: var(--gray-50); padding: 4px 8px; border-radius: var(--radius-sm); display: inline-block; margin-top: -2px; }
.tcd-fx-note { font-size: 11px; color: var(--text-faint); margin-top: 8px; padding-left: 2px; }
.tcd-summary { margin-top: 24px; }
.tcd-grand-total td { font-weight: 700; font-size: 15px; color: var(--purple-800); padding-top: 10px; border-top: 2px solid var(--purple-200); border-bottom: none; }

#print-view {
  display: none;
  position: fixed; inset: 0; background: #fff; z-index: 1000;
  overflow-y: auto; padding: 0;
}
#print-view.open { display: block; }
#print-view .print-title,
#print-view #itin-body-wrap { padding-left: 32px; padding-right: 32px; }
#print-view .print-title { padding-top: 16px; }

#payments-print-view {
  display: none;
  position: fixed; inset: 0; background: #fff; z-index: 1000;
  overflow-y: auto; padding: 0;
}
#payments-print-view.open { display: block; }
#payments-print-view .tcd-drill-btn { display: none; }
.print-payments-content { max-width: 700px; margin: 0 auto; padding: 16px 10px 25px; }
.print-payments-content h2 { font-size: 20px; font-weight: 700; margin: 0 0 20px; text-align: center; }

.print-actions {
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
  background: #fff;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.print-actions-right { display: flex; gap: 8px; }
.print-title { text-align: center; margin-bottom: 24px; }
.print-title h1 {
  font-size: 24px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--purple-900); text-transform: uppercase;
}
.print-title p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.print-cover-block { margin-bottom: 16px; }
.print-trip-cover-row {
  display: flex; justify-content: center; align-items: center; gap: 10px;
}
.print-trip-cover-row-dual .print-trip-cover-img {
  max-width: calc(50% - 5px); max-height: 220px;
}
.print-trip-cover-img {
  display: block; margin: 0 auto; max-width: 100%; max-height: 280px;
  border-radius: var(--radius-md); object-fit: cover;
}
.print-cover-attribution {
  font-size: 8px; color: var(--text-faint); opacity: 0.55;
  margin-top: 3px; letter-spacing: 0.01em; line-height: 1.2;
}

.modal-cover-picker { max-width: 520px; }
.trip-cover-modal-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.trip-cover-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px;
}
.trip-cover-load-more {
  display: block; width: 100%; margin-top: 12px;
}
.trip-cover-load-more[hidden] { display: none !important; }
.trip-cover-load-more:disabled { opacity: 0.6; cursor: wait; }
.trip-cover-loading { text-align: center; color: var(--text-muted); padding: 24px 0; }
.trip-cover-option {
  display: flex; flex-direction: column; align-items: stretch;
  padding: 0; border: 2px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.trip-cover-option:hover { border-color: var(--purple-400); box-shadow: var(--shadow-sm); }
.trip-cover-option:disabled { opacity: 0.6; cursor: wait; }
.trip-cover-option img { width: 100%; height: 88px; object-fit: cover; display: block; }
.trip-cover-photo-credit {
  font-size: 10px; color: var(--text-faint); padding: 4px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trip-cover-upload-btn {
  margin-right: auto; display: inline-flex; align-items: center; gap: 6px;
}
.trip-cover-upload-icon { width: 15px; height: 15px; opacity: 0.75; }
.trip-cover-upload-btn:disabled { opacity: 0.6; cursor: wait; }

/* Desktop table */
.itin-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 32px;
}
.itin-table th {
  background: var(--purple-600); color: #fff;
  padding: 9px 12px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.itin-table th:first-child  { width: 78px; }
.itin-table th:nth-child(2) { width: 130px; }
.itin-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top; line-height: 1.5;
}
.itin-table tr:hover td { background: var(--gray-50); }
.itin-date  { font-weight: 700; white-space: nowrap; }
.itin-place { font-weight: 600; color: var(--purple-800); }

/* Activity list inside each table cell */
.itin-act-list {
  list-style: none; padding: 0; margin: 0;
}
.itin-act-line {
  padding: 5px 0;
  border-bottom: 1px solid var(--gray-100);
  line-height: 1.5;
  font-size: 13px;
}
.itin-act-line:last-child { border-bottom: none; padding-bottom: 0; }
.itin-act-line:first-child { padding-top: 0; }

/* Icon inline with activity */
.itin-act-icon {
  width: 14px; height: 14px;
  vertical-align: middle; margin-right: 4px;
  opacity: 0.65; position: relative; top: -1px;
}
.itin-act-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px; }
.itin-act-main img.itin-act-icon { align-self: center; flex-shrink: 0; }

/* Location: separate line below main activity, no bullet */
.itin-act-location {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  padding-left: 18px; /* indent under icon */
}
.itin-act-location-link {
  color: inherit;
  text-decoration: none;
}
.itin-act-location-link:hover {
  color: var(--purple-600);
  text-decoration: underline;
}

/* Notes only: bulleted sub-list, one <li> per newline */
.itin-act-subs {
  list-style: disc;
  padding-left: 28px;
  margin: 4px 0 0 0;
}
.itin-act-attachments {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 6px 0 0 28px;
}
.itin-act-attachments-files {
  display: flex; flex-wrap: wrap; gap: 6px;
  flex: 1 1 auto; min-width: 0;
}
.itin-attachment-file {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%;
}
.itin-attachment-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--purple-600);
  background: var(--purple-50); padding: 3px 9px; border-radius: 6px;
  text-decoration: none; max-width: 220px;
}
.itin-attachment-link:hover { background: var(--purple-100, #ddd9fb); text-decoration: underline; }
.itin-attachment-link img { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.8; }
.itin-attachment-share {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; flex-shrink: 0;
  border: none; border-radius: 6px; cursor: pointer;
  background: var(--purple-50); color: var(--purple-600);
}
.itin-attachment-share img { width: 14px; height: 14px; display: block; opacity: 0.85; }
.itin-attachment-share:hover { background: var(--purple-100, #ddd9fb); }
.itin-attachment-share:disabled { opacity: 0.5; cursor: wait; }
#print-view .itin-attachment-share { display: none !important; }
.itin-attachment-thumb {
  display: block; flex: 0 0 auto;
  width: 52px; height: 52px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--gray-100);
  text-decoration: none;
}
.itin-attachment-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.itin-attachment-thumb:hover { border-color: var(--purple-300, #a5a0e8); box-shadow: var(--shadow-sm); }
.itin-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.itin-sub-indented { margin-left: 18px; }
/* Inline "open link" badge for http(s) URLs inside activity notes */
.itin-note-link {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple-600);
  background: var(--purple-50);
  padding: 1px 7px;
  border-radius: 5px;
  text-decoration: none;
  vertical-align: 1px;
  line-height: 1.4;
}
.itin-note-link:hover { background: var(--purple-100, #ddd9fb); text-decoration: underline; }

/* Day-level note (italic, slightly muted) */
.itin-day-note {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.itin-time { font-weight: 600; color: var(--purple-600); white-space: nowrap; }
.itin-detail  { font-size: 12px; color: var(--text-muted); }
.itin-platform{ font-size: 12px; color: var(--text-faint); }
.itin-flight-no {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-700, #534AB7);
  margin-left: 4px;
}
.flight-status-btn {
  display: inline-flex; align-items: center; gap: 4px;
  vertical-align: middle; align-self: center;
  margin: 0 5px 0 3px;
  padding: 3px 10px 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--purple-800);
  background: var(--purple-800);
  color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1.3;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.flight-status-btn img {
  width: 13px; height: 13px; display: block;
  filter: brightness(0) invert(1); opacity: 1;
}
.flight-status-btn:hover { background: var(--purple-900); border-color: var(--purple-900); color: #fff; }
#print-view .flight-status-btn { display: none !important; }

.today-day-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--purple-600);
  margin: 12px 2px 6px;
}
.today-day-label:first-of-type { margin-top: 4px; }

/* Live flight status modal */
.fs-banner {
  text-align: center; font-size: 18px; font-weight: 800;
  padding: 14px 16px; border-radius: var(--radius-md);
  margin-bottom: 14px; letter-spacing: -0.01em;
}
.fs-banner-ok { background: var(--green-50); color: var(--green-800); }
.fs-banner-live { background: var(--blue-50); color: var(--blue-800); }
.fs-banner-delay { background: var(--amber-50); color: var(--amber-600); }
.fs-banner-delay-severe,
.fs-banner-cancel { background: var(--red-50); color: var(--red-600); }
.fs-eta {
  text-align: center;
  background: var(--blue-50);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 0 0 14px;
}
.fs-eta-delayed { background: var(--amber-50); }
.fs-eta-landed { background: var(--green-50); }
.fs-eta-landed .fs-eta-value { color: var(--green-800); }
.fs-eta-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
}
.fs-eta-value {
  font-size: 28px; font-weight: 800; color: var(--blue-800);
  letter-spacing: -0.02em; margin: 4px 0 2px; line-height: 1.15;
}
.fs-eta-delayed .fs-eta-value { color: var(--amber-600); }
.fs-eta-sub { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.fs-date-mismatch {
  font-size: 12px; color: var(--amber-600); background: var(--amber-50);
  padding: 8px 10px; border-radius: var(--radius-sm); margin: 0 0 12px;
}
.fs-route {
  text-align: center; font-size: 16px; font-weight: 700;
  margin: 0 0 10px;
}
.fs-progress {
  height: 6px; background: var(--gray-100); border-radius: 99px;
  overflow: hidden; margin: 0 0 16px;
}
.fs-progress-bar { height: 100%; background: var(--purple-600); border-radius: 99px; }
.fs-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.fs-leg {
  background: var(--gray-50); border-radius: var(--radius-md);
  padding: 10px 12px;
}
.fs-leg-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px;
}
.fs-leg-airport { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fs-leg-times { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.fs-time-old {
  font-size: 13px; color: var(--text-faint); text-decoration: line-through;
}
.fs-time-new { font-size: 18px; font-weight: 800; }
.fs-delay-pill {
  font-size: 11px; font-weight: 800; color: var(--red-600);
  background: var(--red-50); padding: 1px 6px; border-radius: 999px;
}
.fs-leg-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.fs-leg-gate {
  margin-top: 8px;
  font-size: 16px; font-weight: 800; color: var(--purple-800);
  line-height: 1.2;
}
.fs-leg-gate-label {
  display: block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 2px;
}
.fs-muted { color: var(--text-faint); }
.fs-extras { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 14px; }
.fs-extra-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 4px 0;
}
.fs-extra-row span { color: var(--text-muted); }
.fs-booked { font-size: 12px; color: var(--text-muted); margin: 12px 0 0; }
.fs-error { color: var(--red-600); margin: 0; }
.itin-phone {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700;
  background: var(--purple-50); color: var(--purple-800);
  padding: 1px 4px 1px 6px; border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.itin-phone-num {
  color: inherit;
  text-decoration: none;
}
.itin-phone-num:hover { text-decoration: underline; }
.itin-phone-copy {
  background: none; border: none; padding: 1px 2px; cursor: pointer;
  display: inline-flex; align-items: center; line-height: 0;
}
.itin-phone-copy img { width: 10px; opacity: 0.7; }
.itin-phone-copy:hover img { opacity: 1; }
.itin-ref {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700;
  background: var(--purple-50); color: var(--purple-800);
  padding: 1px 4px 1px 6px; border-radius: 4px;
}
.itin-ref-copy {
  background: none; border: none; padding: 1px 2px; cursor: pointer;
  display: inline-flex; align-items: center; line-height: 0;
}
.itin-ref-copy img { width: 10px; opacity: 0.7; }
.itin-ref-copy:hover img { opacity: 1; }
.itin-booked {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: var(--green-50); color: var(--green-800);
  padding: 1px 5px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Mobile itinerary cards */
#itin-mobile { display: none; }
.itin-day-card {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 12px;
}
.itin-day-header {
  display: flex; align-items: center;
  background: var(--purple-600); color: #fff;
  padding: 8px 12px; gap: 10px;
}
.itin-day-header .itin-date  { font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; white-space: nowrap; }
.itin-day-header .itin-place { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.92); }
.itin-day-body { padding: 6px 12px 10px; }
.itin-day-body .itin-act-line { font-size: 13px; border-bottom-color: var(--border); }

/* @media print: hide everything except the print-view content */
@media print {
  html, body {
    background: #fff !important;
  }
  body > *:not(#print-view):not(#payments-print-view):not(#trip-cost-detail-view) { display: none !important; }
  #print-view.open,
  #payments-print-view.open,
  #trip-cost-detail-view.open {
    display: block !important; position: static !important;
    padding: 0 !important; overflow: visible !important;
    background: #fff !important;
  }
  .print-actions { display: none !important; }
  .flight-status-btn { display: none !important; }
  .tcd-drill-btn { display: none !important; }
  .payments-date-heading-clickable { cursor: default; }
  .tcd-table th {
    background: var(--purple-600) !important; color: #fff !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .tcd-act-status { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* On print always use table layout */
  .itin-desktop { display: table !important; }
  #itin-mobile  { display: none !important; }
  .itin-table   { font-size: 12px; background: #fff !important; }
  .itin-table td, .itin-table tr { background: #fff !important; }
  .itin-act-line{ font-size: 12px; }
  .itin-sub     { font-size: 12px; }
  .itin-table th {
    background: var(--purple-600) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .itin-act-icon { width: 12px; height: 12px; }
  .payments-table th {
    background: var(--purple-600) !important; color: #fff !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .payments-traveler-breakdown { background: var(--gray-100) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .itin-ref, .itin-phone, .itin-booked, .itin-price, .itin-nights {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* Ensure no element keeps the page's default off-white/beige background */
  * { background-color: transparent !important; }
  .itin-table th { background-color: var(--purple-600) !important; }
  .itin-ref, .itin-phone { background-color: var(--purple-50)  !important; }
  .itin-booked   { background-color: var(--green-50)   !important; }
  .itin-price    { background-color: var(--green-50)   !important; }
  .itin-nights   { background-color: var(--teal-50)    !important; }
  .itin-to-book  { background-color: var(--red-50)      !important; }
  .itin-day-note-above { background-color: var(--amber-50) !important; }
  .pay-autopay-badge-ok { background-color: var(--purple-50) !important; color: var(--purple-800) !important; }
  .pay-autopay-badge-expired { background-color: var(--red-600, #e24b4a) !important; color: #fff !important; }
  .itin-ref-copy, .itin-phone-copy, .itin-attachment-share { display: none !important; }
}

/* ── Bottom nav (mobile only) ─────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--purple-50);
  border-top: 1px solid var(--border);
  z-index: 200;
  /* Safe area padding at bottom for iPhone notch */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-inner {
  display: flex;
  height: 68px;
  padding-bottom: 6px;
  width: 100%;
}
.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;          /* no asymmetric padding — let flexbox centre */
  margin: 0;
  background: none;
  border: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  text-align: center;
}
.bottom-nav-btn img {
  width: 24px;
  height: 24px;
  display: block;
  opacity: 0.65;
  transition: opacity var(--transition);
  /* prevent img from stretching */
  flex-shrink: 0;
  object-fit: contain;
}
.bottom-nav-btn.active { color: var(--purple-600); }
.bottom-nav-btn.active img {
  opacity: 1;
  filter: invert(28%) sepia(80%) saturate(600%) hue-rotate(224deg) brightness(85%);
}
.bottom-nav-btn span {
  display: block;
  line-height: 1;
  white-space: nowrap;
}

/* ── Mobile slide-up menu (Friends / Settings), opened via bottom-nav "Menu" ── */
.mobile-menu-backdrop {
  display: none; /* only shown on mobile via the media query below, and only when .open */
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  z-index: 250; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.mobile-menu-backdrop.open { opacity: 1; pointer-events: auto; }
.mobile-menu-panel {
  position: absolute; right: 12px;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  min-width: 160px; padding: 6px;
  transform: translateY(10px) scale(0.97); opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.mobile-menu-backdrop.open .mobile-menu-panel { transform: translateY(0) scale(1); opacity: 1; }
.mobile-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; border-radius: var(--radius-md);
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-item:hover { background: var(--purple-50); }
.mobile-menu-item img { width: 19px; height: 19px; opacity: 0.7; flex-shrink: 0; }
.mobile-menu-item.active { color: var(--purple-600); background: var(--purple-50); }
.mobile-menu-item.active img { opacity: 1; filter: invert(28%) sepia(80%) saturate(600%) hue-rotate(224deg) brightness(85%); }

/* ── Utils ────────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.hidden      { display: none !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar         { transform: translateX(-100%); }
  .sidebar.open    { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay { display: block; }
  .hamburger       { display: none; }

  .bottom-nav      { display: flex; }
  .mobile-menu-backdrop { display: block; }
  .topbar          { padding: 0 16px; left: 0; }
  .main-content    { margin-left: 0; padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
  .page            { padding: 14px 16px; overflow-x: hidden; }

  .type-grid       { grid-template-columns: repeat(3, 1fr); }
  .doc-type-grid   { grid-template-columns: repeat(2, 1fr); }
  .mem-type-grid   { grid-template-columns: repeat(2, 1fr); }
  .cc-type-grid    { grid-template-columns: repeat(3, 1fr); }
  .trip-type-grid  { grid-template-columns: repeat(2, 1fr); }
  .form-cols       { grid-template-columns: 1fr; }
  .form-cols.rem-datetime-cols { grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.9fr); }
  #field-price,
  .act-payment-due-autopay-row { grid-template-columns: 1fr 1fr auto; }
  .form-cols-3     { grid-template-columns: 1fr 1fr; }
  .trips-grid      { grid-template-columns: 1fr; }

  .modal           { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-backdrop  { align-items: flex-end; padding: 0; }
  /* Keep the image lightbox centered full-screen (not a bottom sheet) */
  #image-viewer-modal { align-items: center; padding: 16px; }
  #image-viewer-modal .image-viewer-modal { border-radius: 8px; }

  #toast-container { bottom: calc(var(--bottom-nav-h) + 8px); right: 12px; left: 12px; }
  .toast           { min-width: unset; }

  .day-header      { padding-right: 0; min-height: 0; }
  .day-edit-fab, .day-add-fab, .day-suggest-fab { width: 34px; height: 34px; }
  .day-edit-fab img, .day-add-fab img { width: 16px; height: 16px; }
  .day-suggest-fab img { width: 19px; height: 19px; }
  .tcd-drill-btn { height: 32px; padding: 0 12px; font-size: 13px; }
  .tcd-drill-btn img { width: 14px; height: 14px; }
  .activity-cards  { margin-left: 0; padding-left: 0; border-left: none; }
  .activity-card   { padding: 9px 10px; }
  .act-card-row    { gap: 8px; }
  .act-right       { max-width: 35%; }
  .act-notes-toggle { width: 26px; height: 26px; }
  .act-reminders-toggle { width: 26px; height: 26px; }
  .act-notes-panel  { margin-top: 8px; padding: 8px 10px; font-size: 12px; }
  .act-reminders-panel { margin-top: 8px; padding: 8px 10px; }
  .rem-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Hide copy-pill on mobile — tap to copy works via long-press natively */
  .copy-pill       { display: none; }

  .trip-header     { flex-direction: column; }
  .trip-header-actions { flex-wrap: wrap; }
  #view-trip-detail { overflow-x: hidden; }
  .page-view       { overflow-x: hidden; }
  #print-view      { padding: 0; }
  #print-view .print-title,
  #print-view #itin-body-wrap { padding-left: 16px; padding-right: 16px; }
  .print-actions   { flex-wrap: wrap; }
  .itin-desktop    { display: none; }
  #itin-mobile     { display: block; }

  .payments-grand-total.cc-charges-grand {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }
  .cc-charges-grand-stats {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    gap: 8px 10px;
  }
  .cc-charges-grand-stat { flex: 1; min-width: 0; text-align: left; }
  .cc-charges-grand-stat-amt { font-size: 15px; }
  .cc-charges-grand-stat-amt.is-muted { font-size: 14px; }
  .cc-charges-item { padding: 12px; }
  .cc-charges-item-stats { gap: 8px; }
  .cc-charges-stat-amt { font-size: 12px; }
}

/* ── Trip cost badges on card ─────────────────────────────── */
.trip-meta .badge-gray { font-size: 11px; }

/* ── Day note ABOVE activities in print ───────────────────── */
.itin-day-note-above {
  font-size: 13px; font-style: italic;
  color: var(--text-muted); margin-bottom: 6px;
  padding: 4px 8px; background: var(--amber-50);
  border-left: 3px solid var(--amber-600);
  border-radius: 0 4px 4px 0;
}

/* ── Travelers in print ───────────────────────────────────── */
.itin-travelers {
  font-size: 11px; color: var(--blue-800);
  background: var(--blue-50); padding: 1px 6px;
  border-radius: 4px; margin-left: 4px;
}
.itin-price {
  font-size: 11px; font-weight: 600; color: var(--green-800);
  background: var(--green-50); padding: 1px 6px;
  border-radius: 4px; margin-left: 4px;
  white-space: nowrap;
}
.itin-nights {
  font-size: 11px; font-weight: 600; color: var(--teal-800);
  background: var(--teal-50); padding: 1px 6px;
  border-radius: 4px; margin-left: 4px;
  white-space: nowrap;
}

/* ── Mobile print: 1px bigger font ───────────────────────── */
@media (max-width: 768px) {
  .itin-act-line    { font-size: 14px; }
  .itin-sub         { font-size: 14px; }
  .itin-act-location{ font-size: 13px; }
  .itin-day-body    { font-size: 14px; }
}

/* end of main.css */

/* ── Share autocomplete chips ─────────────────────────────── */
.share-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--purple-50); color: var(--purple-800);
  border: 1px solid var(--purple-200);
  border-radius: 99px; padding: 3px 10px 3px 12px;
  font-size: 12px; font-weight: 500;
}
.share-chip-remove {
  background: none; border: none; cursor: pointer;
  color: var(--purple-600); font-size: 13px; line-height: 1;
  padding: 0; margin-left: 2px;
}
.share-chip-remove:hover { color: var(--red-600); }
.share-dd-item, .move-trip-dd-item, .act-travelers-dd-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; cursor: pointer; gap: 10px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.share-dd-item:last-child, .move-trip-dd-item:last-child, .act-travelers-dd-item:last-child { border-bottom: none; }
.share-dd-item:hover, .move-trip-dd-item:hover, .act-travelers-dd-item:hover { background: var(--purple-50); }
.share-dd-empty {
  padding: 14px 12px; font-size: 12px; color: var(--text-faint);
  text-align: center; cursor: default;
}
.share-dd-name  { font-size: 13px; font-weight: 500; }
.share-dd-email { font-size: 11px; color: var(--text-faint); }

/* ── Activity travelers autocomplete ──────────────────────── */
.act-travelers-autocomplete { position: relative; }
.act-travelers-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px;
}
.act-travelers-chips:empty { margin-bottom: 0; }
.act-travelers-autocomplete > input[type="text"] { width: 100%; }
.act-travelers-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--surface); border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 200px; overflow-y: auto;
}
.act-traveler-chip-remove {
  background: none; border: none; cursor: pointer;
  color: var(--purple-600); font-size: 13px; line-height: 1;
  padding: 0; margin-left: 2px;
}
.act-traveler-chip-remove:hover { color: var(--red-600); }
.act-travelers-hint {
  font-size: 11px; color: var(--text-faint); margin-top: 5px;
}

/* ── 3-state booking status radio group ───────────────────── */
.booking-status-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 2px;
}
/* The label IS the clickable row — reset everything from form-row label */
label.booking-opt {
  all: unset !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
label.booking-opt input[type="radio"] {
  all: unset;
  width: 18px; height: 18px;
  border: 2px solid var(--border-md);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  -webkit-appearance: radio;
  appearance: radio;
  accent-color: var(--purple-600);
}
label.booking-opt.booking-opt-booked { color: var(--green-600) !important; }
label.booking-opt.booking-opt-tobook  { color: var(--red-600)   !important; }

/* ── itin-to-book badge ───────────────────────────────────── */
.itin-to-book {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: var(--red-50); color: var(--red-600);
  padding: 1px 5px; border-radius: 4px; margin-left: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
/* ── badge-red (for "to book" on activity cards) ─────────── */
.badge-red { background: var(--red-50); color: var(--red-600); }

/* ── Activity URL links ───────────────────────────────────── */
.act-title-link, .itin-act-link {
  color: var(--purple-600);
  text-decoration: none;
  font-weight: 600;
}
.act-title-link:hover, .itin-act-link:hover { text-decoration: underline; }
.itin-link-icon { font-size: 11px; opacity: 0.7; }

/* ── In-app itinerary view (no overlay) ──────────────────── */
#view-itinerary #itin-view-body .itin-day-card { margin-bottom: 14px; }
#itin-view-icon { opacity: 0.75; }

/* ── Settings header with app logo ───────────────────────── */
.settings-app-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.settings-app-logo {
  width: 40px; height: 40px; border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.settings-app-name {
  font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--text);
}
.settings-app-version {
  font-size: 12px; font-weight: 500; color: var(--text-faint);
  background: var(--gray-100, #f1f1f1); padding: 2px 8px; border-radius: 99px;
  margin-left: 2px;
}

/* ── Sidebar logo using PNG icon ──────────────────────────── */
.sidebar-logo .logo-mark img { width: 30px; height: 30px; border-radius: 7px; filter: none; }

/* ── No-share / private badge ─────────────────────────────── */
.badge-gray[title="Hidden from shared users"] { font-size: 10px; }

/* ── Mobile font-size bump (+1pt ≈ +1.33px across the board) ─ */
@media (max-width: 768px) {
  body                { font-size: 17px; }
  .page-header h2     { font-size: 23px; }
  .page-header p      { font-size: 14px; }
  .trip-card-banner h3{ font-size: 18px; }
  .trip-dates         { font-size: 13px; }
  .trip-desc          { font-size: 14px; }
  .badge              { font-size: 12px; }
  .trip-header-info h2{ font-size: 25px; }
  .trip-header-info .meta { font-size: 14px; }
  .day-location-label { font-size: 18px; }
  .day-date-block .dom{ font-size: 27px; }
  .act-title          { font-size: 15px; }
  .act-sub            { font-size: 13px; }
  .act-time           { font-size: 12px; }
  .form-row label      { font-size: 13px; }
  .form-row input,
  .form-row textarea,
  .form-row select     { font-size: 15px; }
  .btn                { font-size: 15px; }
  .topbar-title       { font-size: 17px; }
  .header-back-btn    { height: 30px; padding: 0 10px 0 6px; font-size: 11px; }
  .topbar-back-sep    { height: 20px; margin: 0 0 0 2px; }
  .topbar-left        { gap: 8px; }
  .cal-trip-name      { font-size: 16px; }
  .cal-trip-dates     { font-size: 13px; }
  .settings-row-label { font-size: 15px; }
  .settings-row-desc  { font-size: 13px; }
  .modal-header h3    { font-size: 17px; }
  .booking-opt > label, label.booking-opt { font-size: 15px !important; }

  /* Itineraries → Show screen: bump every itin- element by 1pt over its desktop size */
  #view-itinerary .itin-date            { font-size: 14px; }
  #view-itinerary .itin-place           { font-size: 14px; }
  #view-itinerary .itin-act-line        { font-size: 14px; }
  #view-itinerary .itin-act-location    { font-size: 13px; }
  #view-itinerary .itin-sub             { font-size: 14px; }
  #view-itinerary .itin-day-note        { font-size: 14px; }
  #view-itinerary .itin-day-note-above  { font-size: 14px; }
  #view-itinerary .itin-detail          { font-size: 13px; }
  #view-itinerary .itin-platform        { font-size: 13px; }
  #view-itinerary .itin-flight-no       { font-size: 14px; }
  .flight-status-btn                    { font-size: 13px; padding: 4px 11px 4px 8px; }
  .flight-status-btn img                { width: 14px; height: 14px; }
  #view-itinerary .itin-ref             { font-size: 12px; }
  #view-itinerary .itin-phone           { font-size: 12px; }
  #view-itinerary .itin-booked          { font-size: 11px; }
  #view-itinerary .itin-to-book         { font-size: 11px; }
  #view-itinerary .itin-travelers       { font-size: 12px; }
  #view-itinerary .itin-price           { font-size: 12px; }
  #view-itinerary .itin-nights          { font-size: 12px; }
  #view-itinerary .itin-day-header .itin-date  { font-size: 13px; }
  #view-itinerary .itin-day-header .itin-place { font-size: 14px; }
  #view-itinerary .itin-day-body .itin-act-line{ font-size: 14px; }
  #itin-view-meta { font-size: 14px; }
}

/* ── Yearly Calendar Grid ─────────────────────────────────── */
.yearcal-header {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-bottom: 22px;
}
.yearcal-header h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.01em; min-width: 90px; text-align: center;
}
.yearcal-nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-md); background: var(--surface);
  font-size: 18px; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.yearcal-nav-btn:hover { background: var(--purple-50); border-color: var(--purple-200); color: var(--purple-700); }

/* ── Compact year selector in the topbar's right slot ───────────── */
.topbar-year-selector {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.topbar-year-nav-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-md); background: var(--surface);
  font-size: 18px; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0; padding: 0;
}
.topbar-year-nav-btn:hover { background: var(--purple-100, #ddd9fb); border-color: var(--purple-200); color: var(--purple-700); }
.topbar-year-label {
  font-size: 17px; font-weight: 700; color: var(--text);
  min-width: 48px; text-align: center; letter-spacing: -0.01em;
}
@media (max-width: 768px) {
  .topbar-year-selector { gap: 4px; }
  .topbar-year-nav-btn { width: 30px; height: 30px; font-size: 17px; }
  .topbar-year-label { font-size: 16px; min-width: 42px; }
  .payments-tabs-anchor { min-height: 46px; margin-bottom: 16px; }
  #view-payments .payments-tabs,
  #view-travel-kit .payments-tabs {
    left: 16px;
    right: 16px;
    padding: 6px 12px 0;
  }
  #view-travel-kit .payments-tabs {
    padding: 6px 12px;
  }
  .payments-tab { font-size: 13px; margin-right: 14px; padding: 8px 2px; }
  .payments-tab-actions { margin-bottom: 5px; }
  .bookings-tabs-anchor { min-height: 104px; margin-bottom: 16px; }
  #view-bookings .bookings-tabs {
    left: 16px;
    right: 16px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    overflow-x: visible;
    align-items: stretch;
  }
  .bookings-type-tab {
    width: auto;
    height: 42px;
    justify-self: stretch;
  }
  .bookings-type-tab img { width: 22px; height: 22px; }
}

/* ── Year selector used on Trips and Itineraries list pages ─ */
.list-year-header {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.list-year-header h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em; min-width: 110px; text-align: center;
}

/* Bottom copy of the year selector, repeated after the list so switching
   years doesn't require scrolling all the way back to the top. */
.list-year-footer {
  margin-top: 20px; margin-bottom: 4px;
  padding-top: 16px; border-top: 1px solid var(--border);
}

.yearcal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.yearcal-month-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.yearcal-month-title {
  background: var(--gray-600); color: #fff;
  text-align: center; font-size: 15px; font-weight: 700;
  padding: 9px 0; letter-spacing: 0.02em;
}
.yearcal-dow-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.yearcal-dow {
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-muted); padding: 6px 0;
}
.yearcal-weeks { padding: 4px 6px 8px; }
.yearcal-week {
  position: relative;
  margin-bottom: 6px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto 26px; /* default: day numbers + 1 bar row; JS overrides for more */
  row-gap: 3px;
}
.yearcal-day-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-column: 1 / 8;
  grid-row: 1;
}
.yearcal-day {
  text-align: center; font-size: 12px; color: var(--text);
  padding: 4px 0; min-height: 22px;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 0;
}
.yearcal-day-blank { color: transparent; }
.yearcal-day-today {
  font-weight: 700;
}
.yearcal-day-today::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #E8DCC4;
  z-index: -1;
}

/* Trip bar — grid-column AND grid-row are both set inline by JS so multiple
   overlapping trips stack as separate rows within the same week block.
   Made thicker (26px / 30px on mobile) so they're easy to tap, especially
   when several bars are stacked in the same week. */
.yearcal-trip-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  border-radius: 5px;
  padding: 0 7px;
  cursor: pointer;
  overflow: hidden;
  transition: filter var(--transition);
}
.yearcal-trip-bar:hover { filter: brightness(1.08); }
.yearcal-bar-icon {
  width: 13px; height: 13px; flex-shrink: 0;
  filter: brightness(0) invert(1); opacity: 0.9;
}
.yearcal-bar-label {
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  flex: 1; min-width: 0;
}
.yearcal-bar-owner {
  flex-shrink: 0; /* never sacrificed for the label's ellipsis truncation */
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,0.32);
  font-size: 8px; font-weight: 700; color: #fff;
  letter-spacing: -0.02em;
}
/* Single-day trips: no type icon (saves space), smaller font so short bars
   still fit a readable chunk of the name instead of truncating immediately. */
.yearcal-trip-bar-single .yearcal-bar-label { font-size: 11px; }

@media (max-width: 768px) {
  .yearcal-grid { grid-template-columns: 1fr; gap: 14px; }
  .yearcal-header h2 { font-size: 22px; }
  .yearcal-day { font-size: 13px; }
  .yearcal-day-today::before { width: 24px; height: 24px; }
  .yearcal-bar-label { font-size: 13px; } /* +1pt over desktop's 12px-equivalent */
  .yearcal-trip-bar { height: 30px; padding: 0 8px; }
  .yearcal-bar-icon { width: 15px; height: 15px; }
  .yearcal-trip-bar-single .yearcal-bar-label { font-size: 11px; }
  .yearcal-week { grid-template-rows: auto 30px; }
}

@media (min-width: 1200px) {
  .yearcal-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 769px) and (max-width: 1199px) {
  .yearcal-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Trip Suggest (OpenTripMap) ───────────────────────────── */
.modal.modal-lg { max-width: 560px; width: calc(100% - 32px); }
.trip-suggest-lead {
  font-size: 13px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.4;
}
.trip-suggest-search-fields {
  display: flex; gap: 8px; align-items: stretch;
}
.trip-suggest-search-fields input { flex: 1; min-width: 0; }
.trip-suggest-search-fields .btn { flex-shrink: 0; }
.trip-suggest-kinds {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.trip-suggest-kind-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
  cursor: pointer; transition: var(--transition);
}
.trip-suggest-kind-btn.selected,
.trip-suggest-kind-btn:hover {
  border-color: var(--purple-600);
  background: var(--purple-50);
  color: var(--purple-600);
}
.trip-suggest-status {
  font-size: 13px; color: var(--text-muted); margin: 8px 0;
}
.trip-suggest-place-meta {
  font-size: 12px; color: var(--text-faint); margin: 0 0 10px;
}
.trip-suggest-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: min(52vh, 480px); overflow-y: auto;
  margin: 0 -4px; padding: 2px 4px 4px;
}
.trip-suggest-item-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: var(--transition);
}
.trip-suggest-item-wrap.already-on-trip { opacity: 0.78; }
.trip-suggest-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 10px 10px 12px;
}
.trip-suggest-item.selected {
  background: var(--purple-50);
}
.trip-suggest-item-wrap.is-selected {
  border-color: var(--purple-600);
}
.trip-suggest-check {
  flex-shrink: 0; margin-top: 4px; cursor: pointer;
  display: flex; align-items: center;
  /* Never inherit .form-row label uppercase styles if nesting ever changes */
  text-transform: none; font-weight: 400; letter-spacing: normal;
  margin-bottom: 0; color: inherit;
}
#trip-suggest-list .trip-suggest-check input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  accent-color: var(--purple-600);
  flex-shrink: 0;
}
.trip-suggest-item-main {
  flex: 1; min-width: 0;
  display: flex; align-items: flex-start; gap: 10px;
}
.trip-suggest-item-thumb {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  background: var(--gray-100, #f1f1f3);
}
.trip-suggest-item-body { flex: 1; min-width: 0; }
.trip-suggest-item-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.3;
}
.trip-suggest-item-address {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px; line-height: 1.35;
}
.trip-suggest-item-address.is-empty { display: none; }
.trip-suggest-item-meta {
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.trip-suggest-item-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
  background: var(--gray-100, #f1f1f3); color: var(--text-muted);
}
.trip-suggest-item-already {
  font-size: 11px; color: var(--amber-700, #b45309); font-weight: 600;
}
.trip-suggest-type-icon {
  opacity: .45; flex-shrink: 0; margin-top: 4px;
}
.trip-suggest-expand-btn {
  flex-shrink: 0;
  width: 30px; height: 30px; margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: var(--transition);
}
.trip-suggest-expand-btn img {
  width: 14px; height: 14px;
  transform: rotate(90deg);
  transition: transform .18s ease;
  opacity: .7;
}
.trip-suggest-expand-btn.expanded img { transform: rotate(-90deg); }
.trip-suggest-expand-btn:hover {
  border-color: var(--purple-600);
  background: var(--purple-50);
}
.trip-suggest-item-detail {
  border-top: 1px solid var(--border);
  background: var(--gray-50, #f7f7f9);
  padding: 12px;
}
.trip-suggest-item-detail.hidden { display: none !important; }
.trip-suggest-detail-loading,
.trip-suggest-detail-empty {
  font-size: 13px; color: var(--text-muted);
}
.trip-suggest-detail-inner {
  display: flex; gap: 12px; align-items: flex-start;
}
.trip-suggest-detail-text {
  flex: 1; min-width: 0;
  font-size: 13px; line-height: 1.45; color: var(--text);
  white-space: pre-wrap;
}
.trip-suggest-detail-photos {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 6px;
  width: 88px;
}
.trip-suggest-detail-photo {
  display: block; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--gray-100, #f1f1f3);
}
.trip-suggest-detail-photo img {
  display: block; width: 88px; height: 66px; object-fit: cover;
}
@media (max-width: 768px) {
  .trip-suggest-search-fields { flex-direction: column; }
  .trip-suggest-list { max-height: 46vh; }
  .trip-suggest-detail-inner { flex-direction: column; }
  .trip-suggest-detail-photos {
    flex-direction: row; flex-wrap: wrap; width: auto;
  }
  .trip-suggest-detail-photo img { width: 72px; height: 54px; }
}

/* ── Tutorial page ─────────────────────────────────────────── */
.tutorial-intro {
  margin-bottom: 18px;
}
.tutorial-intro-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--purple-900);
  margin-bottom: 6px;
  line-height: 1.25;
}
.tutorial-intro-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 52rem;
}
.tutorial-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 28px;
}
.tutorial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tutorial-card.open {
  border-color: var(--purple-200);
  box-shadow: var(--shadow-md);
}
.tutorial-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.tutorial-card-header:hover {
  background: var(--gray-50);
}
.tutorial-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tutorial-card-icon img {
  width: 20px;
  height: 20px;
}
.tutorial-card-heading {
  flex: 1;
  min-width: 0;
}
.tutorial-card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.3;
}
.tutorial-card-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}
.tutorial-card-chevron {
  width: 18px;
  height: 18px;
  opacity: 0.45;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.tutorial-card.open .tutorial-card-chevron {
  transform: rotate(90deg);
  opacity: 0.7;
}
.tutorial-card-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.tutorial-card.open .tutorial-card-body {
  display: block;
}
.tutorial-steps {
  margin: 14px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.tutorial-steps li + li { margin-top: 8px; }
.tutorial-steps strong { font-weight: 650; }
.tutorial-ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  margin: 0 3px;
  position: relative;
  top: -1px;
}
.tutorial-ui-icon img {
  display: block;
  width: 12px;
  height: 12px;
}
.tutorial-ui-icon-primary {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #534AB7;
}
.tutorial-ui-icon-primary img {
  filter: brightness(0) invert(1);
}
.tutorial-ui-icon-day {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
}
.tutorial-ui-icon-day img {
  width: 12px;
  height: 12px;
}
.tutorial-ui-icon-help {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-md);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.tutorial-ui-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  height: 22px;
  padding: 0 8px;
  margin: 0 2px;
  border-radius: 999px;
  border: 1px solid var(--purple-200);
  background: #fff;
  color: #534AB7;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  position: relative;
  top: -1px;
}
.tutorial-ui-chip img {
  width: 12px;
  height: 12px;
  display: block;
}
.tutorial-note-hl {
  background: #FFE566;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}
.tutorial-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--amber-50);
  border: 1px solid rgba(133, 79, 11, 0.18);
  color: var(--amber-600);
  font-size: 13px;
  line-height: 1.45;
}
.tutorial-shot {
  margin-top: 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--gray-50);
  position: relative;
}
.tutorial-carousel {
  position: relative;
  padding: 10px 0 4px;
}
.tutorial-carousel-viewport {
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  touch-action: pan-y;
  border-radius: var(--radius-sm);
}
.tutorial-carousel-track {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}
.tutorial-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}
.tutorial-carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  background: var(--gray-100);
  user-select: none;
  -webkit-user-drag: none;
}
.tutorial-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--text);
}
.tutorial-carousel-nav img {
  width: 16px;
  height: 16px;
  opacity: 0.75;
}
.tutorial-carousel-prev {
  left: 6px;
}
.tutorial-carousel-prev img {
  transform: scaleX(-1);
}
.tutorial-carousel-next {
  right: 6px;
}
.tutorial-carousel-nav:hover:not(:disabled) {
  background: #fff;
  border-color: var(--purple-200);
}
.tutorial-carousel-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.tutorial-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
}
.tutorial-carousel-dot {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  border-radius: 50%;
  /* Use real tokens — there is no --purple-700 in this project */
  border: 2px solid #534AB7;
  padding: 0;
  margin: 0;
  background-color: transparent;
  background-clip: padding-box;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.tutorial-carousel-dot.active {
  background-color: #534AB7;
  border-color: #534AB7;
}
.tutorial-carousel-dot:hover:not(.active) {
  border-color: #3C3489;
  background-color: transparent;
}
.tutorial-shot-placeholder {
  display: none;
  padding: 28px 16px;
  text-align: center;
}
.tutorial-shot.is-missing .tutorial-shot-placeholder { display: block; }
.tutorial-shot-placeholder-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tutorial-shot-placeholder-file {
  font-size: 12px;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.tutorial-shot-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
@media (max-width: 768px) {
  .tutorial-intro-title { font-size: 20px; }
  .tutorial-card-header { padding: 13px 14px; }
  .tutorial-card-body { padding: 0 14px 14px; }
  .tutorial-carousel-viewport {
    max-width: none;
    touch-action: pan-y pinch-zoom;
  }
}
