/* Mobile UI: isolated from desktop, including touch phones in landscape. */
.messenger-mobile-back { display: none; }
[data-mobile-only][hidden], [data-messenger-mobile-back][hidden] { display: none !important; }
@media (max-width: 767px), (max-width: 1023px) and (orientation: landscape) and (pointer: coarse) {
  :root { --mobile-nav-height: calc(64px + env(safe-area-inset-bottom, 0px)); --mobile-header-height: calc(64px + env(safe-area-inset-top, 0px)); --mobile-gutter: 16px; }
  html { scroll-padding-top: calc(var(--mobile-header-height) + 16px); -webkit-text-size-adjust: 100%; }
  body { min-width: 0; margin: 0; font-size: 15px; }
  body, main, main > *, section, form, fieldset { min-width: 0; }
  body:has(.mobile-nav) { padding-bottom: var(--mobile-nav-height); }
  body:has(.mobile-nav) > .min-h-screen { min-height: calc(100dvh - var(--mobile-nav-height)); }
  body:not(.profile-page):has(.site-header) main, .profile-page .profile-layout {
    width: 100%; max-width: 720px; grid-template-columns: minmax(0,1fr); gap: 20px;
    padding: 20px max(var(--mobile-gutter), env(safe-area-inset-right)) 28px max(var(--mobile-gutter), env(safe-area-inset-left));
  }
  body .site-sidebar, .profile-page .profile-left-rail { display: none !important; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { max-width: 100%; font-size: 16px !important; }
  input[type=date], input[type=time], input[type=datetime-local] { min-width: 0; width: 100%; min-height: 48px; }
  textarea { line-height: 1.5; scroll-margin: 90px 0 100px; }
  button, a, summary { -webkit-tap-highlight-color: transparent; }
  button, summary { touch-action: manipulation; }
  button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--cp-gold); outline-offset: 3px; }
  img, video { max-width: 100%; }
  [hidden] { display: none !important; }
  .page-heading h1 { font-size: 27px; line-height: 1.18; letter-spacing: -.025em; }
  .page-heading p { font-size: 14px; line-height: 1.5; }

  /* One quiet header; search expands only when requested. */
  .site-header { top: 0; z-index: 80; padding-top: env(safe-area-inset-top,0px); backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--cp-bg); }
  .site-header-inner { min-height: 64px; max-width: 720px; padding: 8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left)); gap: 0; flex-wrap: wrap; }
  .site-brand { gap: 7px; min-width: 0; flex: 1; }
  .site-brand img { width: 32px; height: 32px; flex: none; }
  .site-brand strong { font-size: 19px; line-height: 1.2; white-space: nowrap; }
  .site-header .site-brand small { display: none; }
  .site-header-actions { flex: none; gap: 0; }
  .site-header-actions > .theme-toggle, .site-header-actions > [data-messenger-toggle] { display: none; }
  .header-icon-btn, .account-menu summary { display: grid; place-items: center; min-width: 44px; width: 44px; height: 44px; border-radius: 14px; }
  .header-icon-btn svg { width: 21px; height: 21px; }
  .account-menu summary img { width: 34px; height: 34px; }
  .account-avatar-change { display: none; }
  .site-search { flex-basis: 100%; order: 3; margin: 8px 0 4px; border-radius: 14px; gap: 8px; }
  html[data-mobile-ready] .site-search { display: none; }
  html[data-mobile-search-open] .site-search { display: flex; }
  .site-search input, .site-search button { height: 48px; }
  .site-search button { width: 44px; }
  .account-menu[open] { z-index: 105; }
  .mobile-account-backdrop { position: fixed; z-index: 0; inset: 0; width: 100%; height: 100%; background: #030b0db3; backdrop-filter: blur(6px); border: 0; }
  .account-dropdown { position: fixed; z-index: 1; top: auto; bottom: 0; left: max(0px,env(safe-area-inset-left)); right: max(0px,env(safe-area-inset-right)); width: auto; max-height: calc(var(--mobile-vh,100dvh) - 32px - env(safe-area-inset-top)); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; overflow-y: auto; overscroll-behavior-y: contain; box-shadow: 0 -20px 80px #0005; }
  .account-dropdown > span { padding: 8px 48px 14px 8px; font-size: 19px; color: var(--cp-text); font-weight: 700; }
  .account-dropdown a, .mobile-account-theme { display: flex; align-items: center; gap: 13px; min-height: 48px; width: 100%; padding: 12px 8px; color: var(--cp-text); font-size: 14px; text-align: left; border-radius: 12px; }
  .account-dropdown svg { width: 21px; height: 21px; color: var(--cp-muted); flex: none; }
  .mobile-account-close { position: absolute; top: 8px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--cp-raised); color: var(--cp-text); font-size: 26px; }
  .notification-panel { position: fixed; inset: calc(var(--mobile-header-height) + 4px) max(12px,env(safe-area-inset-right)) auto max(12px,env(safe-area-inset-left)); width: auto; max-height: calc(var(--mobile-vh,100dvh) - var(--mobile-header-height) - var(--mobile-nav-height) - 20px); overflow-y: auto; border-radius: 18px; }
  .notification-panel-head { gap: 8px; flex-wrap: wrap; }
  .notification-panel-head button, .notification-panel-link { min-height: 44px; }
  .notification-panel-body { max-height: none; }

  /* Five destinations keep labels and touch targets legible. */
  body .mobile-nav { display: grid; position: fixed; z-index: 75; left: 0; right: 0; bottom: 0; grid-template-columns: repeat(5,minmax(0,1fr)); height: var(--mobile-nav-height); gap: 0; margin: 0; padding: 4px max(6px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left)); border: 0; border-top: 1px solid var(--cp-border); border-radius: 0; background: var(--cp-mobile-nav); box-shadow: 0 -6px 24px #00000012; backdrop-filter: blur(20px); }
  .mobile-nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 52px; padding: 4px 0; border-radius: 13px; color: var(--cp-muted); border: 0; }
  .mobile-nav-link span { font-size: 10px; line-height: 1.2; font-weight: 650; letter-spacing: 0; }
  .mobile-nav-link svg { width: 22px; height: 22px; stroke-width: 1.8; }
  .mobile-nav-link.is-active { color: var(--cp-gold); background: var(--cp-chip-gold); box-shadow: none; }
  .mobile-nav-badge { top: 0; right: calc(50% - 24px); min-width: 18px; height: 18px; }
  html[data-mobile-keyboard] .mobile-nav { display: none; }
  .messenger-fab { display: none; }

  /* The feed and directory are separate mobile views, without a second page load. */
  .home-content { gap: 20px; display: flex; flex-direction: column; }
  .home-content > .page-heading { order: 0; }
  .home-stream { order: 1; min-width: 0; }
  .home-content > .home-contacts { order: 2; }
  html[data-mobile-ready]:not([data-mobile-view=contacts]) .home-content > .home-contacts { display: none; }
  html[data-mobile-view=contacts] .home-content > .page-heading, html[data-mobile-view=contacts] .home-stream { display: none; }
  .home-contacts { padding: 0; border: 0; background: transparent; }
  .home-contacts-heading h2 { font-size: 27px; letter-spacing: -.025em; }
  .home-contacts-heading p { max-width: 29ch; font-size: 14px; }
  .home-contacts-search { min-height: 48px; border-radius: 14px; margin-bottom: 12px; }
  .home-contact-list { grid-template-columns: 1fr; }
  .home-contact-entry { min-height: 80px; gap: 13px; padding: 12px 2px; }
  .home-contact-avatar { width: 48px; height: 48px; }
  .home-contact-name { font-size: 15px; }
  .home-contact-meta { font-size: 13px; }
  .home-contact-type { font-size: 12px; }
  .home-contact-chat-icon { width: 44px; height: 44px; }
  .fb-composer { border-radius: 18px; }
  .fb-composer-trigger { min-height: 48px; font-size: 14px; }
  .composer-shortcuts button { min-height: 44px; font-size: 12px; padding: 8px; }
  .composer-shortcuts svg { width: 18px; height: 18px; }
  .composer-format-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
  .composer-format-tabs button { min-height: 44px; justify-content: center; font-size: 12px; padding: 8px 4px; }
  .composer-publish-actions { gap: 8px; }
  .composer-submit-btn, .composer-reset-btn { min-height: 48px; }
  .wall-feed-header { padding-bottom: 12px; gap: 8px; flex-wrap: wrap; }
  .wall-feed-action { min-height: 44px; }
  .wall-post { border-radius: 18px; margin-bottom: 16px; }
  .wall-post-header { gap: 10px; padding: 14px; }
  .wall-post-pseudo { font-size: 15px; }
  .wall-post-meta { font-size: 12px; }
  .wall-post-header .wall-post-chip { font-size: 11px; white-space: normal; }
  .wall-post-content { padding: 12px 14px 16px; font-size: 16px; line-height: 1.55; }
  .wall-post-media--square { margin: 0 10px 12px; width: calc(100% - 20px); }
  .wall-post-media--square .wall-post-media-frame { max-height: 60svh; }
  .wall-post-actions { padding: 6px 8px 8px; gap: 4px; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 44px; }
  .wall-post-action, .wall-post-menu { min-height: 44px; min-width: 44px; }
  .wall-post-action { font-size: 12px; padding-inline: 4px; }
  .wall-post-action-bookmark .wall-post-bookmark-label { display: none; }
  .wall-post-reaction-control { position: static; }
  .wall-post-actions { position: relative; }
  .wall-post-reaction-main [data-reaction-label] { white-space: nowrap; max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
  .wall-post-reaction-picker { left: 6px; right: 6px; bottom: calc(100% + 4px); width: auto; gap: 0; padding: 6px 3px; justify-content: space-between; border-radius: 20px; }
  .wall-post-reaction-picker button { min-width: 0; width: auto; flex: 1; height: 46px; font-size: 24px; }
  .wall-post-comment-submit, .wall-post-comment-like, .wall-post-readmore { min-height: 44px; }
  .wall-post-edit-actions { flex-wrap: wrap; }
  .wall-post-edit-save, .wall-post-edit-cancel { min-height: 44px; }

  /* Messaging occupies the available viewport, including when a keyboard is open. */
  .messenger-mobile-back { display: grid; }
  .messenger-dock { z-index: 200; inset: 0; pointer-events: none; }
  .messenger-hub.is-open, .messenger-window:not(.is-minimized) { position: fixed; inset: var(--mobile-top,0px) 0 auto; width: 100%; height: var(--mobile-vh,100dvh); max-height: none; max-width: none; border: 0; border-radius: 0; box-shadow: none; padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); background: var(--cp-bg); }
  .messenger-hub[hidden], .messenger-window.is-minimized { display: none; }
  .messenger-dock:has(.messenger-hub.is-open) .messenger-windows { display: none; }
  .messenger-hub-head, .messenger-window-head { flex: none; min-height: 64px; padding: 10px 12px; gap: 8px; background: var(--cp-surface); }
  .messenger-window-user { flex: 1; }
  .messenger-window-name, .messenger-hub-title, .messenger-thread-name, .messenger-compose-input, .messenger-hub-search-input, .messenger-icon-btn, .messenger-compose-mic { color: var(--cp-text); }
  .messenger-window-status, .messenger-hub-sub, .messenger-thread-time, .messenger-thread-preview, .messenger-section-label, .messenger-empty { color: var(--cp-muted); }
  .messenger-hub-search-input::placeholder, .messenger-compose-input::placeholder { color: var(--cp-muted); opacity: 1; }
  .messenger-compose-input, .messenger-hub-search { background: var(--cp-raised); }
  .messenger-thread-kind.is-contact { color: var(--cp-green); background: var(--cp-chip-green); }
  .messenger-thread-kind.is-member { color: var(--cp-gold); background: var(--cp-chip-gold); }
  .messenger-bubble.is-theirs { background: var(--cp-surface); color: var(--cp-text); border-color: var(--cp-border); }
  .messenger-bubble.is-mine { background: var(--cp-chip-gold); color: var(--cp-text); border-color: var(--cp-border); }
  .messenger-window-name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .messenger-window-status { font-size: 12px; }
  .messenger-window-actions [data-messenger-minimize] { display: none; }
  .messenger-icon-btn, .messenger-compose-mic, .messenger-compose-send { min-width: 44px; width: 44px; min-height: 44px; height: 44px; }
  .messenger-window-body, .messenger-hub-body { min-height: 0; overscroll-behavior: contain; padding: 16px; background: var(--cp-bg); }
  .messenger-hub-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .messenger-hub-search { flex: none; min-height: 48px; margin: 12px; border-radius: 14px; }
  .messenger-thread-btn { min-height: 72px; }
  .messenger-bubble { font-size: 15px; max-width: 86%; padding: 10px 13px; }
  .messenger-bubble-time { font-size: 11px; }
  .messenger-compose { flex: none; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); gap: 4px; background: var(--cp-surface); }
  .messenger-compose-input { min-height: 46px; }
  html[data-mobile-keyboard] .messenger-compose { padding-bottom: 8px; }
  body.mobile-overlay-open { overflow: hidden; overscroll-behavior: none; }

  /* Profiles: readable identity, comfortable actions, horizontally scrollable sections. */
  .mobile-profile-overview { margin-block: 12px; border: 1px solid var(--cp-border); border-radius: 16px; background: var(--cp-surface); }
  .mobile-profile-overview > summary { min-height: 52px; padding: 15px 16px; color: var(--cp-text); font-size: 14px; font-weight: 650; cursor: pointer; }
  .mobile-profile-overview[open] > summary { border-bottom: 1px solid var(--cp-border); }
  .mobile-profile-overview .profile-summary-panel, .mobile-profile-overview .profile-visitor-guide { margin: 0; border: 0; }
  .profile-page .profile-avatar-camera { display: none; }
  .profile-page .profile-avatar-camera-badge { width: 28px; height: 28px; }
  .profile-page .profile-sidebar-card { border-radius: 20px; }
  .profile-page .profile-sidebar-card .profile-cover { height: 112px; }
  .profile-page .profile-sidebar-card .profile-sidebar-body { padding: 0 16px 16px; }
  .profile-page .profile-sidebar-card .profile-sidebar-top { margin-top: -32px; gap: 12px; }
  .profile-page .profile-sidebar-card .profile-avatar { width: 80px; height: 80px; }
  .profile-page .profile-sidebar-card .profile-sidebar-head { margin-top: 39px; }
  .profile-page .profile-sidebar-card h1 { font-size: 24px; line-height: 1.15; }
  .profile-page .profile-sidebar-card .profile-sidebar-badge { font-size: 11px; line-height: 1.5; }
  .profile-page .profile-sidebar-card .profile-stats { min-width: 0; width: 100%; }
  .profile-page .profile-sidebar-card .profile-sidebar-actions { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; gap: 8px !important; }
  .profile-page .profile-sidebar-card .profile-sidebar-actions :is(.profile-cta-primary,.profile-cta-secondary,.profile-visitor-share) { min-height: 48px; width: 100%; font-size: 13px; white-space: normal; }
  .profile-page .profile-tabs { position: sticky; top: var(--mobile-header-height); max-width: 100%; padding: 6px; border-radius: 14px; background: var(--cp-surface); scroll-padding: 6px; }
  .profile-page .profile-tab { min-height: 44px; padding: 10px 14px; font-size: 13px; }
  .profile-page .profile-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .profile-page .profile-summary-note { font-size: 12px; line-height: 1.5; }
  .profile-page .profile-info-grid { grid-template-columns: minmax(0,1fr); }
  .profile-page .profile-field, .profile-page .profile-settings-select { min-height: 48px; }
  .profile-page .profile-save-btn, .profile-page .profile-manage-shortcut, .profile-page .profile-manage-tab { min-height: 44px; }
  .profile-page .profile-visitor-guide { padding: 16px; }
  .profile-page .profile-visitor-guide-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .profile-page .profile-visitor-guide-actions a { min-height: 44px; white-space: normal; }

  /* Event browsing and forms are kept within reach. */
  .events-page .kiosk-hero-lead { font-size: 14px; line-height: 1.5; }
  .events-page .kiosk-section-head { gap: 8px; flex-wrap: wrap; }
  .events-page .kiosk-board-add { min-width: 44px; min-height: 44px; }
  .events-page .event-filters { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
  .events-page .event-filter-search, .events-page .event-city-filter { min-height: 48px; height: 48px; width: 100%; grid-column: 1; grid-row: auto; border-radius: 13px; }
  .events-page .event-filter-search { order: 0; }
  .events-page .event-filter-segments { order: 1; display: flex; grid-row: auto; grid-column: 1; width: 100%; gap: 4px; }
  .events-page .event-filter-segments button { flex: 1; min-height: 44px; padding-inline: 8px; font-size: 12px; }
  .events-page .event-city-filter { order: 2; }
  .event-coverflow { border-radius: 20px; }
  .ecf-topline { padding: 16px 16px 0; }
  .ecf-controls button { min-width: 44px; min-height: 44px; }
  .ecf-selection { padding-inline: 16px; }
  .event-detail-title { font-size: 30px; line-height: 1.12; }
  .event-detail-shell { border-radius: 20px; }
  .event-detail-facts { gap: 16px; }
  .event-detail-fact strong { font-size: 14px; }
  .event-detail-fact small { font-size: 12px; }
  .event-detail-description p { font-size: 16px; line-height: 1.65; }
  .event-detail-practical p { font-size: 14px; }
  .events-page:has(.event-detail-shell.is-joinable) .mobile-nav { display: grid; }
  .event-detail-shell.is-joinable .event-detail-actions { bottom: var(--mobile-nav-height); padding: 8px max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left)); z-index: 60; }
  .events-page:has(.event-detail-shell.is-joinable) main { padding-bottom: 100px; }
  .event-detail-shell .event-primary-action { min-height: 48px; }
  .event-guest-actions { padding-left: 0; flex-wrap: wrap; }
  .event-guest-actions button, .event-export-action { min-height: 44px; }

  /* Sheets follow the visual viewport, not a fixed desktop height. */
  body > .event-create-panel, .event-attend-modal, .composer-type-modal, .welcome-overlay { top: var(--mobile-top,0px); bottom: auto; height: var(--mobile-vh,100dvh); min-height: 0; padding: 0; align-items: end; }
  .event-create-dialog, .event-attend-dialog, .composer-type-modal-panel, .welcome-dialog { width: 100%; max-width: 100%; max-height: calc(var(--mobile-vh,100dvh) - max(8px,env(safe-area-inset-top))); margin: 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding: 86px 0 100px; background: var(--cp-surface); color: var(--cp-text); }
  .event-create-dialog .event-create-head { top: -20px; margin: -20px -20px 20px; padding: 16px 20px; background: var(--cp-surface); }
  .event-create-dialog .event-create-seal, .event-create-dialog .event-create-head .event-eyebrow, .event-create-dialog .event-create-head .event-manage-sub { display: none; }
  .event-create-dialog .event-create-head { align-items: center; min-height: 72px; gap: 8px; padding-block: 12px; margin-bottom: 16px; }
  .event-create-dialog .event-create-title { font-size: 21px; line-height: 1.25; color: var(--cp-text); }
  .event-attend-dialog h2 { font-size: 25px; line-height: 1.2; color: var(--cp-text); }
  .event-wizard-eyebrow { display: none; }
  .event-wizard-step-heading { margin-bottom: 12px; }
  .event-wizard-step-heading h3 { color: var(--cp-text); font-size: 24px; }
  .event-wizard-step-heading p, .event-wizard-step-intro, .event-wizard-note, .event-attend-dialog p, .event-attend-summary span, .event-wizard-recap span { color: var(--cp-muted); }
  .event-wizard-recap strong, .event-attend-dialog strong, .event-attend-dialog .event-attend-fact { color: var(--cp-text); }
  .event-create-dialog .event-wizard-nav { background: var(--cp-surface); }
  .event-wizard-progress button { color: var(--cp-muted); border-color: var(--cp-border); }
  .event-wizard-progress button.is-current { background: var(--cp-gold); color: var(--cp-on-gold); border-color: var(--cp-gold); }
  .event-wizard-progress button.is-done { color: var(--cp-green); border-color: var(--cp-green); }
  .event-wizard-back { color: var(--cp-text); border-color: var(--cp-border); }
  .event-wizard-next { background: var(--cp-gold); color: var(--cp-on-gold); }
  .event-attend-dialog textarea { color: var(--cp-text); background: var(--cp-bg); border-color: var(--cp-border); }
  .event-attend-dialog .event-attend-close { position: sticky; top: 0; float: right; z-index: 8; margin: -8px -8px -44px 8px; background: var(--cp-raised); color: var(--cp-text); }
  .event-create-dialog p, .event-attend-dialog p { font-size: 14px; line-height: 1.55; }
  .event-wizard-fields { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .event-wizard-head { margin-bottom: 20px; }
  .event-wizard-progress { gap: 4px; overflow-x: auto; }
  .event-wizard-progress button { flex: 1 1 0; min-width: 44px; min-height: 44px; font-size: 0; padding: 8px 4px; }
  .event-wizard-progress button::before { content: attr(data-step-number); font-size: 14px; }
  .event-wizard-fields label, .event-field-label { font-size: 14px; color: var(--cp-text); }
  .event-create-dialog .event-field { color: var(--cp-text); background: var(--cp-bg); border-color: var(--cp-border); }
  .event-create-dialog .event-field::placeholder, .event-attend-dialog textarea::placeholder { color: var(--cp-muted); opacity: .85; }
  .event-create-close { color: var(--cp-text); background: var(--cp-raised); border-color: var(--cp-border); }
  .event-audience-option span { color: var(--cp-text); background: var(--cp-bg); border-color: var(--cp-border); }
  .event-audience-option input:checked + span { color: var(--cp-gold); background: var(--cp-chip-gold); border-color: var(--cp-gold); }
  .event-attend-note-label { color: var(--cp-text); }
  .event-attend-note-count, .event-audience-help { color: var(--cp-muted); }
  .event-wizard-number { color: var(--cp-gold); background: var(--cp-chip-gold); }
  .event-wizard-fields .event-field { min-height: 48px; }
  .event-create-dialog .event-wizard-nav { position: sticky; z-index: 5; bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 20px -20px calc(-20px - env(safe-area-inset-bottom)); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--cp-surface); border-top: 1px solid var(--cp-border); }
  .event-create-dialog .event-wizard-nav:has(.event-wizard-next[hidden]) { position: static; margin: 16px 0 0; padding: 0; border: 0; background: transparent; }
  .event-wizard-next, .event-wizard-back, .event-attend-actions button, .event-create-close, .event-attend-close { min-height: 48px; min-width: 44px; font-size: 14px; }
  .event-wizard-status { display: none; }
  .event-audience-options { grid-template-columns: minmax(0,1fr); }
  .event-audience-option span { min-height: 48px; font-size: 14px; }
  .event-attend-actions { gap: 8px; }
  .event-attend-actions > button { flex: 1; }
  .event-wizard-recap > div { gap: 12px; }
  .event-wizard-recap strong { max-width: 65%; }
  .welcome-dialog { padding: 0; background: #111b1b; color: #f5f0e7; }
  .welcome-hero { min-height: 210px; padding: 64px 22px 24px; }
  .welcome-hero h2 { font-size: 30px; }
  .welcome-hero p { font-size: 14px; }
  .welcome-bottom { padding: 20px 22px calc(22px + env(safe-area-inset-bottom)); }
  .welcome-close { width: 44px; height: 44px; top: 12px; right: 12px; }
  .welcome-copy, .welcome-share, .welcome-explore { min-height: 48px; }
  .welcome-actions { gap: 8px; }
  .composer-type-card { min-height: 76px; }
  .composer-type-modal-title, .composer-type-card-label, .composer-type-modal-close { color: var(--cp-text); }
  .composer-type-card-desc { color: var(--cp-muted); }
  .composer-type-card-icon { color: var(--cp-gold); }
  .composer-type-modal-close { width: 44px; height: 44px; }
  .media-lightbox { padding: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); }
  .media-lightbox-close { width: 48px; height: 48px; }
  .mm-dialog, .mm-preview { position: fixed; inset: auto 0 calc(100dvh - var(--mobile-vh,100dvh) - var(--mobile-top,0px)); max-width: 100%; width: 100%; max-height: calc(var(--mobile-vh,100dvh) - 8px); margin: 0; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .mm-dialog-body { overscroll-behavior: contain; }
  .mm-dialog footer { position: sticky; bottom: 0; background: var(--cp-surface); flex-wrap: wrap; }
  .mm-button, .mm-icon, .mm-card-foot .mm-icon { min-height: 44px; min-width: 44px; }
  .mm-card { border-radius: 14px; }
  .mm-card-title { font-size: 13px; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .mobile-media-filters { flex-basis: 100%; border: 1px solid var(--cp-border); border-radius: 12px; padding-inline: 12px; }
  .mobile-media-filters > summary { min-height: 44px; padding: 12px 0; font-size: 14px; cursor: pointer; }
  .mobile-media-filters > div { display: grid; gap: 8px; padding-bottom: 12px; }
  .mobile-media-filters select { min-height: 48px; width: 100%; }
  .mm-card-foot .mm-actions { flex-wrap: wrap; }
  .mm-grid { gap: 10px; }
  .mm-tabs { max-width: 100%; overflow-x: auto; gap: 20px; justify-content: flex-start; }
  .mm-tabs button { min-height: 48px; font-size: 13px; }
  .mm-selection { flex-wrap: wrap; gap: 12px; }
  .mm-selection > .mm-actions { flex-wrap: wrap; }
  .mm-toolbar > select, .mm-search { min-height: 48px; }
  .mm-check { width: 44px; height: 44px; left: 2px; top: 2px; }
  .mm-heading .mm-actions { flex-wrap: wrap; }
  .circle-hero { padding: 18px; }
  .circle-hero-stats { gap: 16px; flex-wrap: wrap; }
  .circle-friend-card, .circle-request-card { min-width: 0; }
  .circle-friend-card button, .circle-request-card button { min-height: 44px; }
  .toast { bottom: calc(var(--mobile-nav-height) + 12px); left: 16px; right: 16px; width: auto; max-width: none; transform: translateY(12px); font-size: 14px; }
  .toast.is-visible { transform: translateY(0); }

  /* Sign-in and registration keep the same identity in a smaller, readable frame. */
  .auth-page .auth-layout { padding: calc(16px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
  .auth-topbar { align-items: center; flex-wrap: wrap; gap: 12px; }
  .auth-topbar .site-brand { flex: 1; }
  .auth-topbar .site-brand small { font-size: 10px; }
  .auth-topbar > a:not(.site-brand) { min-height: 44px; display: flex; align-items: center; margin: 0; font-size: 12px; }
  .auth-led-shell, body.login-page .auth-led-shell-login { width: 100%; margin: 24px auto; --auth-led-inset: 0px; }
  .auth-led-canvas-wrap, .auth-led-shell::before, .auth-led-shell::after { display: none; }
  .auth-led-shell-signup .auth-led-card, body.login-page .auth-led-shell .auth-led-card { padding: 24px 20px; border-radius: 22px; }
  .auth-main { width: 100%; margin: 24px auto; }
  .auth-main h1 { font-size: 29px; line-height: 1.15; }
  .auth-intro { font-size: 14px; line-height: 1.55; }
  .field { min-height: 50px; }
  .field-password-toggle, .auth-page button[type=submit], .signup-step-actions button { min-height: 48px; }
  .signup-progress { gap: 5px; }
  .signup-progress strong { font-size: 11px; }
  .signup-step-actions { gap: 8px; flex-wrap: wrap; }
  .signup-step-actions button { font-size: 14px; }
  .city-suggest-option { min-height: 48px; }
}
@media (max-width: 359px) {
  :root { --mobile-gutter: 12px; }
  .events-page .kiosk-section-head { flex-wrap: nowrap; }
  .events-page .event-results-summary { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; }
  .site-brand strong { font-size: 17px; }
  .site-brand img { width: 27px; height: 27px; }
  .site-header-inner { padding-inline: 8px; }
  .mobile-nav-link span { font-size: 10px; }
  .wall-post-reaction-picker { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
  .wall-post-reaction-picker button { width: 100%; font-size: 24px; }
  .profile-page .profile-sidebar-card .profile-avatar { width: 68px; height: 68px; }
  .profile-page .profile-sidebar-card h1 { font-size: 21px; }
  .event-attend-dialog, .event-create-dialog { padding-inline: 16px; }
  .event-create-dialog .event-create-head, .event-create-dialog .event-wizard-nav { margin-inline: -16px; padding-inline: 16px; }
  .mm-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 1023px) and (orientation: landscape) and (pointer: coarse) {
  :root { --mobile-header-height: calc(56px + env(safe-area-inset-top)); --mobile-nav-height: calc(56px + env(safe-area-inset-bottom)); }
  .site-header-inner { min-height: 56px; padding-block: 4px; }
  .mobile-nav-link { min-height: 44px; flex-direction: row; gap: 7px; }
  .mobile-nav-link span { font-size: 11px; }
  .event-detail-grid { grid-template-columns: minmax(180px,35%) minmax(0,1fr); gap: 24px; }
  .event-detail-art { width: 100%; }
  .event-create-dialog, .event-attend-dialog, .composer-type-modal-panel, .welcome-dialog { max-height: var(--mobile-vh,100dvh); border-radius: 0; }
  .event-create-dialog .event-create-head { position: static; }
  .event-detail-shell.is-joinable .event-detail-actions { bottom: var(--mobile-nav-height); }
  .auth-main { max-width: 540px; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-nav-link, .account-dropdown, .messenger-hub, .messenger-window { animation: none; transition: none; }
}

/* Keep the refined action strip comfortable on touch screens. */
@media (max-width:767px), (max-width:1023px) and (orientation:landscape) and (pointer:coarse){
 .wall-post-actions{grid-template-columns:minmax(0,1fr) auto 44px;column-gap:3px;padding:6px 8px}
 .wall-post-actions .wall-post-action{min-height:44px;padding:8px 7px;gap:6px;font-size:12px;border-radius:11px}
 .wall-post-actions .wall-post-action-bookmark{width:44px;padding:8px;justify-content:center}
 .wall-post-actions .wall-post-like-count,.wall-post-actions .wall-post-comment-count{padding-left:6px;font-size:11px}
 .wall-post-actions .wall-post-reaction-main{max-width:100%;min-width:0}
 .wall-post-actions .wall-post-reaction-main [data-reaction-label]{max-width:80px;min-width:0}
 .wall-post-actions .wall-post-reaction-main::after{flex-shrink:0;margin-left:0}
 .wall-post-actions .wall-post-reaction-emoji{min-width:18px;font-size:18px;flex-shrink:0}
}
@media(max-width:359px){
 .wall-post-actions{column-gap:2px;padding-inline:6px}
 .wall-post-actions .wall-post-action{padding-inline:5px;gap:4px;font-size:11px}
 .wall-post-actions .wall-post-reaction-main::after{display:none}
 .wall-post-actions .wall-post-like-count,.wall-post-actions .wall-post-comment-count{padding-left:4px}
}
@media (max-width:767px), (max-width:1023px) and (orientation:landscape) and (pointer:coarse){
 .events-page .kiosk-hero-title{font-size:22px}
 .events-page .kiosk-hero-lead{font-size:12px;line-height:1.4}
 .events-page .event-filters{grid-template-columns:minmax(0,1fr) 128px;gap:6px}
 .events-page .event-filter-search{grid-column:1;grid-row:1;min-height:44px;height:44px;padding-inline:9px}
 .events-page .event-filter-search input{font-size:16px}
 .events-page .event-filter-search input::placeholder{font-size:12px}
 .events-page .event-city-filter{grid-column:2;grid-row:1;min-height:44px;height:44px;padding-inline:8px}
 .events-page .event-city-filter select{font-size:16px}
 .events-page .event-city-filter svg{display:none}
 .events-page .event-filter-segments{grid-column:1/-1;grid-row:2;gap:3px}
 .events-page .event-filter-segments button{min-height:44px;padding-inline:6px}
}
