/* KPU Frontiersman — design system (Stage 1 redesign, 2026-09-16)
   Tokens per Neel's spec. Every pre-existing class/id hook is preserved. */
:root {
  --bg: #080D14;            /* App background */
  --bg-2: #0D151F;          /* Elevated surface */
  --card: #111C28;          /* Card */
  --card-2: #162230;        /* Secondary card / input */
  --line: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.16);
  --text: #F5F7FA;
  --dim: #9BA9BA;
  --dimmer: #68788D;
  --blue: #2684FF;
  --blue-2: #3994FF;        /* hover / active */
  --blue-deep: #0E3C7A;
  --blue-glow: rgba(38,132,255,0.32);
  --blue-soft: rgba(38,132,255,0.14);
  --ok: #22C55E;
  --warn: #F59E0B;
  --danger: #EF4444;
  --r-xl: 22px; --r-lg: 18px; --r-md: 14px; --r-sm: 12px; --r-xs: 10px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --page-x: 18px;
  --nav-h: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-brand: var(--font);
  --shadow-card: 0 10px 30px rgba(0,0,0,0.35);
  --shadow-float: 0 12px 32px rgba(0,0,0,0.5);
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overscroll-behavior-y: none;
  font-size: 15px; line-height: 1.45;
}
a { color: var(--blue-2); text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
::selection { background: var(--blue-soft); }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; border-radius: 8px; }

