/* ────────────────────────────────────────────
   BOTTOM SHEET MODAL
──────────────────────────────────────────── */
    .sheet-overlay {
      position: fixed;
      inset: 0;
      background: rgba(26, 22, 18, 0.45);
      backdrop-filter: blur(4px);
      z-index: 100;
      display: flex;
      align-items: flex-end;
      animation: fadeIn 0.2s ease;
    }

    .sheet-overlay.hidden {
      display: none;
    }


    .bottom-sheet {
      background: var(--white);
      width: 100%;
      border-radius: 24px 24px 0 0;
      padding: 24px 20px calc(36px + env(safe-area-inset-bottom));
      max-height: 90vh;
      overflow-y: auto;
      animation: sheetUp 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
    }

    .sheet-drag-handle {
      width: 40px;
      height: 4px;
      background: var(--cream3);
      border-radius: var(--radius-full);
      margin: -12px auto 20px;
    }

    .sheet-title {
      font-family: var(--serif);
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 6px;
    }

    .sheet-sub {
      font-size: 13px;
      color: var(--ink3);
      margin-bottom: 18px;
    }

    /* ────────────────────────────────────────────
   TOAST
──────────────────────────────────────────── */
    #toast-container {
      position: fixed;
      top: calc(16px + env(safe-area-inset-top));
      left: 50%;
      transform: translateX(-50%);
      z-index: 999;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      pointer-events: none;
      width: min(360px, 90vw);
    }

    .toast {
      background: var(--ink);
      color: var(--cream);
      border-radius: var(--radius-full);
      padding: 12px 18px;
      font-size: 13px;
      font-weight: 500;
      box-shadow: var(--shadow-lg);
      animation: toastIn 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
      pointer-events: all;
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      justify-content: center;
    }

    .toast.success {
      background: var(--green);
    }

    .toast.error {
      background: var(--rust);
    }

    .toast.warning {
      background: var(--amber);
      color: white;
    }

    @keyframes toastIn {
      from {
        opacity: 0;
        transform: translateY(-12px) scale(0.9);
      }

      to {
        opacity: 1;
        transform: none;
      }
    }

    @keyframes toastOut {
      to {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
      }
    }

    /* Loading */
    .spin {
      width: 18px;
      height: 18px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-top-color: currentColor;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      display: inline-block;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 60px 20px;
      text-align: center;
      color: var(--ink3);
    }

    .empty-icon {
      font-size: 48px;
      margin-bottom: 12px;
      opacity: 0.4;
    }

    .empty-text {
      font-family: var(--serif);
      font-size: 18px;
      color: var(--ink3);
    }

    .empty-sub {
      font-size: 13px;
      color: var(--ink4);
      margin-top: 6px;
    }

    /* conn indicator */
    .conn-indicator {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 11px;
      color: var(--ink4);
      padding: 0 20px;
      margin-bottom: 8px;
    }

    .conn-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--ink4);
      transition: background 0.3s;
    }

    .conn-dot.on {
      background: var(--green);
      animation: pulse-g 2s infinite;
    }

    .conn-dot.reconnecting {
      background: #f59e0b;
      animation: pulse-y 1s infinite;
    }

    @keyframes pulse-y {

      0%,
      100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
      }

      50% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
      }
    }

    @keyframes pulse-g {

      0%,
      100% {
        box-shadow: 0 0 0 0 rgba(45, 106, 79, 0.4);
      }

      50% {
        box-shadow: 0 0 0 4px rgba(45, 106, 79, 0);
      }
    }

    /* Tip increase sheet */
    .tip-increase-content {
      text-align: center;
    }

    .tip-increase-emoji {
      font-size: 48px;
      margin-bottom: 14px;
    }

    /* ── ISSUE REPORT ── */
    .issue-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 14px;
      background: var(--cream);
      border: 1.5px solid var(--cream3);
      border-radius: var(--radius);
      cursor: pointer;
      font-size: 13px;
      margin-bottom: 8px;
      transition: all 0.15s;
    }

    .issue-chip:hover,
    .issue-chip.selected {
      border-color: var(--rust);
      background: var(--rust-light);
    }

    /* ── Pull-to-refresh ── */
    #ptr-bar {
      position: fixed;
      top: env(safe-area-inset-top);
      left: 0;
      right: 0;
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      background: linear-gradient(135deg, var(--rust, #c84b2f) 0%, #a63d25 100%);
      color: #fff;
      font-size: 14px;
      font-weight: 600;
      padding: 0;
      height: 0;
      overflow: hidden;
      transition: height .3s cubic-bezier(0.4, 0, 0.2, 1), padding .3s cubic-bezier(0.4, 0, 0.2, 1), opacity .3s ease;
      pointer-events: none;
      box-shadow: 0 4px 20px rgba(200, 75, 47, 0.3);
    }

    #ptr-bar.ptr-pulling,
    #ptr-bar.ptr-refreshing {
      height: 56px;
      padding: 12px 0;
    }

    #ptr-spinner {
      width: 22px;
      height: 22px;
      border: 3px solid rgba(255, 255, 255, .3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: ptr-spin .8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
      display: none;
    }

    #ptr-bar.ptr-refreshing #ptr-spinner {
      display: block;
    }

    #ptr-arrow {
      font-size: 20px;
      transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #ptr-bar.ptr-pulling #ptr-arrow {
      transform: rotate(180deg);
    }

    #ptr-bar.ptr-refreshing #ptr-arrow {
      display: none;
    }

    @keyframes ptr-spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    @keyframes ptr-bounce {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-3px); }
    }

    #ptr-bar.ptr-refreshing #ptr-text {
      animation: ptr-bounce 1s ease-in-out infinite;
    }

    /* ═══════════════════════════════════════
   GUEST MODE
═══════════════════════════════════════ */
    .guest-banner {
      display: none;
      /* shown via JS */
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin: 0 16px 16px;
      padding: 12px 16px;
      background: linear-gradient(135deg, var(--ink) 0%, var(--ink2) 100%);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

    .guest-banner-text {
      color: rgba(245, 240, 232, 0.85);
      font-size: 13px;
      line-height: 1.4;
    }

    .guest-banner-text strong {
      color: var(--cream);
      font-weight: 700;
      display: block;
      margin-bottom: 2px;
    }

    .guest-banner-cta {
      flex-shrink: 0;
      padding: 8px 16px;
      background: var(--rust);
      color: #fff;
      border: none;
      border-radius: var(--radius-full);
      font-family: var(--sans);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
    }

    /* nudge modal */
    .guest-nudge-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(26, 22, 18, 0.6);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      z-index: 900;
      display: flex;
      align-items: flex-end;
      transition: opacity .25s;
    }

    .guest-nudge-backdrop.hidden {
      display: none;
    }

    .guest-nudge-card {
      background: var(--white);
      border-radius: 28px 28px 0 0;
      width: 100%;
      padding: 32px 24px calc(40px + env(safe-area-inset-bottom));
      animation: sheetUp .35s cubic-bezier(.34, 1.1, .64, 1);
      text-align: center;
    }

    @keyframes sheetUp {
      from {
        transform: translateY(100%);
      }

      to {
        transform: none;
      }
    }

    .guest-nudge-icon {
      font-size: 52px;
      margin-bottom: 16px;
    }

    .guest-nudge-title {
      font-family: var(--serif);
      font-size: 22px;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 10px;
      letter-spacing: -.3px;
    }

    .guest-nudge-body {
      font-size: 14px;
      color: var(--ink3);
      line-height: 1.6;
      margin-bottom: 24px;
    }

    .guest-nudge-signup {
      width: 100%;
      padding: 15px;
      background: var(--ink);
      color: var(--cream);
      border: none;
      border-radius: var(--radius-full);
      font-family: var(--sans);
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      margin-bottom: 10px;
    }

    .guest-nudge-signin {
      width: 100%;
      padding: 13px;
      background: transparent;
      color: var(--ink2);
      border: 1.5px solid var(--cream3);
      border-radius: var(--radius-full);
      font-family: var(--sans);
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      margin-bottom: 10px;
    }

    .guest-nudge-close {
      background: none;
      border: none;
      font-size: 13px;
      color: var(--ink4);
      cursor: pointer;
      margin-top: 4px;
      font-family: var(--sans);
    }

    /* ── Hero banner (home tab — visible to all users incl. guest) ── */
    /* ── Featured (horizontal scroll cards) — larger, more visual ── */
    .feat-scroll {
      display: flex;
      gap: 14px;
      overflow-x: auto;
      padding: 0 0 6px;
      scrollbar-width: none;
    }

    .feat-scroll::-webkit-scrollbar {
      display: none;
    }

    .feat-card {
      flex-shrink: 0;
      width: 220px;
      background: var(--white);
      border-radius: var(--radius-lg);
      overflow: hidden;
      box-shadow: var(--shadow-sm);
      cursor: pointer;
      transition: transform .18s, box-shadow .18s;
    }

    .feat-card:hover {
      transform: translateY(-3px);
      box-shadow: var(--shadow);
    }

    .feat-card-img {
      width: 100%;
      height: 120px;
      object-fit: cover;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 44px;
      background: linear-gradient(135deg, var(--cream2), var(--cream3));
      position: relative;
    }

    .feat-card-body {
      padding: 12px 14px 14px;
    }

    .feat-card-name {
      font-family: var(--serif);
      font-size: 15px;
      font-weight: 700;
      letter-spacing: -.2px;
      margin-bottom: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .feat-card-meta {
      font-size: 12px;
      color: var(--ink3);
    }

    .feat-card-badge {
      display: inline-block;
      margin-top: 6px;
      padding: 3px 10px;
      border-radius: var(--radius-full);
      font-size: 10px;
      font-weight: 700;
    }

    /* ── Browse as guest button on auth screen ── */
    .btn-browse-guest {
      width: 100%;
      padding: 13px 20px;
      background: transparent;
      color: var(--ink3);
      border: 1.5px solid var(--cream3);
      border-radius: var(--radius-full);
      font-family: var(--sans);
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      margin-top: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: background .15s, border-color .15s;
    }

    .btn-browse-guest:hover {
      background: var(--cream);
      border-color: var(--cream3);
    }
