/* Big Water community UI · core system.
   Palette: water — mist, glacier, lagoon, deep sea — on Apple system neutrals, AA contrast.
   Materials: deep water and glacier (solid objects), liquid glass (chrome floating over content),
   frosted fill (quiet controls). The page sits on a soft water wallpaper, never flat black or white. */

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter Tight", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Inter Tight", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --pill: 980px;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --content-w: 1180px;
  --gutter: clamp(16px, 4vw, 48px);
  --bar-h: 60px;
  --deep-water: radial-gradient(120% 90% at 90% 115%, rgba(110, 215, 255, .3), transparent 60%), radial-gradient(90% 70% at 0% 0%, rgba(80, 200, 220, .22), transparent 60%), linear-gradient(160deg, #0d6fae 0%, #0a548b 48%, #07365e 100%);

  --bg: #edf3f8;
  --wallpaper:
    radial-gradient(1200px 820px at 88% -12%, rgba(120, 205, 245, .42), transparent 62%),
    radial-gradient(960px 760px at -8% 32%, rgba(150, 222, 232, .36), transparent 62%),
    radial-gradient(1100px 900px at 58% 112%, rgba(150, 185, 245, .28), transparent 62%),
    linear-gradient(180deg, #f4f9fc 0%, #ebf2f8 55%, #e5eef6 100%);
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, .86);
  --surface-solid: #ffffff;
  --surface-2: rgba(248, 251, 253, .9);
  --fill: rgba(70, 110, 145, .13);
  --fill-2: rgba(70, 110, 145, .085);
  --fill-3: rgba(70, 110, 145, .05);
  --label: #0b1a25;
  --label-2: #4c5d6b;
  --label-3: #5a6c7e;
  --separator: rgba(24, 58, 86, .12);
  --separator-strong: rgba(24, 58, 86, .22);
  --accent: #0068a6;
  --link: #0068a6;
  --accent-soft: rgba(0, 119, 200, .1);
  --solid: #0074c2;
  --solid-hover: #00639f;
  --on-solid: #ffffff;
  --green: #18704a;
  --green-dot: #2fbf89;
  --orange: #a84500;
  --orange-dot: #ff9f0a;
  --red: #c40014;
  --red-soft: rgba(255, 59, 48, .1);

  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(250, 252, 254, .76);
  --panel: rgba(250, 252, 254, .95);
  --glass-edge: rgba(255, 255, 255, .92);
  --glass-shade: rgba(10, 40, 70, .07);
  --glass-blur: saturate(1.8) blur(28px);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .1) 46%, rgba(255, 255, 255, 0) 62%);

  --material: linear-gradient(160deg, #f6fbfe 0%, #e2f2fb 55%, #cfe8f6 100%);
  --material-ink: #0b3a5b;
  --material-sub: rgba(11, 58, 91, .7);
  --material-rim: rgba(255, 255, 255, .95);

  --shadow-1: 0 1px 2px rgba(10, 40, 70, .05), 0 1px 1px rgba(10, 40, 70, .02);
  --shadow-2: 0 2px 6px rgba(10, 40, 70, .05), 0 14px 34px rgba(10, 40, 70, .09);
  --shadow-3: 0 4px 12px rgba(10, 40, 70, .07), 0 30px 72px rgba(10, 40, 70, .18);
}