/* ---------- utilities ---------- */
.muted { color: var(--dim); }
.faint { color: var(--dimmer); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.brand-font { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.ic-svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -0.2em; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .danger-text { color: var(--danger); }

/* ---------- login ---------- */
.screen-login { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 32px 22px calc(32px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; position: relative; }
.screen-login::before { content: ''; position: fixed; inset: 0; background: url('/img/other.jpg') center/cover no-repeat; opacity: 0.22; z-index: -1; filter: saturate(0.8); }
.screen-login::after { content: ''; position: fixed; inset: 0; background: linear-gradient(to bottom, rgba(8,13,20,0.55), var(--bg) 75%); z-index: -1; }
.login-hero { text-align: center; margin-bottom: 28px; }
.brand-lockup { display: inline-block; }
/* Official KPU logo (blue on white) sits on a white plate so it reads on the dark UI. */
.brand-plate { display: inline-flex; align-items: center; justify-content: center; width: 132px; height: 132px; padding: 14px; border-radius: 28px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.brand-logo { display: block; width: 100%; height: auto; }
.brand-word { font-weight: 700; font-size: 22px; letter-spacing: 0.28em; margin-top: 14px; padding-left: 0.28em; }
.brand-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.26em; color: var(--dim); margin-top: 10px; }
.login-motto { text-transform: uppercase; letter-spacing: 0.12em; font-size: 15px; font-weight: 600; color: var(--dim); margin-top: 26px; line-height: 1.5; }
.login-card { background: rgba(17,28,40,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-card); }
.login-help { font-size: 12px; color: var(--dimmer); text-align: center; }

/* ---------- header (FrontiersmanHeader) ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) var(--page-x) 10px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 90%, rgba(8,13,20,0)); min-height: 64px; }
.topbar h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.topbar .hd-title { min-width: 0; }
.topbar .hd-sub { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--blue-2); margin-top: 4px; }
.topbar.compact h1 { font-size: 18px; text-align: center; }
.topbar .brand-mini { line-height: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .brand-mini .txt { min-width: 0; }
.topbar .brand-mini .f, .topbar .brand-mini .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand-mini .k-plate { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 5px; border-radius: 11px; background: #fff; flex-shrink: 0; }
.topbar .brand-mini .k-logo { display: block; width: 100%; height: auto; }
.topbar .brand-mini .f { font-size: 11px; font-weight: 700; letter-spacing: 0.28em; display: block; }
.topbar .brand-mini .t { font-size: 9px; font-weight: 600; letter-spacing: 0.22em; display: block; margin-top: 5px; color: var(--dim); }
.topbar > .row { min-width: 0; flex: 1 1 auto; }
@media (max-width: 479px) { .topbar .brand-mini .t { display: none; } }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: transform .12s var(--ease), background .15s; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { transform: scale(0.92); background: var(--card-2); }
.icon-btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 18px var(--blue-glow); }
.icon-btn.blue:active { background: var(--blue-2); }
.badge-dot { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); box-sizing: content-box; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-weight: 600; font-size: 14px; background: none; border: 0; padding: 6px 4px 6px 0; cursor: pointer; }
.back-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back-btn:active { color: var(--text); }

/* ---------- avatars (MemberAvatar) ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-deep), var(--blue)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; overflow: hidden; border: 1px solid var(--line-strong); position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.avatar.xl { width: 104px; height: 104px; font-size: 34px; border-width: 2px; }
.avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar-wrap .status { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--dimmer); border: 2px solid var(--card); }
.avatar-wrap .status.online { background: var(--ok); }
.avatar-wrap .status.away { background: var(--warn); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; border: 2px solid var(--bg); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- layout ---------- */
.view { padding: 0 0 calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; min-height: 100vh; }
.section { padding: 6px var(--page-x) 14px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); margin: 14px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title a, .section-title .see-all { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--blue-2); display: inline-flex; align-items: center; gap: 2px; }
.section-title .see-all svg { width: 16px; height: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.card + .card { margin-top: 12px; }
.card.flat { padding: 0; overflow: hidden; }
a.card, .card.press { transition: transform .12s var(--ease), border-color .15s; display: block; color: var(--text); }
a.card:active, .card.press:active { transform: scale(0.985); border-color: var(--line-strong); }

/* EmptyState */
.empty { text-align: center; color: var(--dim); padding: 36px 20px; font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .big { display: none; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--blue-2); margin-bottom: 8px; }
.empty-icon svg { width: 26px; height: 26px; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--text); }
.empty-text { color: var(--dim); max-width: 300px; }
.empty-action { margin-top: 12px; }

/* LoadingSkeleton */
.sk { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 40%, var(--card) 80%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; border: 1px solid var(--line); }
.sk-line { height: 12px; margin: 6px 0; }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.sk-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.sk-avatar.lg { width: 76px; height: 76px; }
.sk-hero { height: 300px; border-radius: var(--r-xl); }
.sk-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-tile { height: 140px; border-radius: var(--r-lg); }
.sk-grid { columns: 2; column-gap: 8px; }
.sk-cell { break-inside: avoid; margin-bottom: 8px; border-radius: var(--r-md); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading { text-align: center; padding: 40px; color: var(--dimmer); }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line-strong); background: var(--card-2); color: var(--text); border-radius: 14px; padding: 13px 18px; font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s var(--ease), background .15s, box-shadow .15s, opacity .15s; line-height: 1; min-height: 48px; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 22px var(--blue-glow); }
.btn-primary:hover { background: var(--blue-2); }
.btn-primary:active { background: var(--blue-2); }
.btn-danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); color: var(--danger); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 12px; min-height: 36px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.is-success { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* FilterChip */
.pill-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px var(--page-x) 10px; scrollbar-width: none; }
.pill-row::-webkit-scrollbar { display: none; }
.pill { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; transition: transform .12s var(--ease), background .15s, color .15s; line-height: 1; }
.pill svg { width: 16px; height: 16px; }
.pill:active { transform: scale(0.96); }
.pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill .muted { color: inherit; opacity: 0.7; font-weight: 500; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 11px; font-weight: 600; font-size: 13px; color: var(--dim); cursor: pointer; transition: background .15s, color .15s; }
.seg button.active { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg.fill { display: flex; }
.seg.fill button { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--dim); line-height: 1.3; }
.chip svg { width: 14px; height: 14px; }
.chip.blue { background: var(--blue-soft); border-color: rgba(38,132,255,0.4); color: var(--blue-2); }
.chip.ok { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); color: var(--ok); }
.chip.warn { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.35); color: var(--warn); }
.chip.danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.35); color: var(--danger); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.field input, .field select, .field textarea { background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none; width: 100%; color-scheme: dark; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field textarea { min-height: 84px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2 { font-size: 22px; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 500; }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.toggle:last-child { border-bottom: 0; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--card-2); border: 1px solid var(--line-strong); border-radius: 999px; transition: .15s; }
.switch i::after { content: ''; position: absolute; width: 22px; height: 22px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: .15s var(--ease); }
.switch input:checked + i { background: var(--blue); border-color: var(--blue); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled + i { opacity: 0.4; }
.checkbox { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.checkbox:last-child { border-bottom: 0; }
.checkbox input { width: 22px; height: 22px; accent-color: var(--blue); flex-shrink: 0; }
.checkbox.done span { color: var(--dimmer); text-decoration: line-through; }

/* ---------- hero (AdventureHeroCard) ---------- */
.hero-card { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 320px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: var(--shadow-card); transition: transform .14s var(--ease); }
a.hero-card:active { transform: scale(0.985); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.02); }
.hero-bg.gradient { background: linear-gradient(160deg, #10203a 0%, #0c1524 45%, #1a2f52 100%); }
.hero-bg.fallback { filter: saturate(0.9); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,13,20,0.97) 0%, rgba(8,13,20,0.62) 42%, rgba(8,13,20,0.08) 100%); }
.hero-body { position: relative; padding: 18px; }
.hero-kicker { letter-spacing: 0.2em; font-size: 11px; font-weight: 700; color: var(--blue-2); text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.hero-kicker svg { width: 14px; height: 14px; }
.hero-title { font-size: 26px; font-weight: 700; line-height: 1.12; margin: 8px 0 12px; letter-spacing: -0.02em; }
.hero-meta { display: flex; flex-direction: column; gap: 7px; color: #dfe6ef; font-size: 14px; margin-bottom: 16px; }
.hero-meta div { display: flex; align-items: center; gap: 9px; }
.hero-meta svg { width: 18px; height: 18px; color: var(--dim); }
.hero-card .btn-primary { box-shadow: 0 8px 22px rgba(0,0,0,0.35); }

/* Quick access tiles (photographic CategoryCard) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 8px 12px; text-align: center; cursor: pointer; color: var(--text); transition: transform .12s var(--ease); }
.tile:active { transform: scale(0.97); }
.tile .emoji, .tile .tile-ic { width: 44px; height: 44px; margin: 0 auto; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--blue-2); }
.tile .tile-ic svg { width: 24px; height: 24px; }
.tile .label { font-weight: 600; font-size: 13px; margin-top: 8px; }
.tile .count { font-size: 11px; color: var(--dimmer); margin-top: 2px; }
.tile-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tile-link { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; font-weight: 600; font-size: 14px; color: var(--text); transition: transform .12s var(--ease); }
.tile-link:active { transform: scale(0.97); }
.tile-link .emoji, .tile-link svg { width: 20px; height: 20px; color: var(--blue-2); }
.photo-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--card) center/cover no-repeat; color: #fff; transition: transform .12s var(--ease); box-shadow: var(--shadow-card); }
.photo-card:active { transform: scale(0.97); }
.photo-card .photo-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,13,20,0.95) 0%, rgba(8,13,20,0.45) 50%, rgba(8,13,20,0.05) 100%); }
.photo-card .photo-body { position: relative; padding: 12px; }
.photo-card .photo-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.photo-card .photo-ic svg { width: 17px; height: 17px; }
.photo-card .photo-title { font-weight: 700; font-size: 15px; line-height: 1.2; letter-spacing: -0.01em; }
.photo-card .photo-sub { font-size: 11px; color: rgba(255,255,255,0.72); margin-top: 3px; }
.photo-card.wide { min-height: 130px; }
.photo-card.wide .photo-title { font-size: 17px; }
.photo-card.wide .photo-sub { font-size: 12px; }
.explore-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- feed ---------- */
.composer { display: flex; gap: 10px; align-items: flex-start; }
.composer textarea { flex: 1; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; min-height: 46px; resize: none; font-size: 15px; outline: none; }
.composer textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.composer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.attach-preview { margin-top: 10px; position: relative; }
.attach-preview img { border-radius: 12px; max-height: 220px; object-fit: cover; }
.post { padding: 14px 16px; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-body { font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.post-media { margin-top: 10px; border-radius: 12px; overflow: hidden; background: #000; }
.post-media img, .post-media video { width: 100%; max-height: 420px; object-fit: cover; }
.post-actions { display: flex; gap: 6px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.react-btn { border: 1px solid var(--line); background: var(--card-2); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--dim); display: inline-flex; gap: 6px; align-items: center; line-height: 1; transition: transform .12s var(--ease), background .15s, color .15s; min-height: 34px; }
.react-btn svg { width: 16px; height: 16px; }
.react-btn:active { transform: scale(0.94); }
.react-btn.on { border-color: rgba(38,132,255,0.5); background: var(--blue-soft); color: var(--blue-2); }
.react-btn.on svg { fill: currentColor; fill-opacity: 0.2; }
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.comment { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.comment .bubble { background: var(--card-2); border-radius: 14px; padding: 8px 12px; flex: 1; }
.comment .bubble b { display: block; font-size: 12px; margin-bottom: 2px; }
.comment-form { display: flex; gap: 8px; margin-top: 4px; }
.comment-form input { flex: 1; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 14px; font-size: 14px; outline: none; min-width: 0; }
.comment-form input:focus { border-color: var(--blue); }
.kebab { margin-left: auto; color: var(--dimmer); background: none; border: 0; cursor: pointer; padding: 4px; line-height: 1; display: inline-flex; border-radius: 8px; }
.kebab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.kebab:active { background: var(--card-2); }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px var(--page-x) 10px; gap: 8px; }
.cal-head h2 { font-size: 18px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 14px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--dimmer); letter-spacing: 0.08em; padding: 4px 0; }
.cal-day { aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; position: relative; cursor: pointer; border: 1px solid transparent; transition: background .12s; }
.cal-day:active { background: var(--card-2); }
.cal-day.other { color: var(--dimmer); opacity: 0.5; }
.cal-day.today { border-color: var(--line-strong); font-weight: 700; }
.cal-day.selected { background: var(--blue); color: #fff; box-shadow: 0 4px 14px var(--blue-glow); }
.cal-day .dots { display: flex; gap: 3px; margin-top: 3px; height: 5px; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-2); }
.cal-day.selected .dots i { background: #fff; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 0 14px; }
.week-day { border-radius: 14px; background: var(--card); border: 1px solid var(--line); padding: 10px 4px; text-align: center; cursor: pointer; }
.week-day.selected { background: var(--blue); border-color: var(--blue); color: #fff; }
.week-day .d { font-size: 11px; color: var(--dim); font-weight: 600; }
.week-day.selected .d { color: rgba(255,255,255,0.8); }
.week-day .n { font-size: 18px; font-weight: 700; margin-top: 2px; }
.week-day .dots { display: flex; justify-content: center; gap: 3px; margin-top: 4px; height: 5px; }
.week-day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-2); }
.week-day.selected .dots i { background: #fff; }
.adv-list { display: flex; flex-direction: column; gap: 10px; padding: 0 var(--page-x); }
.adv-item { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; color: var(--text); transition: transform .12s var(--ease); }
a.adv-item:active { transform: scale(0.985); }
.adv-item.cancelled { opacity: 0.55; }
.adv-item.cancelled .t { text-decoration: line-through; }
.adv-date { width: 46px; text-align: center; flex-shrink: 0; }
.adv-date .m { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.adv-date .d { font-size: 22px; font-weight: 700; line-height: 1; }
.adv-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--blue-2); flex-shrink: 0; }
.adv-icon svg { width: 20px; height: 20px; }
.adv-item .t { font-weight: 600; font-size: 15px; }
.adv-item .s { font-size: 13px; color: var(--dim); margin-top: 2px; }
.month-label { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--dim); padding: 14px var(--page-x) 6px; }

/* ---------- adventure detail ---------- */
.detail-hero { min-height: 240px; }
.detail-hero .hero-body { width: 100%; }
.tabs { display: flex; gap: 6px; padding: 6px var(--page-x) 12px; }
.tabs button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 6px; font-weight: 600; font-size: 13px; color: var(--dim); cursor: pointer; transition: background .15s, color .15s; }
.tabs button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.tabs button:disabled { opacity: 0.4; cursor: not-allowed; }
.detail-rows { display: flex; flex-direction: column; gap: 14px; }
.detail-row { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.detail-row .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--blue-2); flex-shrink: 0; }
.detail-row .ic svg { width: 18px; height: 18px; }
.detail-row > div:last-child, .detail-row > a { padding-top: 6px; min-width: 0; }
.detail-row .lab { font-size: 11px; color: var(--dimmer); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.rsvp-bar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); padding: 18px var(--page-x) 10px; }
.attendee { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.attendee:last-child { border-bottom: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photo-grid a { aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--card-2); display: block; }
.photo-grid img, .photo-grid video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- trophy room ---------- */
.masonry { columns: 2; column-gap: 8px; padding: 0 14px; }
.masonry .m-item { break-inside: avoid; margin-bottom: 8px; border-radius: var(--r-md); overflow: hidden; background: var(--card-2); position: relative; display: block; border: 1px solid var(--line); transition: transform .12s var(--ease); }
.masonry .m-item:active { transform: scale(0.98); }
.masonry img, .masonry video { width: 100%; display: block; }
.m-item .m-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px; font-size: 12px; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,0.78)); color: #fff; }
.m-item .m-kind { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.55); border-radius: 8px; padding: 3px 7px; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; backdrop-filter: blur(4px); }
.m-item .m-kind svg { width: 12px; height: 12px; }
.viewer-media { background: #000; border-radius: 14px; overflow: hidden; max-height: 60vh; display: flex; align-items: center; justify-content: center; }
.viewer-media img, .viewer-media video { max-height: 60vh; width: 100%; object-fit: contain; }
.tag { display: inline-block; font-size: 12px; color: var(--blue-2); margin-right: 8px; }
.upload-list { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-list img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- directory (SearchBar / MemberRow / ActionIconButton) ---------- */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; margin: 0 var(--page-x) 12px; min-height: 48px; color: var(--dimmer); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.search input { flex: 1; background: transparent; border: 0; outline: none; font-size: 15px; color: var(--text); min-width: 0; -webkit-appearance: none; }
.search input::placeholder { color: var(--dimmer); }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member .name { font-weight: 600; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.member .sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.member-actions { display: flex; gap: 6px; }
.mini-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); transition: transform .12s var(--ease), background .15s; flex-shrink: 0; }
.mini-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mini-btn:active { transform: scale(0.92); }
.mini-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.mini-btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.mini-btn.ghost { background: transparent; }

/* ---------- more / settings ---------- */
.menu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.menu a, .menu button.item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: transparent; color: var(--text); font-size: 15px; font-weight: 500; text-align: left; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.menu a:active, .menu button.item:active { background: var(--card-2); }
.menu a:last-child, .menu button.item:last-child { border-bottom: 0; }
.menu .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--blue-2); flex-shrink: 0; }
.menu .ic svg { width: 17px; height: 17px; }
.menu .chev { margin-left: auto; color: var(--dimmer); display: inline-flex; }
.menu .chev svg, .chev svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card .name { font-size: 20px; font-weight: 700; }
.profile-card .chev { color: var(--dimmer); display: inline-flex; }
.notif { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--text); }
.notif:last-child { border-bottom: 0; }
.notif.unread .t { color: var(--text); }
.notif .t { font-weight: 600; font-size: 14px; color: var(--dim); }
.notif .b { font-size: 13px; color: var(--dim); margin-top: 2px; }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 6px; flex-shrink: 0; }
.notif .dot.off { background: transparent; }

