/* ============================================================
   活動島嶼 — dark "Modern Product" design system
   Mobile-first. Tokens → primitives → components → responsive.
   ============================================================ */
:root {
  /* color — dark (default theme). Accent = 橘紅 (orange-red), --accent-2 is the
     warm gradient partner every former "purple #9aa6ff" pairing now uses. */
  --bg: #0a0b0e;
  --bg-1: #0e1014;
  --surface: #14161c;
  --surface-2: #191c23;
  --elevated: #1f232b;
  --border: rgba(255,255,255,.07);
  --border-2: rgba(255,255,255,.12);
  --text: #eceef2;
  --text-2: #9aa1ad;
  --text-3: #646b78;
  --accent: #ff5a36;
  --accent-press: #f04a24;
  --accent-2: #ffa64d;
  --accent-ink: #ffb39f;
  --accent-soft: rgba(255,90,54,.16);
  --ok: #34d399;
  --ok-soft: rgba(52,211,153,.14);
  --warn: #f5b53d;
  --warn-soft: rgba(245,181,61,.14);
  --danger: #ff7a7a;
  --danger-soft: rgba(255,122,122,.14);

  /* space (4pt) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  /* radii */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;
  /* elevation (dark: rely on borders + soft glow) */
  --sh-1: 0 1px 0 rgba(255,255,255,.03), 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 8px 24px rgba(0,0,0,.45);
  --sh-3: 0 24px 64px rgba(0,0,0,.6);
  /* motion */
  --ease: cubic-bezier(.2,.8,.2,1);
  --fast: .14s; --med: .24s; --slow: .36s;

  --appbar-h: 56px;
  --tabbar-h: 60px;

  color-scheme: dark;
  font-family: "Manrope", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* 亮色主題 — index.html 的 head 內聯腳本在首繪前就設好 data-theme（無閃爍）。
   3D 島嶼舞台（detail/profile hero、編輯器）刻意保持深色底：畫布內容自帶配色。 */
:root[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-1: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --elevated: #ffffff;
  --border: rgba(16,20,28,.09);
  --border-2: rgba(16,20,28,.16);
  --text: #191b21;
  --text-2: #4d5462;
  --text-3: #8a91a0;
  --accent-ink: #d43e1c;
  --accent-soft: rgba(255,90,54,.12);
  --ok: #0f9d6b;
  --warn: #b97f0f;
  --danger: #cf2f2f;
  --danger-soft: rgba(207,47,47,.12);
  --sh-1: 0 1px 2px rgba(16,20,28,.08);
  --sh-2: 0 8px 24px rgba(16,20,28,.12);
  --sh-3: 0 24px 64px rgba(16,20,28,.18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); overscroll-behavior-y: none; overflow-x: clip; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- app bar ---------- */
.appbar {
  /* fixed (not sticky) — inside a native WKWebView, a `sticky` header pinned at
     the very top can show a blank gap above it during rubber-band overscroll;
     `fixed` removes it from flow entirely so scroll position can't affect it.
     .app below adds matching padding-top to make room for it.
     z-index higher than .filterbar/.tabbar (both 30) so header popovers
     (language menu, account menu) never render underneath sticky content
     that follows the header in DOM order. */
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  /* min-height, NOT height: a rigid height + padding-top:env(safe-area-inset-top)
     under border-box either clips content or overflows unpredictably depending on
     the device's actual inset (Dynamic Island ≈59px, notch ≈47px, none = 0px,
     landscape differs again) — that mismatch was exactly "nav擠太上面了" on some
     devices. min-height lets the box grow to fit both content AND the inset. */
  min-height: var(--appbar-h);
  display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s4);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--border);
  /* +var(--s3) beyond the raw inset: the inset alone gets content to CLEAR the
     notch/Dynamic Island/status bar, but leaves zero breathing room above it —
     content sits pressed flush against that line. This adds a deliberate gap. */
  padding-top: calc(env(safe-area-inset-top) + var(--s3));
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; display: block; box-shadow: 0 0 14px rgba(222,74,31,.35); }
.appbar-links { display: none; gap: var(--s1); margin-left: var(--s4); }
.appbar-links a, .seg-link { padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--text-2); border: none; background: transparent; }
.appbar-links a:hover, .seg-link:hover { color: var(--text); background: var(--surface-2); }
.appbar-links a.active, .seg-link.active { color: var(--text); }
.appbar-spacer { flex: 1; }
.appbar-search { display: none; position: relative; }
.appbar-search input { width: 260px; height: 38px; padding: 0 14px 0 36px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); font-size: 14px; transition: border-color var(--fast), box-shadow var(--fast), width var(--med) var(--ease); }
.appbar-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); width: 300px; }
.appbar-search .s-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--text-2); transition: background var(--fast), border-color var(--fast), color var(--fast), transform var(--fast); }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
/* header's right-side buttons (search/theme/language/account): no fill by default —
   adjacent solid circles were crowding each other; transparent backgrounds read as
   more spaced out even at the same gap. Hover still shows a background for affordance. */
.appbar .icon-btn, .appbar .account-btn { background: transparent; border-color: transparent; }
.appbar .icon-btn:hover, .appbar .account-btn:hover { background: var(--surface-2); border-color: var(--border); }

/* ---------- layout ---------- */
/* padding-top compensates for .appbar now being position:fixed (out of flow).
   --appbar-real-h is measured live off the actual header box (app.js), which is
   the only reliable source once min-height can grow past --appbar-h; the calc()
   fallback only matters for the first paint before that JS measurement lands. */
.app { max-width: 1160px; margin: 0 auto; padding: var(--appbar-real-h, calc(var(--appbar-h) + env(safe-area-inset-top))) var(--s4) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s8)); }
.view[hidden] { display: none; }
.view-head { padding: var(--s6) 0 var(--s4); }
.view-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 4px; }
.view-head p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- filter bar ---------- */
.filterbar {
  position: sticky; top: var(--appbar-real-h, calc(var(--appbar-h) + env(safe-area-inset-top))); z-index: 30;
  display: flex; justify-content: center; padding: var(--s3) 0; margin: 0 calc(-1 * var(--s4)); padding-left: var(--s4); padding-right: var(--s4);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  /* guarantees breathing room between the pill (.filter-scroll) and the near-me/
     view-toggle/collapse cluster (.filter-tools) — without this, .filter-scroll's
     OWN centering of its capped-width pill could put that pill's edge right up
     against .filter-tools with zero reserved space between the two flex siblings. */
  gap: var(--s4);
}
/* Airbnb-style segmented search bar. max-width scales with the viewport (via
   clamp) instead of a single fixed cap — a flat 560px left an obviously empty gap
   on wide desktop windows; clamp grows it up to 900px but never so wide that the
   4 short chip labels look stretched out and sparse. */
/* width (not max-width) is the clamp itself: a flex-grow item can't both "grow to
   fill leftover space" AND "let the parent center the group with that leftover as
   equal outer margins" — grow always consumes the leftover first, which is what
   made the gap before .filter-tools balloon on wide screens. Sizing directly off
   the viewport sidesteps flex-grow entirely, so .filterbar's justify-content:center
   genuinely centers the (pill + gap + tools) unit with even margins on both sides. */
