/*
 * ═══════════════════════════════════════════════════════════
 *   RESPONSIVE FIXES — Wedding Planner Vertical
 *   Stakgro v2 — Full responsive pass
 *
 *   Breakpoints:
 *     Desktop  : 1025px+  (full sidebar, multi-column)
 *     Tablet   : 768–1024px (collapsible sidebar, adapted)
 *     Mobile   : ≤768px   (hamburger drawer, single-column)
 *     Narrow   : ≤480px   (375px phone optimisation)
 * ═══════════════════════════════════════════════════════════
 */

/* ─────────────────────────────────────────────────────────
   1.  MOBILE TOP-PADDING  (Pattern-2 pages that use
       body { padding-left: 240px } + .page container)
       The hamburger toggle sits at top:14px left:14px (38px tall)
       so .page needs ≥70px top padding on mobile.
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body.has-wp-sidebar .page {
    padding-top: 72px !important;
  }
}

/* ─────────────────────────────────────────────────────────
   1b. TOP-BAR / HAMBURGER OVERLAP FIX
       The sidebar toggle (☰) is fixed at top:14px left:14px (38×38px, z-index:310).
       The .top-bar on mobile is fixed at top:0 with the "Stakgro" logo at
       padding-left:16px — they overlap. Fix: push the top-bar content right
       so the logo starts AFTER the sidebar toggle.
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .top-bar {
    padding-left: 60px !important;
  }
}

/* Ensure hamburger toggle doesn't overlap Stakgro logo on SPA nav pages */
@media (max-width: 768px) {
  .nav .nav-inner {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .nav .nav-logo img {
    height: 32px !important;
  }
  .nav-hamburger {
    flex-shrink: 0;
    margin-left: auto;
  }
}

/* At ≤1024px the SPA nav gets crowded — show hamburger + hide secondary links */
@media (max-width: 1024px) {
  .nav-hamburger { display: flex !important; align-items: center; }
  .hide-mobile-nav { display: none !important; }
}

/* ─────────────────────────────────────────────────────────
   2.  STATS GRIDS
       Most tool pages use repeat(4,1fr) or repeat(5,1fr).
       Collapse gracefully at each breakpoint.
   ───────────────────────────────────────────────────────── */

/* Tablet: max 3 columns */
@media (max-width: 1024px) and (min-width: 641px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Mobile: 2 columns */
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Odd last card spans full width */
  .stats-grid > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* ─────────────────────────────────────────────────────────
   3.  DATA TABLES — horizontal scroll + readable columns
   ───────────────────────────────────────────────────────── */

/* Ensure any table wrapper allows scroll */
.guest-table-wrap,
.table-wrap,
.table-scroll,
.csv-preview-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* For bare <table> elements without a wrapper, make them
   scrollable as display:block on mobile */
@media (max-width: 640px) {
  .items-table,
  .items-table-wrap {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  /* Preserve table layout for child elements */
  .items-table tbody,
  .items-table thead,
  .items-table tfoot {
    display: table;
    width: 100%;
  }
}

/* On small screens, tables that aren't already wrapped
   get a minimum usable width */
@media (max-width: 640px) {
  .guest-table {
    min-width: 520px;
  }
  /* De-prioritise less critical columns on narrow phones */
  .guest-table th:nth-child(5),
  .guest-table td:nth-child(5),
  .guest-table th:nth-child(6),
  .guest-table td:nth-child(6) {
    display: none;
  }
}

/* ─────────────────────────────────────────────────────────
   4.  MODALS — full-screen on mobile, centred on tablet+
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-backdrop .modal,
  .modal-backdrop > div {
    border-radius: 20px 20px 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    padding: 20px 20px 28px !important;
  }
  /* Keep scrollability inside modals */
  .modal-backdrop .modal {
    overflow-y: auto;
  }
}

/* overlay/modal pattern used in guests.html */
@media (max-width: 640px) {
  .overlay .modal {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
  }
  .modal-body {
    padding: 16px 16px 24px !important;
  }
  .modal-header {
    padding: 16px 16px 12px !important;
  }
}

/* ─────────────────────────────────────────────────────────
   5.  FORM GRIDS — stack on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-grid,
  .form-row {
    grid-template-columns: 1fr !important;
  }
  .form-grid .full,
  .form-row .full {
    grid-column: 1 !important;
  }
}

/* ─────────────────────────────────────────────────────────
   6.  PAGE HEADERS — stack title + action buttons
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .page-actions,
  .header-actions {
    width: 100%;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .page-title {
    font-size: clamp(1.375rem, 5vw, 1.75rem) !important;
  }
}

/* ─────────────────────────────────────────────────────────
   7.  TOUCH TARGETS — minimum 44 × 44 px on mobile
       (WCAG 2.5.5 AAA; Apple HIG)
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .btn,
  .btn-primary,
  .btn-ghost,
  .btn-danger,
  .btn-success,
  .btn-info,
  button:not(.wp-sidebar-toggle):not(.wp-sidebar-close):not(.wp-sidebar-logout) {
    min-height: 44px;
  }
  /* Smaller badge-style buttons retain compact look but keep tap area */
  .btn-sm {
    min-height: 36px;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  /* Make select/input/textarea taller for fat-finger accuracy */
  select,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="search"],
  input[type="url"],
  input[type="password"],
  textarea {
    min-height: 44px;
    font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
  }
}

/* ─────────────────────────────────────────────────────────
   8.  TOOLBAR / FILTER ROW — wrap and full-width search
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .toolbar .search-wrap,
  .toolbar .filter-select,
  .toolbar .btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  .search-wrap {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }
}

/* ─────────────────────────────────────────────────────────
   9.  COUPLE SELECTOR BAR — wrap on small screens
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .couple-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .couple-bar .select,
  .couple-bar select {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ─────────────────────────────────────────────────────────
   10. TABS — horizontal scroll on narrow screens
   ───────────────────────────────────────────────────────── */
.tabs,
.view-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar,
.view-tabs::-webkit-scrollbar {
  display: none;
}
@media (max-width: 480px) {
  .tab,
  .view-tab {
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
    white-space: nowrap;
  }
}

/* ─────────────────────────────────────────────────────────
   11. PIPELINE STATS BAR (CRM)
       Already overflow-x:auto but needs bottom padding for
       the scrollbar on iOS.
   ───────────────────────────────────────────────────────── */
.pipeline-stats {
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
@media (max-width: 640px) {
  .pipeline-stat {
    min-width: 90px !important;
    padding: 8px 12px !important;
  }
  .pipeline-stat-count {
    font-size: 1.25rem !important;
  }
}

/* ─────────────────────────────────────────────────────────
   12. KANBAN BOARD — horizontal scroll with momentum
   ───────────────────────────────────────────────────────── */
.kanban-board {
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .kanban-board {
    /* Add padding so last column doesn't clip on mobile */
    padding-right: 16px;
  }
  .kanban-col {
    width: 200px !important;
  }
}

/* ─────────────────────────────────────────────────────────
   13. WEDDING UPCOMING CARDS — full-width on narrow
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wedding-cards {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow-x: hidden !important;
  }
  .wedding-card {
    min-width: 0 !important;
  }
}

/* ─────────────────────────────────────────────────────────
   14. DASHBOARD QUICK ACTIONS — wrap and expand on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .quick-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .quick-actions .qa-btn {
    justify-content: center;
    font-size: 0.8rem !important;
    padding: 10px 8px !important;
  }
  /* First (primary) button spans full width */
  .quick-actions .qa-btn-primary:first-child {
    grid-column: 1 / -1;
  }
}

/* ─────────────────────────────────────────────────────────
   15. SECTION / PANEL GRID — collapse two-column panels
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─────────────────────────────────────────────────────────
   16. REVENUE ROW inside panel — stack on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .revenue-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .revenue-big {
    font-size: 1.75rem !important;
  }
}

/* ─────────────────────────────────────────────────────────
   17. TOOL GRID — always at least 2 cols, max-3 on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .tool-card {
    padding: 12px !important;
  }
  .tool-name {
    font-size: 0.8rem !important;
  }
  .tool-desc {
    display: none !important; /* Save space on small phones */
  }
}

