:root {
  --bg: #f4f6f8;
  --surface: rgba(255,255,255,.94);
  --surface-solid: #fff;
  --surface-soft: #eef2f5;
  --text: #101827;
  --muted: #687386;
  --line: rgba(15,23,42,.10);
  --primary: #715cff;
  --primary-dark: #5743e4;
  --secondary: #1bc7b1;
  --navy: #0f172a;
  --navy-2: #17233c;
  --success: #15845f;
  --warning: #d68b16;
  --danger: #d84646;
  --shadow: 0 18px 50px rgba(15,23,42,.10);
  --shadow-sm: 0 8px 24px rgba(15,23,42,.07);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; width:100%; max-width:100%; background: var(--bg); overflow-x:clip; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 5% -10%, rgba(27,199,177,.12), transparent 32rem),
    radial-gradient(circle at 95% 0%, rgba(113,92,255,.12), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  width:100%;
  max-width:100%;
  overflow-x:clip;
}
#app { min-height:100vh; min-height:100dvh; width:100%; max-width:100%; overflow-x:clip; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

.app-loader {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 32px;
}
.loader-card { text-align: center; color: var(--muted); }
.loader-mark { width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 22px; background: var(--navy); color: white; display: grid; place-items: center; font-size: 28px; animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-4px) scale(1.03); box-shadow: 0 18px 35px rgba(15,23,42,.18); } }