.searchbar { display: flex; align-items: center; gap: 2px; width: clamp(560px, 45vw, 900px); max-width: 100%; padding: 5px 5px 5px 6px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: var(--surface); box-shadow: var(--sh-1); }
.sb-seg { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 16px; border: 0; border-radius: var(--r-full); background: transparent; text-align: left; transition: background var(--fast); }
.sb-seg:hover { background: var(--surface-2); }
.sb-seg.active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-2); }
.sb-k { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .02em; }
.sb-v { font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sb-v.on { color: var(--text); }
.sb-sep { width: 1px; height: 26px; background: var(--border); flex: 0 0 auto; }
.sb-go { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--accent); color: #fff; }
.sb-go svg { width: 18px; height: 18px; }
.sb-go[data-on] { box-shadow: 0 0 0 3px var(--accent-soft); }
.sb-go-label { display: none; }  /* shown only in the mobile full-width redesign below */

/* facet popover — anchored card (desktop) / bottom sheet (mobile) */
.facet-pop { position: fixed; inset: 0; z-index: 45; }
.facet-scrim { position: absolute; inset: 0; background: rgba(4,5,7,.5); backdrop-filter: blur(2px); animation: fade var(--med); }
.facet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto;
  padding: var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border-2);
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--sh-3); animation: sheet-up var(--med) var(--ease); }
.facet-head { font-size: 13px; font-weight: 800; color: var(--text-3); letter-spacing: .04em; margin-bottom: var(--s3); }
.facet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.fo { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 46px; padding: 0 14px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 600; }
.fo:hover { border-color: var(--border-2); }
.fo.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.fo[disabled] { opacity: .35; pointer-events: none; }
.fo-n { font-size: 12px; font-weight: 700; opacity: .55; }
.fo.on .fo-n { opacity: .8; }
.fo-near { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 14px; margin-bottom: var(--s3); border-radius: var(--r-lg); border: 1px solid var(--accent-soft); background: var(--accent-soft); color: var(--accent-ink); text-align: left; }
.fo-near svg { width: 20px; height: 20px; flex: 0 0 auto; }
.fo-near b { display: block; font-size: 14px; }
.fo-near small { color: var(--text-3); font-size: 12px; }
.fo-near.on { box-shadow: inset 0 0 0 2px var(--accent); }
.facet-rows { display: flex; flex-direction: column; gap: var(--s2); }
.fo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-align: left; }
.fo-row.on { box-shadow: inset 0 0 0 2px var(--text); }
.fo-row b { display: block; font-size: 15px; font-weight: 700; }
.fo-row small { color: var(--text-3); font-size: 12px; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (min-width: 720px) {
  .facet-scrim { background: rgba(4,5,7,.28); backdrop-filter: none; }
  .facet-panel {
    left: 50%; right: auto; bottom: auto; transform: translateX(-50%);
    top: calc(var(--appbar-real-h, calc(var(--appbar-h) + env(safe-area-inset-top))) + 64px);
    width: min(560px, calc(100vw - 48px)); max-height: 70vh;
    border: 1px solid var(--border-2); border-radius: var(--r-xl); animation: pop var(--med) var(--ease);
  }
}
/* pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: var(--s5) 0 var(--s3); }
.pg-num, .pg-arrow { min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 700; }
.pg-num:hover, .pg-arrow:not([disabled]):hover { border-color: var(--border-2); color: var(--text); }
.pg-num.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.pg-arrow[disabled] { opacity: .35; }
.pg-gap { color: var(--text-3); padding: 0 2px; }

/* ---------- detail hero: my ticket QR (default if held) ⇄ island ---------- */
.hero-qr, .hero-island { position: absolute; transition: inset .28s var(--ease), width .28s var(--ease), height .28s var(--ease), border-radius .28s var(--ease); }
.hero-island { background: var(--bg-1); }
.hero-qr { display: grid; place-items: center; background: radial-gradient(120% 120% at 50% 20%, #20242e, #0e1016); }
:root { --pip-w: 132px; --pip-h: 96px; }
/* QR is the main view; island is the corner thumbnail */
.detail-hero.qr-main .hero-qr { inset: 0; width: 100%; height: 100%; z-index: 0; }
.detail-hero.qr-main .hero-island { right: 14px; bottom: 14px; width: var(--pip-w); height: var(--pip-h); border-radius: var(--r-lg); z-index: 2; box-shadow: 0 8px 24px rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.85); }
.detail-hero.qr-main .build-bar, .detail-hero.qr-main .visual-cap { display: none; }
/* swapped: island is the main view, QR is the thumbnail */
.detail-hero.island-main .hero-island { inset: 0; width: 100%; height: 100%; border-radius: 0; z-index: 0; }
.detail-hero.island-main .hero-qr { right: 14px; bottom: 14px; width: var(--pip-w); height: var(--pip-h); border-radius: var(--r-lg); overflow: hidden; z-index: 2; box-shadow: 0 8px 24px rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.85); }
/* QR content */
.hero-qr-inner { text-align: center; padding: 12px; }
.hero-qr-code { width: 200px; height: 200px; margin: 0 auto 12px; background: #fff; border-radius: 14px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); display: grid; place-items: center; }
.hero-qr-code img { width: 100%; height: 100%; display: block; }
.hero-qr-meta { font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: .02em; }
.hero-qr-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
/* when QR is the small thumbnail, hide the text — just show the code */
.detail-hero.island-main .hero-qr-meta, .detail-hero.island-main .hero-qr-hint { display: none; }
.detail-hero.island-main .hero-qr-code { width: 100%; height: 100%; margin: 0; border-radius: 0; box-shadow: none; padding: 6px; }
/* the PiP toggle button sits on the thumbnail corner */
.hero-pip { position: absolute; right: 14px; bottom: 14px; width: var(--pip-w); height: var(--pip-h); z-index: 3; border: 0; background: transparent; border-radius: var(--r-lg); cursor: pointer; display: flex; align-items: flex-start; justify-content: flex-end; padding: 7px; }
.hero-pip[hidden] { display: none; }
.hero-pip-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: #fff; padding: 4px 11px; border-radius: var(--r-full); background: rgba(8,9,12,.72); backdrop-filter: blur(4px); box-shadow: 0 1px 4px rgba(0,0,0,.3); pointer-events: none; }
.hero-pip-label::before { content: "⤢"; font-size: 13px; }
.hero-pip:hover .hero-pip-label { background: rgba(8,9,12,.9); }

/* ---------- feed ---------- */
.feed { padding-top: var(--s5); display: flex; flex-direction: column; gap: var(--s6); }
.section-label { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text-3); letter-spacing: .04em; text-transform: none; margin-bottom: calc(-1 * var(--s2)); }
.grid { display: grid; grid-template-columns: 1fr; gap: var(--s4); }

/* card */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; transition: transform var(--fast) var(--ease), border-color var(--fast), box-shadow var(--fast); will-change: transform; }
.card:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: var(--sh-2); }
.card:active { transform: translateY(0) scale(.992); }
.card-cover { position: relative; aspect-ratio: 16/10; background: linear-gradient(160deg, #1a1e28, #111319); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(8,9,12,.55)); }
.skeleton { position: absolute; inset: 0; background: linear-gradient(100deg, #16191f 30%, #1d212a 50%, #16191f 70%); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.badge { position: absolute; z-index: 2; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-full); backdrop-filter: blur(8px); }
.badge-cat { top: 10px; left: 10px; background: rgba(20,22,28,.7); border: 1px solid var(--border-2); color: var(--text); }
.badge-going { bottom: 10px; left: 10px; background: rgba(8,9,12,.5); color: #eef0f3; display: inline-flex; align-items: center; gap: 5px; }
.badge-going .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.card-body { padding: var(--s4); }
.card-date { font-size: 13px; font-weight: 700; color: var(--accent-ink); letter-spacing: -.01em; margin-bottom: 5px; }
.past-tag { font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface-2); padding: 1px 7px; border-radius: var(--r-full); }
.ongoing-tag, .ongoing-text { color: var(--accent-ink); background: var(--accent-soft); }
.ongoing-text { background: none; padding: 0; }
/* island as circular corner badge when a cover image is present */
.island-badge { position: absolute; z-index: 2; bottom: 10px; right: 10px; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,255,255,.8); background: var(--surface-2); box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.island-badge img { width: 100%; height: 100%; object-fit: cover; }
/* AI link auto-fill row in the editor */
.ai-link { display: flex; gap: var(--s2); margin-bottom: var(--s3); }
.ai-link input { flex: 1; min-width: 0; height: 44px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface); padding: 0 14px; font-size: 14px; color: var(--text); }
.ai-link input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ai-link .btn { height: 44px; padding: 0 16px; white-space: nowrap; }
.card-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.35; margin: 0 0 var(--s3); }
.card-meta { display: flex; flex-direction: column; gap: 6px; }
.meta-row { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.meta-row svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--text-3); }
.mine-tag { display: inline-flex; align-items: center; gap: 5px; margin-top: var(--s3); font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 4px 10px; border-radius: var(--r-full); }
.mine-tag svg { width: 13px; height: 13px; }

/* featured hero */
.feature { position: relative; border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
.feature:hover { border-color: var(--border-2); box-shadow: var(--sh-2); }
.feature-cover { position: relative; aspect-ratio: 16/10; background: linear-gradient(160deg, #1a1e28, #0f1116); }
.feature-cover img { width: 100%; height: 100%; object-fit: cover; }
.feature-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(8,9,12,.82)); }
.feature-body { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s5); }
.feature .pill-row { display: flex; gap: 6px; margin-bottom: var(--s2); }
.feature-title { font-size: 22px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; }
.feature-sub { display: flex; flex-wrap: wrap; gap: var(--s4); font-size: 13px; color: var(--text-2); }
.feature-sub b { color: var(--accent-ink); font-weight: 700; }
.feature-sub span { display: inline-flex; align-items: center; gap: 6px; }
.feature-sub svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--text-3); }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-full); background: rgba(20,22,28,.7); border: 1px solid var(--border-2); backdrop-filter: blur(8px); }
.pill.pill-ongoing { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: none; color: var(--text-3); font-size: 11px; font-weight: 700; transition: color var(--fast); }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--text); }
.tab .badge-num { position: absolute; transform: translate(12px,-12px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-full); background: var(--accent); color: #fff; font-size: 10px; display: grid; place-items: center; }

/* ---------- sheet (detail / search) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(4,5,7,.62); backdrop-filter: blur(3px); animation: fade var(--med); }
@keyframes fade { from { opacity: 0; } }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; top: 0;
  background: var(--bg-1); display: flex; flex-direction: column; overflow: hidden;
  animation: sheetup var(--slow) var(--ease);
}
@keyframes sheetup { from { transform: translateY(6%); opacity: .6; } }
@keyframes pop { from { transform: translate(-50%,-48%) scale(.98); opacity: .5; } }

/* detail */
.detail-hero { position: relative; height: 42vh; min-height: 240px; overflow: hidden; background: linear-gradient(180deg, #1a1f2e, #0e1016); flex: 0 0 auto; }
#island-canvas { display: block; touch-action: none; }
.detail-back { position: absolute; top: calc(var(--s3) + env(safe-area-inset-top)); left: var(--s3); z-index: 3; height: 38px; padding: 0 14px 0 10px; display: inline-flex; align-items: center; gap: 4px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: rgba(10,11,14,.6); backdrop-filter: blur(8px); font-size: 13px; font-weight: 700; }
.detail-back svg { width: 16px; height: 16px; }
.detail-share { position: absolute; top: calc(var(--s3) + env(safe-area-inset-top)); right: calc(var(--s3) + 48px); z-index: 3; height: 38px; padding: 0 14px 0 11px; display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: rgba(10,11,14,.6); backdrop-filter: blur(8px); color: var(--text); font-size: 13px; font-weight: 700; }
.detail-share svg { width: 16px; height: 16px; }
.detail-fav { position: absolute; top: calc(var(--s3) + env(safe-area-inset-top)); right: var(--s3); z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-2); background: rgba(10,11,14,.6); backdrop-filter: blur(8px); color: var(--text); display: grid; place-items: center; }
.detail-fav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; }
.detail-fav.on svg { fill: #ff5a7a; stroke: #ff5a7a; }
.detail-fav:active { transform: scale(.92); }
/* heart on event cards */
.fav-btn { position: absolute; top: 10px; right: 10px; z-index: 4; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(10,11,14,.5); backdrop-filter: blur(6px); color: #fff; display: grid; place-items: center; }
.fav-btn svg { width: 19px; height: 19px; fill: none; stroke: #fff; transition: transform var(--fast); }
.fav-btn.on svg { fill: #ff5a7a; stroke: #ff5a7a; }
.fav-btn:active svg { transform: scale(.8); }
.fav-btn.fav-row { position: static; width: 30px; height: 30px; background: transparent; backdrop-filter: none; flex: 0 0 auto; }
.fav-btn.fav-row svg { stroke: #ff5a7a; fill: #ff5a7a; }
.plist-n { color: var(--text-3); font-weight: 700; }
/* favorite collections (boards) */
.coll-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: var(--s2); margin-bottom: var(--s2); }
.coll-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.coll-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.coll-chip .coll-n { font-size: 11px; opacity: .6; }
.coll-chip.coll-add { color: var(--accent-ink); border-color: var(--accent-soft); background: var(--accent-soft); }
.coll-manage { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.coll-vis { height: 30px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 700; }
.btn-soft.xs { height: 30px; padding: 0 12px; font-size: 12px; }
.fav-item .fav-move { flex: 0 0 auto; max-width: 104px; height: 30px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font-size: 12px; }
.fav-item .fav-move:focus { outline: none; border-color: var(--accent); }
.fav-empty { color: var(--text-3); font-size: 13px; padding: 12px 2px 4px; }
.coll-block { margin-bottom: var(--s4); }
.coll-head { display: flex; align-items: center; gap: 8px; margin-bottom: var(--s2); }
.coll-head b { font-size: 15px; font-weight: 800; }
.coll-vis-mini { font-size: 11px; color: var(--text-3); font-weight: 600; }
.detail-share:active { transform: scale(.96); }
.build-bar { position: absolute; top: calc(var(--s3) + env(safe-area-inset-top)); right: var(--s3); z-index: 3; display: flex; gap: 5px; padding: 5px; border-radius: 14px; background: rgba(10,11,14,.66); backdrop-filter: blur(10px); border: 1px solid var(--border); }
.build-bar[hidden] { display: none; }
.build-bar button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 700; }
.build-bar button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.visual-cap { position: absolute; left: var(--s4); bottom: var(--s3); z-index: 3; font-size: 12px; font-weight: 600; color: var(--text-2); background: rgba(10,11,14,.5); padding: 5px 11px; border-radius: var(--r-full); backdrop-filter: blur(6px); }

.detail-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s6) var(--s5) 0; }
.detail-tags { display: flex; gap: 6px; margin-bottom: var(--s4); }
.detail-body h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; margin: 0 0 var(--s5); }
.info-list { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s6); }
.info-item { display: flex; gap: var(--s3); align-items: center; padding: var(--s3); border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.info-ic { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent-ink); }
.info-ic svg { width: 19px; height: 19px; }
.info-tx .k { font-size: 12px; color: var(--text-3); font-weight: 600; }
.info-tx .v { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.info-tx .v small { font-weight: 400; color: var(--text-2); }
.host { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: var(--s5); }
.host-av { width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-weight: 800; color: #0a0b0e; }
.host .k { font-size: 12px; color: var(--text-3); }
.host .v { font-size: 14px; font-weight: 700; }
.desc { font-size: 14.5px; line-height: 1.8; color: var(--text-2); margin: 0 0 var(--s10); }

/* sticky register dock */
.dock { position: sticky; bottom: 0; margin: 0 calc(-1 * var(--s5)); padding: var(--s4) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg-1) 88%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); display: flex; align-items: center; gap: var(--s4); }
.dock .cap { flex: 1; min-width: 0; }
.dock .cap .bar { height: 5px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.dock .cap .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: var(--r-full); transition: width var(--slow) var(--ease); }
.dock .cap small { font-size: 12px; color: var(--text-2); }
.btn { height: 48px; padding: 0 24px; border-radius: var(--r); border: none; font-size: 15px; font-weight: 800; letter-spacing: -.01em; transition: transform var(--fast), background var(--fast), filter var(--fast); white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.statepill { height: 48px; display: inline-flex; align-items: center; gap: 7px; padding: 0 20px; border-radius: var(--r); font-weight: 700; font-size: 14px; }
.statepill.pending { background: var(--warn-soft); color: var(--warn); }
.statepill.going { background: var(--ok-soft); color: var(--ok); }
.statepill svg { width: 16px; height: 16px; }

/* tickets view */
.tickets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s5); padding-top: var(--s5); }