/* ─────────────────────────────────────────────────────────
   18. PLAYFAIR DISPLAY HEADINGS — prevent overflow
   ───────────────────────────────────────────────────────── */
.welcome-name,
.page-title,
h1, h2, h3 {
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* ─────────────────────────────────────────────────────────
   19. BULK ACTION BAR — wrap on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .bulk-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .bulk-actions {
    width: 100% !important;
    flex-wrap: wrap !important;
  }
}

/* ─────────────────────────────────────────────────────────
   20. ALERT BOXES — pad correctly on narrow screens
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .alert {
    font-size: 0.825rem !important;
    padding: 10px 12px !important;
  }
  .beo-sync-banner {
    flex-direction: column !important;
    gap: 8px !important;
  }
}

/* ─────────────────────────────────────────────────────────
   21. DIETARY TAG CHIPS — ensure wrap on mobile
   ───────────────────────────────────────────────────────── */
.dietary-tag-chips,
.preset-chips {
  display: flex !important;
  flex-wrap: wrap !important;
}

/* ─────────────────────────────────────────────────────────
   22. PAGINATION — stack on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .pagination {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center;
  }
  .page-btns {
    justify-content: center;
  }
}

/* ─────────────────────────────────────────────────────────
   23. MODAL FOOTER BUTTONS — stack on narrow
   ───────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .modal-footer {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ─────────────────────────────────────────────────────────
   24. UNDO TOAST — full-width on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #cancel-undo-toast,
  #date-undo-toast {
    min-width: 0 !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    transform: none !important;
    bottom: 16px !important;
  }
}

/* ─────────────────────────────────────────────────────────
   25. DIETARY CARD GRID — collapse on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .dietary-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─────────────────────────────────────────────────────────
   26. CSV UPLOAD ZONE — compact on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .csv-upload-zone {
    padding: 24px 16px !important;
  }
  .csv-upload-icon {
    font-size: 2rem !important;
  }
}

/* ─────────────────────────────────────────────────────────
   27. SEATING CHART — ensure canvas/stage doesn't overflow
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .seating-canvas,
  .seating-stage,
  #seating-canvas {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .seating-toolbar,
  .seating-controls {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
}

/* ─────────────────────────────────────────────────────────
   28. REVENUE DASHBOARD CHARTS — clip-safe on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .chart-wrap,
  .chart-container,
  canvas {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────
   29. SETTINGS — tab nav scrolls, form sections stack
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .settings-tabs,
  .settings-nav {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-grid,
  .settings-form-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─────────────────────────────────────────────────────────
   30. COUPLE-FACING PAGES (proposal-view, sign, portal)
       These must look PREMIUM on mobile — couples open
       these on their phones to sign and pay.
   ───────────────────────────────────────────────────────── */

