/* Wherapp r20. Shared mobile surfaces, typography and interaction states. */
:root {
  --ink:#192633; --muted:#586574; --surface:#fff; --surface-raised:#f3f5f8;
  --surface-accent:#edf1ff; --accent:#304dd5; --blue:#304dd5;
  --outline:#dce3eb; --line:#dce3eb; --soft:#f3f5f8;
  --on-accent:#fff; --map-bg:#eef2f5; --shadow:0 4px 18px #15283c16;
  --radius-control:14px; --radius-card:20px; --ease-out:cubic-bezier(.2,.8,.2,1);
  font-size:16px; text-rendering:optimizeLegibility;
}
html[data-theme=dark] {
  --ink:#edf3fa; --muted:#acb9cc; --surface:#111c2b; --surface-raised:#1b293c;
  --surface-accent:#253452; --accent:#bdccff; --blue:#bdccff;
  --outline:#35465e; --line:#35465e; --soft:#1b293c; --on-accent:#132655;
  --shadow:0 5px 20px #0004; --map-bg:#0b1420; background:#0b1420;
}
.phone-app {font-size:1rem;line-height:1.5}
button,input,select,textarea {font:inherit}
button {touch-action:manipulation}
button:disabled {cursor:default}
button:active:not(:disabled) {filter:none}
:is(button,a,summary,input,select,textarea):focus-visible {outline:3px solid var(--accent);outline-offset:3px}
.primary-action,.secondary-action {font-size:.9375rem;line-height:1.4;min-height:52px;border-radius:var(--radius-control);font-weight:700;box-shadow:none;gap:10px}
.primary-action {background:var(--accent);color:var(--on-accent);padding:14px 16px}
.primary-action svg {color:inherit;stroke:currentColor}
.secondary-action {color:var(--ink);background:var(--surface);border-color:var(--outline);padding:12px 16px}
.primary-action:active:not(:disabled) {transform:translateY(1px)}
.inline-link {font-size:.875rem;line-height:1.5;min-height:44px;padding:10px 0;color:var(--accent);font-weight:650;text-underline-offset:3px}
.round-button,.round-button.small {width:48px;height:48px;min-width:48px;border-radius:14px;background:var(--surface-raised);color:var(--ink)}
.events-footnote,.consent-note,.privacy-details p {font-size:.875rem;line-height:1.6;color:var(--muted)}
.dialog-notice {border:0;border-left:3px solid var(--accent);border-radius:4px 12px 12px 4px;background:var(--surface-accent);font-size:.875rem;line-height:1.55;padding:12px 14px;margin:16px 0;color:var(--ink)}
.dialog-notice button {flex-shrink:0}