/* Auth */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0,1.08fr) minmax(420px,.92fr); }
.auth-visual { position: relative; padding: clamp(36px,6vw,82px); background: var(--navy); color: white; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.auth-visual::before,.auth-visual::after { content:""; position:absolute; border-radius:50%; filter: blur(2px); }
.auth-visual::before { width: 560px; height: 560px; right: -220px; top: -200px; background: linear-gradient(145deg,rgba(27,199,177,.55),rgba(27,199,177,.05)); }
.auth-visual::after { width: 420px; height: 420px; left: -180px; bottom: -190px; background: linear-gradient(145deg,rgba(113,92,255,.52),rgba(113,92,255,.05)); }
.brand-lockup { position:relative; z-index:2; display:flex; align-items:center; gap:13px; font-weight:900; font-size:22px; letter-spacing:-.04em; }
.brand-mark { width:48px; height:48px; border-radius:17px; background:linear-gradient(145deg,var(--primary),#2dd7c0); display:grid; place-items:center; box-shadow:0 14px 34px rgba(113,92,255,.32); }
.brand-mark svg { width:27px; height:27px; }
.auth-copy { position:relative; z-index:2; max-width:680px; padding:70px 0; }
.auth-copy h1 { font-size:clamp(48px,6.6vw,92px); line-height:.92; letter-spacing:-.075em; margin:0 0 26px; }
.auth-copy p { margin:0; max-width:560px; color:rgba(255,255,255,.70); font-size:clamp(16px,1.5vw,20px); line-height:1.6; }
.feature-strip { position:relative; z-index:2; display:flex; flex-wrap:wrap; gap:10px; }
.feature-chip { padding:10px 13px; border-radius:999px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.10); color:rgba(255,255,255,.82); font-size:12px; font-weight:750; }
.auth-panel { min-height:100%; padding:calc(30px + var(--safe-top)) clamp(24px,5vw,76px) calc(32px + var(--safe-bottom)); display:grid; place-items:center; }
.auth-card { width:min(100%,490px); }
.mobile-brand { display:none; margin-bottom:30px; }
.auth-card h2 { font-size:38px; letter-spacing:-.055em; margin:0 0 10px; }
.auth-card > p { color:var(--muted); margin:0 0 28px; line-height:1.55; }
.auth-tabs { display:grid; grid-template-columns:1fr 1fr; background:#e9edf1; border-radius:15px; padding:4px; margin-bottom:20px; }
.auth-tab { height:43px; border-radius:12px; background:transparent; color:var(--muted); font-weight:800; }
.auth-tab.active { background:white; color:var(--text); box-shadow:0 3px 10px rgba(15,23,42,.08); }
.form-stack { display:grid; gap:14px; }
.field { display:grid; gap:7px; }
.field label { font-size:12px; font-weight:850; color:#455166; }
.field input,.field select,.field textarea { width:100%; border:1px solid var(--line); outline:none; border-radius:15px; background:var(--surface-solid); min-height:52px; padding:0 15px; color:var(--text); transition:.18s border,.18s box-shadow; }
.field textarea { min-height:105px; padding-top:13px; resize:vertical; }
.field input:focus,.field select:focus,.field textarea:focus { border-color:rgba(27,199,177,.72); box-shadow:0 0 0 4px rgba(27,199,177,.11); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.password-wrap { position:relative; }
.password-wrap input { padding-right:48px; }
.password-toggle { position:absolute; right:8px; top:8px; width:36px; height:36px; border-radius:11px; background:var(--surface-soft); }
.btn { min-height:52px; white-space:nowrap; border-radius:15px; padding:0 18px; display:inline-flex; align-items:center; justify-content:center; gap:10px; font-weight:850; transition:.16s transform,.16s filter; }
.btn svg { width:18px; height:18px; flex:none; }
.btn:hover { filter:brightness(.985); }
.btn:active { transform:scale(.985); }
.btn-primary { background:var(--navy); color:white; box-shadow:0 12px 24px rgba(15,23,42,.15); }
.btn-accent { background:var(--primary); color:white; box-shadow:0 12px 24px rgba(113,92,255,.20); }
.btn-soft { background:var(--surface-soft); color:var(--text); }
.btn-white { background:white; color:var(--text); border:1px solid var(--line); }
.btn-danger { background:#fff0f0; color:var(--danger); }
.btn-sm { min-height:40px; padding:0 13px; border-radius:12px; font-size:12px; }
.btn-block { width:100%; }
.google-btn svg { width:20px; height:20px; }
.divider { display:flex; align-items:center; gap:12px; color:#9aa3b2; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; margin:4px 0; }
.divider::before,.divider::after { content:""; height:1px; background:var(--line); flex:1; }
.text-link { border:0; padding:0; background:transparent; color:#1d6f89; font-weight:800; font-size:13px; }
.demo-notice { margin-top:18px; padding:14px; border-radius:15px; background:#fff7df; border:1px solid #f2df9c; color:#795b10; font-size:12px; line-height:1.5; }

/* Main application */
.layout { min-height:100vh; min-height:100dvh; width:100%; max-width:100%; min-width:0; display:grid; grid-template-columns:250px minmax(0,1fr); overflow-x:clip; }
.sidebar { position:sticky; top:0; height:100vh; height:100dvh; padding:calc(22px + var(--safe-top)) 16px calc(18px + var(--safe-bottom)); background:rgba(15,23,42,.97); color:white; display:flex; flex-direction:column; z-index:50; }
.sidebar .brand-lockup { font-size:20px; padding:0 8px 24px; }
.sidebar .brand-mark { width:42px; height:42px; border-radius:15px; }
.side-nav { display:grid; gap:6px; }
.side-link { min-height:48px; width:100%; border-radius:14px; padding:0 13px; background:transparent; color:rgba(255,255,255,.58); display:flex; align-items:center; gap:12px; text-align:left; font-weight:750; }
.side-link svg { width:20px; height:20px; flex:none; }
.side-link.active,.side-link:hover { color:white; background:rgba(255,255,255,.09); }
.side-spacer { flex:1; }
.user-mini { display:flex; align-items:center; gap:10px; padding:12px 8px 0; border-top:1px solid rgba(255,255,255,.10); }
.avatar { width:40px; height:40px; flex:none; border-radius:14px; background:linear-gradient(145deg,var(--secondary),#57d9ca); color:white; display:grid; place-items:center; font-weight:900; overflow:hidden; }
.avatar img { width:100%; height:100%; object-fit:cover; }
.user-mini strong { display:block; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:130px; }
.user-mini span { display:block; font-size:10px; color:rgba(255,255,255,.48); margin-top:2px; }
.main { width:100%; max-width:100%; min-width:0; padding:calc(28px + var(--safe-top)) clamp(22px,4vw,58px) calc(52px + var(--safe-bottom)); overflow-x:clip; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:28px; }
.page-heading small { color:var(--muted); font-weight:800; font-size:12px; text-transform:uppercase; letter-spacing:.08em; }
.page-heading h1 { margin:5px 0 0; font-size:clamp(31px,4vw,48px); line-height:1; letter-spacing:-.06em; }
.top-actions { display:flex; align-items:center; gap:9px; }
.icon-button { width:47px; height:47px; border-radius:15px; background:var(--surface); border:1px solid var(--line); display:grid; place-items:center; color:var(--text); box-shadow:0 5px 18px rgba(15,23,42,.04); }
.icon-button svg { width:20px; height:20px; }
.mobile-menu { display:none; }

.content { width:100%; max-width:1420px; min-width:0; margin:0 auto; overflow-x:clip; }
.stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
.stat-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); padding:19px; box-shadow:var(--shadow-sm); }
.stat-top { display:flex; align-items:center; justify-content:space-between; }
.stat-icon { width:42px; height:42px; border-radius:14px; display:grid; place-items:center; background:#e9f8f5; color:#087f72; }
.stat-icon svg { width:20px; height:20px; }
.stat-card strong { display:block; font-size:27px; letter-spacing:-.04em; margin-top:17px; }
.stat-card span { color:var(--muted); font-size:12px; font-weight:700; }

.section-head { display:flex; align-items:end; justify-content:space-between; gap:16px; margin:28px 0 14px; }
.section-head h2 { margin:0; font-size:22px; letter-spacing:-.04em; }
.section-head p { margin:4px 0 0; color:var(--muted); font-size:13px; }
.section-head > *, .topbar > *, .stats-grid > * { min-width:0; max-width:100%; }
.filter-row { display:flex; width:100%; max-width:100%; min-width:0; gap:8px; overflow-x:auto; overflow-y:hidden; overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch; scrollbar-width:none; padding-bottom:3px; }
.filter-row::-webkit-scrollbar { display:none; }
.filter-chip { min-height:38px; padding:0 14px; border-radius:999px; background:var(--surface); color:var(--muted); border:1px solid var(--line); white-space:nowrap; font-size:12px; font-weight:820; }
.filter-chip.active { background:var(--navy); color:white; border-color:var(--navy); }

.trip-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.trip-card { min-height:320px; position:relative; border-radius:28px; overflow:hidden; color:white; box-shadow:var(--shadow); cursor:pointer; isolation:isolate; background:#27364f; }
.trip-card::after { content:""; position:absolute; inset:0; background:linear-gradient(to top,rgba(7,12,25,.88) 0%,rgba(7,12,25,.22) 58%,rgba(7,12,25,.08) 100%); z-index:-1; }
.trip-cover { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; transition:.35s transform; }
.trip-card:hover .trip-cover { transform:scale(1.035); }
.trip-card-body { height:100%; min-height:320px; padding:20px; display:flex; flex-direction:column; }
.trip-card-top { display:flex; justify-content:space-between; gap:10px; }
.trip-state { min-height:31px; padding:0 11px; border-radius:999px; display:inline-flex; align-items:center; background:rgba(255,255,255,.15); backdrop-filter:blur(12px); font-size:10px; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.trip-emoji { width:42px; height:42px; border-radius:14px; background:rgba(255,255,255,.17); backdrop-filter:blur(12px); display:grid; place-items:center; font-size:21px; }
.trip-card-content { margin-top:auto; }
.trip-card h3 { margin:0 0 7px; font-size:27px; letter-spacing:-.055em; line-height:1.02; }
.trip-card p { margin:0; color:rgba(255,255,255,.72); font-size:12px; }
.trip-progress { height:5px; border-radius:999px; background:rgba(255,255,255,.18); margin:16px 0 9px; overflow:hidden; }
.trip-progress > i { display:block; height:100%; border-radius:inherit; background:white; }
.trip-card-foot { display:flex; align-items:center; justify-content:space-between; color:rgba(255,255,255,.78); font-size:11px; font-weight:750; }
.avatar-stack { display:flex; }
.avatar-stack .avatar { width:29px; height:29px; border-radius:10px; border:2px solid rgba(15,23,42,.6); margin-left:-7px; font-size:10px; }
.avatar-stack .avatar:first-child { margin-left:0; }
.new-trip-card { min-height:320px; border-radius:28px; border:2px dashed rgba(15,23,42,.14); background:rgba(255,255,255,.55); display:grid; place-items:center; text-align:center; padding:28px; color:var(--muted); }
.new-trip-card:hover { border-color:rgba(27,199,177,.5); background:white; }
.new-trip-icon { width:65px; height:65px; border-radius:22px; display:grid; place-items:center; margin:0 auto 14px; background:#e9f8f5; color:#087f72; }
.new-trip-icon svg { width:28px; height:28px; }
.new-trip-card strong { display:block; color:var(--text); font-size:17px; }
.new-trip-card span { display:block; font-size:12px; margin-top:6px; line-height:1.5; }

.empty-state { min-height:340px; border:1px dashed rgba(15,23,42,.16); border-radius:28px; background:rgba(255,255,255,.55); display:grid; place-items:center; padding:36px; text-align:center; }
.empty-state .empty-icon { width:74px; height:74px; border-radius:24px; background:#e9f8f5; color:#087f72; display:grid; place-items:center; margin:0 auto 17px; }
.empty-state .empty-icon svg { width:32px; height:32px; }
.empty-state h3 { margin:0 0 8px; font-size:23px; letter-spacing:-.04em; }
.empty-state p { margin:0 auto 20px; max-width:450px; color:var(--muted); line-height:1.55; font-size:13px; }

/* Trip dashboard */
.trip-hero { position:relative; min-height:330px; color:white; border-radius:32px; overflow:hidden; padding:26px; display:flex; flex-direction:column; isolation:isolate; box-shadow:var(--shadow); }
.trip-hero::after { content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(100deg,rgba(7,12,25,.88),rgba(7,12,25,.35) 72%,rgba(7,12,25,.10)); }
.trip-hero-cover { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; }
.trip-hero-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.breadcrumb { display:flex; align-items:center; gap:8px; font-size:12px; color:rgba(255,255,255,.72); font-weight:750; }
.hero-action { background:rgba(255,255,255,.14); color:white; border:1px solid rgba(255,255,255,.15); backdrop-filter:blur(12px); }
.trip-hero-content { margin-top:auto; max-width:760px; }
.trip-hero h1 { margin:0 0 10px; font-size:clamp(40px,6vw,72px); letter-spacing:-.07em; line-height:.94; }
.trip-hero p { margin:0; color:rgba(255,255,255,.72); line-height:1.5; max-width:660px; }
.trip-meta { display:flex; flex-wrap:wrap; gap:9px; margin-top:20px; }
.meta-pill { min-height:37px; padding:0 13px; border-radius:999px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.10); display:inline-flex; align-items:center; gap:7px; font-size:11px; font-weight:820; backdrop-filter:blur(10px); }
.meta-pill svg { width:16px; height:16px; }
.module-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; }
.module-card { min-height:172px; padding:18px; background:var(--surface); border:1px solid var(--line); border-radius:24px; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; text-align:left; }
.module-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.module-icon { width:47px; height:47px; border-radius:16px; display:grid; place-items:center; }
.module-icon svg { width:23px; height:23px; }
.module-card h3 { margin:16px 0 4px; font-size:17px; letter-spacing:-.035em; }
.module-card p { margin:0; color:var(--muted); font-size:11px; line-height:1.45; }
.module-foot { display:flex; align-items:center; justify-content:space-between; margin-top:auto; padding-top:13px; color:var(--muted); font-size:11px; font-weight:830; }
.module-card:nth-child(5n+1) .module-icon { background:#ffecec; color:#d74343; }
.module-card:nth-child(5n+2) .module-icon { background:#e9f8f5; color:#0d8175; }
.module-card:nth-child(5n+3) .module-icon { background:#edf0fb; color:#5569b7; }
.module-card:nth-child(5n+4) .module-icon { background:#fff3dc; color:#b57a13; }
.module-card:nth-child(5n) .module-icon { background:#f3eafa; color:#8053a2; }

/* Module lists */
.module-toolbar { display:flex; gap:10px; align-items:center; margin-bottom:15px; }
.search-box { min-height:49px; flex:1; background:var(--surface); border:1px solid var(--line); border-radius:15px; padding:0 14px; display:flex; align-items:center; gap:9px; }
.search-box svg { width:18px; height:18px; color:var(--muted); }
.search-box input { flex:1; min-width:0; border:0; outline:0; background:transparent; }
.card-list { display:grid; gap:11px; }
.item-card { background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:15px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:13px; align-items:center; box-shadow:0 5px 18px rgba(15,23,42,.035); }
.item-card.clickable { cursor:pointer; }
.item-check { width:43px; height:43px; border-radius:14px; border:1.5px solid rgba(15,23,42,.15); background:white; display:grid; place-items:center; color:white; }
.item-check.done { background:var(--success); border-color:var(--success); }
.item-main { min-width:0; }
.item-title { font-size:15px; font-weight:850; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-card.completed .item-title { text-decoration:line-through; color:var(--muted); }
.item-sub { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.tag { min-height:24px; padding:0 8px; border-radius:999px; display:inline-flex; align-items:center; background:var(--surface-soft); color:#667083; font-size:9px; font-weight:850; text-transform:uppercase; letter-spacing:.04em; }
.tag.accent { background:#ffe9e9; color:#c84242; }
.tag.success { background:#e4f3ed; color:#18785a; }
.item-menu { width:39px; height:39px; border-radius:12px; background:var(--surface-soft); display:grid; place-items:center; color:var(--muted); }
.item-menu svg { width:18px; height:18px; }

.city-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.city-card { min-height:220px; border-radius:25px; overflow:hidden; color:white; position:relative; padding:18px; display:flex; flex-direction:column; isolation:isolate; cursor:pointer; background:#394968; }
.city-card::after { content:""; position:absolute; inset:0; background:linear-gradient(to top,rgba(7,12,25,.88),rgba(7,12,25,.12)); z-index:-1; }
.city-card img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; }
.city-card h3 { margin:auto 0 4px; font-size:25px; letter-spacing:-.05em; }
.city-card p { margin:0; font-size:11px; color:rgba(255,255,255,.72); }
.city-card .city-count { align-self:flex-start; background:rgba(255,255,255,.15); backdrop-filter:blur(10px); padding:8px 10px; border-radius:999px; font-size:10px; font-weight:850; }

.photo-grid { columns:4 220px; column-gap:11px; }
.photo-card { break-inside:avoid; margin-bottom:11px; position:relative; border-radius:19px; overflow:hidden; background:#dfe4e8; cursor:pointer; }
.photo-card img { width:100%; height:auto; }
.photo-overlay { position:absolute; inset:auto 0 0; padding:42px 12px 11px; background:linear-gradient(transparent,rgba(7,12,25,.78)); color:white; font-size:11px; }

.expense-summary { display:grid; grid-template-columns:1.3fr .7fr; gap:14px; margin-bottom:16px; }
.balance-panel,.total-panel { border-radius:25px; padding:21px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-sm); }
.total-panel { color:white; background:linear-gradient(145deg,var(--navy),#263856); border:0; }
.total-panel small { color:rgba(255,255,255,.58); font-weight:800; }
.total-panel strong { display:block; font-size:34px; margin:10px 0 4px; letter-spacing:-.05em; }
.total-panel span { color:rgba(255,255,255,.65); font-size:11px; }
.balance-list { display:grid; gap:9px; margin-top:13px; }
.balance-row { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:12px; }
.balance-row b.positive { color:var(--success); }
.balance-row b.negative { color:var(--danger); }

.currency-card { max-width:720px; margin:0 auto; border-radius:30px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); padding:25px; }
.currency-fields { display:grid; grid-template-columns:1fr auto 1fr; gap:14px; align-items:end; }
.swap-btn { width:48px; height:48px; border-radius:16px; background:var(--navy); color:white; display:grid; place-items:center; margin-bottom:1px; }
.rate-info { margin-top:17px; padding-top:16px; border-top:1px solid var(--line); display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:11px; }

/* People / Admin */
.people-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.person-card { background:var(--surface); border:1px solid var(--line); border-radius:22px; padding:17px; display:flex; align-items:center; gap:12px; }
.person-card .avatar { width:50px; height:50px; border-radius:17px; }
.person-card strong { display:block; font-size:14px; }
.person-card span { color:var(--muted); font-size:11px; }
.role-select { margin-left:auto; min-height:38px; border-radius:11px; border:1px solid var(--line); background:white; padding:0 8px; font-size:11px; font-weight:750; }
.admin-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; }
.admin-grid > * { min-width:0; max-width:100%; }
.table-scroll { width:100%; max-width:100%; min-width:0; overflow-x:auto; overflow-y:hidden; overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch; border-radius:20px; }
.data-table { width:100%; border-collapse:collapse; background:var(--surface); border-radius:20px; overflow:hidden; box-shadow:var(--shadow-sm); }
.data-table th,.data-table td { padding:12px 14px; border-bottom:1px solid var(--line); text-align:left; font-size:12px; }
.data-table th { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.06em; }

/* Modal */
.modal-backdrop { position:fixed; inset:0; z-index:100; background:rgba(7,12,25,.52); backdrop-filter:blur(5px); display:flex; align-items:center; justify-content:center; padding:20px; overflow-y:auto; overscroll-behavior:contain; animation:fadeIn .16s ease; }
.modal { width:min(100%,660px); max-height:calc(100dvh - 40px); overflow:auto; scrollbar-gutter:stable; background:#f8fafb; border-radius:28px; padding:22px; box-shadow:0 30px 80px rgba(7,12,25,.32); animation:slideUp .2s ease; }
.modal.wide { width:min(100%,900px); }
.modal.trip-editor { width:min(100%,760px); }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:20px; }
.modal-head h2 { margin:0; font-size:25px; letter-spacing:-.045em; }
.modal-head p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.modal-head > .close-modal { width:42px; height:42px; min-width:42px; flex:none; padding:0; border-radius:14px; background:var(--surface-soft); display:grid; place-items:center; font-size:22px; line-height:1; }
.modal-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:20px; }
.modal.trip-editor .modal-actions { position:sticky; z-index:3; bottom:-22px; margin:20px -22px -22px; padding:16px 22px 22px; background:linear-gradient(to bottom,rgba(248,250,251,.76),#f8fafb 28%); border-top:1px solid rgba(15,23,42,.06); }
.field small { color:var(--muted); font-size:11px; line-height:1.45; }
.field input[type="file"] { height:auto; min-height:54px; padding:7px 9px; color:var(--muted); }
.field input[type="file"]::file-selector-button { min-height:38px; margin-right:12px; padding:0 13px; border:0; border-radius:11px; background:var(--surface-soft); color:var(--text); font-weight:800; cursor:pointer; }
.wizard-steps { display:flex; gap:8px; margin-bottom:18px; }
.wizard-step { height:5px; border-radius:999px; flex:1; background:#dde3e8; }
.wizard-step.active { background:var(--secondary); }
.color-options { display:flex; flex-wrap:wrap; gap:10px; }
.color-dot { width:38px; height:38px; border-radius:13px; border:3px solid transparent; box-shadow:inset 0 0 0 1px rgba(0,0,0,.06); }
.color-dot.active { border-color:white; outline:2px solid var(--navy); }
.emoji-options { display:flex; flex-wrap:wrap; gap:8px; }
.emoji-option { width:43px; height:43px; border-radius:13px; background:white; border:1px solid var(--line); font-size:20px; }
.emoji-option.active { background:var(--navy); }
.member-checks { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.member-check { display:flex; gap:9px; align-items:center; min-height:43px; border-radius:13px; padding:0 11px; background:white; border:1px solid var(--line); font-size:12px; font-weight:750; }

.toast-root { position:fixed; z-index:200; right:18px; bottom:18px; display:grid; gap:9px; pointer-events:none; }
.toast { min-width:250px; max-width:390px; padding:14px 16px; border-radius:15px; background:var(--navy); color:white; box-shadow:0 18px 45px rgba(7,12,25,.24); font-size:12px; font-weight:700; animation:toastIn .2s ease; }
.toast.error { background:#9e3232; }
.toast.success { background:#136c52; }
@keyframes toastIn { from { transform:translateY(10px); opacity:0; } }
@keyframes fadeIn { from { opacity:0; } }
@keyframes slideUp { from { transform:translateY(20px); opacity:.5; } }

.banner { display:flex; align-items:center; justify-content:space-between; gap:13px; padding:15px 17px; border-radius:18px; margin-bottom:18px; background:#fff7dc; border:1px solid #efd88f; color:#725910; }
.banner strong { display:block; font-size:13px; }
.banner span { display:block; font-size:11px; margin-top:3px; line-height:1.45; }
.offline-pill { position:fixed; z-index:80; left:50%; transform:translateX(-50%); bottom:calc(18px + var(--safe-bottom)); padding:10px 14px; border-radius:999px; background:#7a3d12; color:white; font-size:11px; font-weight:800; box-shadow:var(--shadow); }

.mobile-bottom { display:none; }

@media (max-width:1180px) {
  .trip-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .module-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .people-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:900px) {
  .auth-shell { grid-template-columns:1fr; }
  .auth-visual { display:none; }
  .auth-panel { padding-top:calc(24px + var(--safe-top)); }
  .mobile-brand { display:flex; }
  .layout { display:block; }
  .sidebar { position:fixed; inset:0 auto 0 0; width:270px; transform:translateX(-105%); transition:.22s transform; box-shadow:25px 0 60px rgba(7,12,25,.28); }
  .sidebar.open { transform:translateX(0); }
  .mobile-menu { display:grid; }
  .main { padding-left:18px; padding-right:18px; padding-bottom:calc(100px + var(--safe-bottom)); }
  .module-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .city-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .expense-summary { grid-template-columns:1fr; }
  .admin-grid { grid-template-columns:1fr; }
  .mobile-bottom { position:fixed; display:grid; grid-template-columns:repeat(var(--mobile-nav-count,4),minmax(0,1fr)); z-index:45; left:50%; right:auto; width:min(calc(100vw - 24px),560px); max-width:calc(100vw - 24px); transform:translateX(-50%); bottom:calc(10px + var(--safe-bottom)); min-height:68px; border-radius:22px; padding:6px; overflow:hidden; contain:layout paint; background:rgba(255,255,255,.94); border:1px solid rgba(15,23,42,.10); backdrop-filter:blur(16px); box-shadow:0 18px 42px rgba(15,23,42,.14); }
  .mobile-nav-btn { min-width:0; min-height:54px; padding:4px 2px; border-radius:17px; background:transparent; color:var(--muted); display:grid; place-items:center; align-content:center; gap:2px; font-size:9px; font-weight:800; }
  .mobile-nav-btn span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .mobile-nav-btn svg { width:21px; height:21px; }
  .mobile-nav-btn.active { background:var(--navy); color:white; }
}
@media (max-width:620px) {
  .auth-panel { padding-left:18px; padding-right:18px; }
  .auth-card h2 { font-size:32px; }
  .topbar { flex-wrap:wrap; gap:14px; margin-bottom:22px; }
  .topbar > div:first-child { min-width:0; flex:1 1 210px; }
  .top-actions { flex:1 1 100%; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
  .top-actions .btn { min-height:44px; padding-left:13px; padding-right:13px; }
  .page-heading { min-width:0; }
  .page-heading h1 { overflow-wrap:anywhere; }
  .section-head { align-items:flex-start; flex-direction:column; gap:10px; }
  .section-head > .btn,.section-head > button { width:100%; }
  .module-toolbar { align-items:stretch; flex-direction:column; }
  .module-toolbar > .btn { width:100%; }
  .trip-hero-top { align-items:stretch; flex-direction:column; }
  .trip-hero-top .hero-action { width:100%; }
  .modal-actions { display:grid; grid-template-columns:1fr; }
  .modal-actions .btn { width:100%; }
  .banner { align-items:flex-start; flex-direction:column; }
  .banner .btn { width:100%; }
  .person-card { align-items:flex-start; flex-wrap:wrap; }
  .person-card > div:not(.avatar) { min-width:0; flex:1; }
  .role-select { width:100%; margin-left:0; }
  .rate-info { flex-direction:column; }
  .filter-chip { flex:none; }
  .item-card { grid-template-columns:auto minmax(0,1fr) auto; gap:10px; padding:13px; }
  .main { padding-left:14px; padding-right:14px; }
  .form-row { grid-template-columns:1fr; }
  .topbar { align-items:flex-start; }
  .page-heading h1 { font-size:34px; }
  .top-actions .desktop-label { display:none; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-card { padding:15px; }
  .stat-card strong { font-size:23px; }
  .trip-grid { grid-template-columns:1fr; }
  .trip-card,.new-trip-card { min-height:290px; }
  .trip-card-body { min-height:290px; }
  .trip-hero { min-height:380px; padding:20px; border-radius:27px; }
  .trip-hero h1 { font-size:43px; }
  .module-grid { gap:10px; }
  .module-card { min-height:158px; padding:15px; border-radius:21px; }
  .module-card h3 { font-size:15px; }
  .city-grid { grid-template-columns:1fr; }
  .people-grid { grid-template-columns:1fr; }
  .photo-grid { columns:2 140px; }
  .currency-fields { grid-template-columns:1fr; }
  .swap-btn { margin:0 auto; transform:rotate(90deg); }
  .member-checks { grid-template-columns:1fr; }
  .modal-backdrop { align-items:flex-end; padding:0; }
  .modal { width:100%; max-height:93dvh; scrollbar-gutter:auto; border-radius:28px 28px 0 0; padding:20px; }
  .modal.trip-editor .modal-actions { bottom:-20px; margin:20px -20px -20px; padding:15px 20px calc(20px + var(--safe-bottom)); }
  .toast-root { left:14px; right:14px; bottom:calc(92px + var(--safe-bottom)); }
  .toast { min-width:0; max-width:none; }
}

@media (max-width:380px) {
  .mobile-bottom { left:50%; right:auto; width:calc(100vw - 16px); max-width:calc(100vw - 16px); padding:5px; }
  .mobile-nav-btn { font-size:8px; }
  .mobile-nav-btn svg { width:19px; height:19px; }
  .stats-grid { grid-template-columns:1fr; }
  .module-grid { grid-template-columns:1fr; }
  .page-heading h1 { font-size:29px; }
  .trip-hero h1 { font-size:37px; }
}

@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; scroll-behavior:auto!important; transition-duration:.01ms!important; } }

/* WayGather identity refinements */
.brand-mark { position:relative; isolation:isolate; }
.brand-mark::after { content:""; position:absolute; inset:1px; border-radius:inherit; border:1px solid rgba(255,255,255,.24); pointer-events:none; }
.auth-visual { background:linear-gradient(155deg,#090e1d 0%,#111a33 55%,#151d36 100%); }
.auth-visual::before { background:linear-gradient(145deg,rgba(27,199,177,.58),rgba(27,199,177,.02)); }
.auth-visual::after { background:linear-gradient(145deg,rgba(113,92,255,.56),rgba(113,92,255,.02)); }
.trip-card,.trip-hero { transform:translateZ(0); }
@media (prefers-reduced-motion:no-preference) {
  .brand-mark { animation:wayGatherFloat 5s ease-in-out infinite; }
  .module-card,.trip-card,.new-trip-card { transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease; }
  @keyframes wayGatherFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-2px)} }
}
.activity-list{display:grid;gap:9px;max-height:min(56vh,520px);overflow:auto;padding-right:4px}.activity-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;padding:12px;border-radius:15px;background:var(--surface-soft)}.activity-dot{width:10px;height:10px;border-radius:50%;background:linear-gradient(145deg,var(--primary),var(--secondary));box-shadow:0 0 0 5px rgba(113,92,255,.09)}.activity-row strong{display:block;font-size:13px}.activity-row span{display:block;color:var(--muted);font-size:10px;margin-top:3px}.activity-row time{color:var(--muted);font-size:10px;white-space:nowrap}.empty-inline{padding:28px;border:1px dashed var(--line);border-radius:18px;text-align:center}.empty-inline strong,.empty-inline span{display:block}.empty-inline span{color:var(--muted);font-size:12px;margin-top:6px}

/* WayGather 2.3 — responsive, navigation, search, admin and currency refinements */
body.sidebar-visible { overflow:hidden; }
.topbar-heading { display:flex; align-items:center; gap:12px; min-width:0; }
.top-actions { min-width:0; }
.top-actions-leading,.top-actions-trailing { display:flex; align-items:center; gap:9px; min-width:0; }
.topbar-back { flex:none; }
.module-summary { margin:-15px 0 15px; color:var(--muted); font-size:12px; font-weight:750; }

.sidebar-head { display:flex; align-items:center; gap:10px; }
.sidebar-head .brand-lockup { flex:1; min-width:0; }
.sidebar-close { display:none; width:40px; height:40px; flex:none; border-radius:13px; background:rgba(255,255,255,.09); color:white; font-size:25px; line-height:1; }
.sidebar-backdrop { display:none; }

.dismissible-banner { position:relative; min-width:0; }
.banner-copy { flex:1; min-width:0; }
.banner-actions { display:flex; align-items:center; gap:9px; margin-left:auto; flex:none; }
.banner-close { width:34px; height:34px; flex:none; border-radius:11px; background:rgba(15,23,42,.08); color:currentColor; font-size:20px; line-height:1; }
.banner-success { background:#e9f5f3; border-color:#b1ddd6; color:#155e56; }

.search-hidden { display:none !important; }
.search-empty { padding:22px; border:1px dashed var(--line); border-radius:18px; background:rgba(255,255,255,.62); color:var(--muted); text-align:center; font-size:12px; font-weight:750; }
.search-box:focus-within { border-color:rgba(27,199,177,.72); box-shadow:0 0 0 4px rgba(27,199,177,.11); }

.trip-hero-top .hero-action { width:auto; max-width:100%; flex:0 1 auto; }
.hero-back { margin-right:auto; }
.hero-invite { margin-left:auto; }

.currency-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:20px; }
.currency-head h2 { margin:0; font-size:25px; letter-spacing:-.045em; }
.currency-head p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.currency-note { margin-top:13px; color:var(--muted); font-size:10px; line-height:1.5; }
.inline-loader { display:inline-block; width:14px; height:14px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; vertical-align:-2px; animation:wgSpin .72s linear infinite; opacity:.72; }
.inline-loader.large { width:28px; height:28px; border-width:3px; }
.icon-button.loading svg { animation:wgSpin .72s linear infinite; }
@keyframes wgSpin { to { transform:rotate(360deg); } }
.admin-loading { min-height:300px; display:grid; place-items:center; align-content:center; gap:14px; border:1px dashed var(--line); border-radius:26px; background:rgba(255,255,255,.58); color:var(--muted); }
.admin-table-card { min-width:0; }
.table-secondary { color:var(--muted); overflow-wrap:anywhere; }
.table-empty { color:var(--muted); text-align:center !important; padding:28px !important; }
.data-table td { overflow-wrap:anywhere; }

@media (max-width:900px) {
  .sidebar { overflow-y:auto; overscroll-behavior:contain; }
  .sidebar-head .brand-lockup { padding-bottom:18px; }
  .sidebar-close { display:grid; place-items:center; margin-top:-8px; }
  .sidebar-backdrop { position:fixed; inset:0; z-index:49; width:100%; height:100%; background:rgba(7,12,25,.48); backdrop-filter:blur(2px); opacity:0; pointer-events:none; transition:opacity .2s ease; display:block; }
  .sidebar-backdrop.visible { opacity:1; pointer-events:auto; }
  .mobile-bottom { width:min(calc(100dvw - 24px),560px); max-width:calc(100dvw - 24px); }
  .content,.main,.layout { max-width:100dvw; }
}

@media (min-width:720px) and (max-width:900px) {
  .main { padding-left:28px; padding-right:28px; }
  .module-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .trip-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .city-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .modal { width:min(calc(100dvw - 48px),760px); }
}

@media (max-width:620px) {
  .topbar { display:grid; grid-template-columns:minmax(0,1fr); gap:13px; }
  .topbar-heading { width:100%; }
  .top-actions { width:100%; flex:initial; display:flex; justify-content:space-between; align-items:center; flex-wrap:nowrap; }
  .top-actions-leading { flex:0 1 auto; min-width:0; }
  .top-actions-trailing { flex:0 0 auto; margin-left:auto; }
  .topbar-back { min-height:42px; padding:0 11px; font-size:11px; }
  .topbar-back span { display:inline; }
  .module-summary { margin:-8px 0 13px; }
  .trip-hero-top { flex-direction:row; align-items:center; justify-content:space-between; gap:8px; }
  .trip-hero-top .hero-action { width:auto; min-height:39px; padding:0 10px; font-size:10px; }
  .trip-hero-top .hero-action svg { width:16px; height:16px; }
  .banner { flex-direction:row; align-items:flex-start; }
  .banner-actions { align-self:flex-start; }
  .banner-actions .btn { width:auto; }
  .dismissible-banner .banner-copy { padding-right:2px; }
  .currency-card { padding:19px; border-radius:24px; }
  .currency-head h2 { font-size:22px; }
  .currency-fields { gap:10px; }
  .rate-info { gap:5px; }
  .admin-table-card .section-head { margin-top:18px; }
  .table-scroll { overflow:visible; border-radius:0; }
  .responsive-table { background:transparent; box-shadow:none; border-radius:0; }
  .responsive-table thead { display:none; }
  .responsive-table,.responsive-table tbody,.responsive-table tr,.responsive-table td { display:block; width:100%; }
  .responsive-table tbody { display:grid; gap:10px; }
  .responsive-table tr { padding:13px; border:1px solid var(--line); border-radius:17px; background:var(--surface); box-shadow:var(--shadow-sm); }
  .responsive-table td { display:grid; grid-template-columns:minmax(78px,.36fr) minmax(0,1fr); align-items:center; gap:10px; border:0; padding:7px 0; text-align:right; }
  .responsive-table td::before { content:attr(data-label); color:var(--muted); font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.06em; text-align:left; }
  .responsive-table td:first-child { display:block; text-align:left; padding-top:0; padding-bottom:10px; border-bottom:1px solid var(--line); margin-bottom:3px; }
  .responsive-table td:first-child::before { display:block; margin-bottom:5px; }
  .responsive-table td .btn { min-height:38px; width:auto; justify-self:end; }
  .responsive-table .table-empty { display:block; text-align:center !important; }
  .responsive-table .table-empty::before { display:none; }
  .city-detail-head > .btn { width:auto; }
}

@media (max-width:430px) {
  .main { padding-left:12px; padding-right:12px; }
  .mobile-bottom { width:calc(100dvw - 16px); max-width:calc(100dvw - 16px); bottom:calc(7px + var(--safe-bottom)); border-radius:19px; }
  .mobile-nav-btn { min-height:51px; }
  .topbar-heading { gap:9px; }
  .icon-button { width:43px; height:43px; border-radius:13px; }
  .page-heading h1 { font-size:31px; }
  .stats-grid { gap:8px; }
  .stat-card { padding:13px; }
  .trip-hero { min-height:350px; padding:17px; }
  .trip-hero h1 { font-size:39px; }
  .hero-action span { white-space:nowrap; }
  .module-grid { gap:8px; }
  .module-card { min-height:150px; padding:13px; }
  .item-card { padding:11px; gap:8px; }
  .item-check { width:39px; height:39px; border-radius:12px; }
  .item-menu { width:37px; height:37px; }
  .modal { padding:17px; }
  .modal.trip-editor .modal-actions { margin-left:-17px; margin-right:-17px; margin-bottom:-17px; padding-left:17px; padding-right:17px; }
}

@media (max-width:350px) {
  .main { padding-left:9px; padding-right:9px; }
  .topbar-back span { display:none; }
  .topbar-back { width:42px; padding:0; }
  .trip-hero-top .hero-action { padding:0 8px; }
  .hero-back span { max-width:82px; overflow:hidden; text-overflow:ellipsis; }
  .page-heading h1 { font-size:27px; }
  .mobile-nav-btn span { font-size:7.5px; }
  .currency-card { padding:15px; }
  .responsive-table td { grid-template-columns:70px minmax(0,1fr); }
}

@media (max-width:900px) and (max-height:560px) {
  .sidebar { padding-top:12px; padding-bottom:12px; }
  .side-link { min-height:42px; }
  .mobile-bottom { min-height:59px; padding:4px; }
  .mobile-nav-btn { min-height:48px; }
  .main { padding-bottom:calc(82px + var(--safe-bottom)); }
}

@media (orientation:landscape) and (max-width:900px) and (max-height:600px) {
  .trip-hero { min-height:280px; }
  .modal { max-height:96dvh; }
}

/* WayGather 2.4 — form controls, admin mobile cards and stable trip filters */
.field select,
.role-select {
  -webkit-appearance:none;
  appearance:none;
  background-color:var(--surface-solid);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 8 4 4 4-4' stroke='%23546175' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 15px center;
  background-size:18px 18px;
  padding-right:46px;
  cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.78),0 4px 14px rgba(15,23,42,.025);
}
.field select:hover,
.role-select:hover,
.field input[type="date"]:hover,
.field input[type="datetime-local"]:hover,
.field input[type="month"]:hover,
.field input[type="time"]:hover {
  border-color:rgba(113,92,255,.30);
  background-color:#fcfcff;
}
.field select:focus,
.role-select:focus {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 12 4-4 4 4' stroke='%23715cff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.field select option,
.role-select option {
  background:#fff;
  color:var(--text);
  font-weight:650;
}
.field select:disabled,
.role-select:disabled {
  cursor:not-allowed;
  opacity:.66;
  background-color:var(--surface-soft);
}
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="month"],
.field input[type="time"] {
  min-width:0;
  color-scheme:light;
  cursor:pointer;
  padding-right:50px;
  background-color:var(--surface-solid);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='3' stroke='%23546175' stroke-width='1.7'/%3E%3Cpath d='M7.5 3.5v4M16.5 3.5v4M3.5 10h17' stroke='%23546175' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 15px center;
  background-size:20px 20px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.78),0 4px 14px rgba(15,23,42,.025);
}
.field input[type="date"]:focus,
.field input[type="datetime-local"]:focus,
.field input[type="month"]:focus,
.field input[type="time"]:focus {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='3' stroke='%23715cff' stroke-width='1.8'/%3E%3Cpath d='M7.5 3.5v4M16.5 3.5v4M3.5 10h17' stroke='%23715cff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.field input[type="month"]::-webkit-calendar-picker-indicator,
.field input[type="time"]::-webkit-calendar-picker-indicator {
  width:36px;
  height:36px;
  margin:0 -7px 0 0;
  opacity:0;
  cursor:pointer;
}
.field input[type="date"]::-webkit-datetime-edit,
.field input[type="datetime-local"]::-webkit-datetime-edit {
  min-width:0;
}
.role-select {
  min-width:154px;
  background-position:right 10px center;
  background-size:16px 16px;
  padding-right:32px;
}

.trips-collection-head { align-items:flex-end; }
#trip-collection-results { min-width:0; }
#trip-collection-results.collection-updating { animation:wgCollectionIn .16s ease both; }
@keyframes wgCollectionIn { from { opacity:.72; transform:translateY(2px); } to { opacity:1; transform:none; } }
.filter-chip { transition:background-color .16s ease,color .16s ease,border-color .16s ease,transform .16s ease; }
.filter-chip:active { transform:scale(.97); }

.admin-data-grid { align-items:start; }
.admin-table-card {
  padding:18px;
  border:1px solid var(--line);
  border-radius:26px;
  background:rgba(255,255,255,.76);
  box-shadow:var(--shadow-sm);
}
.admin-table-head { margin:0 2px 15px; }
.admin-title-line { display:flex; align-items:center; gap:9px; }
.admin-title-line h2 { margin:0; }
.admin-count {
  min-width:27px;
  height:27px;
  padding:0 8px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(113,92,255,.10);
  color:var(--primary-dark);
  font-size:11px;
  font-weight:900;
}
.admin-table-card .data-table {
  border:1px solid rgba(15,23,42,.075);
  box-shadow:none;
  background:rgba(255,255,255,.90);
}
.admin-table-card .data-table th {
  padding-top:13px;
  padding-bottom:13px;
  background:linear-gradient(180deg,#fafbfe,#f4f6fa);
  color:#758095;
}
.admin-table-card .data-table tr:last-child td { border-bottom:0; }
.admin-table-card .data-table tbody tr { transition:background-color .16s ease; }
.admin-table-card .data-table tbody tr:hover { background:rgba(113,92,255,.035); }
.admin-identity { display:flex; align-items:center; gap:11px; min-width:0; }
.admin-avatar,
.admin-trip-symbol {
  width:42px;
  height:42px;
  flex:none;
  border-radius:14px;
  display:grid;
  place-items:center;
  overflow:hidden;
  font-weight:900;
}
.admin-avatar { background:linear-gradient(145deg,var(--secondary),#57d9ca); color:#fff; }
.admin-avatar img { width:100%; height:100%; object-fit:cover; }
.admin-trip-symbol { background:linear-gradient(145deg,rgba(113,92,255,.14),rgba(27,199,177,.13)); font-size:20px; }
.admin-record-copy { min-width:0; }
.admin-record-copy strong,
.admin-record-copy span,
.admin-record-copy small { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.admin-record-copy strong { font-size:12px; white-space:nowrap; }
.admin-record-copy span { margin-top:3px; color:var(--muted); font-size:10.5px; white-space:nowrap; }
.admin-record-copy small { max-width:230px; margin-top:4px; color:#9aa3b2; font-size:8.5px; white-space:nowrap; }
.admin-status {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:30px;
  padding:0 10px;
  border-radius:999px;
  background:var(--surface-soft);
  color:var(--muted);
  font-size:10px;
  font-weight:850;
  white-space:nowrap;
}
.admin-status i { width:7px; height:7px; border-radius:50%; background:currentColor; box-shadow:0 0 0 4px currentColor; opacity:.78; }
.admin-status.is-active { background:#e8f7f2; color:#11765a; }
.admin-status.is-suspended { background:#fff0f0; color:#c94343; }
.admin-status.is-planning { background:#f0edff; color:#6652df; }
.admin-status.is-completed { background:#e9f5f3; color:#16745e; }
.admin-status.is-archived { background:#eef1f5; color:#687386; }
.admin-you { color:var(--muted); font-size:10px; font-weight:800; }
.admin-detail-cell strong,
.admin-detail-cell span { font-size:10.5px; }

@media (max-width:620px) {
  .field select,
  .field input[type="date"],
  .field input[type="datetime-local"],
  .field input[type="month"],
  .field input[type="time"] { min-height:54px; border-radius:16px; }
  .role-select { width:100%; min-width:0; min-height:43px; margin-left:0; }
  .trips-collection-head { align-items:stretch; }
  .admin-data-grid { gap:14px; }
  .admin-table-card { padding:13px; border-radius:23px; background:rgba(255,255,255,.82); }
  .admin-table-card .section-head.admin-table-head { margin:2px 3px 12px !important; }
  .admin-title-line h2 { font-size:19px; }
  .admin-mobile-table tbody { gap:12px; }
  .admin-mobile-table tr.admin-record {
    position:relative;
    padding:0;
    overflow:hidden;
    border:1px solid rgba(15,23,42,.085);
    border-radius:19px;
    background:#fff;
    box-shadow:0 8px 22px rgba(15,23,42,.065);
  }
  .admin-mobile-table tr.admin-record::after {
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:4px;
    background:linear-gradient(180deg,var(--primary),var(--secondary));
  }
  .admin-mobile-table td {
    grid-template-columns:minmax(74px,.38fr) minmax(0,1fr);
    min-height:45px;
    padding:10px 14px 10px 17px;
    gap:9px;
  }
  .admin-mobile-table td::before { font-size:8.5px; }
  .admin-mobile-table td.admin-main-cell {
    display:block;
    margin:0;
    padding:14px 14px 13px 17px;
    border:0;
    border-bottom:1px solid var(--line);
    background:linear-gradient(135deg,rgba(113,92,255,.055),rgba(27,199,177,.035));
    text-align:left;
  }
  .admin-mobile-table td.admin-main-cell::before { display:none; }
  .admin-mobile-table td.admin-state-cell,
  .admin-mobile-table td.admin-action-cell,
  .admin-mobile-table td.admin-detail-cell {
    display:grid;
    border:0;
    border-bottom:1px solid rgba(15,23,42,.065);
    text-align:right;
  }
  .admin-mobile-table td:last-child { border-bottom:0; }
  .admin-mobile-table .admin-identity { gap:11px; }
  .admin-mobile-table .admin-avatar,
  .admin-mobile-table .admin-trip-symbol { width:46px; height:46px; border-radius:15px; }
  .admin-mobile-table .admin-record-copy strong { font-size:13px; }
  .admin-mobile-table .admin-record-copy span { font-size:10.5px; }
  .admin-mobile-table .admin-record-copy small { max-width:calc(100vw - 125px); font-size:8px; }
  .admin-mobile-table .admin-status { justify-self:end; min-height:31px; }
  .admin-mobile-table .admin-action-cell .btn { width:min(100%,142px); justify-self:end; margin:0; }
  .admin-mobile-table .admin-you { justify-self:end; }
  .admin-mobile-table .table-empty { padding:25px 14px !important; border:1px dashed var(--line); border-radius:17px; background:rgba(255,255,255,.7); }
}

@media (max-width:360px) {
  .admin-table-card { padding:10px; }
  .admin-mobile-table td { grid-template-columns:66px minmax(0,1fr); padding-left:15px; padding-right:11px; }
  .admin-mobile-table td.admin-main-cell { padding-left:15px; padding-right:11px; }
  .admin-mobile-table .admin-avatar,
  .admin-mobile-table .admin-trip-symbol { width:42px; height:42px; }
  .admin-mobile-table .admin-record-copy small { max-width:calc(100vw - 112px); }
}

/* WayGather 2.5 — Safari stability, custom calendar, uploads and integrated modal scrolling */
html,body,#app,.layout,.main,.content { overflow-x:hidden; }
@supports (overflow:clip) {
  html,body,#app,.layout,.main,.content { overflow-x:clip; }
}

/* WebKit requires the prefixed form on some Apple releases. */
.auth-visual,.trip-state,.trip-emoji,.hero-action,.meta-pill,.sidebar-backdrop,.mobile-bottom,.modal-backdrop {
  -webkit-backdrop-filter:blur(12px);
}
.modal-backdrop,.sidebar-backdrop { -webkit-backdrop-filter:blur(5px); }

body.modal-open {
  position:fixed;
  left:0;
  right:0;
  width:100%;
  overflow:hidden;
  touch-action:none;
}
body.date-picker-open { overflow:hidden; }

/* Modal scrollbars: discreet on desktop, invisible on touch devices. */
.modal-backdrop {
  scrollbar-width:none;
  -ms-overflow-style:none;
  -webkit-overflow-scrolling:touch;
}
.modal-backdrop::-webkit-scrollbar { display:none; }
.modal,
.activity-list {
  scrollbar-width:thin;
  scrollbar-color:rgba(113,92,255,.42) transparent;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.modal::-webkit-scrollbar,
.activity-list::-webkit-scrollbar { width:9px; height:9px; }
.modal::-webkit-scrollbar-track,
.activity-list::-webkit-scrollbar-track { background:transparent; margin:18px 0; }
.modal::-webkit-scrollbar-thumb,
.activity-list::-webkit-scrollbar-thumb {
  border:3px solid transparent;
  border-radius:999px;
  background:linear-gradient(180deg,rgba(113,92,255,.62),rgba(27,199,177,.58)) padding-box;
}
.modal::-webkit-scrollbar-thumb:hover,
.activity-list::-webkit-scrollbar-thumb:hover {
  background:linear-gradient(180deg,rgba(113,92,255,.86),rgba(27,199,177,.78)) padding-box;
}

/* Hide the inconsistent browser calendar while keeping the ISO value in the form. */
.wg-date-native { display:none !important; }
.wg-date-trigger {
  width:100%;
  min-height:54px;
  padding:0 13px;
  border:1px solid var(--line);
  border-radius:16px;
  background:linear-gradient(180deg,#fff,#fcfcff);
  color:var(--muted);
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 26px;
  align-items:center;
  gap:8px;
  text-align:left;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 5px 16px rgba(15,23,42,.035);
  transition:border-color .18s ease,box-shadow .18s ease,transform .16s ease;
}
.wg-date-trigger:hover { border-color:rgba(113,92,255,.34); }
.wg-date-trigger:focus-visible {
  outline:0;
  border-color:rgba(27,199,177,.72);
  box-shadow:0 0 0 4px rgba(27,199,177,.11),0 8px 20px rgba(15,23,42,.05);
}
.wg-date-trigger:active { transform:scale(.995); }
.wg-date-trigger.has-value { color:var(--text); }
.wg-date-icon {
  width:36px;
  height:36px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:linear-gradient(145deg,rgba(113,92,255,.13),rgba(27,199,177,.12));
  color:var(--primary-dark);
}
.wg-date-icon svg { width:18px; height:18px; }
.wg-date-value { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:780; }
.wg-date-chevron { justify-self:end; color:#8b94a5; font-size:25px; transform:rotate(90deg); line-height:1; }

#wg-date-picker-root { position:fixed; inset:0; z-index:220; }
.wg-date-backdrop {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(7,12,25,.58);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
  animation:fadeIn .16s ease;
}
.wg-date-panel {
  width:min(100%,390px);
  max-height:calc(100dvh - 40px);
  overflow:auto;
  padding:20px;
  border:1px solid rgba(255,255,255,.7);
  border-radius:27px;
  background:rgba(249,251,253,.98);
  box-shadow:0 32px 90px rgba(7,12,25,.34);
  color:var(--text);
  animation:slideUp .2s ease;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.wg-date-panel::-webkit-scrollbar { display:none; }
.wg-date-panel header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:17px;
}
.wg-date-panel header small {
  display:block;
  margin-bottom:4px;
  color:var(--muted);
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.09em;
}
.wg-date-panel header strong { display:block; font-size:19px; letter-spacing:-.035em; text-transform:capitalize; }
.wg-date-close {
  width:39px;
  height:39px;
  flex:none;
  border-radius:13px;
  background:var(--surface-soft);
  color:var(--text);
  font-size:22px;
  line-height:1;
}
.wg-cal-nav {
  display:grid;
  grid-template-columns:40px minmax(0,1fr) 40px;
  align-items:center;
  gap:8px;
  margin-bottom:13px;
}
.wg-cal-nav strong { text-align:center; font-size:15px; text-transform:capitalize; }
.wg-cal-nav button {
  width:40px;
  height:40px;
  border-radius:13px;
  background:#fff;
  border:1px solid var(--line);
  color:var(--text);
  font-size:23px;
  line-height:1;
}
.wg-cal-week,.wg-cal-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; }
.wg-cal-week { margin-bottom:6px; }
.wg-cal-week span { padding:5px 0; color:#8a94a6; text-align:center; font-size:9px; font-weight:900; text-transform:uppercase; }
.wg-cal-day {
  aspect-ratio:1;
  min-width:0;
  border-radius:12px;
  background:transparent;
  color:var(--text);
  font-size:12px;
  font-weight:800;
  position:relative;
}
.wg-cal-day:hover { background:rgba(113,92,255,.09); }
.wg-cal-day.outside { color:#b4bac5; }
.wg-cal-day.today::after {
  content:"";
  position:absolute;
  left:50%;
  bottom:4px;
  width:4px;
  height:4px;
  border-radius:50%;
  background:var(--secondary);
  transform:translateX(-50%);
}
.wg-cal-day.selected {
  background:linear-gradient(145deg,var(--primary),#806bff);
  color:#fff;
  box-shadow:0 8px 18px rgba(113,92,255,.28);
}
.wg-cal-day.selected::after { background:#fff; }
.wg-time-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:end;
  gap:10px;
  margin-top:16px;
  padding:14px;
  border-radius:17px;
  background:linear-gradient(135deg,rgba(113,92,255,.07),rgba(27,199,177,.07));
  border:1px solid rgba(113,92,255,.10);
}
.wg-time-row > span { padding-bottom:13px; font-weight:900; }
.wg-time-row label { display:grid; gap:6px; color:var(--muted); font-size:10px; font-weight:850; }
.wg-time-row select {
  min-height:43px;
  width:100%;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fff;
  color:var(--text);
  font:inherit;
  font-size:15px;
  font-weight:800;
}
.wg-date-panel footer { display:grid; grid-template-columns:1fr 1fr 1.2fr; gap:8px; margin-top:18px; }
.wg-date-panel footer .btn { min-height:45px; padding:0 12px; border-radius:13px; font-size:11px; }

/* Persistent upload feedback, especially useful on Safari/iOS. */
.task-toast {
  width:min(calc(100dvw - 28px),410px);
  min-height:78px;
  padding:14px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:19px;
  background:rgba(15,23,42,.96);
  color:#fff;
  box-shadow:0 20px 55px rgba(7,12,25,.32);
  display:flex;
  align-items:center;
  gap:12px;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.task-spinner {
  width:25px;
  height:25px;
  flex:none;
  border:3px solid rgba(255,255,255,.24);
  border-right-color:var(--secondary);
  border-radius:50%;
  animation:wgSpin .72s linear infinite;
}
.task-copy { flex:1; min-width:0; }
.task-copy strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.task-copy small { display:block; margin-top:5px; color:rgba(255,255,255,.60); font-size:9px; font-weight:800; }
.task-progress { height:5px; margin-top:9px; overflow:hidden; border-radius:999px; background:rgba(255,255,255,.13); }
.task-progress i { display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,var(--primary),var(--secondary)); transition:width .18s ease; }

.is-safari .field input,
.is-safari .field select,
.is-safari .field textarea,
.is-safari .wg-date-trigger {
  -webkit-appearance:none;
  appearance:none;
}
.is-safari .modal { transform:translateZ(0); }
.is-ios input,.is-ios select,.is-ios textarea { font-size:max(16px,1em); }
.is-ios .btn,.is-ios .icon-button,.is-ios .mobile-nav-btn { font-size:inherit; }

@media (max-width:900px), (pointer:coarse) {
  .modal,.activity-list { scrollbar-width:none; }
  .modal::-webkit-scrollbar,.activity-list::-webkit-scrollbar { display:none; }
}

@media (max-width:620px) {
  .wg-date-backdrop { place-items:end center; padding:0; }
  .wg-date-panel {
    width:100%;
    max-height:94dvh;
    padding:18px 17px calc(17px + var(--safe-bottom));
    border-radius:28px 28px 0 0;
    border-left:0;
    border-right:0;
    border-bottom:0;
  }
  .wg-date-panel footer { position:sticky; bottom:calc(-17px - var(--safe-bottom)); margin:18px -17px calc(-17px - var(--safe-bottom)); padding:14px 17px calc(17px + var(--safe-bottom)); background:linear-gradient(to bottom,rgba(249,251,253,.78),#f9fbfd 28%); border-top:1px solid var(--line); }
  .wg-cal-day { border-radius:11px; font-size:13px; }
  .wg-date-trigger { min-height:56px; }
}

@media (max-width:350px) {
  .wg-date-panel { padding-left:12px; padding-right:12px; }
  .wg-date-panel footer { grid-template-columns:1fr 1fr; margin-left:-12px; margin-right:-12px; padding-left:12px; padding-right:12px; }
  .wg-date-panel footer [data-date-action="confirm"] { grid-column:1/-1; }
  .wg-cal-week,.wg-cal-grid { gap:3px; }
  .wg-cal-day { border-radius:10px; }
}

/* WayGather 2.6 — Apple performance, stable gallery, non-destructive calendar and unified scrolling */
:root {
  --scrollbar-size: 10px;
  --scrollbar-thumb: rgba(113,92,255,.52);
  --scrollbar-thumb-hover: rgba(87,67,228,.78);
  --scrollbar-track: rgba(15,23,42,.045);
  --radius-card: 25px;
  --radius-inner: 18px;
  --radius-control: 15px;
}

/* One visual language for the page and every internal scroll surface. */
html,
body,
.main,
.sidebar,
.table-scroll,
.activity-list,
.modal-scroll-region,
.wg-date-panel,
.filter-row {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.main::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.activity-list::-webkit-scrollbar,
.modal-scroll-region::-webkit-scrollbar,
.wg-date-panel::-webkit-scrollbar,
.filter-row::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.main::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track,
.activity-list::-webkit-scrollbar-track,
.modal-scroll-region::-webkit-scrollbar-track,
.wg-date-panel::-webkit-scrollbar-track,
.filter-row::-webkit-scrollbar-track {
  background: transparent;
  margin: 12px 0;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.main::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb,
.activity-list::-webkit-scrollbar-thumb,
.modal-scroll-region::-webkit-scrollbar-thumb,
.wg-date-panel::-webkit-scrollbar-thumb,
.filter-row::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg,var(--scrollbar-thumb),rgba(27,199,177,.48)) padding-box;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.main::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover,
.activity-list::-webkit-scrollbar-thumb:hover,
.modal-scroll-region::-webkit-scrollbar-thumb:hover,
.wg-date-panel::-webkit-scrollbar-thumb:hover,
.filter-row::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,var(--scrollbar-thumb-hover),rgba(27,199,177,.72)) padding-box;
}

/* The outer modal clips the scrollbar inside its own rounded silhouette. */
.modal {
  overflow: hidden !important;
  padding: 0 !important;
  isolation: isolate;
  background: #f8fafb;
  -webkit-mask-image: -webkit-radial-gradient(white,black);
}
.modal-scroll-region {
  width: 100%;
  max-height: calc(100dvh - 40px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px;
  background: inherit;
  border-radius: inherit;
  scrollbar-gutter: stable;
}
.modal-scroll-region:focus { outline: none; }
.modal.trip-editor .modal-scroll-region { padding-bottom: 22px; }
.table-scroll,
.activity-list {
  overflow-clip-margin: content-box;
  background-clip: padding-box;
}
.table-scroll { border-radius: var(--radius-inner); }

/* Safari multi-column fragmentation could split images between columns. Grid keeps each photo atomic. */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(210px,1fr));
  align-items: start;
  gap: 12px;
  columns: unset !important;
  column-gap: 0;
}
.photo-card {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  break-inside: auto;
  display: grid;
  place-items: center;
  contain: layout paint;
  isolation: isolate;
  border-radius: var(--radius-inner);
  background: linear-gradient(145deg,#e9edf2,#dfe5eb);
  transform: translateZ(0);
}
.photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  background: #e8ecf1;
  transform: translateZ(0);
  -webkit-user-drag: none;
}
.photo-overlay {
  z-index: 2;
  width: 100%;
  pointer-events: none;
}

/* Selecting a day now only updates the selected cell instead of rebuilding the picker. */
.wg-cal-day {
  transition: background-color .14s ease,color .14s ease,box-shadow .14s ease,transform .14s ease;
}
.wg-cal-day:active { transform: scale(.94); }

/* Parent/child radius hierarchy: inner surfaces are always tighter than their card. */
.stat-card,
.trip-card,
.module-card,
.city-card,
.balance-panel,
.total-panel,
.admin-table-card,
.currency-card {
  border-radius: var(--radius-card);
}
.item-card,
.person-card,
.activity-row,
.banner,
.empty-inline,
.responsive-table,
.data-table,
.table-scroll {
  border-radius: var(--radius-inner);
}
.field input,
.field select,
.field textarea,
.wg-date-trigger,
.btn {
  border-radius: var(--radius-control);
}

@media (max-width:900px) {
  .modal-scroll-region {
    max-height: 93dvh;
    padding: 20px;
    scrollbar-gutter: auto;
  }
  .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
}

@media (max-width:420px) {
  .modal-scroll-region { max-height: 96dvh; padding: 17px; }
  .photo-grid { gap: 8px; }
  .photo-overlay { padding: 34px 9px 9px; font-size: 10px; }
}

/* iOS owns its overlay scroll indicators; keep them unobtrusive on touch screens. */
@media (pointer:coarse) {
  .modal-scroll-region,
  .activity-list,
  .table-scroll,
  .filter-row,
  .sidebar,
  .wg-date-panel {
    scrollbar-width: none;
  }
  .modal-scroll-region::-webkit-scrollbar,
  .activity-list::-webkit-scrollbar,
  .table-scroll::-webkit-scrollbar,
  .filter-row::-webkit-scrollbar,
  .sidebar::-webkit-scrollbar,
  .wg-date-panel::-webkit-scrollbar {
    display: none;
  }
}