/* Couple portal page */
@media (max-width: 640px) {
  .portal-header,
  .portal-hero {
    padding: 24px 16px !important;
  }
  .portal-actions,
  .portal-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .portal-card,
  .portal-section {
    padding: 16px !important;
  }
}

/* Proposal view — couple reads on phone */
@media (max-width: 640px) {
  .proposal-header,
  .proposal-hero {
    padding: 24px 16px !important;
  }
  .proposal-package,
  .proposal-item {
    padding: 14px 16px !important;
  }
  .proposal-actions {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .proposal-actions .btn,
  .proposal-actions a {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

/* Contract signing — must work perfectly on mobile */
@media (max-width: 640px) {
  .contract-body,
  .contract-content {
    font-size: 0.9rem !important;
    line-height: 1.7 !important;
    padding: 16px !important;
  }
  .signature-section,
  .signature-pad {
    padding: 16px !important;
  }
  .sign-actions {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .sign-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ─────────────────────────────────────────────────────────
   31. EMPTY STATES — compact on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .empty-state {
    padding: 32px 16px !important;
  }
  .empty-icon {
    font-size: 2.5rem !important;
  }
  .empty-title {
    font-size: 1rem !important;
  }
}

/* ─────────────────────────────────────────────────────────
   32. GENERAL OVERFLOW SAFETY — nothing bleeds off-screen
   ───────────────────────────────────────────────────────── */

/* CRITICAL: overflow-x:hidden must be on <html>, NOT <body>.
   Setting it on body creates a new scroll containment block on
   iOS Safari, which clips position:fixed children (modals, overlays).
   On <html>, the viewport remains the containing block for fixed
   elements — modals appear correctly and horizontal scroll is still
   prevented. Never revert this to body. */
html {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  /* body overflow intentionally NOT set — see note above */
  /* Ensure panels don't overflow */
  .panel,
  .stat-card,
  .client-card,
  .wedding-card,
  .feature-card {
    min-width: 0 !important;
    word-break: break-word;
  }
  /* Truncate very long names/text */
  .client-names,
  .client-name,
  .guest-name-cell {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ─────────────────────────────────────────────────────────
   33. TABLET INTERMEDIATE (768–1024px) IMPROVEMENTS
       Sidebar is visible (240px), so content area is 528–784px.
       Apply mid-width optimisations.
   ───────────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Slightly tighter padding to give content more room */
  .main-content {
    padding: 24px 24px 60px !important;
  }
  .page {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  /* Stats: allow 3 columns on medium tablet */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  /* Section grid: keep 2 cols if content area is wide enough */
  .section-grid {
    grid-template-columns: 1fr 1fr;
  }
  /* Quick actions wrap nicely */
  .quick-actions {
    flex-wrap: wrap;
  }
}

/* ─────────────────────────────────────────────────────────
   34. SCROLLBAR NORMALISATION on iOS
   ───────────────────────────────────────────────────────── */
* {
  -webkit-tap-highlight-color: rgba(196, 163, 90, 0.15);
}

/* ─────────────────────────────────────────────────────────
   35. VENDOR CARD GRID — collapse on tablet/mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .vendor-grid,
  .vendors-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─────────────────────────────────────────────────────────
   36. COMM HUB — message list + composer stack on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .comm-layout,
  .message-layout {
    flex-direction: column !important;
  }
  .message-sidebar,
  .thread-list {
    width: 100% !important;
    max-height: 280px !important;
    overflow-y: auto;
    border-right: none !important;
    border-bottom: 1px solid var(--border, #E8E0D5);
  }
  .message-main,
  .thread-view {
    flex: 1 !important;
  }
}

/* ─────────────────────────────────────────────────────────
   37. TOP BAR SAFETY — prevent content obscuring
       on pages that use Pattern-1 (app-layout) + .top-bar
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .top-bar ~ * .main-content,
  .app-layout .main-content {
    /* .top-bar is 60px; ensure top padding accounts for it */
    padding-top: max(80px, 80px) !important;
  }
}

/* ─────────────────────────────────────────────────────────
   38. MOBILE NAV PADDING — leave room for hamburger toggle
       (wp-sidebar-toggle: 38px wide at left:14px, z-index:310)
       Any sticky/fixed nav bar on sidebar pages needs
       left padding to avoid overlap with the toggle.
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-topbar {
    padding-left: 62px !important;
  }
  /* Pages with own nav bars (day-of, seating-chart, budget-tracker) */
  body.has-wp-sidebar .nav,
  body.has-wp-sidebar nav.nav {
    padding-left: 58px !important;
  }
}

/* ─────────────────────────────────────────────────────────
   39. PROPOSALS PAGE — stats-row responsive
   ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 12px 14px !important;
  }
  .stat-value {
    font-size: 1.25rem !important;
  }
}

/* ─────────────────────────────────────────────────────────
   40. CONTRACT PAGE — signature pad usable on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  canvas.signature-canvas,
  .sig-canvas {
    width: 100% !important;
    touch-action: none; /* Prevent page scroll while signing */
  }
  .signature-wrap,
  .signature-box {
    width: 100% !important;
  }
}

/* ─────────────────────────────────────────────────────────
   41. COMM HUB — reply composer full-width on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .reply-bar,
  .compose-bar {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .reply-bar .btn,
  .compose-bar .btn {
    align-self: flex-end;
    min-width: 80px;
  }
  .reply-textarea,
  .compose-textarea {
    font-size: 16px !important; /* Prevent iOS zoom */
  }
}