@supports (corner-shape: squircle) {
  :root { --r-xs: 11px; --r-sm: 17px; --r-md: 23px; --r-lg: 32px; --r-xl: 44px; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050d15;
  --wallpaper:
    radial-gradient(1200px 820px at 88% -12%, rgba(20, 112, 175, .42), transparent 62%),
    radial-gradient(960px 760px at -8% 36%, rgba(14, 92, 112, .36), transparent 62%),
    radial-gradient(1100px 900px at 58% 115%, rgba(32, 62, 145, .34), transparent 62%),
    linear-gradient(180deg, #07141f 0%, #050e17 55%, #040a12 100%);
  --bg-elevated: #132231;
  --surface: rgba(17, 30, 43, .82);
  --surface-solid: #111e2b;
  --surface-2: rgba(22, 37, 52, .86);
  --fill: rgba(140, 180, 210, .17);
  --fill-2: rgba(140, 180, 210, .11);
  --fill-3: rgba(140, 180, 210, .07);
  --label: #f0f6fa;
  --label-2: #b0c0cd;
  --label-3: #9badbd;
  --separator: rgba(140, 180, 210, .16);
  --separator-strong: rgba(140, 180, 210, .28);
  --accent: #6bd3ff;
  --link: #6bd3ff;
  --accent-soft: rgba(100, 210, 255, .14);
  --solid: #5ac8fa;
  --solid-hover: #7dd6fc;
  --on-solid: #00131f;
  --green: #41dc8e;
  --green-dot: #30d158;
  --orange: #ffb340;
  --red: #ff6961;
  --red-soft: rgba(255, 69, 58, .16);
  --glass: rgba(16, 28, 40, .55);
  --glass-strong: rgba(16, 28, 40, .74);
  --panel: rgba(14, 25, 37, .95);
  --glass-edge: rgba(180, 220, 255, .14);
  --glass-shade: rgba(0, 0, 0, .45);
  --sheen: linear-gradient(180deg, rgba(200, 235, 255, .08), rgba(255, 255, 255, .02) 46%, rgba(255, 255, 255, 0) 62%);
  --material: linear-gradient(160deg, #1b3a52 0%, #142e44 55%, #0f2436 100%);
  --material-ink: #e8f5fc;
  --material-sub: rgba(205, 232, 248, .74);
  --material-rim: rgba(170, 225, 255, .18);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-3: 0 6px 18px rgba(0, 0, 0, .45), 0 30px 80px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #050d15;
    --wallpaper:
      radial-gradient(1200px 820px at 88% -12%, rgba(20, 112, 175, .42), transparent 62%),
      radial-gradient(960px 760px at -8% 36%, rgba(14, 92, 112, .36), transparent 62%),
      radial-gradient(1100px 900px at 58% 115%, rgba(32, 62, 145, .34), transparent 62%),
      linear-gradient(180deg, #07141f 0%, #050e17 55%, #040a12 100%);
    --bg-elevated: #132231;
    --surface: rgba(17, 30, 43, .82);
    --surface-solid: #111e2b;
    --surface-2: rgba(22, 37, 52, .86);
    --fill: rgba(140, 180, 210, .17);
    --fill-2: rgba(140, 180, 210, .11);
    --fill-3: rgba(140, 180, 210, .07);
    --label: #f0f6fa;
    --label-2: #b0c0cd;
    --label-3: #9badbd;
    --separator: rgba(140, 180, 210, .16);
    --separator-strong: rgba(140, 180, 210, .28);
    --accent: #6bd3ff;
    --link: #6bd3ff;
    --accent-soft: rgba(100, 210, 255, .14);
    --solid: #5ac8fa;
    --solid-hover: #7dd6fc;
    --on-solid: #00131f;
    --green: #41dc8e;
    --green-dot: #30d158;
    --orange: #ffb340;
    --red: #ff6961;
    --red-soft: rgba(255, 69, 58, .16);
    --glass: rgba(16, 28, 40, .55);
    --glass-strong: rgba(16, 28, 40, .74);
  --panel: rgba(14, 25, 37, .95);
    --glass-edge: rgba(180, 220, 255, .14);
    --glass-shade: rgba(0, 0, 0, .45);
    --sheen: linear-gradient(180deg, rgba(200, 235, 255, .08), rgba(255, 255, 255, .02) 46%, rgba(255, 255, 255, 0) 62%);
    --material: linear-gradient(160deg, #1b3a52 0%, #142e44 55%, #0f2436 100%);
    --material-ink: #e8f5fc;
    --material-sub: rgba(205, 232, 248, .74);
    --material-rim: rgba(170, 225, 255, .18);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
    --shadow-3: 0 6px 18px rgba(0, 0, 0, .45), 0 30px 80px rgba(0, 0, 0, .6);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--label);
  font: 400 16px/1.55 var(--font);
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "palt";
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--wallpaper); pointer-events: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; color: var(--label); letter-spacing: -.022em; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(32px, 4.2vw, 48px); letter-spacing: -.032em; line-height: 1.06; }
h2 { font-size: clamp(22px, 2.3vw, 28px); }
h3 { font-size: 19px; letter-spacing: -.016em; line-height: 1.25; }
h4 { font-size: 17px; letter-spacing: -.012em; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: .6em; }
small { font-size: 13px; }
b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
code, pre, kbd { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: .5px solid var(--separator); margin: 24px 0; }

.wi { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn .wi-arrow, .text-link .wi-arrow { display: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 200; padding: 10px 18px; border-radius: var(--pill); background: var(--solid); color: var(--on-solid); font-weight: 600; transition: top .2s var(--ease); }
.skip:focus { top: 14px; text-decoration: none; }
.muted { color: var(--label-2); }
.small { font-size: 13px; line-height: 1.5; }
.overline {
  display: block;
  margin: 0 0 8px;
  color: var(--label-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

/* ---------- Materials ---------- */
.app-top, .bottom-nav, .sidebar, .feed-tabs, .raffle-tabs, .build-tabs, .wm-tabs, .wd-tabs, .jb-sort,
.wsn-launch, .wai-panel, .wsn-panel, .wai-invite, dialog, .water-toast, .pulse-bar {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.app-top, .bottom-nav, .sidebar, .wsn-launch, .wai-panel, .wsn-panel, .guest-dialog, .experience-dialog, .global-poll-dialog, .build-join-dialog, .water-toast {
  background-color: var(--glass-strong);
  background-image: var(--sheen);
  border: .5px solid var(--glass-edge);
  box-shadow: inset 0 .5px 0 var(--glass-edge), inset 0 -.5px 0 var(--glass-shade), var(--shadow-3);
}
.app-top { box-shadow: inset 0 .5px 0 var(--glass-edge), inset 0 -.5px 0 var(--glass-shade), var(--shadow-2); }

/* App icons — iOS-style squircles in the water palette. */
.app-icon {
  position: relative;
  display: inline-grid; place-items: center; flex: none;
  width: 48px; height: 48px;
  border-radius: 13px; corner-shape: squircle;
  color: #fff;
  background: linear-gradient(180deg, var(--tone-a), var(--tone-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 1px 2px rgba(10, 40, 70, .18), 0 4px 10px -4px rgba(10, 40, 70, .3);
}
.app-icon .wi { width: 26px; height: 26px; stroke-width: 1.8; }
.tone-ocean { --tone-a: #4aa8ff; --tone-b: #0a6fd6; }
.tone-lagoon { --tone-a: #5ad8cc; --tone-b: #1a97a5; }
.tone-reef { --tone-a: #ffa27a; --tone-b: #ef6352; }
.tone-glacier { --tone-a: #8fdcff; --tone-b: #2fa6dc; }
.tone-deep { --tone-a: #5b86ef; --tone-b: #1e3f9c; }
.tone-current { --tone-a: #46cbe0; --tone-b: #0b85a0; }
.tone-tide { --tone-a: #6bb8dd; --tone-b: #276b94; }
.tone-sun { --tone-a: #ffd666; --tone-b: #f09a1c; }
.tone-spring { --tone-a: #6fe3ff; --tone-b: #2a63e0; }
.tone-kelp { --tone-a: #72d6a0; --tone-b: #2a9563; }
.tone-ink { --tone-a: #536e8f; --tone-b: #1b2c42; }
.tone-stone { --tone-a: #b3bec9; --tone-b: #6c7a88; }

/* Water orb — the AI companion's mark. */
.ai-orb, .wai-launch {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 18%, #b4ecff 0%, #47bdf6 26%, #0b80dc 58%, #0b3a6e 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .75), inset 0 -6px 12px rgba(0, 24, 64, .35), 0 0 0 .5px rgba(255, 255, 255, .45);
  color: #fff;
}
.ai-orb::after, .wai-launch::after {
  content: ""; position: absolute; inset: -30%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 12%, rgba(255, 255, 255, .34) 18%, transparent 26% 52%, rgba(160, 235, 255, .3) 60%, transparent 70% 100%);
  mix-blend-mode: soft-light;
  animation: orb-caustic 9s linear infinite;
}
@keyframes orb-caustic { to { transform: rotate(360deg); } }
.ai-orb { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; }
.ai-orb .wi { width: 18px; height: 18px; stroke-width: 1.9; filter: drop-shadow(0 1px 1px rgba(0, 30, 70, .35)); }

/* ---------- Shell ---------- */
.app-shell { position: relative; min-width: 0; min-height: calc(100vh - 84px); display: flex; flex-direction: column; }
.app-main { width: 100%; max-width: calc(var(--content-w) + var(--gutter) * 2); margin: 0 auto; padding: 8px var(--gutter) 80px; flex: 1; min-width: 0; }
.app-main > * + * { margin-top: 20px; }
.app-main > .notice:first-child { margin: 18px 0 4px; }

.app-top {
  position: sticky; top: 12px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  width: calc(100% - var(--gutter) * 2); max-width: var(--content-w);
  height: var(--bar-h);
  margin: 12px auto 0;
  padding: 0 10px 0 10px;
  border-radius: var(--pill);
}
.bar-brand { display: flex; align-items: center; gap: 10px; flex: none; padding-right: 6px; color: var(--label); font: 600 16px/1 var(--font-display); letter-spacing: -.018em; text-decoration: none !important; }
.brand-mark {
  position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--material);
  box-shadow: inset 0 .5px 0 var(--material-rim), inset 0 -.5px 0 rgba(0, 0, 0, .18), 0 1px 3px rgba(10, 40, 70, .18);
}
.brand-mark img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 .5px .5px rgba(0, 0, 0, .25)); }
.bar-tabs { display: flex; gap: 2px; margin: 0 auto; padding: 3px; border-radius: var(--pill); background: var(--fill-2); box-shadow: inset 0 0 0 .5px var(--separator); overflow-x: auto; scrollbar-width: none; }
.bar-tabs::-webkit-scrollbar { display: none; }
.bar-tabs a { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 16px; border-radius: var(--pill); color: var(--label-2); font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none !important; transition: color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease); }
.bar-tabs a:hover { color: var(--label); }
.bar-tabs a.active { background: var(--surface); color: var(--label); font-weight: 600; box-shadow: 0 1px 2px rgba(10, 40, 70, .1), 0 4px 10px -2px rgba(10, 40, 70, .1), inset 0 0 0 .5px var(--separator); }
.bar-tabs a.is-extra { color: var(--accent); }
:root[data-theme="dark"] .bar-tabs a.active { background: #2a3a48; }
.app-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.app-avatar { display: block; border-radius: 50%; }
.app-avatar .avatar { width: 36px; height: 36px; font-size: 14px; }
.bar-launcher { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--fill-2); color: var(--label); transition: background-color .2s var(--ease), transform .25s var(--spring); }
.bar-launcher:hover { background: var(--fill); }
.bar-launcher[aria-expanded="true"] { background: var(--solid); color: var(--on-solid); }
.bar-launcher .wi { width: 20px; height: 20px; }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 85; border: 0; padding: 0; background: rgba(6, 35, 58, .14); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sidebar {
  position: fixed; z-index: 90;
  top: calc(var(--bar-h) + 22px);
  right: max(var(--gutter), calc((100vw - var(--content-w)) / 2));
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - var(--bar-h) - 40px);
  display: flex; flex-direction: column;
  padding: 18px 16px 14px;
  border-radius: var(--r-xl); corner-shape: squircle;
  overflow: hidden;
  transform-origin: top right;
  opacity: 0; visibility: hidden; transform: translateY(-10px) scale(.96);
  transition: opacity .22s var(--ease), transform .36s var(--spring), visibility 0s linear .36s;
}
.sidebar.open { opacity: 1; visibility: visible; transform: none; transition: opacity .22s var(--ease), transform .36s var(--spring), visibility 0s; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-group + .nav-group { margin-top: 8px; }
.nav-group-title { margin: 0 0 4px; padding: 0 8px; color: var(--label-2); font-size: 12px; font-weight: 600; }
.launcher-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 8px 4px 8px;
  border-radius: 16px; corner-shape: squircle;
  color: var(--label);
  font-size: 12.5px; font-weight: 500; line-height: 1.25; text-align: center;
  text-decoration: none !important;
  transition: background-color .18s var(--ease), transform .3s var(--spring);
}
.nav-item:hover { background: var(--fill-2); }
.nav-item:active { transform: scale(.95); }
.nav-item.active { background: var(--fill); font-weight: 600; }
.nav-item .app-icon { transition: transform .3s var(--spring); }
.nav-item:hover .app-icon { transform: translateY(-2px); }
.release-nav-version { margin-top: -4px; color: var(--label-2); font: 500 10.5px/1 var(--font-mono); }
.sidebar-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-top: 12px; margin-top: 10px; border-top: .5px solid var(--separator); }
.sidebar-ai { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px 8px 8px; border: 0; border-radius: 16px; corner-shape: squircle; background: var(--fill-2); color: var(--label); font-size: 14.5px; font-weight: 600; text-align: left; transition: background-color .18s var(--ease); }
.sidebar-ai:hover { background: var(--fill); }
.sidebar-ai > span:not(.ai-orb) { flex: 1; }
.sidebar-ai > .wi-chevron { width: 15px; height: 15px; color: var(--label-3); }
.sidebar-prefs { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.sidebar-prefs .language-picker { flex: 1; }
.sidebar-user { grid-column: 1; display: flex; align-items: center; gap: 6px; }
.sidebar-user-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px 6px; border-radius: 12px; color: var(--label); text-decoration: none !important; }
.sidebar-user-link:hover { background: var(--fill-2); }
.sidebar-user-link > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { color: var(--label-2); font-size: 12px; white-space: nowrap; }
.sidebar-user form { margin: 0; }
.sidebar-bottom > .btn { grid-column: 1; }
.back-site:hover { background: var(--fill-2); text-decoration: none; }
.back-site { grid-column: 2; align-self: center; padding: 6px 10px; border-radius: var(--pill); color: var(--label-2); font-size: 13px; }

.page-mark { display: flex; align-items: center; gap: 8px; margin: 30px 0 0; color: var(--label-2); font-size: 13px; font-weight: 600; }
.page-mark .app-icon { width: 30px; height: 30px; border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(10, 40, 70, .18); }
.page-mark .app-icon .wi { width: 17px; height: 17px; }
.page-mark > span[aria-hidden] { color: var(--label-3); }
.page-mark + :not(.notice) { margin-top: 0 !important; padding-top: 10px !important; }
.page-mark + .panel, .page-mark + .wm-wrap, .page-mark + .global-gate-page, .page-mark + .narrow { margin-top: 16px !important; padding-top: revert !important; }

.app-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  width: 100%; max-width: calc(var(--content-w) + var(--gutter) * 2); margin: 0 auto;
  padding: 22px var(--gutter) 36px;
  color: var(--label-3); font-size: 12px; line-height: 1.6;
  border-top: .5px solid var(--separator);
}
.app-footer a { color: var(--label-2); }
.bottom-nav { display: none; }

/* ---------- Controls ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--pill);
  background: var(--fill);
  color: var(--label);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--spring), opacity .2s var(--ease), box-shadow .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn .wi { width: 18px; height: 18px; }
.btn:hover { background: color-mix(in srgb, var(--fill) 100%, var(--label) 6%); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--solid); color: var(--on-solid); }
.btn.primary:hover { background: var(--solid-hover); }
.btn.ink { background: var(--ink-solid); color: var(--on-ink); }
.btn.ink:hover { background: color-mix(in srgb, var(--ink-solid) 88%, var(--bg)); }
.btn.white { background: var(--surface); color: var(--label); box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--separator); }
.btn.ghost { background: transparent; color: var(--link); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--link) 45%, transparent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger, .btn.ghost.danger { color: var(--red); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 40%, transparent); }
.btn.small-btn { min-height: 34px; padding: 7px 16px; font-size: 14px; }
.btn.wide { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .42; transform: none; }
.btn.google-signin { width: 100%; gap: 10px; background: var(--surface); color: var(--label); box-shadow: inset 0 0 0 1px var(--separator-strong); }
.btn.google-signin img { width: 18px; height: 18px; }

.text-button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 4px 10px; margin: 0;
  border: 0; border-radius: var(--pill);
  background: transparent; color: var(--label-2);
  font-size: 14px; font-weight: 500;
  text-decoration: none !important;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.text-button .wi { width: 18px; height: 18px; }
.text-button:hover { background: var(--fill-2); color: var(--label); }
.text-button.muted { color: var(--label-3); }
.text-button.danger { color: var(--red); }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-size: 15px; font-weight: 400; }
.icon-button {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--label-2);
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.icon-button:hover { background: var(--fill-2); color: var(--label); }
.icon-button .wi { width: 19px; height: 19px; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 0; border-radius: var(--pill);
  background: var(--fill-2); color: var(--label);
  font-size: 13px; font-weight: 500;
  transition: background-color .18s var(--ease);
}
.theme-toggle:hover { background: var(--fill); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-icon-sun, :root[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
.theme-toggle.icon-only { width: 36px; padding: 0; }
.theme-toggle.icon-only [data-theme-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.language-picker {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px 0 12px;
  border-radius: var(--pill); background: var(--fill-2); color: var(--label);
  font-size: 13px; font-weight: 500;
  transition: background-color .18s var(--ease);
}
.language-picker:hover { background: var(--fill); }
.language-picker svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; color: var(--label-2); }
.language-picker select { appearance: none; -webkit-appearance: none; min-width: 0; height: 100%; padding: 0 18px 0 0; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5l3-3' fill='none' stroke='%2386868b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right center / 12px; cursor: pointer; }
.language-picker select, .language-picker select:hover, .language-picker select:focus { min-height: 0; width: auto; border-radius: 0; background-color: transparent; box-shadow: none; font-size: 13px; font-weight: 500; line-height: 1; color: var(--label); }
.language-picker select:focus-visible { outline: none; }
.language-picker:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.language-error { color: var(--red); font-size: 12px; }

.balance-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px 0 11px;
  border-radius: var(--pill);
  background: var(--material);
  box-shadow: inset 0 .5px 0 var(--material-rim), inset 0 -.5px 0 rgba(0, 0, 0, .14), var(--shadow-1);
  color: var(--material-ink);
  font: 600 14px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  text-decoration: none !important;
  white-space: nowrap;
}
.balance-pill .wi { width: 16px; height: 16px; color: var(--material-sub); }
.balance-pill.large { height: 44px; padding: 0 20px 0 16px; font-size: 17px; }
.date-pill { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: var(--pill); background: var(--fill-2); color: var(--label-2); font: 500 13px/1 var(--font-mono); letter-spacing: .02em; white-space: nowrap; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 24px; padding: 2px 10px;
  border-radius: var(--pill);
  background: var(--fill-2); color: var(--label-2);
  font-size: 12px; font-weight: 500; line-height: 1.4;
  white-space: nowrap; text-decoration: none !important;
}
a.tag:hover { background: var(--fill); color: var(--label); }
.tag.blue { background: var(--accent-soft); color: var(--accent); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.green { background: color-mix(in srgb, var(--green-dot) 14%, transparent); color: var(--green); }
.tag.orange, .tag.warn { background: color-mix(in srgb, var(--orange-dot) 16%, transparent); color: var(--orange); }

.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md); corner-shape: squircle;
  background: var(--fill-2); color: var(--label);
  font-size: 14px; line-height: 1.55;
}
.notice .wi { width: 18px; height: 18px; margin-top: 2px; color: var(--label-2); }
.notice.success { background: color-mix(in srgb, var(--green-dot) 12%, var(--surface)); }
.notice.error, .notice.danger { background: var(--red-soft); color: var(--red); }
.notice.info { background: var(--fill-2); }
.notice a { color: var(--link); }

/* ---------- Forms ---------- */
.stack-form { display: grid; gap: 16px; }
.stack-form > label, .stack-form fieldset > label, .form-row > label, label.field {
  display: grid; gap: 7px;
  color: var(--label); font-size: 14px; font-weight: 500;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-radius: var(--r-sm); corner-shape: squircle;
  background: var(--fill-2);
  box-shadow: inset 0 0 0 .5px var(--separator);
  color: var(--label);
  font-size: 16px; font-weight: 400;
  line-height: 1.4;
  transition: box-shadow .18s var(--ease), background-color .18s var(--ease);
}
select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5l3-3' fill='none' stroke='%2386868b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--label-3); opacity: 1; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):hover, select:hover, textarea:hover { background-color: var(--fill); }
input:not([type=checkbox]):not([type=radio]):not([type=file]):focus, select:focus, textarea:focus { outline: none; background-color: var(--surface); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
input[readonly] { color: var(--label-2); }
input[type=file] { width: 100%; padding: 10px; border-radius: var(--r-sm); background: var(--fill-3); box-shadow: inset 0 0 0 1px var(--separator); color: var(--label-2); font-size: 14px; }
input[type=file]::file-selector-button { margin-right: 12px; padding: 7px 14px; border: 0; border-radius: var(--pill); background: var(--fill); color: var(--label); font: 500 13px var(--font); cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.check-label, .build-agreement, .poll-toggle { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 10px !important; color: var(--label-2) !important; font-size: 14px !important; font-weight: 400 !important; line-height: 1.55; }
.field-help { color: var(--label-3); font-size: 12.5px; font-weight: 400; line-height: 1.5; }
.char-counter { color: var(--label-3); font: 500 12px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 72px !important; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 12px; border: 0; border-radius: var(--pill); background: transparent; color: var(--link); font-size: 14px; font-weight: 500; }
.password-toggle:hover { background: var(--accent-soft); }

/* ---------- Surfaces ---------- */
.panel {
  position: relative;
  padding: 24px;
  border-radius: var(--r-lg); corner-shape: squircle;
  background: var(--surface);
  box-shadow: var(--shadow-1), inset 0 0 0 .5px var(--separator);
}
.panel > h2:first-child, .panel > h3:first-child { margin-bottom: 12px; }
.panel h2 { font-size: 22px; }
.narrow { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.narrow > * + * { margin-top: 16px; }

.page-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap;
  padding: 28px 0 12px;
}
.page-heading > div { max-width: 720px; }
.page-heading h1 { margin: 2px 0 0; }
.page-heading p { margin-top: 12px; color: var(--label-2); font-size: 18px; line-height: 1.5; }
.page-heading .text-link { margin-bottom: 10px; font-size: 15px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.section-title h2 { font-size: 24px; }
.section-title h3 { font-size: 17px; }
.section-title > span, .section-title > small { color: var(--label-2); font-size: 14px; }
.section-title small { color: var(--label-3); font-weight: 500; font-size: .7em; }

.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center; }
.empty > .wi { width: 34px; height: 34px; color: var(--label-3); stroke-width: 1.3; }
.empty h2, .empty h3 { font-size: 21px; }
.empty p { max-width: 460px; color: var(--label-2); }
.empty .btn { margin-top: 8px; }

.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 8px 0; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--label);
  font: 600 16px/1 var(--font-display);
  object-fit: cover;
  box-shadow: inset 0 0 0 .5px var(--separator);
}
.avatar-0 { background: #e2eef6; color: #0b3a5b; }
.avatar-1 { background: #dcf1f7; color: #0d4f63; }
.avatar-2 { background: #dff3ec; color: #145440; }
.avatar-3 { background: #e5eaf0; color: #2a3a4b; }
.avatar-4 { background: #e3e8f8; color: #233a7a; }
:root[data-theme="dark"] .avatar-0 { background: #16324a; color: #cfe7f7; }
:root[data-theme="dark"] .avatar-1 { background: #123d4a; color: #c9eef7; }
:root[data-theme="dark"] .avatar-2 { background: #123d32; color: #c8efe0; }
:root[data-theme="dark"] .avatar-3 { background: #26323e; color: #d6e1ea; }
:root[data-theme="dark"] .avatar-4 { background: #1d2b55; color: #d3dcfa; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .avatar-0 { background: #16324a; color: #cfe7f7; }
  :root:not([data-theme]) .avatar-1 { background: #123d4a; color: #c9eef7; }
  :root:not([data-theme]) .avatar-2 { background: #123d32; color: #c8efe0; }
  :root:not([data-theme]) .avatar-3 { background: #26323e; color: #d6e1ea; }
  :root:not([data-theme]) .avatar-4 { background: #1d2b55; color: #d3dcfa; }
}

/* ---------- Dialogs ---------- */
dialog { color: var(--label); }
dialog::backdrop { background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.guest-dialog, .experience-dialog, .global-poll-dialog, .build-join-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 30px 28px 24px;
  border-radius: var(--r-xl); corner-shape: squircle;
  text-align: center;
  overflow: auto;
}
.guest-dialog[open], .experience-dialog[open], .global-poll-dialog[open], .build-join-dialog[open], .raffle-celebration[open], .community-image-dialog[open] { animation: sheet-in .38s var(--spring); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.guest-dialog h2, .experience-dialog h2 { margin: 8px 0 10px; font-size: 24px; }
.guest-dialog p, .experience-dialog p { color: var(--label-2); font-size: 15px; }
.guest-dialog .overline { margin-top: 4px; }
.guest-dialog-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 6px; border-radius: 16px; corner-shape: squircle; background: var(--material); box-shadow: inset 0 .5px 0 var(--material-rim), var(--shadow-1); color: var(--material-ink); }
.guest-dialog-icon .wi { width: 26px; height: 26px; }
.guest-dialog-close { position: absolute; top: 12px; right: 12px; font-size: 22px; line-height: 1; }
.guest-dialog-actions, .experience-actions { display: grid; gap: 10px; margin: 22px 0 6px; }
.guest-dialog > .text-button { margin-top: 4px; }
.experience-kicker { display: none; }

/* ---------- Toasts & progress ---------- */
#water-progress { position: fixed; z-index: 300; top: 0; left: 0; right: 0; height: 2px; overflow: hidden; pointer-events: none; }
#water-progress::before { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); border-radius: 2px; animation: progress-run 1.1s var(--ease) infinite; }
@keyframes progress-run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
#water-toasts { position: fixed; z-index: 280; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.water-toast { padding: 13px 18px; border-radius: var(--r-md); corner-shape: squircle; color: var(--label); font-size: 14px; font-weight: 500; text-align: center; pointer-events: auto; animation: sheet-in .32s var(--spring); }
.water-toast.error { color: var(--red); }

/* ---------- Floating chat & notifications ---------- */
.wai-panel, .wsn-panel, .guest-dialog, .experience-dialog, .global-poll-dialog, .build-join-dialog { background-color: var(--panel); }
.wai-root { z-index: 72; }
body:has(.wai-panel) .wsn-root, body:has(.wsn-panel) .wai-root { visibility: hidden; }
.wai-root, .wsn-root { position: fixed; z-index: 70; right: 22px; font-family: var(--font); }
.wai-root { bottom: 22px; }
.wsn-root { bottom: 90px; }
.wai-root button, .wsn-root button { font-family: inherit; }
.wai-launch, .wsn-launch {
  position: relative; display: grid; place-items: center;
  width: 56px; height: 56px; padding: 0;
  border-radius: 50%;
  color: var(--label);
  font-size: 0 !important;
  transition: transform .3s var(--spring), box-shadow .3s var(--spring);
}
.wai-launch { border: 0; color: #fff; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .75), inset 0 -6px 12px rgba(0, 24, 64, .35), 0 0 0 .5px rgba(255, 255, 255, .45), 0 10px 26px -6px rgba(10, 110, 210, .55); }
.wai-launch:hover, .wsn-launch:hover { transform: scale(1.06); }
.wai-launch:active, .wsn-launch:active { transform: scale(.96); }
.wai-launch::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 28px; height: 28px;
  background: #fff;
  filter: drop-shadow(0 1px 1px rgba(0, 30, 70, .4));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2c-3.4 4.2-6.2 7.6-6.2 10.9a6.2 6.2 0 0 0 12.4 0c0-3.3-2.8-6.7-6.2-10.9Z'/%3E%3Cpath stroke-width='2.4' d='M9.4 14.3h.01m2.6 0h.01m2.6 0h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2c-3.4 4.2-6.2 7.6-6.2 10.9a6.2 6.2 0 0 0 12.4 0c0-3.3-2.8-6.7-6.2-10.9Z'/%3E%3Cpath stroke-width='2.4' d='M9.4 14.3h.01m2.6 0h.01m2.6 0h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wai-launch > * { display: none !important; }
.wsn-launch > svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.wsn-label { display: none; }
.wsn-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); background: #ff3b30; color: #fff; font: 600 11px/20px var(--font) !important; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.wai-invite {
  position: absolute; right: 66px; bottom: 8px;
  min-width: 0; max-width: 240px; white-space: nowrap;
  padding: 9px 14px;
  border-radius: var(--pill);
  background: var(--glass-strong);
  border: .5px solid var(--glass-edge);
  box-shadow: var(--shadow-2);
  color: var(--label); font-size: 13px !important; font-weight: 500;
}
.wai-panel, .wsn-panel {
  position: absolute; right: 0; bottom: 68px;
  display: flex; flex-direction: column;
  width: 384px;
  border-radius: var(--r-xl); corner-shape: squircle;
  overflow: hidden;
}
.wai-panel { height: min(640px, calc(100dvh - 120px)); }
.wsn-panel { max-height: min(600px, calc(100dvh - 190px)); }
.wai-header, .wsn-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: .5px solid var(--separator); }
.wai-header strong, .wsn-header strong { display: block; font: 600 17px/1.25 var(--font-display); letter-spacing: -.015em; }
.wai-header small, .wsn-header small { display: block; color: var(--label-2); font-size: 12px; }
.wai-close, .wsn-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--fill-2); color: var(--label-2); font-size: 18px; line-height: 1; }
.wai-log { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.wai-empty { margin: auto 0; text-align: center; color: var(--label-2); font-size: 14px; display: grid; gap: 10px; justify-items: center; }
.wai-chip { padding: 8px 14px; border: 0; border-radius: var(--pill); background: var(--fill-2); color: var(--label); font-size: 13px; }
.wai-chip:hover { background: var(--fill); }
.wai-message { align-self: flex-start; max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--fill-2); color: var(--label); font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.wai-message.wai-user { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--solid); color: var(--on-solid); }
.wai-message.wai-user a { color: inherit; text-decoration: underline; }
.wai-message small { display: block; margin-top: 4px; opacity: .65; font-size: 11px; }
.wai-message p { margin: 0; }
.wai-thinking { color: var(--label-2); font-size: 13px; }
.wai-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 8px; border-top: .5px solid var(--separator); }
.wai-compose textarea { flex: 1; min-height: 40px !important; max-height: 140px; padding: 9px 14px !important; border-radius: 20px !important; font-size: 15px !important; resize: none; }
.wai-primary { height: 40px; padding: 0 16px; border: 0; border-radius: var(--pill); background: var(--solid); color: var(--on-solid); font-size: 14px; font-weight: 600; }
.wai-primary:disabled { opacity: .4; }
.wai-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px 12px; color: var(--label-3); font-size: 11.5px; }
.wai-foot small { font-size: 11.5px; }
.wai-clear { padding: 4px 8px; border: 0; border-radius: var(--pill); background: transparent; color: var(--label-2); font-size: 12px; }
.wai-clear:hover { background: var(--fill-2); }
.wai-error, .wsn-error { margin: 0 16px 10px; padding: 9px 12px; border-radius: 12px; background: var(--red-soft); color: var(--red); font-size: 13px; }
.wai-skip { align-self: center; padding: 5px 12px; border: 0; border-radius: var(--pill); background: var(--fill-2); color: var(--label-2); font-size: 12px; }
.wai-markdown > :first-child { margin-top: 0; }
.wai-markdown > :last-child { margin-bottom: 0; }
.wai-markdown p, .wai-markdown ul, .wai-markdown ol, .wai-markdown pre, .wai-markdown blockquote { margin: .5em 0; }
.wai-markdown ul, .wai-markdown ol { padding-left: 1.3em; }
.wai-markdown h1, .wai-markdown h2, .wai-markdown h3, .wai-markdown h4 { margin: .7em 0 .3em; font-size: 15.5px; letter-spacing: -.01em; }
.wai-markdown blockquote { padding-left: 10px; border-left: 2px solid var(--separator-strong); color: var(--label-2); }
.wai-markdown pre { padding: 10px 12px; border-radius: 10px; background: var(--fill-2); overflow-x: auto; }
.wai-markdown :not(pre) > code { padding: 1px 5px; border-radius: 5px; background: var(--fill-2); }
.wai-markdown a { color: var(--link); }
.wai-markdown hr { margin: 10px 0; }
.wai-table { overflow-x: auto; margin: .5em 0; }
.wai-markdown table { border-collapse: collapse; font-size: 13px; }
.wai-markdown th, .wai-markdown td { padding: 5px 9px; border-bottom: .5px solid var(--separator); text-align: left; }
.wai-markdown .wai-align-center { text-align: center; }
.wai-markdown .wai-align-right { text-align: right; }
.wai-writing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.wsn-tools { display: flex; justify-content: flex-end; padding: 8px 14px; border-bottom: .5px solid var(--separator); }
.wsn-read-all { padding: 5px 10px; border: 0; border-radius: var(--pill); background: transparent; color: var(--link); font-size: 13px; font-weight: 500; }
.wsn-read-all:hover { background: var(--accent-soft); }
.wsn-list { flex: 1; overflow-y: auto; padding: 6px; }
.wsn-empty, .wsn-login { padding: 32px 20px; color: var(--label-2); font-size: 14px; text-align: center; }
.wsn-item { position: relative; display: flex; gap: 11px; width: 100%; padding: 11px 12px; border: 0; border-radius: 14px; background: transparent; color: var(--label); text-align: left; text-decoration: none !important; }
.wsn-item:hover { background: var(--fill-2); }
.wsn-item.is-unread { background: var(--accent-soft); }
.wsn-item-body { flex: 1; min-width: 0; }
.wsn-item-heading { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.wsn-item-heading strong { font-weight: 600; }
.wsn-excerpt { margin-top: 2px; color: var(--label-2); font-size: 13px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wsn-item time { color: var(--label-3); font-size: 12px; white-space: nowrap; }
.wsn-unread-dot { position: absolute; left: 4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
.wsn-more { display: block; margin: 6px auto 8px; padding: 7px 14px; border: 0; border-radius: var(--pill); background: var(--fill-2); color: var(--label); font-size: 13px; }
.social-avatar-wrap, .online-avatar-wrap { position: relative; display: inline-block; flex: none; }
.social-avatar-wrap > .avatar { width: 36px; height: 36px; font-size: 14px; }

/* ---------- Auth ---------- */
.auth-body { background: var(--bg); }
.auth-layout { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 0 16px 28px; }
.auth-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 1080px; padding: 18px 8px; }
.auth-back { color: var(--label-2); font-size: 14px; }
.theme-auth-tools { display: flex; align-items: center; gap: 8px; }
.auth-card {
  width: 100%; max-width: 460px;
  margin: clamp(8px, 5vh, 56px) auto 0;
  padding: 36px clamp(22px, 5vw, 40px) 32px;
  border-radius: var(--r-xl); corner-shape: squircle;
  background: var(--surface);
  box-shadow: var(--shadow-2), inset 0 0 0 .5px var(--separator);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 26px; color: var(--label); font: 600 15px/1 var(--font-display); text-decoration: none !important; }
.auth-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.auth-brand .brand-mark img { width: 27px; height: 27px; }
.auth-form-wrap > h2 { font-size: 30px; letter-spacing: -.028em; text-align: center; }
.auth-form-wrap > .form-lead { margin: 10px auto 26px; max-width: 340px; color: var(--label-2); font-size: 15px; text-align: center; }
.auth-form-wrap > .notice { margin-bottom: 18px; }
.auth-form-wrap > .overline { display: none; }
.auth-form-wrap .stack-form + .auth-switch, .auth-form-wrap .stack-form + p { margin-top: 20px; }
.auth-switch { margin-top: 10px; color: var(--label-2); font-size: 14px; text-align: center; }
.auth-form-wrap > .muted.small { margin-top: 14px; text-align: center; color: var(--label-3); }
.google-auth-form { gap: 10px; margin-bottom: 18px; padding-bottom: 20px; border-bottom: .5px solid var(--separator); }
.google-auth-note { color: var(--label-3); font-size: 12px; text-align: center; }
.google-auth-note a { margin-left: 4px; }
.verify-address { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -8px auto 22px; padding: 9px 16px; width: fit-content; max-width: 100%; border-radius: var(--pill); background: var(--fill-2); color: var(--label); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.verify-address .wi { width: 16px; height: 16px; color: var(--label-2); }
.verification-code { text-align: center; font: 600 26px/1 var(--font-mono) !important; letter-spacing: .4em !important; }
.verify-resend { margin-top: 20px; text-align: center; }
.verify-resend .muted { margin-top: 10px; color: var(--label-3); }
.resend-button { border: 0; background: none; padding: 6px; color: var(--link); font-size: 14px; font-weight: 500; }
.resend-button:disabled { color: var(--label-3); }
.verify-switch { display: flex; align-items: center; justify-content: center; gap: 4px 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: .5px solid var(--separator); }
.verify-switch form { margin: 0; }
.google-verify { margin-top: 20px; padding: 18px; background: var(--fill-3); box-shadow: none; }
.auth-bottom { margin-top: auto; padding-top: 32px; color: var(--label-3); font-size: 12px; letter-spacing: .02em; }

/* ---------- Responsive shell ---------- */
@media (max-width: 1100px) {
  .bar-brand-text { display: none; }
}
@media (max-width: 960px) {
  html { scroll-padding-top: 80px; }
  :root { --bar-h: 54px; }
  .community-body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .app-top { top: 8px; width: calc(100% - 16px); margin-top: 8px; padding: 0 8px; padding-left: 7px; }
  .bar-tabs, .bar-launcher { display: none; }
  .bar-brand-text { display: inline; font-size: 17px; }
  .bar-brand .brand-mark { width: 38px; height: 38px; }
  .app-tools { margin-left: auto; }
  .bottom-nav {
    position: fixed; z-index: 55;
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(5, 1fr);
    max-width: 520px; margin: 0 auto;
    padding: 6px;
    border-radius: 30px; corner-shape: squircle;
  }
  .bottom-nav a, .bottom-more {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 52px; padding: 4px 2px;
    border: 0; border-radius: 22px;
    background: transparent; color: var(--label-2);
    font-size: 10.5px; font-weight: 500; letter-spacing: 0;
    text-decoration: none !important;
    transition: background-color .2s var(--ease), color .2s var(--ease);
  }
  .bottom-nav .wi { width: 23px; height: 23px; }
  .bottom-nav a.active { background: var(--fill); color: var(--accent); }
  .bottom-more[aria-expanded="true"] { background: var(--fill); color: var(--label); }
  .sidebar {
    top: auto; left: 8px; right: 8px; bottom: 8px;
    width: auto; max-width: 560px; margin: 0 auto;
    max-height: calc(100dvh - 64px);
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    opacity: 1;
    transform: translateY(calc(100% + 24px));
    transition: transform .42s var(--spring), visibility 0s linear .42s;
  }
  .sidebar::before { content: ""; display: block; flex: none; width: 38px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: var(--separator-strong); }
  .sidebar.open { transform: none; transition: transform .42s var(--spring), visibility 0s; }
  .app-icon { width: 52px; height: 52px; border-radius: 14px; }
  .launcher-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .app-main { padding-top: 4px; padding-bottom: 32px; }
  .page-mark { margin-top: 20px; }
  .app-footer { flex-direction: column; padding-bottom: 20px; }
  .wai-root { right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); }
  .wsn-root { right: 16px; bottom: calc(158px + env(safe-area-inset-bottom)); }
  .wai-launch, .wsn-launch { width: 50px; height: 50px; }
  .wai-panel, .wsn-panel { position: fixed; left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); width: auto; max-width: 480px; margin: 0 auto; }
  .wai-panel { height: min(600px, calc(100dvh - 170px)); }
  .wsn-panel { max-height: calc(100dvh - 170px); }
  #water-toasts { bottom: calc(100px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .app-tools .balance-pill { padding: 0 11px 0 9px; font-size: 13px; }
  .launcher-grid { gap: 0; }
  .nav-item { font-size: 11.5px; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  h1 { font-size: 32px; }
  .panel { padding: 20px 18px; }
  .page-heading { padding-top: 18px; }
  .page-heading p { font-size: 16px; }
  .wai-invite { display: none; }
  .auth-card { margin-top: 0; padding-top: 30px; box-shadow: none; background: transparent; }
  .auth-body .auth-card { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar, .bottom-nav, .app-top, .mobile-top, .wai-panel, .wsn-panel, dialog { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: var(--bg-elevated); }
}