/* Apple Wallet-style ticket stub */
.pass { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); transition: transform var(--fast), box-shadow var(--fast); }
.pass:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.pass-top { position: relative; height: 132px; overflow: hidden; cursor: pointer; background: linear-gradient(160deg, #1a1e28, #0f1116); }
.pass-top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.pass-top::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(8,9,12,.08), rgba(8,9,12,.66)); }
.pass-cat, .pass-status { position: absolute; z-index: 2; top: 12px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-full); backdrop-filter: blur(8px); }
.pass-cat { left: 12px; background: rgba(20,22,28,.7); border: 1px solid var(--border-2); color: var(--text); }
.pass-status { right: 12px; }
.pass-status.going { background: var(--accent-soft); color: var(--accent-ink); }
.pass-status.checked { background: var(--ok-soft); color: var(--ok); }
.pass-status.pending { background: var(--warn-soft); color: var(--warn); }
.pass-body { padding: var(--s4) var(--s5) var(--s3); }
.pass-body h3 { margin: 0 0 var(--s3); font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; cursor: pointer; }
.pass-rows { display: flex; flex-direction: column; gap: 7px; }
.prow { display: flex; gap: var(--s3); font-size: 13px; align-items: baseline; }
.prow .pl { color: var(--text-3); width: 40px; flex: 0 0 auto; }
.prow .pv { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pv.mono { font-family: ui-monospace, monospace; letter-spacing: .04em; color: var(--accent-ink); }
.pass-perf { position: relative; border-top: 2px dashed var(--border-2); margin: var(--s2) 0; }
.pass-perf::before, .pass-perf::after { content: ""; position: absolute; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--bg); }
.pass-perf::before { left: -11px; } .pass-perf::after { right: -11px; }
.pass-stub { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s5) var(--s4); }
.pass-qr { width: 80px; height: 80px; flex: 0 0 auto; border-radius: 10px; background: #fff; padding: 5px; display: grid; place-items: center; }
.pass-qr img { width: 100%; height: 100%; }
.pass-qr.placeholder { background: var(--surface-2); color: var(--text-3); }
.pass-qr.placeholder svg { width: 26px; height: 26px; }
.pass-stub-info { min-width: 0; flex: 1; }
.pss { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; }
.ticket-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.tact { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 700; }
.tact:hover { background: var(--elevated); }
.tact svg { width: 14px; height: 14px; }

/* add-to-calendar buttons (detail) */
.cal-actions { display: flex; gap: var(--s2); margin-bottom: var(--s6); flex-wrap: wrap; }
.btn-soft { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 700; }
.btn-soft:hover { background: var(--surface-2); }
.btn-soft svg { width: 16px; height: 16px; color: var(--accent-ink); }

/* empty state — vertically centered in the view */
.empty { grid-column: 1 / -1; min-height: 56vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text-3); padding: var(--s10) var(--s6); }
.empty .ill { width: 64px; height: 64px; margin: 0 auto var(--s4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-3); }
.empty .ill svg { width: 28px; height: 28px; }
.empty h3 { color: var(--text-2); font-size: 17px; margin: 0 0 6px; }
.empty p { font-size: 13.5px; margin: 0; max-width: 320px; }