/* ─────────────────────────────────────────────────────────
   42. DAY-OF TOOLS — checklist items touch-friendly
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .checklist-item,
  .timeline-item,
  .run-sheet-row {
    min-height: 44px;
    padding: 10px 12px !important;
  }
  .panic-btn,
  .emergency-btn {
    padding: 16px 24px !important;
    font-size: 1rem !important;
    min-height: 56px !important;
  }
}

/* ─────────────────────────────────────────────────────────
   43. REVENUE DASHBOARD — chart legends wrap on mobile
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .chart-legend {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .legend-item {
    font-size: 0.75rem !important;
  }
  .rev-stats,
  .revenue-stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ─────────────────────────────────────────────────────────
   44. LANDING PAGE — /for/wedding-planners + public pages
       Two-column sections that need mobile collapse.
   ───────────────────────────────────────────────────────── */

/* Tablet: 2-col → 1-col for large grids */
@media (max-width: 768px) {
  .peak-grid,
  .capacity-grid,
  .comparison-grid,
  .proof-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* Mobile: 3-col feature grids → 1-col */
@media (max-width: 640px) {
  .features-grid-6,
  .features-grid-3 {
    grid-template-columns: 1fr !important;
  }
  .feat-card {
    padding: 1.5rem !important;
  }
}

/* Tablet: 3-col → 2-col for feature grids */
@media (max-width: 1024px) and (min-width: 641px) {
  .features-grid-6 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* App chips grid (the chaos section) */
@media (max-width: 480px) {
  .apps-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem !important;
  }
  .app-chip { padding: 0.5rem !important; }
  .app-chip-icon { font-size: 1.2rem !important; }
}

/* Hero text on landing pages */
@media (max-width: 480px) {
  .hero h1,
  .hero-title {
    font-size: clamp(2rem, 8vw, 2.75rem) !important;
  }
  .hero-sub,
  .hero-subtitle {
    font-size: 1rem !important;
  }
  .hero-cta,
  .hero-actions {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .hero-cta a,
  .hero-actions a {
    text-align: center;
  }
}

/* Pricing cards — stack on narrow */
@media (max-width: 640px) {
  .pricing-grid,
  .plans-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ─────────────────────────────────────────────────────────
   45. BOOKING PAGE — public consultation form
   ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .booking-layout,
  .booking-grid {
    grid-template-columns: 1fr !important;
  }
  .calendar-grid,
  .time-slots {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .time-slot {
    font-size: 0.8rem !important;
    padding: 8px 4px !important;
  }
}