/* ---------- placeholder (Messages / Video) ---------- */
.coming { text-align: center; padding: 48px 28px; display: flex; flex-direction: column; align-items: center; }
.coming .big { display: none; }
.coming .coming-ic { width: 84px; height: 84px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--blue-2); box-shadow: var(--shadow-card); margin-bottom: 18px; }
.coming .coming-ic svg { width: 38px; height: 38px; }
.coming h2 { font-size: 24px; margin: 6px 0 8px; }
.coming p { color: var(--dim); line-height: 1.55; max-width: 320px; }
.coming .chip { margin-bottom: 4px; }

/* ---------- bottom nav / FAB (BottomNavigation / FloatingCreateButton) ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(8,13,20,0.86); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-top: 1px solid var(--line); display: flex; align-items: stretch; justify-content: space-around; z-index: 20; max-width: 640px; margin: 0 auto; }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--dimmer); font-size: 11px; font-weight: 600; letter-spacing: 0.01em; transition: color .15s, transform .12s var(--ease); }
.bottom-nav a:active { transform: scale(0.94); }
.bottom-nav a.active { color: var(--blue-2); }
.bottom-nav a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav a.active svg { stroke-width: 2.1; }
.nav-spacer { flex: 1; }
.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) - 24px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--bg); background: var(--blue); color: #fff; box-shadow: 0 10px 26px var(--blue-glow), 0 2px 8px rgba(0,0,0,0.4); z-index: 21; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .14s var(--ease), background .15s; }
.fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fab:active { transform: translateX(-50%) scale(0.92); background: var(--blue-2); }

/* ---------- sheet / toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.62); animation: fade .18s ease-out; }
.sheet-panel { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 8px var(--page-x) calc(24px + env(safe-area-inset-bottom)); animation: up .22s var(--ease); box-shadow: 0 -10px 40px rgba(0,0,0,0.5); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-list h2 { font-size: 20px; margin-bottom: 6px; }
.sheet-list .btn { justify-content: flex-start; padding: 14px 16px; gap: 12px; }
.sheet-list .btn .ic { width: 36px; height: 36px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--blue-2); flex-shrink: 0; }
.sheet-list .btn.btn-primary .ic { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.2); color: #fff; }
.sheet-list .btn .ic svg { width: 18px; height: 18px; }
.sheet-list .btn .lbl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.sheet-list .btn .lbl small { font-size: 12px; font-weight: 500; color: var(--dim); }
.sheet-list .btn.btn-primary .lbl small { color: rgba(255,255,255,0.75); }
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); background: var(--card-2); border: 1px solid var(--line-strong); color: var(--text); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; z-index: 60; box-shadow: var(--shadow-float); max-width: 90vw; text-align: center; animation: up .2s var(--ease); }
.toast.error { background: #3a1216; border-color: rgba(239,68,68,0.45); color: #fca5a5; }
.toast.success { border-color: rgba(34,197,94,0.45); }

/* ---------- responsive ---------- */
@media (min-width: 700px) { .masonry { columns: 3; } .sk-grid { columns: 3; } }
@media (hover: hover) {
  .icon-btn:hover, .mini-btn:hover:not(:disabled), .pill:hover:not(.active) { background: var(--card-2); border-color: var(--line-strong); }
  .btn:hover:not(:disabled):not(.btn-primary) { border-color: var(--line-strong); }
  .bottom-nav a:hover { color: var(--dim); }
  .bottom-nav a.active:hover { color: var(--blue-2); }
  .fab:hover { background: var(--blue-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.empty.compact { padding: 14px; }

/* Stage 1 polish: keep rows from overflowing, hide FAB behind sticky RSVP bar */
.field input, .field select { min-width: 0; }
.field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.member .name { flex-wrap: wrap; }
.member .name .chip { font-size: 11px; padding: 2px 8px; }
body:has(.rsvp-bar) .fab { display: none; }

/* Stage 2: Home — photographic Quick Access + More to Explore */
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photo-card.quick { min-height: 138px; }
.photo-card.quick .photo-body { padding: 9px; }
.photo-card.quick .photo-ic { width: 28px; height: 28px; margin-bottom: 6px; }
.photo-card.quick .photo-title { font-size: clamp(11px, 3.1vw, 15px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-card.quick .photo-sub { font-size: 11px; }
.explore-grid .photo-card.wide { min-height: 150px; }
@media (min-width: 480px) { .photo-card.quick { min-height: 160px; } .photo-card.quick .photo-title { font-size: 15px; } .explore-grid .photo-card.wide { min-height: 180px; } }

/* Stage 3: Trophy Room — search, tabs, album strip, gallery overlays */
.tr-tabs { margin: 0 var(--page-x) 12px; }
.tr-context { display: flex; align-items: center; gap: 8px; margin: 0 var(--page-x) 12px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.tr-context svg { width: 16px; height: 16px; color: var(--blue-2); flex-shrink: 0; }
.tr-context span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-context .tr-clear { display: inline-flex; padding: 4px; border-radius: 8px; color: var(--dim); }
.tr-context .tr-clear:active { background: var(--card-2); }
.album-section { padding-bottom: 0; }
.album-strip { display: flex; gap: 10px; overflow-x: auto; padding: 0 var(--page-x) 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.album-strip::-webkit-scrollbar { display: none; }
.album-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.album-card { position: relative; display: block; flex: 0 0 136px; aspect-ratio: 1 / 1.1; border-radius: var(--r-md); overflow: hidden; background: var(--card-2) center / cover no-repeat; border: 1px solid var(--line); scroll-snap-align: start; transition: transform .12s var(--ease), box-shadow .15s; }
.album-card:active { transform: scale(0.97); }
.album-card.active { box-shadow: 0 0 0 2px var(--blue); border-color: var(--blue); }
.album-card .photo-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,13,20,0) 35%, rgba(8,13,20,0.85) 100%); }
.album-card .album-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; color: #fff; }
.album-card .album-title { font-size: 13px; font-weight: 700; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.album-card .album-sub { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masonry { padding: 0 var(--page-x); column-gap: 8px; }
.masonry .m-item { margin-bottom: 8px; border: 0; }
.m-item .m-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 28px 9px 8px; background: linear-gradient(transparent, rgba(0,0,0,0.78)); color: #fff; }
.m-item .m-foot .m-cap { position: static; padding: 0; background: none; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m-item .m-stats { display: inline-flex; gap: 8px; flex-shrink: 0; font-size: 12px; font-weight: 600; }
.m-item .m-stats span { display: inline-flex; align-items: center; gap: 3px; }
.m-item .m-stats svg { width: 14px; height: 14px; }
.m-item .m-stats span.on svg { fill: var(--blue); color: var(--blue); }
@media (min-width: 700px) { .album-card { flex-basis: 170px; } .album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Stage 4: Frontiersmen directory + profile */
.member-main { min-width: 0; }
.member .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.avatar.online::after { content: ''; position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--card); }
.profile-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 16px 16px; }
.profile-hero .ph-name { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin-top: 12px; }
.profile-hero .ph-role { font-size: 13px; color: var(--dim); margin-top: 4px; }
.profile-hero .ph-stats { display: flex; gap: 28px; margin-top: 16px; }
.profile-hero .ph-stats div { display: flex; flex-direction: column; align-items: center; }
.profile-hero .ph-stats b { font-size: 20px; font-weight: 700; }
.profile-hero .ph-stats span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dimmer); margin-top: 2px; }
.profile-hero .ph-actions { width: 100%; margin-top: 18px; }
.ph-bio { font-size: 15px; line-height: 1.5; color: var(--text); }
.ph-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ph-thumb { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line); transition: transform .12s var(--ease); }
.ph-thumb:active { transform: scale(0.96); }
.ph-thumb img, .ph-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-thumb .m-kind { padding: 4px; }

/* Stage 5: Calendar — toolbar, carded month/week grid, day list */
.cal-toolbar { display: flex; align-items: center; gap: 10px; padding: 4px var(--page-x) 12px; }
.cal-toolbar .seg { min-width: 0; }
.cal-card { padding: 8px 8px 10px; }
.cal-card .cal-head { padding: 2px 4px 8px; }
.cal-card .cal-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.cal-card .cal-head .icon-btn { width: 36px; height: 36px; background: var(--card-2); }
.cal-card .cal-grid { padding: 0; gap: 2px; }
.cal-dow { font-size: 10px; padding: 6px 0 4px; }
.cal-day { font-size: 14px; border-radius: 10px; }
.cal-day.today { border-color: transparent; background: var(--blue-soft); color: var(--blue-2); }
.cal-day.today.selected { background: var(--blue); color: #fff; }
.cal-card .week-strip { padding: 0; gap: 4px; }
.cal-card .week-day { background: var(--card-2); padding: 8px 2px; border-radius: 12px; }
.cal-day-list { padding-top: 0; }
.cal-day-list .section-title { margin-top: 4px; }
.cal-day-list .empty.compact { padding: 22px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.month-label.past-label { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Stage 6/7: Messages & Video placeholders — photographic coming-soon hero + feature list */
.coming-hero { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 280px; display: flex; align-items: flex-end; background: var(--card) center/cover no-repeat; border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.coming-hero .photo-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(8,13,20,0.15), rgba(8,13,20,0.55) 45%, rgba(8,13,20,0.96)); }
.coming-hero-body { position: relative; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.coming-hero .coming-ic { width: 52px; height: 52px; border-radius: 16px; background: rgba(17,28,40,0.75); border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; color: var(--blue-2); margin-bottom: 4px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.coming-hero .coming-ic svg { width: 24px; height: 24px; }
.coming-hero h2 { font-size: 24px; line-height: 1.1; }
.coming-hero p { color: var(--dim); font-size: 14px; line-height: 1.5; max-width: 340px; }
.coming-list .coming-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.coming-list .coming-row:last-child { border-bottom: 0; }
.coming-list .ic { width: 36px; height: 36px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--blue-2); flex-shrink: 0; }
.coming-list .ic svg { width: 18px; height: 18px; }
.coming-list .t { font-weight: 600; font-size: 15px; }
.coming-list .s { font-size: 13px; color: var(--dim); margin-top: 1px; }
.coming-actions { margin-top: 16px; }

/* Stage 8: More / Settings — profile card (a.card beat .profile-card on specificity), menu labels, footer */
a.card.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.profile-card .name { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card .role { font-size: 13px; color: var(--dim); margin-top: 2px; }
.profile-card .edit { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--blue-2); margin-top: 8px; }
.profile-card .edit svg { width: 14px; height: 14px; }
.profile-card .chev { margin-left: auto; flex-shrink: 0; }
.menu .lbl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.menu .chip { margin-left: -4px; }
.more-foot { text-align: center; margin-top: 22px; }
.section-title:first-child { margin-top: 4px; }
.card > .section-title:first-child { margin-top: 0; }
.member.muted .name { color: var(--dim); }

/* Stage 9: responsive / accessibility / performance polish */
.topbar .hd-sub { font-size: 10.5px; letter-spacing: 0.16em; line-height: 1.4; }
.topbar .hd-title h1 { overflow-wrap: anywhere; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 600; transition: top .15s; }
.skip-link:focus { top: calc(12px + env(safe-area-inset-top)); }
.seg button:focus-visible, .pill:focus-visible, .cal-day:focus-visible, .m-item:focus-visible, .photo-card:focus-visible, .album-card:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.cal-day { min-height: 40px; }
.m-item img, .m-item video, .album-card, .photo-card, .hero-bg { content-visibility: auto; }
.m-item img { background: var(--card-2); }
@media (min-width: 480px) { :root { --page-x: 20px; } }
@media (min-width: 900px) {
  .view, .bottom-nav, .sheet-panel { max-width: 760px; }
  .topbar h1 { font-size: 34px; }
  .ph-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .quick-grid { gap: 14px; }
  .fab { bottom: calc(var(--nav-h) - 22px + env(safe-area-inset-bottom)); }
}
@media (min-width: 1200px) { .view, .bottom-nav, .sheet-panel { max-width: 840px; } }
@media (hover: hover) { .m-item:hover img, .m-item:hover video { transform: scale(1.02); } .m-item img, .m-item video { transition: transform .25s var(--ease); } .photo-card:hover, .album-card:hover, a.card:hover { border-color: var(--line-strong); } }
@media (prefers-contrast: more) { :root { --line: rgba(255,255,255,0.22); --dim: #B8C4D2; --dimmer: #8A99AB; } }

/* ---------- Phase 2: Messages ---------- */
.bottom-nav a { position: relative; }
.bottom-nav a .badge-dot { top: 4px; right: calc(50% - 26px); }
.topbar .chat-hd { text-align: center; }
.topbar .chat-hd h1 { font-size: 18px; }
.topbar .chat-hd .hd-sub { margin-top: 2px; letter-spacing: 0.08em; text-transform: none; font-weight: 600; }
.conv-list { padding-top: 0; padding-bottom: 0; }
.conv-list.flat { padding: 12px; }
.conv { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.conv:last-child { border-bottom: 0; }
.conv .name { font-weight: 600; font-size: 15px; }
.conv .sub { font-size: 13px; color: var(--dim); margin-top: 2px; }
.conv.unread .name { color: #fff; }
.conv.unread .sub { color: var(--text); font-weight: 500; }
.conv .conv-time { flex-shrink: 0; margin-left: 8px; }
.conv .cnt { flex-shrink: 0; margin-left: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.conv-main { min-width: 0; }
.avatar.conv-ic { background: var(--blue-soft); color: var(--blue-2); border: 1px solid rgba(38,132,255,0.35); }
.avatar.conv-ic svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar.conv-ic.adventure { background: var(--card-2); color: var(--text); border-color: var(--line-strong); }
.chat-wrap { padding: 4px var(--page-x) 12px; min-height: calc(100vh - 220px); display: flex; flex-direction: column; justify-content: flex-end; }
.chat-more { text-align: center; padding: 6px 0 12px; }
.chat-log { display: flex; flex-direction: column; gap: 6px; }
.day-sep { text-align: center; margin: 14px 0 8px; }
.day-sep span { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dimmer); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar.sm { flex-shrink: 0; margin-bottom: 22px; }
.msg-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.msg.mine .msg-body { align-items: flex-end; }
.msg .who { font-size: 12px; font-weight: 600; color: var(--blue-2); margin: 0 0 3px 6px; }
.msg .bubble { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-size: 15px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; max-width: 100%; }
.msg.mine .bubble { background: var(--blue); border-color: var(--blue); color: #fff; border-radius: 18px 18px 6px 18px; }
.msg.mine .bubble a { color: #fff; text-decoration: underline; }
.msg .bubble.deleted { font-style: italic; color: var(--dimmer); background: transparent; border-style: dashed; }
.msg.mine .bubble.deleted { color: var(--dimmer); }
.msg .bubble .txt { white-space: pre-wrap; }
.msg .msg-photo { display: block; margin: -4px -8px 6px; }
.msg .bubble .txt + .msg-photo, .msg .msg-photo:last-child { margin-bottom: -4px; }
.msg .msg-photo img { display: block; width: min(260px, 70vw); max-height: 320px; object-fit: cover; border-radius: 14px; background: var(--card-2); }
.msg .meta { font-size: 11px; color: var(--dimmer); margin: 3px 6px 0; }
.msg-reacts { display: flex; gap: 4px; flex-wrap: wrap; margin: -8px 4px 0; position: relative; z-index: 1; }
.msg-reacts:empty { display: none; }
.rchip { border: 1px solid var(--line); background: var(--bg-2); border-radius: 999px; padding: 2px 8px; font-size: 12px; color: var(--text); cursor: pointer; line-height: 1.4; }
.rchip.on { border-color: rgba(38,132,255,0.5); background: var(--blue-soft); color: var(--blue-2); }
.msg-tools { display: flex; gap: 6px; margin: 6px 4px 2px; }
.msg-tools .react-btn.danger { color: var(--danger); border-color: rgba(239,68,68,0.4); }
.chat-composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 18%); padding: 14px var(--page-x) 10px; z-index: 4; }
.chat-composer .bar { display: flex; align-items: flex-end; gap: 8px; }
.chat-composer textarea { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line-strong); border-radius: 21px; padding: 11px 14px; min-height: 42px; max-height: 140px; resize: none; font-size: 15px; line-height: 1.35; outline: none; }
.chat-composer textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.chat-composer .icon-btn { flex-shrink: 0; }
.chat-composer .attach-preview { margin: 0 0 8px; display: inline-block; }
.chat-composer .attach-preview img { max-height: 140px; border-radius: 12px; }
.chat-composer .attach-x { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; background: var(--bg-2); }
.chat-composer .attach-x svg { width: 14px; height: 14px; }
.chat-composer .typing { font-size: 12px; color: var(--dim); padding: 0 8px 6px; }
body:has(.chat-composer) .fab { display: none; }
.member.pick { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.member.pick svg { width: 18px; height: 18px; color: var(--dimmer); fill: none; stroke: currentColor; stroke-width: 1.8; }
.member.pick input { width: 20px; height: 20px; accent-color: var(--blue); flex-shrink: 0; }
.lightbox img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: #000; margin-bottom: 12px; }
.adv-chat-card .name { font-weight: 600; font-size: 16px; }

/* ---------- Invite links + public join page (/join/<token>) ---------- */
.join-card h2 { font-size: 22px; line-height: 1.25; }
.join-card form { display: flex; flex-direction: column; gap: 14px; }
.join-tips { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.join-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--dim); line-height: 1.45; }
.join-steps b { color: var(--text); font-weight: 600; }
.join-done { display: flex; justify-content: center; margin-top: 4px; }
.join-done .ic-svg { width: 60px; height: 60px; color: var(--ok); stroke-width: 2; }
.invite-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.invite-row:last-of-type { border-bottom: 0; }
.invite-row .name { font-weight: 600; }
.invite-row .sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.invite-row.muted .name { color: var(--dim); }
.invite-row .ic-plate { width: 36px; height: 36px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--blue-2); flex-shrink: 0; }
.invite-row.muted .ic-plate { color: var(--dimmer); }
.invite-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; user-select: all; -webkit-user-select: all; line-height: 1.4; }
.invite-qr summary { cursor: pointer; font-weight: 600; color: var(--blue-2); list-style: none; }
.invite-qr summary::-webkit-details-marker { display: none; }
.invite-qr summary::before { content: '▸ '; }
.invite-qr[open] summary::before { content: '▾ '; }
.qr-wrap { display: flex; justify-content: center; margin: 12px 0 6px; }
.qr-wrap img { width: 240px; height: 240px; background: #fff; padding: 10px; border-radius: 16px; box-shadow: var(--shadow-card); }