/* search sheet (mobile) */
.search-sheet .sheet-panel { top: 0; bottom: auto; min-height: 100%; }
.search-head { display: flex; align-items: center; gap: var(--s3); padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s4) var(--s3); border-bottom: 1px solid var(--border); }
.search-head input { flex: 1; height: 42px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); padding: 0 14px; font-size: 15px; }
.search-head input:focus { outline: none; border-color: var(--accent); }
.search-cancel { background: none; border: none; color: var(--accent-ink); font-weight: 700; font-size: 14px; padding: 8px; }
/* live results INSIDE the search sheet — no need to dismiss it to see matches */
.search-results { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--s4); padding-bottom: calc(var(--s8) + env(safe-area-inset-bottom)); }
.search-results .grid { grid-template-columns: 1fr; }
.search-results .search-hint { padding: var(--s8) var(--s4); text-align: center; color: var(--text-3); font-size: 14px; }

/* buttons (shared) */
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, transparent); }
.btn-ghost.danger:hover { background: var(--danger-soft); }

/* organizer console */
.org-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.org-actions { display: flex; gap: var(--s2); }
.org-actions .btn { height: 42px; padding: 0 16px; font-size: 14px; }
@media (max-width: 560px) {
  .org-head { align-items: stretch; }
  .org-actions { width: 100%; }
  .org-actions .btn { flex: 1; padding: 0 10px; }
}
/* organizer toolbar (filters + search) */
.org-toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: var(--s4) 0 var(--s2); }
.org-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); }
.org-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border: 0; border-radius: var(--r-full); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.org-tab.active { background: var(--text); color: var(--bg); }
.org-n { font-size: 11px; font-weight: 700; opacity: .6; }
.org-tab.active .org-n { opacity: .8; }
.org-search { flex: 1 1 200px; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-3); }
.org-search svg { width: 16px; height: 16px; flex: 0 0 auto; }
.org-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 14px; color: var(--text); }
.org-search input:focus { outline: none; }
.org-events { display: grid; grid-template-columns: 1fr; gap: var(--s4); padding-top: var(--s2); }
.org-events .pager, .org-events .org-pagewrap { grid-column: 1 / -1; }
.oev { display: grid; grid-template-columns: 84px 1fr; gap: var(--s4); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.oev-cover { width: 84px; height: 84px; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.oev-cover img { width: 100%; height: 100%; object-fit: cover; }
.oev-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.oev-title { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.oev-sub { font-size: 12px; color: var(--text-2); }
.oev-stats { display: flex; gap: var(--s4); margin-top: 2px; }
.oev-stat { font-size: 12px; color: var(--text-2); }
.oev-stat b { display: block; font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.oev-stat.warn b { color: var(--warn); }
.oev-stat.danger b { color: var(--danger); }
.oev-stat.oev-shared { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 0; }
.oev-stat.oev-shared b { display: inline; font-size: 13px; color: var(--accent); }
.oev-badge { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); letter-spacing: .02em; }
.oev-badge-pending { color: var(--warn); background: var(--warn-soft); }
.oev-badge-rejected { color: var(--danger); background: var(--danger-soft); }
.oev-badge-collab { color: var(--ok); background: var(--ok-soft); }

/* 重複刊登防呆的確認清單 */
.dupe-row { display: flex; align-items: center; gap: var(--s3); padding: 12px 14px; border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface-2); margin-bottom: var(--s2); }
.dupe-main { flex: 1 1 auto; min-width: 0; }
.dupe-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 3px; }
.dupe-meta { font-size: 12px; color: var(--text-3); line-height: 1.6; }
.dupe-row .btn-soft { flex: 0 0 auto; }
.dupe-acts { display: flex; gap: var(--s2); margin-top: var(--s3); }
.dupe-acts .btn { flex: 1; justify-content: center; }
/* 協作管理：活動名稱獨立一列（不併進要翻譯的說明句） */
.collab-ev { font-size: 15px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.oev-actions { display: flex; gap: var(--s2); margin-top: var(--s2); flex-wrap: wrap; }
.oev-actions button { height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; }
.oev-actions button:hover { background: var(--elevated); }
.oev-actions button.pending-dot::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-left: 6px; vertical-align: middle; }

/* form sheet (editor / roster) */
.form-panel { position: absolute; left: 0; right: 0; bottom: 0; top: 0; background: var(--bg-1); display: flex; flex-direction: column; overflow: hidden; animation: sheetup var(--slow) var(--ease); }
.form-head { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--s4) + env(safe-area-inset-top)) var(--s5) var(--s4); border-bottom: 1px solid var(--border); }
.form-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.form-close { width: 34px; height: 34px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
/* overflow-x:hidden is a hard backstop — without it, overflow-y:auto implicitly
   computes overflow-x to auto too (CSS pairing rule), so any child that blows out
   horizontally (see .fld min-width fix below) turns the whole modal scrollable. */
.form-body { overflow-y: auto; overflow-x: hidden; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
/* min-width:0 overrides the grid-item default of min-width:auto — without it, a
   child with a wide intrinsic min-content (WebKit's datetime-local especially)
   refuses to shrink below that width and blows out the .fld-row grid track. */
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.fld input, .fld textarea, .fld-select { width: 100%; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); padding: 12px 14px; font-size: 15px; color: var(--text); }
.fld input:focus, .fld textarea:focus, .fld-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fld textarea { resize: vertical; }
/* custom event labels — chip input (organizer) */
.chip-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); padding: 8px 10px; cursor: text; }
.chip-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chip-list { display: contents; }
.chip-input input { flex: 1 1 120px; min-width: 120px; width: auto; border: 0; background: transparent; padding: 4px 2px; }
.chip-input input:focus { outline: none; border: 0; box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.chip button { border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; padding: 0 2px; cursor: pointer; opacity: .7; }
.chip button:hover { opacity: 1; }
/* labels shown on the detail page (tap to search) */
.label-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s5); }
.label-tag { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.label-tag:hover { background: var(--surface-2); color: var(--text); }
.fld-select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23646b78' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.fld-select option { background: var(--surface); color: var(--text); }
.fld-hint { font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.warn-hint { color: var(--warn); font-weight: 600; }
#review-hint { margin: 0 0 var(--s3); padding: 10px 12px; background: var(--warn-soft); border-radius: var(--r); }
/* cover image dropzone */
.dropzone { position: relative; border: 1.5px dashed var(--border-2); border-radius: var(--r); background: var(--surface); aspect-ratio: 16 / 8; display: grid; place-items: center; overflow: hidden; cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dz-empty { text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.7; padding: var(--s3); }
#dz-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dz-remove { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(10,11,14,.7); color: #fff; border: none; border-radius: var(--r-full); padding: 5px 12px; font-size: 12px; font-weight: 700; }
/* uploaded cover banner in event detail */
.detail-cover { margin: 0 0 var(--s5); border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* map embed in detail */
.map-embed { margin: 0 0 var(--s6); border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); position: relative; }
.map-embed iframe { width: 100%; height: 180px; border: 0; display: block; filter: grayscale(.2) brightness(.9); }
.map-open { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s2); font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.map-open svg { width: 14px; height: 14px; }
/* top-center, clear of .badge-cat (top-left) and .fav-btn (top-right) */
.dist-badge { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2; max-width: calc(100% - 100px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(8,9,12,.6); color: #eef0f3; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-full); backdrop-filter: blur(6px); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.fld-toggle { flex-direction: row; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); padding: 10px 14px; }
.fld-toggle input { display: none; }
.fld-toggle .switch { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); position: relative; transition: background var(--fast); flex: 0 0 auto; }
.fld-toggle .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); transition: transform var(--fast), background var(--fast); }
.fld-toggle input:checked + .switch { background: var(--accent-soft); border-color: var(--accent); }
.fld-toggle input:checked + .switch::after { transform: translateX(18px); background: var(--accent); }
.form-foot { display: flex; align-items: center; gap: var(--s3); padding-top: var(--s2); position: sticky; bottom: 0; }
.form-foot .btn { height: 46px; }

/* roster */
.roster-stats { display: flex; gap: var(--s5); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.roster-stats .st b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.roster-stats .st span { font-size: 12px; color: var(--text-2); }
.roster-body { overflow-y: auto; padding: var(--s4) var(--s5) var(--s10); display: flex; flex-direction: column; gap: var(--s2); }
.rrow { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.rrow .rav { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; color: var(--text-2); flex: 0 0 auto; }
.rrow .rinfo { flex: 1; min-width: 0; }
.rrow .rinfo strong { font-size: 14px; font-weight: 700; }
.rrow .rinfo small { display: block; font-size: 12px; color: var(--text-3); }
.rrow .rbtns { display: flex; gap: 6px; }
.rrow .rbtns button { height: 32px; padding: 0 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; border: none; }
.b-approve { background: var(--accent); color: #fff; }
.b-reject { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-2) !important; }
.r-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-full); }
.r-status.approved { background: var(--ok-soft); color: var(--ok); }
.r-status.checked { background: var(--accent-soft); color: var(--accent-ink); }
.r-status.rejected { background: var(--danger-soft); color: var(--danger); }

/* scanner */
.scanner-panel { position: absolute; left: 0; right: 0; bottom: 0; top: 0; background: #000; display: flex; flex-direction: column; animation: sheetup var(--slow) var(--ease); }
.scanner-panel .form-head { background: var(--bg-1); }
.scanner-stage { position: relative; flex: 1; overflow: hidden; display: grid; place-items: center; }
#scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; width: 62vw; max-width: 280px; aspect-ratio: 1; border: 3px solid rgba(255,255,255,.9); border-radius: 20px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); }
.scan-result { padding: var(--s5); padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom)); background: var(--bg-1); font-size: 15px; font-weight: 600; text-align: center; min-height: 84px; display: grid; place-items: center; }
.scan-result.ok { color: var(--ok); } .scan-result.dup { color: var(--warn); } .scan-result.err { color: var(--danger); }

/* ticket card in detail */
.ticket-card { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); border-radius: var(--r-lg); margin-bottom: var(--s6); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 5%, transparent)); border: 1px solid var(--accent-soft); }
.ticket-card-info { flex: 1; min-width: 0; }
/* Apple Wallet — black pill, matching Apple's add-to-wallet convention */
.wallet-btn { height: 36px; margin-top: 10px; padding: 0 12px; background: #000; color: #fff; border-color: #000; font-size: 12.5px; }
.wallet-btn:hover { background: #1a1a1a; }
.wallet-btn:disabled { opacity: .6; }
.ticket-card-info .k { font-size: 12px; color: var(--text-3); font-weight: 600; }
.ticket-card-info .tno { font-size: 26px; font-weight: 800; letter-spacing: 1px; margin: 2px 0 4px; }
.ticket-card-info small { font-size: 12px; color: var(--text-2); }
.ticket-card-qr { width: 76px; height: 76px; border-radius: 10px; background: #fff; padding: 5px; flex: 0 0 auto; display: grid; place-items: center; }
.ticket-card-qr img { width: 100%; height: 100%; border-radius: 4px; }

/* ticket QR */
.ticket-qr { width: 64px; height: 64px; border-radius: 8px; background: #fff; padding: 4px; flex: 0 0 auto; display: grid; place-items: center; align-self: center; }
.qr-big { display: grid; place-items: center; padding: var(--s5) 0; }
.qr-big img { width: 220px; height: 220px; background: #fff; border-radius: var(--r); padding: 10px; }
.qr-code-text { text-align: center; font-family: ui-monospace, monospace; font-size: 13px; color: var(--text-2); letter-spacing: 1px; margin-top: var(--s2); }

@media (min-width: 640px) { .org-events { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1025px) {
  .form-sheet .form-panel { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%,-50%); width: min(640px, calc(100vw - 64px)); height: min(760px, calc(100vh - 64px)); border-radius: var(--r-xl); border: 1px solid var(--border-2); box-shadow: var(--sh-3); animation: pop var(--med) var(--ease); }
  .scanner-sheet .scanner-panel { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%,-50%); width: min(520px, calc(100vw - 64px)); height: min(680px, calc(100vh - 64px)); border-radius: var(--r-xl); overflow: hidden; }
  .org-events { grid-template-columns: 1fr 1fr 1fr; }
}

/* profile page */
.profile-hero { position: relative; height: 38vh; min-height: 220px; background: linear-gradient(180deg, #1a1f2e, #0e1016); flex: 0 0 auto; }
#profile-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.profile-body { flex: 1; overflow-y: auto; padding: var(--s6) var(--s5) var(--s10); }
.profile-id { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s4); }
.profile-av { width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), var(--accent-2)); color: #0a0b0e; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: 0 0 auto; }
.profile-id .nm { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.profile-id .un { font-size: 13px; color: var(--text-3); }
.profile-bio { font-size: 14px; color: var(--text-2); line-height: 1.7; margin: 0 0 var(--s5); }
.profile-stats { display: flex; gap: var(--s6); padding: var(--s4) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: var(--s5); }
.pstat b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.pstat span { font-size: 12px; color: var(--text-2); }
.profile-actions { display: flex; gap: var(--s2); margin-bottom: var(--s6); }
.profile-actions .btn, .profile-actions .btn-soft { flex: 1; height: 44px; justify-content: center; }
.friend-tag { font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 4px 10px; border-radius: var(--r-full); align-self: center; }
.plist-head { font-size: 13px; font-weight: 700; color: var(--text-3); margin: 0 0 var(--s3); }
.pevent { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: var(--s2); cursor: pointer; }
.pevent:hover { background: var(--surface); }
.pevent .pe-type { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-full); }
.pe-type.shared { background: var(--accent-soft); color: var(--accent-ink); }
.pe-type.hosted { background: var(--surface-2); color: var(--text-2); }
.pevent .pe-main { flex: 1; min-width: 0; }
.pevent .pe-main strong { font-size: 14px; font-weight: 700; display: block; }
.pevent .pe-main small { font-size: 12px; color: var(--text-3); }

/* island editor */
.edit-stage { position: relative; flex: 1; min-height: 0; background: linear-gradient(180deg, #1a1f2e, #0e1016); }
#edit-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.edit-save { position: absolute; top: calc(var(--s3) + env(safe-area-inset-top)); right: var(--s3); z-index: 3; height: 38px; padding: 0 18px; }
.edit-hint { position: absolute; bottom: var(--s3); left: 50%; transform: translateX(-50%); z-index: 3; font-size: 12px; color: var(--text-2); background: rgba(10,11,14,.6); padding: 6px 12px; border-radius: var(--r-full); backdrop-filter: blur(6px); white-space: nowrap; }
.unlock-bar { position: absolute; top: calc(var(--s3) + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 3; font-size: 12px; font-weight: 600; color: var(--text-2); background: rgba(10,11,14,.6); padding: 6px 12px; border-radius: var(--r-full); backdrop-filter: blur(6px); }
/* avatar (voxel character) editor */
.avatar-stage { flex: 0 0 auto; height: 230px; background: radial-gradient(120% 100% at 50% 20%, #20242e, #0e1016); display: grid; place-items: center; }
#avatar-canvas { width: 220px; height: 220px; display: block; touch-action: none; }
.avatar-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.avatar-presets { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 4px; }
.av-preset { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 4px; border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.av-preset img { display: block; }
.av-preset:hover { background: var(--surface-2); }
.avatar-controls { display: flex; flex-direction: column; gap: var(--s3); }
.av-row { display: flex; align-items: center; gap: var(--s3); }
.av-label { flex: 0 0 46px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.av-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.av-opt { height: 32px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 700; cursor: pointer; }
.av-opt.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.av-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.av-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--border-2); cursor: pointer; }
.av-sw.active { border-color: var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.avatar-toggle { display: flex; align-items: center; gap: var(--s3); font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.avatar-toggle span:first-child { flex: 1; }
.avatar-toggle input { display: none; }
.avatar-toggle .switch { flex: 0 0 auto; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); position: relative; transition: background var(--fast); }
.avatar-toggle .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); transition: transform var(--fast), background var(--fast); }
.avatar-toggle input:checked + .switch { background: var(--accent-soft); border-color: var(--accent); }
.avatar-toggle input:checked + .switch::after { transform: translateX(18px); background: var(--accent); }

.palette { flex: 0 0 auto; display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--bg-1); border-top: 1px solid var(--border); }
.mat { flex: 0 0 auto; width: 60px; height: 64px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--text-2); position: relative; }
.mat.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.mat.locked { opacity: .4; }
.mat .swatch { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,.04); }
.mat .swatch img { width: 100%; height: 100%; object-fit: contain; }
.mat .swatch.eraser { background: repeating-linear-gradient(45deg, #3a3f47, #3a3f47 5px, #23262c 5px, #23262c 10px); }
.mat .swatch.raise, .mat .swatch.lower { font-weight: 900; font-size: 19px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, #23262c); }
.mat .swatch.raise::before { content: '▲'; }
.mat .swatch.lower::before { content: '▼'; }
.mat.mat-tool.active .swatch { box-shadow: 0 0 0 2px var(--accent) inset; }
.mat .lockdot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 2px var(--surface); }
.mat { width: 66px; height: 78px; gap: 6px; }

/* profile meta + desktop two-pane */
.profile-meta { display: flex; flex-wrap: wrap; gap: var(--s4); margin: 0 0 var(--s5); font-size: 13px; color: var(--text-2); }
.pmeta { display: inline-flex; align-items: center; gap: 6px; }
.pmeta svg { width: 14px; height: 14px; color: var(--text-3); }
.profile-actions { flex-wrap: wrap; }
.profile-actions .btn, .profile-actions .btn-soft { flex: 1 1 auto; min-width: 90px; }

/* QR modal */
.qr-sheet[hidden] { display: none; }
.qr-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(360px, calc(100vw - 40px)); background: var(--bg-1); border: 1px solid var(--border-2); border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: var(--s6); text-align: center; animation: pop var(--med) var(--ease); }
.qr-card h3 { font-size: 17px; font-weight: 800; margin: 0 0 var(--s4); }
.qr-img { width: 220px; height: 220px; margin: 0 auto var(--s3); background: #fff; border-radius: var(--r); padding: 12px; display: grid; place-items: center; }
.qr-img img { width: 100%; height: 100%; }
.qr-url { font-size: 12px; color: var(--text-3); word-break: break-all; margin-bottom: var(--s4); }

/* shared-event mode hides registration fields */
.mode-shared .fld-capacity { display: none; }

@media (min-width: 1025px) {
  .profile-sheet .sheet-panel { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%,-50%); width: min(1040px, calc(100vw - 64px)); height: min(680px, calc(100vh - 64px)); border-radius: var(--r-xl); border: 1px solid var(--border-2); box-shadow: var(--sh-3); flex-direction: row; animation: pop var(--med) var(--ease); }
  .profile-hero { height: auto; width: 50%; min-height: 0; }
  .profile-body { padding: var(--s8); }
}

/* account button */
.account-btn { height: 38px; min-width: 38px; padding: 0 6px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.account-btn[hidden] { display: none; }
.account-btn:hover { background: var(--surface-2); }
.account-btn .av { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), var(--accent-2)); color: #0a0b0e; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.account-btn .lbl { padding-right: 6px; }

/* sign-in sheet */
.auth-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(420px, calc(100vw - 32px)); background: var(--bg-1); border: 1px solid var(--border-2); border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: var(--s8) var(--s6) var(--s6); text-align: center; animation: pop var(--med) var(--ease); }
.auth-sheet .sheet-panel { display: none; }
.auth-mark { width: 56px; height: 56px; margin: 0 auto var(--s4); border-radius: 16px; object-fit: cover; display: block; box-shadow: 0 0 28px rgba(222,74,31,.4); }
.auth-card h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 var(--s2); }
.auth-card p { font-size: 13.5px; line-height: 1.7; color: var(--text-2); margin: 0 0 var(--s5); }
/* header language switcher */
.lang-wrap { position: relative; display: inline-flex; }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 132px; padding: 6px; background: var(--elevated, #16181d); border: 1px solid var(--border-2); border-radius: var(--r); box-shadow: var(--sh-3); display: flex; flex-direction: column; gap: 2px; }
.lang-menu[hidden] { display: none; }
.lang-menu button { text-align: left; height: 38px; padding: 0 12px; border: 0; background: transparent; color: var(--text); font-size: 14px; font-weight: 600; border-radius: 8px; cursor: pointer; }
.lang-menu button:hover { background: var(--surface); }
.lang-menu button.active { background: var(--accent-soft); color: var(--accent-ink); }

/* native social sign-in (Apple / Google) — shown only in the iOS/Android app */
.auth-native { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--s4); }
.auth-social { display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; width: 100%; border-radius: var(--r); border: 1px solid var(--border-2); font-size: 15px; font-weight: 700; cursor: pointer; }
.auth-social[hidden] { display: none; }
.auth-social svg { flex: 0 0 auto; }
.auth-apple { background: #000; color: #fff; border-color: #000; }
.auth-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.auth-social:disabled { opacity: .6; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 4px 0 2px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: var(--s4); }
.auth-tab { flex: 1; height: 36px; border: none; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 700; border-radius: 9px; }
.auth-tab.active { background: var(--elevated); color: var(--text); }
.auth-card form { display: flex; flex-direction: column; gap: var(--s3); }
.auth-card input { height: 48px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface); padding: 0 16px; font-size: 15px; text-align: center; }
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-card .btn-primary { width: 100%; }
.auth-msg { font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 10px; text-align: center; }
.auth-msg[hidden] { display: none; }
.auth-msg.err { background: var(--danger-soft); color: var(--danger); }
.auth-msg.ok { background: var(--ok-soft); color: var(--ok); }
.auth-alt { margin-top: var(--s4); background: none; border: none; color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.auth-alt:hover { text-decoration: underline; }
.auth-dismiss { display: block; width: 100%; margin-top: var(--s3); background: none; border: none; color: var(--text-3); font-size: 13px; font-weight: 600; }
.auth-dismiss:hover { color: var(--text-2); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); transform: translate(-50%, 12px); z-index: 70; background: var(--elevated); color: var(--text); border: 1px solid var(--border-2); padding: 12px 18px; border-radius: var(--r); font-size: 14px; font-weight: 600; box-shadow: var(--sh-3); opacity: 0; pointer-events: none; transition: opacity var(--med), transform var(--med) var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =================== responsive =================== */
@media (min-width: 640px) {
  .grid { grid-template-columns: 1fr 1fr; gap: var(--s5); }
  .feature-cover { aspect-ratio: 21/9; }
  .feature-title { font-size: 26px; }
  .tickets-grid { grid-template-columns: 1fr 1fr; }
  .toast { bottom: 24px; }
}
@media (min-width: 1025px) {
  :root { --appbar-h: 64px; }
  .app { padding-bottom: var(--s16); }
  .appbar-links { display: flex; }
  .appbar-search { display: block; }
  .appbar .icon-search { display: none; }
  .tabbar { display: none; }
  .view-head { padding: var(--s10) 0 var(--s5); }
  .view-head h1 { font-size: 32px; }
  .grid { grid-template-columns: 1fr 1fr 1fr; }
  /* featured hero becomes a horizontal split on desktop */
  .feature { display: grid; grid-template-columns: 1.15fr 1fr; }
  .feature-cover { aspect-ratio: auto; height: 340px; }
  .feature-cover::after { background: linear-gradient(90deg, transparent 50%, rgba(8,9,12,.4)); }
  .feature-body { position: static; display: flex; flex-direction: column; justify-content: center; padding: var(--s8); }
  .feature-title { font-size: 28px; }
  /* detail as centered two-pane modal */
  .sheet-scrim { cursor: zoom-out; }
  .detail .sheet-panel { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%,-50%); width: min(1040px, calc(100vw - 64px)); height: min(680px, calc(100vh - 64px)); border-radius: var(--r-xl); border: 1px solid var(--border-2); box-shadow: var(--sh-3); flex-direction: row; animation: pop var(--med) var(--ease); }
  @keyframes pop { from { transform: translate(-50%,-48%) scale(.98); opacity: .5; } }
  .detail-hero { height: auto; width: 48%; min-height: 0; }
  .detail-body { padding: var(--s8) var(--s8) 0; }
  .dock { margin: 0 calc(-1 * var(--s8)); padding: var(--s5) var(--s8); }
}
@media (min-width: 1280px) { .app { padding-left: 0; padding-right: 0; } }

/* ---------- small-screen / touch hardening ----------
   iOS zooms the ENTIRE page whenever a focused form control has font-size < 16px,
   and with no `maximum-scale` that zoom persists after blur — which is what pushes
   the layout past the right edge of the screen (the search sheet auto-focuses its
   input, so it fires on the very first tap of the search icon). Keep every control
   at >= 16px on touch / small viewports so the page never scales. */
@media (pointer: coarse), (max-width: 1024px) {
  .appbar-search input,
  .ai-link input,
  .search-head input,
  .org-search input,
  .fld input,
  .fld textarea,
  .fld-select,
  .auth-card input { font-size: 16px; }
}
/* kill double-tap-to-zoom on interactive elements */
button, a, input, select, textarea, .card, .feature, .tab, .seg-link { touch-action: manipulation; }

/* overflow insurance: no appbar child may force the bar wider than the screen */
.appbar > * { min-width: 0; }
.brand { min-width: 0; overflow: hidden; white-space: nowrap; }
.brand-mark { flex: 0 0 auto; }
.account-btn .lbl { max-width: 8ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- feed view toggle (網格 ⇄ 列表) + 篩選工具列 ---------- */
/* .filter-scroll wraps the segmented pill (桌機置中；手機變成固定 2×2 格)。
   .filter-tools 是「我的附近」+ 檢視切換 + 收合鈕 — 三者永遠同一列。 */
/* flex-GROW:0 (not 1) — a growing filter-scroll would consume all of .filterbar's
   free space and then center the pill WITHIN that oversized box, putting far more
   gap before .filter-tools than after the pill on the other side. Sized to its own
   content instead, so .filterbar's own `justify-content:center` genuinely centers
   the (pill + gap + tools) group as a whole, giving a small, even, controlled gap
   on both sides — flex-shrink stays 1 so it still yields under real space pressure. */
.filter-scroll { flex: 0 1 auto; min-width: 0; display: flex; justify-content: center; }
/* the collapse toggle sets the `hidden` ATTRIBUTE — but an author class selector
   (display:flex above) and the browser's built-in `[hidden]{display:none}` rule
   are equal specificity, so the class silently wins and hidden becomes a no-op.
   This attribute-qualified selector outranks the bare class and actually hides it. */
.filter-scroll[hidden] { display: none; }
.filter-scroll .searchbar { flex: 0 1 auto; min-width: 0; }
.filter-tools { display: flex; align-items: center; gap: var(--s2); flex: 0 0 auto; }
.filter-collapse-btn svg { width: 16px; height: 16px; transition: transform var(--fast); }
.filter-collapse-btn.collapsed svg { transform: rotate(180deg); }
/* ---- 獨立小螢幕佈局：不擠成一排捲動 chips，改成固定 2×2 篩選格 ----
   4 個篩選項固定排成 2 列 2 欄（grid 保證恰好 2 列，不是靠內容寬度自然換行）；
   「我的附近」+ 檢視切換 + 收合鈕同一列（收合鈕可把上面的 2×2 篩選格整個藏起來，
   只留這一列） — 不會互相擠壓，也不需要橫向滑動。 */
@media (max-width: 640px) {
  .filterbar { flex-wrap: wrap; row-gap: var(--s2); align-items: flex-start; }
  .filter-scroll { flex: 1 1 100%; overflow: visible; padding: 0; }
  .searchbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2);
    width: 100%; max-width: none; border: 0; background: transparent; box-shadow: none; padding: 0;
  }
  .sb-sep { display: none; }
  .sb-seg {
    flex-direction: row; align-items: center; gap: 7px; width: 100%; height: 46px; padding: 0 14px;
    border: 1px solid var(--border-2); background: var(--surface); border-radius: var(--r-lg);
  }
  .sb-seg.active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-2); }
  .sb-k { font-size: 11px; }
  .sb-v { font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sb-v.on { color: var(--accent-ink); }
  /* 定位鈕、檢視切換、收合鈕同一列：定位鈕吃滿剩餘寬度，其餘固定寬 */
  .filter-tools { flex: 1 1 100%; }
  .sb-go {
    flex: 1 1 auto; min-width: 0; height: 46px; border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--border-2); color: var(--text);
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .sb-go svg { width: 18px; height: 18px; color: var(--accent-ink); flex: 0 0 auto; }
  .sb-go[data-on] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); box-shadow: none; }
  .sb-go-label { display: inline; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .view-toggle, .filter-collapse-btn { flex: 0 0 auto; }
}
/* the collapse toggle exists to reclaim vertical space on phones where the 2×2
   chip grid is tall — desktop's single-row pill has no such problem, so hide the
   control there. Force .filter-scroll visible regardless of state.filtersCollapsed
   (same specificity as .filter-scroll[hidden]{display:none}, later in the
   cascade wins) so a collapse toggled while on mobile can never get stuck hidden
   with no way to re-expand it once the window is widened past this breakpoint. */
@media (min-width: 1025px) {
  .filter-collapse-btn { display: none; }
  .filter-scroll[hidden] { display: flex; }
}
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); flex: 0 0 auto; align-self: center; }
.view-toggle button { width: 34px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-full); background: transparent; color: var(--text-3); }
.view-toggle button.active { background: var(--text); color: var(--bg); }
.view-toggle svg { width: 16px; height: 16px; }
/* list rows (列表檢視) */
.list { display: flex; flex-direction: column; gap: var(--s3); }
.lrow { display: grid; grid-template-columns: 108px 1fr; gap: var(--s4); padding: var(--s3); position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); cursor: pointer; transition: border-color var(--fast), transform var(--fast); }
.lrow:hover { border-color: var(--border-2); transform: translateY(-1px); }
.lrow-cover { position: relative; width: 108px; height: 76px; border-radius: var(--r); overflow: hidden; background: linear-gradient(160deg, #1a1e28, #111319); }
.lrow-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lrow-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; padding-right: 34px; }
.lrow-date { font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.lrow-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow-sub { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 10px; }
/* an item with overflow:hidden loses its content-based auto min-width (flexbox
   spec: becomes 0 instead), so under space pressure flex SHRINKS it below its own
   text — that's how "免費" (2 chars) was clipping to "免…". Only the first span
   (venue name, which can legitimately be long) should absorb the squeeze; the
   short fixed labels after it (participant count, price) must never shrink. */
.lrow-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow-sub span:first-child { flex: 1 1 auto; min-width: 0; }
.lrow-sub span:not(:first-child) { flex: 0 0 auto; }
.lrow .fav-btn { top: 50%; transform: translateY(-50%); right: 8px; width: 30px; height: 30px; background: transparent; backdrop-filter: none; }
.lrow .fav-btn svg { stroke: var(--text-3); }
.lrow .fav-btn.on svg { stroke: #ff5a7a; }

/* ---------- 自訂區間（價格 / 日期時間）in facet panels ---------- */
.facet-custom { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--border-2); display: flex; flex-direction: column; gap: var(--s2); }
.facet-custom .fc-label { font-size: 12px; font-weight: 700; color: var(--text-3); }
/* 轉刊分享開關（.fld-toggle 原本是表單用的，這裡借用它的 switch 外觀） */
.facet-toggle { display: flex; gap: var(--s3); cursor: pointer; }
.facet-toggle > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facet-toggle b { font-size: 14px; font-weight: 700; }
.facet-toggle small { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
/* .fc-row: price min/max (plain <input type="number"> — small native intrinsic
   width, always safe side by side, no responsive stacking needed). */
.fc-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s2); align-items: center; }
.fc-row .fc-sep { color: var(--text-3); font-size: 13px; text-align: center; }
/* .fc-input: shared visual style for every small filter input (price + date/time). */
.fc-input { min-width: 0; width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-size: 16px; }
.fc-input:focus { outline: none; border-color: var(--accent); }
.fc-actions { display: flex; gap: var(--s2); margin-top: 2px; }
.fc-actions .btn { flex: 1; height: 40px; font-size: 14px; padding: 0 10px; }
/* .fc-field: captioned range input (開始/結束時間) */
.fc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fc-field > span { font-size: 11px; font-weight: 700; color: var(--text-3); }
/* .fc-dt-row: date + time as TWO separate native inputs, not one combined
   datetime-local. A Chinese-locale datetime-local control renders at its native
   minimum width (「2026年7月12日 下午3:18」) which is wider than most phone screens
   can fit — even stacked to one column, a SINGLE such field could still overflow.
   Splitting into date + time roughly halves each field's own intrinsic minimum,
   so the pair fits safely side by side at any real phone width. */
.fc-dt-row { display: flex; gap: var(--s2); }
.fc-dt-row .fc-input { flex: 1 1 0; min-width: 0; }

/* ---------- partner application (hidden page /?partner) ---------- */
.partner-perks { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.partner-perks b { font-size: 14px; }
.partner-perks .pk { display: flex; gap: 8px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.partner-perks .pk::before { content: "✓"; color: var(--accent-ink); font-weight: 800; flex: 0 0 auto; }
.partner-done { text-align: center; padding: var(--s10) var(--s5); }
.partner-done .ok-ic { width: 56px; height: 56px; margin: 0 auto var(--s4); border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 26px; }
.partner-done h3 { margin: 0 0 8px; font-size: 18px; }
.partner-done p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.8; }

/* ---------- onboarding tour (spotlight 引導) ---------- */
#tour { position: fixed; inset: 0; z-index: 80; }
#tour[hidden] { display: none; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(4,5,7,.62); border: 2px solid var(--accent); transition: top var(--med) var(--ease), left var(--med) var(--ease), width var(--med) var(--ease), height var(--med) var(--ease); }
.tour-card { position: fixed; width: min(320px, calc(100vw - 32px)); background: var(--elevated); border: 1px solid var(--border-2); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: var(--s4); }
.tour-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.tour-card p { margin: 0 0 var(--s3); font-size: 13px; line-height: 1.7; color: var(--text-2); }
.tour-foot { display: flex; align-items: center; gap: var(--s2); }
.tour-dots { display: flex; gap: 5px; flex: 1; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-2); }
.tour-dots i.on { background: var(--accent); }
.tour-foot button { height: 34px; padding: 0 13px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); }
.tour-foot .tour-next { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- theme hardening: overlays on covers / 3D canvases ----------
   These elements sit on top of photos or the dark island stage in BOTH themes,
   so their text must stay light — never var(--text), which flips in light mode. */
.badge-cat, .pass-cat { color: #eceef2; }
.detail-back, .detail-share, .detail-fav { color: #eceef2; }
.visual-cap, .edit-hint, .unlock-bar { color: #c9cdd4; }
.build-bar button { color: #c9cdd4; background: #14161c; border-color: rgba(255,255,255,.1); }
/* the featured hero's text overlays its dark cover below 1025px (desktop puts the
   body on a plain surface beside the cover, where theme text is correct) */
@media (max-width: 1024px) {
  :root[data-theme="light"] .feature-body { color: #f2f3f5; }
  :root[data-theme="light"] .feature-body .feature-sub { color: rgba(242,243,245,.82); }
  :root[data-theme="light"] .feature-body .feature-sub svg { color: rgba(242,243,245,.6); }
  :root[data-theme="light"] .feature-body .feature-sub b { color: #ffb39f; }
  :root[data-theme="light"] .feature-body .pill { background: rgba(20,22,28,.7); border-color: rgba(255,255,255,.14); color: #eceef2; }
  :root[data-theme="light"] .feature-body .pill.pill-ongoing { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
}

/* more overlays that live on always-dark surfaces (ticket QR hero, pass covers) */
.pill { color: #eceef2; }                              /* dark-glass chip in both themes */
.hero-qr-meta { color: #eceef2; }
.hero-qr-hint { color: #9aa1ad; }
.pass-top .pass-status.going { background: rgba(255,90,54,.22); color: #ffb39f; }
.pass-top .pass-status.checked { background: rgba(52,211,153,.2); color: #4fe0ac; }
.pass-top .pass-status.pending { background: rgba(245,181,61,.2); color: #f5c76a; }

/* ---- 小螢幕卡片總覽：緊湊雙欄（參考購物 App 的資訊密度，比單欄大卡好讀） ----
   只縮小 .card（探索列表的卡片），不影響 .feature（首頁精選大卡，維持原樣）—
   badge-cat/badge-going/fav-btn/dist-badge 是兩者共用的 class，故都加 .card 限定。 */
@media (max-width: 639px) {
  .grid { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .card-cover { aspect-ratio: 1 / 1; }
  .card .badge { font-size: 10px; padding: 3px 7px; }
  .card .badge-cat { top: 7px; left: 7px; }
  .card .badge-going { bottom: 7px; left: 7px; }
  .card .fav-btn { top: 7px; right: 7px; width: 27px; height: 27px; }
  .card .fav-btn svg { width: 14px; height: 14px; }
  .card .dist-badge { top: 7px; font-size: 10px; padding: 3px 7px; max-width: calc(100% - 50px); }
  .card-body { padding: 10px 10px 12px; }
  .card-date { font-size: 11px; margin-bottom: 3px; }
  .card-title {
    font-size: 13.5px; line-height: 1.32; margin: 0 0 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .card-meta { gap: 3px; }
  .meta-row { font-size: 11px; gap: 5px; }
  .meta-row svg { width: 11px; height: 11px; }
  /* 只留場地那行（第一行），組織者那行在雙欄密度下省略以求好讀 */
  .card-meta .meta-row:nth-of-type(n+2) { display: none; }
  .mine-tag { font-size: 10.5px; padding: 3px 8px; margin-top: 6px; gap: 4px; }
  .mine-tag svg { width: 11px; height: 11px; }
}

/* ---------- admin console (/?admin) ---------- */
/* .form-body 是 flex 捲動容器：子項一律不得壓縮 — overflow 子項（如 .coll-chips）
   的自動最小尺寸是 0，會被 flex 壓成半截（chips 列被切掉就是這個原因）。 */
.form-body > * { flex-shrink: 0; }
/* 通過/婉拒按鈕：.rrow .rbtns 的 reset 只作用在報名管理列裡，這裡要自己補齊 */
.adm-app-acts button { height: 36px; padding: 0 18px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 700; border: none; cursor: pointer; }
.adm-app-acts button:disabled { opacity: .55; }
.adm-app { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: var(--s4); margin-bottom: var(--s3); }
.adm-app-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: 4px; }
.adm-app-head b { font-size: 15px; font-weight: 800; }
.adm-app-meta { font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; overflow-wrap: anywhere; }
.adm-app-promo { font-size: 13px; color: var(--text-2); line-height: 1.7; background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; margin: 6px 0; overflow-wrap: anywhere; }
.adm-app-promo span { display: block; font-size: 11px; font-weight: 700; color: var(--text-3); margin-bottom: 2px; }
.adm-app-acts { justify-content: flex-end; margin-top: var(--s2); }
.adm-admin { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); margin-bottom: var(--s2); }
.adm-admin-mail { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.adm-admin small { color: var(--text-3); font-weight: 400; }
.adm-invite { display: flex; gap: var(--s2); margin-top: var(--s2); }
.adm-invite input { flex: 1; min-width: 0; height: 44px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface); padding: 0 14px; font-size: 16px; color: var(--text); }
.adm-invite input:focus { outline: none; border-color: var(--accent); }
.adm-invite .btn { height: 44px; padding: 0 18px; }

/* ---------- 首頁品牌／FAQ 區塊（SEO + AIO 的實體內容） ----------
   活動列表是 JS 算繪的，不執行 JS 的爬蟲只看得到表單標籤 —— 這區是首頁唯一
   說明「活動島嶼 ActIsland 是什麼」的靜態內容，必須真的看得到（隱藏＝作弊，
   且 FAQPage 結構化資料要求答案在頁面上可見）。 */
.site-about { margin: var(--s7, 48px) 0 var(--s6); padding-top: var(--s6); border-top: 1px solid var(--border); color: var(--text-2); }
.site-about h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 var(--s3); }
.site-about h3 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--text); margin: var(--s6) 0 var(--s3); }
.site-about h4 { font-size: 14px; font-weight: 700; color: var(--text); margin: var(--s4) 0 4px; }
.site-about p { margin: 0 0 var(--s2); font-size: 13.5px; line-height: 1.85; }
.site-about b { color: var(--text); font-weight: 700; }
.about-lead { font-size: 14.5px; line-height: 1.9; max-width: 74ch; }
.about-list { margin: 0; padding-left: 1.15em; display: flex; flex-direction: column; gap: 7px; }
.about-list li { font-size: 13.5px; line-height: 1.8; }
.about-faq { max-width: 78ch; }
.about-faq p { color: var(--text-2); }
.about-foot { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.about-foot a { color: var(--accent-ink); text-decoration: none; }
.about-foot a:hover { text-decoration: underline; }
/* /api/home 注入的近期活動清單（給爬蟲的真實內部連結，也給無 JS 訪客可用的列表） */
.ssr-events { margin: var(--s6) 0; }
.ssr-events h3 { font-size: 15px; font-weight: 800; color: var(--text); margin: 0 0 var(--s2); }
.ssr-list { margin: var(--s3) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ssr-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 13px; line-height: 1.7; }
.ssr-list a { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.ssr-list a:hover { text-decoration: underline; }
.ssr-meta { color: var(--text-3); font-size: 12px; }

/* ---------- 分享到 Instagram（地圖公版卡） ---------- */
.ig-panel { max-width: 460px; }
/* 預覽舞台：用 aspect-ratio 固定外框，canvas 自己縮到裡面 —— 兩個比例共用同一個容器，
   切換時不會讓整個 sheet 的高度跳動 */
.ig-stage { display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: var(--s3); margin-bottom: var(--s3); min-height: 340px; }
.ig-stage canvas { display: block; max-height: 46vh; max-width: 100%; width: auto; height: auto; border-radius: var(--r); box-shadow: var(--sh-2); }
@media (max-height: 760px) { .ig-stage canvas { max-height: 38vh; } .ig-stage { min-height: 240px; } }
.ig-seg-row { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.ig-seg-label { font-size: 12px; font-weight: 700; color: var(--text-3); flex: 0 0 34px; }
.ig-seg { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); flex: 1 1 auto; }
.ig-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 0; border-radius: var(--r-full); background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.ig-seg button small { font-size: 11px; font-weight: 600; color: var(--text-3); }
.ig-seg button.on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.ig-seg button.on small { color: var(--accent-ink); opacity: .8; }
.ig-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; border: 1px solid var(--border-2); }
.ig-dot-dark { background: #0a0b0e; }
.ig-dot-light { background: #ffffff; }
.ig-acts { display: flex; gap: var(--s2); margin-top: var(--s4); }
.ig-acts .btn { flex: 1; justify-content: center; }
.ig-acts #ig-go { flex: 1.6; }
