  /* ---------- Modal ---------- */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.5);
    display: none;
    align-items: center; justify-content: center;
    z-index: 100; padding: 24px;
    animation: fadein .15s ease;
  }
  /* Address autosuggest dropdown (Nominatim-backed) */
  .addr-suggest-dropdown {
    position: fixed;
    z-index: 10000;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15,23,42,0.18);
    max-height: 280px;
    overflow-y: auto;
    display: none;
    font-family: inherit;
  }
  .addr-suggest-item {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.35;
    border-bottom: 1px solid var(--border);
  }
  .addr-suggest-item:last-child { border-bottom: none; }
  .addr-suggest-item:hover,
  .addr-suggest-item.active { background: var(--brand-soft); }
  .addr-suggest-primary { color: var(--text); }
  @keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
  .modal-overlay.open { display: flex; }
  .modal {
    background: white; border-radius: 16px;
    width: 100%; max-width: 580px;
    max-height: 90vh; overflow-y: auto;
    padding: 28px;
    box-shadow: var(--shadow-lg);
  }
  .modal h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.01em; }
  .modal p.subtitle { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

  /* Detail modal — wider, two-column with independently-scrolling right column.
     Modal is a fixed 90vh flex container; the grid fills it so the right column
     has a real height to overflow-scroll inside. */
  .detail-overlay .modal {
    max-width: 880px;
    height: 90vh;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
    display: flex;
  }
  .detail-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 1fr;
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  .detail-image {
    background-size: cover; background-position: center;
    background-color: var(--bg-soft);
    min-height: 0;
  }
  .detail-content {
    padding: 24px 26px;
    display: flex; flex-direction: column;
    overflow-y: auto;
    /* min-height:0 is required for a grid/flex item to actually overflow-scroll */
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  @media (max-width: 760px) {
    .detail-overlay .modal { height: 90vh; max-height: 90vh; }
    .detail-grid {
      grid-template-columns: 1fr;
      grid-template-rows: 200px 1fr;
      height: 100%;
    }
    .detail-image { min-height: 0; aspect-ratio: auto; }
    .detail-content { overflow-y: auto; }
  }
  .detail-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin-bottom: 4px;
  }
  .detail-title { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
  .detail-short { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
  .detail-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding: 14px 0; border-top: 1px solid var(--border);
  }
  .detail-meta-item .label {
    font-size: 11px; color: var(--muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
  }
  .detail-meta-item .value {
    font-size: 14px; font-weight: 700; margin-top: 4px;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .detail-meta-item .value svg { width: 14px; height: 14px; color: var(--muted); }
  .detail-section { padding: 14px 0; border-top: 1px solid var(--border); }
  .detail-section h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
  .detail-section p { margin: 0; font-size: 14px; line-height: 1.55; }
  .detail-mini-map {
    height: 160px; border-radius: 10px; overflow: hidden;
    margin-top: 8px; border: 1px solid var(--border); background: var(--bg-soft);
  }
  .detail-actions {
    display: flex; gap: 8px; margin-top: auto; padding-top: 14px;
  }
  .save-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--brand); background: var(--brand);
    color: white; padding: 9px 16px;
    border-radius: 999px; font-size: 13px; font-weight: 700;
  }
  .save-toggle.is-saved {
    background: white; color: var(--brand);
  }
  .save-toggle svg { width: 14px; height: 14px; }

  .field { margin-bottom: 14px; }
  .field label {
    display: block; font-size: 11px; font-weight: 700;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 6px;
  }
  .field label .req { color: var(--danger); }
  .field input, .field select, .field textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; font-size: 14px; background: var(--bg-soft);
    outline: none; transition: border-color .15s, background .15s;
  }
  .field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--brand); background: white;
  }
  .field textarea { min-height: 110px; resize: vertical; }
  .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

  .price-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
  .price-toggle {
    display: flex; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  }
  .price-toggle button {
    background: var(--bg-soft); border: none; padding: 10px 14px;
    font-size: 13px; font-weight: 600; color: var(--muted);
  }
  .price-toggle button.active { background: var(--brand); color: white; }

  .modal-actions {
    display: flex; gap: 8px; margin-top: 20px;
    justify-content: space-between; align-items: center;
  }
  .modal-actions .btn { padding: 10px 18px; }

  .btn {
    border: 1px solid var(--border); background: #fff;
    padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 14px;
    transition: all .15s ease;
  }
  .btn:hover { background: var(--bg-soft); }
  .btn.primary { background: var(--cta); color: white; border-color: var(--cta); }
  .btn.primary:hover { background: var(--cta-dark); border-color: var(--cta-dark); }
  .btn.danger { color: var(--danger); border-color: #fecaca; }
  .btn.danger:hover { background: #fef2f2; }

  .sub-lbl {
    display: block; font-size: 11px; color: var(--muted-2);
    font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    margin-bottom: 4px;
  }

  /* Party steppers in detail modal */
  .party-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px; margin-bottom: 12px;
  }
  .party-stepper {
    background: var(--bg-soft);
    border-radius: 10px; padding: 10px 6px 10px;
    text-align: center;
  }
  .party-label {
    font-size: 10px; color: var(--muted);
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 8px;
  }
  .stepper {
    display: inline-flex; align-items: center; gap: 8px;
  }
  .stepper button {
    width: 28px; height: 28px; border-radius: 50%;
    background: white; border: 1px solid var(--border);
    font-size: 16px; font-weight: 700; line-height: 1;
    color: var(--text);
  }
  .stepper button:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
  .stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
  .stepper span { font-weight: 700; font-size: 16px; min-width: 18px; }
  .party-line-total {
    font-size: 11px; color: var(--muted-2); margin-top: 6px; min-height: 14px;
  }
  .party-total {
    background: var(--brand-soft); color: var(--brand);
    padding: 10px 14px; border-radius: 10px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; font-weight: 600;
  }
  .party-total strong { font-size: 16px; }

  .helper { font-size: 12px; color: var(--muted); margin-top: 6px; }
  .helper a { color: var(--brand); }
  .img-preview {
    width: 100%; aspect-ratio: 16/9; background: var(--bg-soft);
    border-radius: 10px; margin-top: 8px;
    background-size: cover; background-position: center;
    display: none;
  }
  .img-preview.show { display: block; }

  /* Website URL row with auto-fill button */
  .url-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .url-row .btn { white-space: nowrap; }
  .url-row .btn:disabled { opacity: 0.6; cursor: progress; }

  /* Image uploader */
  .image-uploader {
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    background: var(--bg-soft);
    overflow: hidden;
    transition: border-color .15s ease, background .15s ease;
  }
  .image-uploader.drag-over {
    border-color: var(--brand);
    background: var(--brand-soft);
  }
  .image-uploader-empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--muted);
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-size: 13px;
  }
  .image-uploader-empty:hover { color: var(--text); }
  .image-uploader-empty svg { width: 32px; height: 32px; color: var(--muted-2); }
  .image-uploader-empty:hover svg { color: var(--brand); }
  .image-uploader-empty strong { color: var(--brand); font-weight: 600; }
  .image-uploader-empty small { font-size: 11px; color: var(--muted-2); }
  .image-uploader-preview { position: relative; background: white; }
  .image-uploader-preview img {
    width: 100%; max-height: 240px;
    object-fit: cover; display: block;
  }
  .image-uploader-actions {
    display: flex; gap: 8px; padding: 10px;
    background: white; border-top: 1px solid var(--border);
  }
  .image-uploader-actions .btn {
    flex: 1; padding: 8px 12px; font-size: 13px;
  }

  .loc-display {
    margin-top: 6px; font-size: 12px; color: var(--muted);
    background: var(--brand-soft); border-radius: 8px;
    padding: 6px 10px; display: none;
  }
  .loc-display.show { display: block; }
  .loc-display strong { color: var(--brand); }

  .picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; }
  .picker-item {
    display: flex; gap: 10px; align-items: center;
    padding: 8px 10px; border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer; transition: background .12s, border-color .12s;
    background: white;
  }
  .picker-item:hover { background: var(--bg-soft); border-color: var(--border-strong); }
  .picker-item.assigned { opacity: .55; }
  .picker-item img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
  .picker-item .info { flex: 1; min-width: 0; }
  .picker-item .info .t { font-weight: 600; font-size: 14px; }
  .picker-item .info .c { font-size: 12px; color: var(--muted); }
  .picker-item .price { font-weight: 700; font-size: 13px; }

  .toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--text); color: white;
    padding: 10px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 200;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

  /* ============================================================
     Mobile (Airbnb-style): slim top trip picker + bottom tab bar
     ============================================================ */
  .mobile-tabbar { display: none; }

  @media (max-width: 760px) {
    /* App becomes top-bar + content (bottom tab bar is fixed) */
    .app {
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr;
      height: 100dvh;
    }
    /* Sidebar collapses to a slim header with only the trip picker */
    .sidebar {
      max-height: none !important;
      padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px !important;
      border-right: none !important;
      border-bottom: 1px solid var(--border);
      background: #fff;
      overflow: visible !important;
    }
    /* Make sure the trip dropdown floats above the bottom tab bar */
    .trip-dropdown { z-index: 110; }
    .sidebar .brand,
    .sidebar .section-nav-top,
    .sidebar .section-toggle,
    .sidebar .section-nav,
    .sidebar .sidebar-footer { display: none !important; }
    .trip-picker { margin: 0; }
    .trip-picker-btn { padding: 8px 10px; }

    /* Main reserves space so the bottom tab bar doesn't cover content */
    .main { padding: 16px 16px calc(80px + env(safe-area-inset-bottom)); }
    .main.guide-full { padding: 0 0 calc(72px + env(safe-area-inset-bottom)); }

    /* Bottom tab bar */
    .mobile-tabbar {
      display: flex;
      position: fixed;
      bottom: 0; left: 0; right: 0;
      background: #fff;
      border-top: 1px solid var(--border);
      padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
      box-shadow: 0 -2px 12px rgba(15,23,42,0.04);
      z-index: 100;
    }
    .mobile-tabbar button {
      flex: 1;
      display: flex; flex-direction: column; align-items: center; gap: 3px;
      background: transparent; border: none;
      padding: 4px 6px;
      color: var(--muted);
      font-size: 11px; font-weight: 600;
      letter-spacing: 0.01em;
    }
    .mobile-tabbar button svg { width: 24px; height: 24px; }
    .mobile-tabbar button.active { color: var(--brand); }
    .mobile-tabbar button.active svg { stroke-width: 2.4; }
    /* Center "Start a Trip" FAB */
    .mobile-tabbar .mt-fab { justify-content: flex-start; }
    .mobile-tabbar .mt-fab .mt-fab-circle {
      width: 52px; height: 52px; border-radius: 50%;
      background: var(--cta); color: #fff;
      display: grid; place-items: center;
      margin-top: -20px;
      box-shadow: 0 8px 20px rgba(255,107,87,0.42);
      transition: background .15s ease, transform .08s ease;
    }
    .mobile-tabbar .mt-fab:active .mt-fab-circle { transform: translateY(1px); }
    .mobile-tabbar .mt-fab .mt-fab-circle svg { width: 28px; height: 28px; stroke-width: 2.4; }
    .mobile-tabbar .mt-fab.active { color: var(--muted); }

    /* Map top-overlay must clear the slim header */
    .map-top-overlay { top: 12px; }

    /* Home / Trips / Inbox / Profile: hide the trip-picker header, give the
       content its own safe-area top padding. */
    body.tl-view .sidebar { display: none !important; }
    body.tl-view .main { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  }

  /* ---------- Wishlists view ---------- */
  .wishlist-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin: 4px 0 16px;
  }
  .wishlist-header h1 {
    font-size: 28px; letter-spacing: -0.02em; margin: 0;
  }
  .wishlist-header .wl-count {
    color: var(--muted); font-size: 14px;
  }
  .wishlist-grid {
    display: grid; grid-template-columns: 1fr; gap: 18px;
  }
  @media (min-width: 600px) {
    .wishlist-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  }
  @media (min-width: 980px) {
    .wishlist-grid { grid-template-columns: 1fr 1fr 1fr; }
  }
  .wl-card {
    background: transparent;
    border: none;
    text-align: left;
    padding: 0;
    cursor: pointer;
  }
  .wl-card-img {
    width: 100%; aspect-ratio: 1 / 1;
    border-radius: 14px;
    background-size: cover; background-position: center;
    background-color: var(--bg-soft);
    position: relative;
  }
  .wl-card-heart {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 999px;
    display: grid; place-items: center;
    box-shadow: 0 2px 6px rgba(15,23,42,0.18);
  }
  .wl-card-heart svg { width: 18px; height: 18px; fill: var(--brand); stroke: var(--brand); }
  .wl-card-cat-badge {
    position: absolute; top: 10px; left: 10px;
    background: rgba(255,255,255,0.92);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px; font-weight: 700;
    color: var(--text);
  }
  .wl-card-body {
    padding: 10px 4px 0;
  }
  .wl-card-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    margin: 0 0 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .wl-card-meta {
    font-size: 13px; color: var(--muted); margin: 0;
  }
  .wl-card-price {
    font-size: 14px; font-weight: 600; color: var(--text);
    margin-top: 4px;
  }
  .wishlist-empty {
    text-align: center; padding: 60px 20px;
    color: var(--muted);
  }
  .wishlist-empty strong { color: var(--text); font-size: 17px; display:block; margin-bottom: 6px; }