/* One calm search bar, one navigation control. The map stays mounted. */
.mode-map .world-header {top:calc(12px + env(safe-area-inset-top));left:12px;right:12px;gap:0;padding:4px;background:var(--surface);border:1px solid var(--outline);border-radius:20px;box-shadow:var(--shadow);pointer-events:auto;min-height:56px}
.mode-map .world-header button {border:0;box-shadow:none;background:transparent;min-height:48px;height:48px;border-radius:14px;pointer-events:auto}
.mode-map .world-brand {width:48px;padding:7px;flex:0 0 48px;margin:0}
.mode-map .world-brand .brand-mark {transform:scale(.8)}
.mode-map .world-search {flex:1;min-width:0;margin:0;padding:0 10px;justify-content:flex-start;color:var(--muted);gap:10px;font-size:.9375rem;font-weight:600}
.mode-map .world-search span {display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mode-map .world-menu {width:48px;min-width:48px;padding:0;border-left:1px solid var(--outline);border-radius:0 14px 14px 0;color:var(--ink)}
.map-mode-switch {top:calc(80px + env(safe-area-inset-top));left:12px;right:12px;padding:4px;border-radius:18px;background:var(--surface);border-color:var(--outline);box-shadow:var(--shadow)}
.map-mode-switch>i {top:4px;bottom:4px;left:4px;width:calc((100% - 8px)/3);border-radius:13px;background:var(--surface-accent);transition:transform 180ms var(--ease-out)}
.map-mode-switch button {min-height:48px;padding:10px 3px;font-size:.875rem;font-weight:700;color:var(--muted);border-radius:13px}
.map-mode-switch [aria-selected=true] {color:var(--accent)}
.mode-map .world-simulation {top:calc(148px + env(safe-area-inset-top));left:12px;min-height:44px;padding:10px 12px;border-radius:14px;box-shadow:none;font-size:.8125rem;font-weight:650}
.mode-map .mode-context-action {top:calc(148px + env(safe-area-inset-top));left:12px;min-height:48px;max-width:calc(100% - 84px);font-size:.875rem;border-radius:16px}
.mode-map.is-simulation .mode-context-action {top:calc(204px + env(safe-area-inset-top))}
.mode-map .map-locate {top:calc(148px + env(safe-area-inset-top));right:12px;width:48px;height:48px;border-radius:16px}
.mode-map.is-simulation .map-locate {top:calc(204px + env(safe-area-inset-top))}
.mode-map .map-overview {top:calc(208px + env(safe-area-inset-top));right:12px;width:48px;height:48px;border-radius:16px}
.mode-map.is-simulation .map-overview {top:calc(264px + env(safe-area-inset-top))}
.mode-map .events-map-chip>b {border-radius:8px;min-width:25px;font-size:.875rem;background:var(--surface-accent);color:var(--accent)}
.map-mode-hint {left:30px;right:30px;bottom:calc(46px + env(safe-area-inset-bottom));font-size:.875rem;border-radius:16px;padding:12px 16px;box-shadow:var(--shadow);color:var(--ink)}
.mode-food-action {left:12px;right:12px;bottom:calc(38px + env(safe-area-inset-bottom));padding:14px;border-radius:20px;gap:12px;min-height:80px}
.mode-food-action .action-symbol {flex:0 0 44px;height:44px;display:grid;place-items:center;background:var(--surface-accent);border-radius:14px;color:var(--accent)}
.mode-food-action strong {display:block;font-size:1rem;font-weight:750;letter-spacing:-.3px}
.mode-food-action small {display:block;font-size:.8125rem;line-height:1.5;font-weight:500;color:var(--muted);margin-top:3px}
.mode-map .toast {top:auto;bottom:calc(140px + env(safe-area-inset-bottom));font-size:.875rem;border-radius:16px}

/* Consistent sheets. Close/back remain reachable while the contents scroll. */
.bottom-dialog {max-height:90dvh;border-radius:26px 26px 0 0;box-shadow:0 -8px 48px #06162b30;background:var(--surface);scroll-padding-top:88px;overflow-y:auto;overscroll-behavior:contain}
.bottom-dialog::backdrop {backdrop-filter:none;background:#07142466}
.bottom-dialog[open] {animation:sheet-enter 180ms var(--ease-out)}
.bottom-dialog .dialog-inner {padding:0 20px calc(24px + env(safe-area-inset-bottom))}
.bottom-dialog .dialog-header {position:sticky;top:0;z-index:8;min-height:78px;padding:14px 20px;margin:0 -20px 20px;background:var(--surface);border-bottom:1px solid var(--outline);gap:10px}
.bottom-dialog .dialog-header h2 {font-size:1.25rem;font-weight:800;line-height:1.35;letter-spacing:-.5px;margin:0;overflow-wrap:anywhere}
.bottom-dialog .dialog-header h2:focus {outline:none}
.bottom-dialog .dialog-back {width:44px;min-width:44px;background:transparent;margin-left:-10px}
.bottom-dialog .dialog-lead {font-size:1rem;line-height:1.6;margin-bottom:16px}
.bottom-dialog h3 {letter-spacing:-.35px}
.bottom-dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {font-size:1rem;min-height:48px;border-radius:12px;border-color:var(--outline);color:var(--ink);background:var(--surface-raised)}
.bottom-dialog .search-input {border:1px solid var(--outline);border-radius:14px;background:var(--surface-raised);min-height:54px}
.bottom-dialog .search-input input {background:transparent;min-height:52px}
.bottom-dialog .search-input input::placeholder {font-size:.9375rem;color:var(--muted)}
.appearance-options,.explore-tabs {gap:8px;margin:18px 0}
.appearance-options button,.explore-tabs button {border-radius:12px;min-height:48px;font-weight:650;font-size:.875rem}
.appearance-options button[aria-pressed=true],.explore-tabs button[aria-pressed=true] {border-color:var(--accent)}
.section-label {font-size:.75rem;letter-spacing:.08em;line-height:1.5}
.city-suggestions {padding:0 0 18px;border-bottom:1px solid var(--outline)}
.city-suggestions p {font-size:.8125rem}
.neighborhood-grid {gap:12px}
.neighborhood-card {border-radius:18px;box-shadow:none;background:var(--surface-raised)}
.neighborhood-card strong {font-size:1rem;line-height:1.4;letter-spacing:-.3px}
.neighborhood-card small {font-size:.8125rem}
.neighborhood-count {font-size:.8125rem}
.photo-credits-link {min-height:48px;font-size:.875rem}
.mode-map .smart-dock {left:12px;right:12px;padding:18px;border-radius:22px;box-shadow:var(--shadow);max-height:44dvh}
.smart-dock .dock-heading h1 {font-size:1.375rem;line-height:1.25;letter-spacing:-.55px}
.smart-dock .dock-heading p {font-size:.875rem;line-height:1.5;margin-top:6px}
.dock-explore,.dock-back {width:auto;min-width:44px;min-height:44px;border-radius:12px;box-shadow:none}
.dock-stats {font-size:.8125rem;line-height:1.5;gap:8px 12px}
.dock-actions {gap:10px;margin-top:12px}
.dock-actions button {border-radius:14px;min-height:60px}
.dock-actions small {font-size:.8125rem}
.zone-details {border-top:1px solid var(--outline);margin-top:12px}
.zone-details summary {font-size:.875rem;min-height:44px;color:var(--muted)}
.dock-foot {font-size:.8125rem;line-height:1.5}

/* Agenda: dates, refinements, then a scan-friendly image + title list. */
.weekly-events .events-intro {font-size:.875rem;margin:0 0 18px;color:var(--muted);line-height:1.6}
.weekly-events .event-days {gap:8px;padding-bottom:8px;margin:0 -2px 12px;scroll-padding-inline:4px;scrollbar-width:none}
.weekly-events .event-days::-webkit-scrollbar {display:none}
.weekly-events .event-days button {flex:0 0 58px;min-width:58px;min-height:88px;border-radius:16px;gap:5px;border-color:transparent;background:var(--surface-raised)}
.weekly-events .event-days small {font-size:.75rem;font-weight:600}
.weekly-events .event-days strong {font-size:1.25rem;font-weight:800}
.weekly-events .event-days button[aria-pressed=true] {background:var(--accent);color:var(--on-accent)}
.weekly-events .event-days button>.day-event-count {background:transparent;color:var(--muted);font-size:.75rem}
.weekly-events .event-days button>.day-event-count.has-events {background:var(--surface-accent);color:var(--accent)}
.weekly-events .event-days button[aria-pressed=true]>.day-event-count {background:transparent;color:inherit}
.weekly-events .events-filters {gap:6px;display:flex;flex-wrap:wrap;margin:6px 0 12px}
.weekly-events .events-filters button {border:1px solid var(--outline);border-radius:24px;min-height:44px;font-size:.8125rem;line-height:1.4;padding:10px;flex:1 1 auto;background:var(--surface);font-weight:650;color:var(--muted)}
.weekly-events .events-filters button[aria-pressed=true] {background:var(--surface-accent);border-color:var(--accent);color:var(--accent)}
.event-filter-options {border-top:1px solid var(--outline);padding:2px 0}
.event-filter-options summary {min-height:48px;font-size:.875rem;font-weight:600}
.events-results {margin:8px 0 4px}
.event-day-heading {font-size:1rem;font-weight:750;margin:22px 0 10px}
.event-day-heading>span {background:var(--surface-raised);border-radius:8px;min-width:26px;text-align:center;padding:2px 6px;font-weight:650}
.event-list {display:grid;gap:10px}
.event-list .event-row {background:var(--surface);border:1px solid var(--outline);border-radius:18px;padding:12px;gap:13px;min-height:116px;margin:0;text-align:left}
.event-list .event-row>span:nth-child(2) {min-width:0;flex:1}
.event-list .event-row strong {font-size:1rem;line-height:1.4;letter-spacing:-.2px;font-weight:750;margin:5px 0}
.event-list .event-row>span:nth-child(2)>small {font-size:.8125rem;font-weight:700;line-height:1.4}
.event-list .event-row>span:nth-child(2)>span:not(.saved-event-mark) {font-size:.8125rem;line-height:1.5;color:var(--muted)}
.event-list .event-row>svg:last-child {display:none}
.event-thumbnail {width:76px;height:100px;flex:0 0 76px;border-radius:12px;align-self:center}
.event-date-tile {width:76px;min-height:100px;flex:0 0 76px;border-radius:12px;background:var(--surface-raised);color:var(--accent)}
.events-map-action {padding-top:12px;margin-top:20px;background:var(--surface);box-shadow:0 -8px 12px var(--surface)}
.events-empty {padding:30px 18px;border-radius:18px;background:var(--surface-raised)}
.events-empty strong {display:block;font-size:1.125rem;line-height:1.4;margin:12px 0 8px}
.events-empty p {font-size:.9375rem;line-height:1.6}
.event-details>.event-artwork {margin:0 0 20px;padding:0;border:0}
.event-details>.event-artwork img {max-height:220px;border-radius:16px;object-fit:contain;background:var(--surface-raised)}
.event-artwork figcaption {font-size:.75rem;margin-top:6px}
.event-details h3 {font-size:1.625rem;font-weight:800;line-height:1.25;letter-spacing:-.7px;margin:10px 0 14px}
.event-details>p {font-size:.9375rem;line-height:1.6;margin-bottom:12px;color:var(--muted)}
.event-details>p strong {color:var(--ink)}
.event-response-actions {margin:8px 0;gap:10px}
.event-response-actions button {display:flex;align-items:center;justify-content:space-between;min-height:56px;font-size:.875rem;border-radius:14px;padding:12px;background:var(--surface-raised);font-weight:650}
.event-response-actions button b {font-size:1rem;font-variant-numeric:tabular-nums}
.event-response-actions button[aria-pressed=true] {color:var(--accent);border-color:var(--accent);background:var(--surface-accent)}
.event-details .event-actions {margin-top:20px}
.event-actions button {background:transparent;border:0;min-height:64px;padding:8px 4px;font-size:.8125rem}
.event-sources a {font-size:.875rem;min-height:48px}

/* Meals and profile use the same form rhythm; no clipped two-column selects. */
.food-welcome {padding:8px 0 22px;border-bottom:1px solid var(--outline)}
.welcome-symbol {display:grid;place-items:center;width:52px;height:52px;border-radius:17px;background:var(--surface-accent);color:var(--accent);margin-bottom:16px}
.food-panel .food-welcome h3 {font-size:1.5rem;font-weight:800;line-height:1.3;letter-spacing:-.6px;margin:0 0 10px}
.food-welcome>p {font-size:.9375rem;color:var(--muted);line-height:1.6;margin:0 0 20px;max-width:30ch}
.food-panel .meal-list-title {margin-top:22px;margin-bottom:10px}
.meal-list-title h3 {font-size:1.125rem;font-weight:750}
.food-panel .meal-filters {margin:0 0 12px;padding:0;border:0;background:none}
.meal-filters .meal-times {grid-template-columns:1fr 1fr;gap:10px}
.meal-filters label {display:grid;gap:6px;font-size:.8125rem;font-weight:600;color:var(--muted);min-width:0}
.meal-filters select {width:100%;min-width:0;padding:10px 8px;border:1px solid var(--outline);font-size:.875rem!important;min-height:48px}
.meal-form {border-radius:18px;background:var(--surface-raised);padding:16px;border:0;gap:18px}
.meal-form label {font-size:.875rem;gap:8px}
.meal-empty {padding:26px 12px;text-align:center;color:var(--muted)}
.meal-empty>svg {color:var(--accent)}
.meal-empty h4 {font-size:1rem;line-height:1.4;font-weight:750;color:var(--ink);margin:12px 0 8px}
.meal-empty p {font-size:.875rem;line-height:1.6;margin:0;max-width:31ch;margin-inline:auto}
.meal-poll {background:var(--surface);padding:16px;border-radius:18px}
.food-info {border-top:1px solid var(--outline);margin-top:18px;padding-top:4px}
.food-info summary {min-height:48px;font-weight:600;font-size:.875rem}
.bottom-dialog .profile-panel>.meal-form {padding:0;border:0;background:none}
.bottom-dialog .profile-heading {padding:16px;border-radius:20px;background:var(--surface-raised);gap:14px;margin:0 0 20px}
.bottom-dialog .profile-heading h3 {font-size:1.25rem;margin:0;line-height:1.4}
.bottom-dialog .profile-heading p {font-size:.8125rem;color:var(--muted);line-height:1.5;margin-top:4px}
.bottom-dialog .profile-qr-actions {gap:10px}
.bottom-dialog .profile-qr-actions button {min-height:56px;font-size:.875rem;margin:0}
.bottom-dialog .friend-card {background:var(--surface-raised);border:0;border-radius:18px}
.bottom-dialog .friend-qr {padding:20px;border-radius:18px;background:var(--surface-raised);text-align:center}
.bottom-dialog .friend-qr img {max-width:100%;height:auto;border-radius:12px}
.bottom-dialog .friend-qr p {font-size:.875rem;line-height:1.5;color:var(--muted);margin:12px 0}
.bottom-dialog .friend-qr .inline-link {margin:0 10px}

/* Personal menu: profile first; secondary tools grouped below. */
.menu-links {margin:0 0 20px}
.menu-links button {min-height:60px;padding:10px 4px;font-size:.9375rem;font-weight:600;border-color:var(--outline);gap:14px}
.menu-links button>svg:first-child {color:var(--muted)}
.menu-links button>svg:last-child {width:17px;color:var(--muted)}
.menu-links .menu-profile {border:1px solid var(--outline);background:var(--surface-raised);border-radius:20px;padding:16px;min-height:92px;gap:12px}
.menu-profile .menu-symbol {width:48px;height:48px;flex:0 0 48px;display:grid;place-items:center;border-radius:16px;background:var(--surface-accent);color:var(--accent)}
.menu-profile>span:nth-child(2) {flex:1;min-width:0}
.menu-profile strong {display:block;font-size:1.0625rem;letter-spacing:-.3px;font-weight:750}
.menu-profile small {display:block;font-size:.8125rem;color:var(--muted);line-height:1.5;margin-top:4px;font-weight:500}
.menu-label {font-size:.75rem;text-transform:uppercase;letter-spacing:.08em;font-weight:750;color:var(--muted);margin:24px 0 6px}
.bottom-dialog .mode-toolbar {margin:22px 0 12px}
.mode-switch {border-radius:15px;background:var(--surface-raised)}
.mode-switch button {min-height:48px;font-size:.875rem;border-radius:11px}
.release-note {font-size:.75rem;letter-spacing:.02em;margin-top:24px}

@media(max-width:360px) {
  .mode-map .world-header,.map-mode-switch {left:10px;right:10px}
  .map-mode-switch button {font-size:.8125rem}
  .mode-map .world-search {font-size:.875rem;padding-inline:6px;gap:7px}
  .bottom-dialog .dialog-inner {padding-inline:16px}
  .bottom-dialog .dialog-header {margin-inline:-16px;padding-inline:16px}
  .event-thumbnail,.event-date-tile {width:66px;flex-basis:66px}
  .event-list .event-row {gap:10px;padding:10px}
  .food-welcome h3 {font-size:1.375rem}
}
@media(max-height:640px) {
  .bottom-dialog,.bottom-dialog:has(.weekly-events) {max-height:100dvh;border-radius:0}
  .bottom-dialog .dialog-header {min-height:68px;padding-block:10px;margin-bottom:16px}
  .mode-map .smart-dock {max-height:48dvh;padding:14px}
}
@media(prefers-reduced-motion:reduce) {
  .map-mode-switch>i,.bottom-dialog[open],.primary-action {animation:none!important;transition:none!important;transform:none}
  /* Keep the selected tab positioned; only its travel is disabled. */
  .map-mode-switch>i {transform:translateX(calc(var(--mode-index)*100%))}
}
