/* Battle Buddy website. Colors are tokens; app.js swaps them for the member's Customize theme. */
:root {
  --accent: #ff7a1f;
  --accent-ink: #14100c;
  --bg-top: #11151b;
  --bg: #090b0f;
  --panel: #151a21;
  --panel-2: #1b2129;
  --border: #2f3741;
  --text: #eceff2;
  --muted: #8a96a3;
  --dim: #4e5865;
  --good: #4ade80;
  --bad: #f85149;
  --radius: 10px;
  --font-head: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
:root[data-light='1'] { color-scheme: light; }

/* Bigger screens: the whole site scales up with the window (phones and laptops stay at 1).
   vh/vw sizes below are divided by --z so full-height things still fit the screen. */
:root { --z: 1; }
@media (min-width: 1400px) { :root { --z: 1.1; } }
@media (min-width: 1600px) { :root { --z: 1.2; } }
@media (min-width: 1800px) { :root { --z: 1.28; } }
@media (min-width: 2100px) { :root { --z: 1.35; } }
html { zoom: var(--z); }


/* ==================== MOTION GUIDELINE ====================
   One set of timings and curves for everything that moves, so the whole site feels like one app.
   Curves:  --ease-ios     iOS-style deceleration: page pushes, sheets, panels (fast start, long soft landing)
            --ease-out     general "settle into place": fades, rises, list items, small things
            --ease-spring  a touch of overshoot: things that pop (press release, badges, the menu circle)
   Timings: --t-press  110ms  touch feedback (press in)
            --t-quick  180ms  hovers, small state changes, fades out
            --t-base   280ms  items appearing, chat bubbles, toasts
            --t-page   380ms  page push/pop, chat windows
            --t-sheet  460ms  sheets, pop-ups, full-screen pictures
   Rules:   animate transform and opacity only (smooth on the GPU; the one exception is expand() opening a section in place); things leave faster than they arrive;
            lists cascade 28ms apart (max 14 steps); everything turns off for prefers-reduced-motion. */
:root {
  --ease-ios: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.36, .64, 1);
  --t-press: 110ms;
  --t-quick: 180ms;
  --t-base: 280ms;
  --t-page: 380ms;
  --t-sheet: 460ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: linear-gradient(180deg, var(--bg-top), var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: 0.02em; margin: 0; line-height: 1.1; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.kicker { font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- shell: the floating menu (top left) ---------- */
.shell { min-height: calc(100vh / var(--z)); }
/* The banner: always on top. */
:root { --banner-h: 56px; }
.banner { position: fixed; top: 0; left: 0; right: 0; z-index: 45; height: calc(var(--banner-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.banner-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.banner-brand img { width: 30px; height: 30px; border-radius: 50%; }
.bname { font-family: var(--font-head); font-weight: 700; font-size: 21px; letter-spacing: .06em; text-transform: uppercase; }
.bver { position: absolute; right: 14px; bottom: 5px; font-size: 11px; color: var(--muted); letter-spacing: .04em; }

/* The menu: a circle that morphs into the menu panel. */
.morph { position: fixed; top: calc(var(--banner-h) + 12px + env(safe-area-inset-top)); left: 16px; z-index: 61; width: 40px; height: 40px; border-radius: 20px; border: 1px solid var(--border); background: var(--panel-2); overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.3);
  transition: width .38s cubic-bezier(.2, 1.25, .35, 1), height .42s cubic-bezier(.2, 1.15, .35, 1), border-radius .3s ease, background .25s ease, box-shadow .3s ease, border-color .2s ease; }
.morph.open { width: 262px; height: var(--open-h, 340px); border-radius: 16px; background: var(--panel); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 22px 60px rgba(0,0,0,.55), 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
  transition: width .32s cubic-bezier(.2, 1.25, .35, 1), height .46s cubic-bezier(.2, 1.12, .35, 1) .04s, border-radius .25s ease, background .2s ease, box-shadow .3s ease, border-color .2s ease; }
.morph-btn { position: absolute; top: 0; left: 0; width: 38px; height: 38px; border: 0; background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; z-index: 2; }
.morph-btn:hover { color: var(--accent); }
.burger { position: relative; width: 18px; height: 14px; }
.burger i { position: absolute; left: 0; width: 18px; height: 2.2px; border-radius: 2px; background: currentColor; transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), opacity .2s ease, top .25s ease; }
.burger i:nth-child(1) { top: 0; }
.burger i:nth-child(2) { top: 6px; }
.burger i:nth-child(3) { top: 12px; }
.morph.open .burger i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.morph.open .burger i:nth-child(2) { opacity: 0; transform: scaleX(0); }
.morph.open .burger i:nth-child(3) { top: 6px; transform: rotate(-45deg); }
.morph-list { position: absolute; top: 46px; left: 0; width: 262px; display: flex; flex-direction: column; padding: 4px 8px 8px; }
.morph-list a .mi { display: inline-grid; place-items: center; height: 24px; padding-right: 10px; margin-right: 12px; vertical-align: -6px; color: #fff; border-right: 2px solid var(--accent); }
.morph-list a .mi svg { width: 24px; height: 24px; }
.morph-list a { padding: 9px 10px; border-radius: 9px; color: var(--text); font-family: var(--font-head); font-weight: 600; font-size: 17px; letter-spacing: .04em; white-space: nowrap; opacity: 0; transform: translateX(-12px); transition: opacity .15s ease, transform .15s ease, background .15s ease; }
.morph.open .morph-list a { opacity: 1; transform: none; transition: opacity .25s ease calc(.12s + var(--i) * .045s), transform .35s cubic-bezier(.2, 1.4, .4, 1) calc(.12s + var(--i) * .045s), background .15s ease; }
.morph-list a:hover { background: var(--panel-2); }
.morph-list a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.morph-list a.out { color: var(--muted); font-size: 15px; margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 9px 9px; }
@media (prefers-reduced-motion: reduce) { .morph, .morph.open, .morph-list a, .burger i { transition: none !important; } }

main { max-width: 1180px; margin: 0 auto; padding: calc(var(--banner-h) + 66px + env(safe-area-inset-top)) 16px 40px; } /* phones: the menu circle sits above the page */
@media (min-width: 900px) { main { padding: calc(var(--banner-h) + 22px) 32px 48px 82px; } } /* wider: beside it */

/* Apply to Web: the member's wallpaper behind the whole site, darkened so text stays readable. */
html.web-wall body { background: var(--bg); }
html.web-wall body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 52%, transparent), color-mix(in srgb, var(--bg) 78%, transparent)), var(--web-wall) center / cover no-repeat; } /* an uploaded picture: still */
/* A pattern wallpaper is drawn live (app.js liveWall) on this canvas behind everything. */
.live-wall { position: fixed; inset: 0; width: calc(100vw / var(--z)); height: calc(100vh / var(--z)); z-index: -1; pointer-events: none; }

.cz-tabs-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-grid > * { min-width: 0; } /* a long row of tabs scrolls instead of widening the page */
.cz-tabs-row .tabs { flex: 1; min-width: 0; margin-bottom: 0; }
.web-apply { flex: 0 0 auto; min-height: 36px; padding: 0 11px; border-radius: 99px; border: 1px dashed var(--accent); background: transparent; color: var(--accent); font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: .04em; cursor: pointer; white-space: nowrap; }
.web-apply.flash { animation: web-flash .7s ease-out; }
@keyframes web-flash { 0% { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { background: transparent; color: var(--accent); box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); } }

/* Home: the latest news from #announcements. */
.home-status { margin-top: 28px; }
.status-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.status-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.status-card { --st: var(--good); padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); box-shadow: inset 3px 0 0 var(--st); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.status-card.linked { color: inherit; text-decoration: none; cursor: pointer; transition: transform var(--t-quick) var(--ease-out), border-color var(--t-quick) var(--ease-out); }
.status-card.linked:hover { transform: translateY(-2px); }
.status-card.linked:active { transform: scale(.98); }
.status-src { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--accent); }
.status-src svg { width: 13px; height: 13px; }
.status-card.reports { --st: #ff9f1a; }
.status-card.down { --st: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.status-card.unknown { --st: var(--dim); }
.status-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.status-top h3 { font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st); flex: 0 0 auto; box-shadow: 0 0 0 0 var(--st); }
.status-card:not(.ok):not(.unknown) .status-dot { animation: status-ping 1.6s var(--ease-out) infinite; }
@keyframes status-ping { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.status-word { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: .04em; color: var(--st); }
.home-news { margin-top: 28px; }
.news-sub { margin: 2px 0 12px; }
.news-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.news-card { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); overflow: hidden; }
.news-img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; cursor: zoom-in; }
.news-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.news-meta { display: flex; align-items: center; gap: 8px; }
.news-body h3 { font-size: 20px; }
.news-text { color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: 14.5px; line-height: 1.5; }
.news-date { font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: .04em; color: var(--text); }
.news-links { margin-top: auto; }

/* ---------- building blocks ---------- */
.page-head { overflow-x: clip; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 54px; margin-bottom: 14px; }
.page-title { font-family: var(--font-head); font-weight: 700; font-size: clamp(30px, 5vw, 42px); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); flex: 0 1 auto; min-width: 0; margin-right: auto; position: relative; isolation: isolate; }
.page-title::before { content: ''; position: absolute; inset: -18px -36px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(0,0,0,.5), rgba(0,0,0,.25) 55%, transparent); } /* keeps the title readable on any wallpaper */
:root[data-light='1'] .page-title::before { background: radial-gradient(closest-side, rgba(255,255,255,.6), rgba(255,255,255,.3) 55%, transparent); }
@media (max-width: 599px) { .page-title { letter-spacing: .08em; } .page-head .head-actions { width: 100%; } }
.back-arrow { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; margin-left: -8px; }
.back-arrow svg { width: 34px; height: 34px; }
@media (hover: hover) { .back-arrow:hover { color: var(--accent); background: var(--panel); } } /* phones keep :hover after a tap */
.head-actions { flex-wrap: nowrap; }
.count-line { margin: 2px 0 14px; }
.row.nowrap > input { flex: 1; min-width: 0; }
.sub-head { font-size: 26px; margin: 4px 0 14px; }
.nowrap { flex-wrap: nowrap; }
.show-btn { position: absolute; right: 12px; bottom: 12px; z-index: 4; height: 50px; min-width: 50px; max-width: 50px; padding: 0 13px; border-radius: 25px; border: 0; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; gap: 0; overflow: hidden; white-space: nowrap; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.45); transition: max-width .22s ease, gap .22s ease, transform .08s ease; }
.show-btn svg { width: 24px; height: 24px; flex: 0 0 auto; }
.show-label { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: .04em; opacity: 0; transition: opacity .15s ease; }
.show-btn:active { transform: scale(.96); }
/* Idle: a soft glowing ring pulses out, and the sparkle twinkles. */
.show-btn { animation: show-pulse 2.4s ease-out infinite; }
.show-btn svg { animation: show-twinkle 2.4s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes show-pulse { 0% { box-shadow: 0 6px 18px rgba(0,0,0,.45), 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 6px 18px rgba(0,0,0,.45), 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent); } }
@keyframes show-twinkle { 0%, 60%, 100% { transform: scale(1) rotate(0deg); } 70% { transform: scale(1.22) rotate(18deg); } 82% { transform: scale(.94) rotate(-6deg); } }
.show-btn:hover svg { animation: show-twinkle .9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .show-btn, .show-btn svg { animation: none; } }
@media (hover: hover) {
  .show-btn:hover, .show-btn:focus-visible { max-width: 170px; gap: 8px; padding-right: 18px; }
  .show-btn:hover .show-label, .show-btn:focus-visible .show-label { opacity: 1; transition-delay: .06s; }
}
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.pad { padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-family: var(--font-head); font-weight: 600; font-size: 16px; letter-spacing: 0.04em; cursor: pointer; white-space: nowrap;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.good { background: color-mix(in srgb, var(--good) 22%, var(--panel-2)); border-color: color-mix(in srgb, var(--good) 55%, var(--border)); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--border)); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 32px; padding: 0 9px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; min-height: 50px; font-size: 18px; padding: 0 24px; }

.tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); cursor: pointer; text-align: left; position: relative; overflow: hidden; transition: border-color .15s ease, transform .1s ease; }
.tile:hover { border-color: var(--accent); }
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.tile h3 { font-size: 20px; }
.tile.soon { opacity: .75; }
.tile.soon::before { background: var(--dim); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.tag.accent { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 14px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; min-height: 36px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: .04em; cursor: pointer; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tabs button[disabled] { opacity: .4; cursor: not-allowed; }

input[type=text], input[type=search], input[type=number], input[type=date], input[type=time], textarea, select {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
label.field, div.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- pictures ---------- */
.pic { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--border); }
.pic img { display: block; width: 100%; height: auto; transition: opacity .12s ease; }
.pic.loading img { opacity: .55; }
.pic .spin { position: absolute; top: 10px; right: 10px; display: none; }
.pic.loading .spin { display: block; }
.pic .empty { aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--muted); }
.spinner, .spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: calc(100vh / var(--z)); display: grid; place-items: center; }

/* ---------- loadouts ---------- */
.lo-list { display: flex; flex-direction: column; gap: 8px; }
.lo-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); cursor: pointer; }
.lo-item:hover { border-color: var(--muted); }
.lo-item .main { flex: 1; min-width: 0; }
.lo-item .title { font-family: var(--font-head); font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lo-item .pts { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--accent); }
.lo-item.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.lo-item .tick { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center; flex: 0 0 auto; }
.lo-item.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.group-title { margin: 14px 0 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.section-head h2 { font-size: 26px; }
.lo-item .title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; white-space: normal; }
.lo-item .title .pts { font-size: 15px; margin-left: 4px; }
.lo-item .desc { margin-top: 2px; }
.wpn { color: var(--accent); }
.sep { color: var(--muted); }
.actions { gap: 6px; flex-wrap: nowrap; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; flex: 0 0 auto; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn.fav.on { color: #ef4444; border-color: color-mix(in srgb, #ef4444 55%, var(--border)); }
.icon-btn.del:hover { color: var(--bad); border-color: var(--bad); }
.icon-btn.back { color: var(--text); }

.builder { display: grid; gap: 16px; }
@media (min-width: 1000px) {
  .builder { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); align-items: start; }
  .builder .sticky { position: sticky; top: 78px; }
}
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.slot { text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; min-height: 62px; }
.slot .s { font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.slot .v { font-family: var(--font-head); font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.slot.on .s { color: var(--accent); }
.slot.emptyv .v { color: var(--dim); }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; padding: 2px; }
.opt { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; text-align: left; }
.opt:hover { border-color: var(--muted); }
.opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.opt .n { font-weight: 600; font-size: 14px; line-height: 1.2; }
.opt .c { font-family: var(--font-head); font-weight: 600; color: var(--muted); white-space: nowrap; }
.opt.def .n::after { content: ' · default'; color: var(--muted); font-weight: 400; font-size: 12px; }
.budget { height: 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.budget > div { height: 100%; background: var(--accent); transition: width .2s ease; }
.budget.over > div { background: var(--bad); }
.points { font-family: var(--font-head); font-weight: 700; font-size: 26px; }
.points.over { color: var(--bad); }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wbtn { padding: 14px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); text-align: left; cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.wbtn:hover { border-color: var(--accent); }
.wbtn .small { display: block; font-family: var(--font-body); font-weight: 400; }
.wbtn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- customize, trophies ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.swatch { position: relative; border-radius: 10px; border: 2px solid var(--border); overflow: hidden; cursor: pointer; text-align: left; padding: 0; background: var(--panel); }
.swatch .ti { aspect-ratio: 2 / 1; background-color: var(--panel-2); background-repeat: no-repeat; }
.swatches.emblem { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.swatches.emblem .ti { aspect-ratio: 1; }
.swatch .nm { padding: 8px 10px; font-family: var(--font-head); font-weight: 600; font-size: 15px; display: flex; flex-direction: column; gap: 2px; }
.swatch .nm .st { font-family: var(--font-body); font-weight: 600; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--good); white-space: nowrap; }
.swatch .nm .st.on { color: var(--accent); }
.swatch .nm .st.locked { color: var(--muted); }
.swatch.on { border-color: var(--accent); }
.swatch.locked { cursor: not-allowed; }
.swatch.locked .ti { opacity: .4; filter: grayscale(.5); }
.swatch.locked .nm { opacity: .5; }
.lock { font-size: 12px; color: var(--muted); font-family: var(--font-body); font-weight: 500; }
.trophy-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.trophy-bar .tabs { flex: 1; min-width: 0; margin-bottom: 0; }
.drop-wrap { position: relative; }
.drop-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; min-width: 180px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.drop-menu .check { padding: 6px 4px; font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.drop-item { text-align: left; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.drop-item:hover { background: var(--panel-2); }
.drop-item.on { color: var(--accent); }
.trophy-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .trophy-grid { grid-template-columns: 1fr 1fr; } }
.trophy { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); box-shadow: inset 3px 0 0 var(--accent); cursor: pointer; text-align: left; width: 100%; }
.trophy:hover { border-color: var(--muted); }
.trophy.locked { box-shadow: inset 3px 0 0 var(--dim); }
.trophy.locked .t-main h3, .trophy.locked .t-desc { color: var(--muted); }
.medal-img { width: 56px; height: 56px; flex: 0 0 auto; background-repeat: no-repeat; border-radius: 6px; }
.medal-img.big { width: 112px; height: 112px; margin: 0 auto; }
.t-main { flex: 1; min-width: 0; }
.t-main h3 { font-size: 21px; }
.t-desc { font-size: 15.5px; color: var(--muted); margin-top: 2px; }
.t-date { font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: .06em; margin-top: 4px; }
.t-side { align-self: flex-start; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.t-kind { font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.rarity { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--muted); }
.rarity svg { width: 14px; height: 14px; }
.trophy .bar { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin-top: 6px; }
.trophy .bar div { height: 100%; background: var(--accent); }
.trophy-pop { position: relative; text-align: center; padding-top: 26px; padding-bottom: calc(26px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; min-height: 340px; }
.trophy-pop .close { position: absolute; top: 12px; right: 12px; font-size: 22px; }
.pop-kind { font-family: var(--font-head); font-weight: 600; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; margin-top: 6px; }
.trophy-pop h2 { font-size: 30px; }
.pop-desc { font-size: 17px; color: var(--muted); margin: 0 auto; max-width: 420px; }
.pop-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--font-head); font-weight: 600; font-size: 16px; margin-top: 6px; padding-bottom: 50px; }
.pop-meta .rarity { font-size: 15px; }
.pop-foot .show-btn { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }

/* ---------- BF6 stats ---------- */
.search-wrap { position: relative; margin-bottom: 16px; max-width: 520px; }
.search-drop { max-height: min(calc(52vh / var(--z)), 420px); overflow-y: auto; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45; display: flex; flex-direction: column; padding: 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.res { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.res:hover:not([disabled]) { background: var(--panel-2); }
.res[disabled] { opacity: .5; cursor: not-allowed; }
.res img, .res .ph { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); flex: 0 0 auto; }
.res .n { flex: 1; font-weight: 600; }
.bf6-cards { display: flex; flex-direction: column; gap: 16px; }
.bf6-grid { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 760px) { .bf6-grid { display: block; columns: 2; column-gap: 16px; } .bf6-grid > * { break-inside: avoid; margin-bottom: 16px; } } /* cards stack in two columns with no holes under short ones */
.link-box { max-width: 620px; }
.people { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); }
.person:hover { border-color: var(--accent); }
.person img, .person .ph { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); flex: 0 0 auto; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: var(--accent); }
.person .n { flex: 1; min-width: 0; font-family: var(--font-head); font-weight: 700; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.tool { width: 36px; height: 36px; }
.builder-actions { margin-top: 14px; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: min(calc(92vw / var(--z)), 520px); padding: 12px 16px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.4); font-weight: 500; }
.toast.bad { border-color: var(--bad); }
.toast.good { border-color: var(--good); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.hello { text-align: center; padding: 6px 0 4px; }
.hello-line { font-family: var(--font-head); font-weight: 700; font-size: clamp(26px, 4.2vw, 46px); letter-spacing: .03em; color: var(--text); overflow-wrap: anywhere; }
.hub-title { font-family: var(--font-head); font-size: 24px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.home-grid { display: grid; gap: 16px; margin-top: 16px; }
.home-actions { display: flex; flex-direction: column; gap: 10px; }
.home-actions .tile h3 { font-size: 21px; }
.btn.wide { width: 100%; min-height: 50px; font-size: 18px; }
@media (min-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.empty-state { text-align: center; padding: 34px 16px; color: var(--muted); }
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: grid; place-items: end center; }
.sheet { width: min(100%, 560px); max-height: calc(86vh / var(--z)); overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet-backdrop { place-items: center; } .sheet { border-radius: 16px; } }
.hide { display: none !important; }

/* ---------- live loadout builder ---------- */
.stage { position: relative; border-radius: 12px; border: 1px solid var(--border); background: radial-gradient(60% 55% at 50% 58%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), linear-gradient(180deg, var(--bg-top), var(--bg)); overflow: hidden; }
.stage.loading .stage-gun { opacity: .7; }
.stage { color: var(--text); transition: background-color var(--t-base) ease; }
.look-wear { color: var(--text); }
.look-wear.walled { background: var(--look-wall) center / cover no-repeat; } /* the member's Server Card wallpaper (drawn on their theme): builder stage, trophy and Show off pop-ups */
.stage-head { padding: 14px 16px 0; }
.stage-title { font-size: clamp(24px, 3.2vw, 40px); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; }
.stage-name, .stage-desc { cursor: text; border-radius: 6px; outline: none; }
.stage-name:hover, .stage-desc:hover, .stage-name:focus, .stage-desc:focus { background: color-mix(in srgb, var(--text) 7%, transparent); }
.stage-name.placeholder, .stage-desc.placeholder { color: var(--dim); }
.stage-desc { color: var(--muted); font-size: 15px; margin: 4px 0 18px; max-width: 46%; min-height: 22px; white-space: pre-wrap; }
.stage-name input { font: inherit; width: min(420px, calc(60vw / var(--z))); padding: 0 6px; min-height: 0; }
.stage-desc textarea { width: 100%; min-height: 60px; }
.stage-pts { position: absolute; top: 14px; right: 18px; font-family: var(--font-head); font-weight: 700; font-size: clamp(22px, 2.6vw, 34px); color: var(--good); }
.stage-pts.over { color: var(--bad); }
.stage-gun { display: block; transition: opacity .15s ease; pointer-events: none; }
.stage-lines line { stroke: var(--dim); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.stage-lines line.on { stroke: color-mix(in srgb, var(--accent) 65%, transparent); }
.stage-lines line.hi { stroke: var(--accent); stroke-width: 2.5; }
.sbox { display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left; padding: 6px 10px 6px 12px; border: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 92%, transparent); color: var(--text); cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); box-shadow: inset 3px 0 0 var(--accent); min-width: 0; }
.sbox.emptyv { box-shadow: none; }
.sbox .s { display: flex; justify-content: space-between; gap: 6px; font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sbox .v { font-family: var(--font-head); font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbox.emptyv .v { color: var(--dim); }
.sbox:hover { border-color: var(--muted); }
.sbox.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.sbox.on .s { color: var(--accent); }
.picker { position: absolute; z-index: 70; max-height: 340px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.45); overflow: hidden; }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--border); }
.picker-head .icon-btn { width: 32px; height: 32px; font-size: 20px; }
.picker-list { overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.picker.sheet-pick { position: fixed; left: 0; right: 0; bottom: 0; max-height: calc(70vh / var(--z)); border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 760px) {
  .stage { height: 0; padding-bottom: calc(544 / 1040 * 100% + var(--push, 0px)); } /* the art's shape, plus room for a long description */
  .stage-head { position: absolute; left: 2%; top: 3%; right: 22%; padding: 0; z-index: 2; }
  .stage-art, .stage-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
  .stage-gun { position: absolute; height: auto; }
  .stage-slots { position: absolute; inset: 0; }
  .stage > .stage-art, .stage-slots { top: var(--push, 0px); height: auto; bottom: 0; }
  .sbox { position: absolute; left: var(--x); top: var(--y); width: 18.08%; height: 13.24%; z-index: 3; }
}
@media (max-width: 759px) {
  .stage-lines { display: none; }
  .stage-desc { max-width: none; }
  .stage-pts { top: 12px; right: 14px; }
  .stage-head { padding-right: 90px; }
  .stage-gun { width: min(78%, 320px) !important; position: static; margin: 14px auto 8px; } /* smaller and centered on phones */
  .stage-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; }
  .sbox { min-height: 58px; }
  .stage:has(.show-btn) .stage-slots { padding-bottom: 74px; }
}

/* ---------- player notes ---------- */
.bell-btn { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); cursor: pointer; transition: color var(--t-quick) var(--ease-out), border-color var(--t-quick) var(--ease-out), background var(--t-quick) var(--ease-out); }
.bell-btn svg { width: 20px; height: 20px; transform-origin: 50% 10%; }
.bell-btn.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.bell-btn:hover { border-color: var(--muted); }
.bell-btn:active { transform: scale(.92); }
.bell-row { display: flex; align-items: center; gap: 10px; }
.notes-add { margin-bottom: 14px; }
.notes-add .search-wrap { margin-bottom: 0; }
.note-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); text-align: left; cursor: pointer; width: 100%; }
.note:hover { border-color: var(--accent); }
.note img, .note .ph, .member img, .member .ph, .chip img, .chip .ph, .avatars img, .avatars .ph { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); flex: 0 0 auto; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: var(--accent); }
.note-main { flex: 1; min-width: 0; }
.note-main h3 { font-size: 19px; }
.note-main p { margin: 4px 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.res .ph { display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: var(--accent); }

/* ---------- notifications ---------- */
.notif-sec h2 { font-size: 22px; }
.row-sec { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch { width: 52px; height: 30px; flex: 0 0 auto; border-radius: 99px; border: 1px solid var(--border); background: var(--bg); position: relative; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on span { transform: translateX(22px); background: var(--accent-ink); }
.outage-grid { display: grid; grid-template-columns: 1fr 90px 90px; gap: 10px 8px; align-items: center; }
.outage-grid .c { justify-content: center; text-align: center; }
.svc { font-weight: 600; }
.tabs.seg { margin-bottom: 0; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--border); font-weight: 600; }
.chip img, .chip .ph { width: 26px; height: 26px; font-size: 13px; }
.chip button { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.chip button:hover { color: var(--bad); }
.invite-box .chip { padding-left: 10px; }

/* ---------- gun stats ---------- */
.gun-slots { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.gun-slot { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); border: 1px dashed var(--border); background: transparent; text-align: left; }
.gun-slot.on { border-style: solid; background: var(--panel); cursor: pointer; }
.gun-slot .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.gun-slot .n { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.gun-slot .x { margin-left: auto; color: var(--muted); font-size: 20px; }
.gun-slot.free { cursor: pointer; justify-content: center; color: var(--muted); font-weight: 600; }
.gun-slot.free:hover { border-color: var(--accent); }
@media (max-width: 599px) { .gun-slots { grid-template-columns: 1fr; } .gun-slot:not(.on) { min-height: 44px; } }
.gun-drop { max-height: min(calc(62vh / var(--z)), 520px); overflow-y: auto; padding: 8px; gap: 2px; }
.drop-cat { font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); padding: 10px 6px 6px; }
.drop-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gun-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; text-align: left; }
.gun-opt .n { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.gun-opt:hover, .gun-opt.hi { border-color: var(--accent); }
.gun-glyph { width: 100%; max-width: 150px; aspect-ratio: 560 / 250; background-repeat: no-repeat; filter: brightness(2.6) contrast(.9); }
:root[data-light="1"] .gun-glyph { filter: none; }
.gs-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.gun-slot .gun-glyph { max-width: 110px; }
@media (max-width: 599px) {
  /* phones: smaller glyphs, centered in the weapon list; in a picked slot the glyph sits beside the name */
  .gun-opt { align-items: center; text-align: center; }
  .gun-opt .gun-glyph { max-width: 96px; }
  .gs-main { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .gun-slot .gun-glyph { max-width: 84px; flex: 0 0 84px; }
}
.res.hi { background: var(--panel-2); }
.res .small { margin-left: auto; }
.wbtn.on { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }

/* ---------- parties ---------- */
.party-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.party-head h2 { font-size: 28px; margin-top: 2px; }
.party-head .pts { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--accent); }
.roster { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); }
.member img, .member .ph { width: 34px; height: 34px; }
.member .n { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member.empty { border-style: dashed; background: transparent; }
.member.empty .ph { color: var(--muted); background: transparent; border: 1px dashed var(--border); }
.icon-btn.small-x { width: 28px; height: 28px; font-size: 18px; }
.party-settings { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.invite-box { padding-top: 12px; border-top: 1px solid var(--border); }
.invite-box h3 { font-size: 18px; }
.invite-box .search-wrap { margin-bottom: 0; }
.party-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.party-card h3 { font-size: 21px; }
.avatars { display: flex; gap: 6px; }
.avatars img, .avatars .ph { width: 32px; height: 32px; }
.grow { flex: 1; }

/* ---------- chat windows (Battle Buddy bottom left, #general bottom right) ---------- */
.chat-win { position: fixed; bottom: 16px; z-index: 50; width: min(var(--w), calc(100vw / var(--z) - 64px)); height: var(--chat-h); display: flex; flex-direction: column; border: 1px solid var(--border); background: var(--bg); box-shadow: 0 18px 50px rgba(0,0,0,.55); overflow: hidden; }
.chat-win.left { --w: var(--w-bot, 280px); left: 0; border-left: 0; border-radius: 0 14px 14px 0; animation: slide-l var(--t-page) var(--ease-ios); }
.chat-win.right { --w: var(--w-general, 280px); right: 0; border-right: 0; border-radius: 14px 0 0 14px; animation: slide-r var(--t-page) var(--ease-ios); }
.chat-win.left.closing { animation: slide-l-out var(--t-quick) var(--ease-out) forwards; }
.chat-win.right.closing { animation: slide-r-out var(--t-quick) var(--ease-out) forwards; }
@keyframes slide-l-out { to { transform: translateX(-100%); opacity: .4; } } /* own keyframes: re-running the open one in reverse jumps straight to the end */
@keyframes slide-r-out { to { transform: translateX(100%); opacity: .4; } }
@keyframes slide-l { from { transform: translateX(-100%); } }
@keyframes slide-r { from { transform: translateX(100%); } }
/* The edge bubbles: half off-screen when closed; open, they ride on the window's outer edge as its handle. */
/* The edge bubbles: slim tabs, centered on their chat window's height; open, they ride on the window's outer edge. */
:root { --chat-h: min(510px, calc(100vh / var(--z) - 32px)); --tab-h: 44px; }
.chat-tab { position: fixed; bottom: calc(16px + (var(--chat-h) - var(--tab-h)) / 2); z-index: 51; width: 30px; height: var(--tab-h); display: grid; place-items: center; padding: 0; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.4); transition: left .2s ease, right .2s ease, background .15s ease, color .15s ease; }
.chat-tab svg { width: 16px; height: 16px; }
.chat-tab-icon { width: 22px; height: 22px; border-radius: 50%; }
.chat-tab:hover { color: var(--accent); }
.chat-tab.left { left: 0; border-left: 0; border-radius: 0 12px 12px 0; }
.chat-tab.right { right: 0; border-right: 0; border-radius: 12px 0 0 12px; }
.chat-tab.open { display: none; } /* an open chat closes with its × */
.chat-tab.left.open { left: calc(min(var(--w-bot, 280px), calc(100vw / var(--z) - 64px)) - 1px); }
.chat-tab.right.open { right: calc(min(var(--w-general, 280px), calc(100vw / var(--z) - 64px)) - 1px); }
/* The resize handle along each window's inner edge. */
.chat-grip { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; touch-action: none; }
.chat-win.left .chat-grip { right: 0; }
.chat-win.right .chat-grip { left: 0; }
.chat-grip::after { content: ''; position: absolute; top: 50%; width: 3px; height: 36px; margin-top: -18px; border-radius: 2px; background: var(--border); opacity: 0; transition: opacity .15s ease; }
.chat-win.left .chat-grip::after { right: 2px; }
.chat-win.right .chat-grip::after { left: 2px; }
.chat-win:hover .chat-grip::after, body.chat-resizing .chat-grip::after { opacity: 1; }
body.chat-resizing, body.chat-resizing * { cursor: ew-resize !important; user-select: none; }
body.chat-resizing .chat-tab { transition: none; }
@media (max-width: 759px) { .chat-grip { display: none; } }
.chat-head .chat-icon { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; }
.bot-line { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.bot-line .bubble.bot { max-width: none; min-width: 0; }
.bot-av { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; }
.chat-head .hash svg { width: 18px; height: 18px; }
.chat-pics img { cursor: zoom-in; }
.chat-compose textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-win .chat-compose .send { padding: 0 12px; }
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.88); cursor: zoom-out; animation: drop .14s ease; }
.lightbox img { width: auto; height: auto; max-width: calc(100vw / var(--z) - 48px); max-height: calc(100vh / var(--z) - 48px); object-fit: contain; border-radius: 8px; } /* always fits the screen */
.lb-close { position: absolute; top: 16px; right: 16px; font-size: 22px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel); }
.chat-head h3 { font-size: 18px; }
.chat-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head .icon-btn { width: 34px; height: 34px; font-size: 20px; }
.chat-head .hash { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 19px; background: var(--accent); color: var(--accent-ink); flex: 0 0 auto; }
.chat-head .hash { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { margin: auto; max-width: 300px; text-align: center; color: var(--muted); }
.bubble { max-width: 86%; padding: 9px 13px; border-radius: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.bubble.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble.me a { color: inherit; text-decoration: underline; }
.bubble code, .gtext code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--text) 12%, transparent); }
.chat-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bubble.me .chat-sub { color: inherit; opacity: .75; }
.chat-pics { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.chat-pics img { max-width: 100%; max-height: 260px; border-radius: 10px; object-fit: contain; }
.bubble.typing { display: flex; gap: 5px; padding: 13px 15px; }
.bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.bubble.typing span:nth-child(2) { animation-delay: .15s; }
.bubble.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.gmsg { display: flex; gap: 10px; align-items: flex-start; }
.gmsg .av { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; background: var(--panel-2); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; color: var(--accent); }
.gbody { flex: 1; min-width: 0; }
.gtop { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gname { font-weight: 700; }
.gmsg.isbot .gname { color: var(--accent); }
.gtext { overflow-wrap: anywhere; }
.gtext div { white-space: pre-wrap; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--panel); }
.chat-compose textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; padding: 10px 12px; }
.chat-compose .send { flex: 0 0 auto; }
/* Party chat (Parties page): the party's private chat, inline */
.pchat { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel-2); }
.pchat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.pchat-head h3 { margin: 0; }
.pchat-log { height: 320px; flex: none; }
.pchat.readonly { border: 0; background: none; overflow: visible; }
.pchat.readonly .pchat-log { height: min(60vh, 460px); padding: 0; }
.pchat .chat-compose { border-top: 1px solid var(--border); }
.pchat-attach { flex: 0 0 auto; width: 42px; height: 42px; }
.pchat-attach svg { width: 20px; height: 20px; }
.pchat-chip { display: flex; align-items: center; gap: 8px; margin: 8px 12px 0; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); width: fit-content; max-width: calc(100% - 24px); font-size: 13px; animation: bubble-in var(--t-base) var(--ease-out) both; }
.pchat-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchat-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.pchat-chip[hidden] { display: none; }
.pchat-file { color: var(--accent); word-break: break-all; }
.chat-pics video { max-width: 100%; max-height: 260px; border-radius: 10px; background: #000; }
@media (max-width: 640px) { .pchat-log { height: 260px; } }
@media (max-width: 759px) {
  :root { --chat-h: min(510px, calc(100vh / var(--z) - 100px)); }
  .chat-win { height: var(--chat-h); }
}

.pic.zoomable img { cursor: zoom-in; }

/* Side-scrolling rows (tabs, chips): the edges fade where more is hidden, with small < > arrows to scroll. */
.hscroll { position: relative; min-width: 0; }
.hscroll > .tabs { margin-bottom: 0; }
.hscroll.more-l > .tabs { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 34px); mask-image: linear-gradient(to right, transparent 0, #000 34px); }
.hscroll.more-r > .tabs { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 34px); mask-image: linear-gradient(to left, transparent 0, #000 34px); }
.hscroll.more-l.more-r > .tabs { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%); }
.hs-arrow { position: absolute; top: 50%; z-index: 2; width: 22px; height: 28px; margin-top: -14px; border: 0; background: transparent; color: var(--text); display: none; place-items: center; cursor: pointer; padding: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.8)); }
.hs-arrow svg { width: 18px; height: 18px; }
.hs-arrow:hover { color: var(--accent); }
.hs-arrow.l { left: -4px; animation: hs-float-l 1.6s ease-in-out infinite; }
.hs-arrow.r { right: -4px; animation: hs-float-r 1.6s ease-in-out infinite; }
/* A gentle nudge toward the hidden side. */
@keyframes hs-float-l { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-3px); } }
@keyframes hs-float-r { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .hs-arrow.l, .hs-arrow.r { animation: none; } }
.hscroll.more-l > .hs-arrow.l, .hscroll.more-r > .hs-arrow.r { display: grid; }

/* Scrollbars: slim, rounded, in the accent color, no track; dim until you hover or scroll the area. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
:hover::-webkit-scrollbar-thumb { background-color: color-mix(in srgb, var(--accent) 55%, transparent); }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--accent); }
::-webkit-scrollbar-button { display: none; }
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 45%, transparent) transparent; } }
.tabs { scrollbar-width: none; } /* sideways rows use the fades and arrows instead */
html { scrollbar-width: none; } html::-webkit-scrollbar { display: none; } /* no page scrollbar; inner panels keep their slim ones */

/* ---------- motion: press feedback ---------- */
:is(.btn, .tile, .lo-item, .trophy, .swatch, .wbtn, .note, .person, .tabs button, .icon-btn, .web-apply, .chat-tab, .gun-slot.on, .res, .gun-opt, .sbox, .opt, .morph-btn, .back-arrow, .send) {
  transition: transform var(--t-quick) var(--ease-spring), background var(--t-quick) ease, border-color var(--t-quick) ease, color var(--t-quick) ease, opacity var(--t-quick) ease, box-shadow var(--t-quick) ease;
}
:is(.btn, .tile, .lo-item, .trophy, .swatch, .wbtn, .note, .person, .tabs button, .icon-btn, .web-apply, .gun-slot.on, .res, .gun-opt, .sbox, .opt, .back-arrow, .send):active:not([disabled]) {
  transform: scale(.965); transition-duration: var(--t-press); transition-timing-function: var(--ease-out);
}
:is(.tile, .lo-item, .trophy, .note, .person):active { transform: scale(.985); }

/* Every other button presses too (zero specificity, so a button's own rules win). */
:where(button) { transition: transform var(--t-quick) var(--ease-spring); }
:where(button):active:not(:disabled) { transform: scale(.965); transition-duration: var(--t-press); transition-timing-function: var(--ease-out); }
.switch:active span { width: 26px; } /* the knob stretches while held, like iOS */
.switch.on:active span { transform: translateX(18px); }
.switch, .switch span { transition-timing-function: var(--ease-spring); transition-duration: var(--t-base); }
.switch span { transition-property: transform, background, width; }

/* Home: the latest announcement under the greeting (a day after it's posted). */
.home-notice { margin: 22px 0 18px; } /* room between the greeting and the banner */
.notice { position: relative; padding: 16px 18px; border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--border); box-shadow: inset 3px 0 0 var(--accent); display: flex; flex-direction: column; gap: 10px; }
.notice-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.notice-body { display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.notice-body p { margin: 0; line-height: 1.45; }
.notice-body .rt-head { font-size: 22px; }
.notice-body .rt-title { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.15; letter-spacing: .02em; margin-bottom: 2px; }
.notice-body .rt-small { font-size: 13px; color: var(--muted); }
.notice-body a { color: var(--accent); }
.notice-img { max-width: 100%; max-height: 360px; width: auto; border-radius: 8px; cursor: zoom-in; align-self: flex-start; }

/* Player notes: detail pills, tags on the list, squads. */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background var(--t-quick) ease, border-color var(--t-quick) ease, color var(--t-quick) ease, transform var(--t-quick) var(--ease-spring); }
.pill:active { transform: scale(.94); }
.pill.on { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); border-color: var(--accent); color: var(--text); }
.note-field { display: flex; flex-direction: column; gap: 8px; }
.big-avatar { display: flex; justify-content: center; margin: -4px 0 4px; }
.big-avatar img, .big-avatar .ph { width: 96px; height: 96px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 40px; color: var(--accent); box-shadow: 0 0 0 3px var(--accent), 0 10px 30px rgba(0,0,0,.4); }
.notes-squads-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 26px; }
.notes-squads-head .sub-head { margin: 0; }
.squad-slots { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 599px) { .squad-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sq-slot { position: relative; min-height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); color: var(--text); text-align: center; cursor: pointer; min-width: 0; }
.sq-slot img, .sq-slot .ph { width: 64px; height: 64px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 26px; color: var(--accent); }
.sq-slot .n { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-slot.me { cursor: default; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.sq-slot.empty { border-style: dashed; color: var(--muted); }
.sq-slot.empty:hover, .sq-slot.picking { border-color: var(--accent); }
.sq-slot .plus { width: 64px; height: 64px; border-radius: 50%; border: 2px dashed var(--border); display: grid; place-items: center; font-size: 30px; line-height: 1; }
.sq-slot .x { position: absolute; top: 6px; right: 10px; color: var(--muted); font-size: 18px; }
.squad-pick .search-wrap { margin-bottom: 0; max-width: none; }
.note-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.note-tags span { padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); font-size: 12.5px; font-weight: 600; }
.squad-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip.me { border-color: var(--accent); }

/* Staff: hub, member page, chat summary, LFG detection; Commands; About */
.soon-tile { cursor: default; opacity: .6; }
.staff-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); align-items: start; }
.staff-stage { position: relative; overflow-x: clip; min-width: 0; }
.stage-screen { min-width: 0; }
.staff-stage .page-head { margin-top: 0; }
.staff-stage .page-title { font-size: clamp(20px, 2vw, 24px); letter-spacing: .1em; }
.staff-stage .page-title::before { inset: -10px -20px; }
.staff-stage .back-arrow { width: 32px; height: 32px; margin-left: -6px; }
.staff-stage .back-arrow svg { width: 22px; height: 22px; }
.staff-stage .page-head { gap: 6px; margin-bottom: 8px; }
/* Wide screens: the Staff Panel fills exactly one screen. The title stays put; the tools and the
   logs each scroll on their own, and the page itself doesn't move. */
@media (min-width: 1101px) {
  main.staff-app { height: calc(100vh / var(--z)); padding-bottom: 16px; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; }
  main.staff-app > .page-head { flex: 0 0 auto; }
  main.staff-app .staff-layout { flex: 1; min-height: 0; align-items: stretch; }
  main.staff-app .staff-stage { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
  main.staff-app .staff-logs { height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .staff-logs .logs-box { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
  .staff-stage .ed-grid > .stack:last-child { top: 0; }
}
/* Narrow screens: the title scrolls with the page like every other page title (only its radial glow behind it, no bar). */
/* Staff Panel scroll areas: the bar only shows while scrolling (the class comes from app.js). */
.staff-stage, .logs-box { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color var(--t-quick) var(--ease-out); }
.staff-stage.scrolling, .logs-box.scrolling { scrollbar-color: color-mix(in srgb, var(--muted) 70%, transparent) transparent; }
.staff-stage::-webkit-scrollbar, .logs-box::-webkit-scrollbar { width: 8px; }
.staff-stage::-webkit-scrollbar-track, .logs-box::-webkit-scrollbar-track { background: transparent; }
.staff-stage::-webkit-scrollbar-thumb, .logs-box::-webkit-scrollbar-thumb { background: transparent; border-radius: 8px; }
.staff-stage.scrolling::-webkit-scrollbar-thumb, .logs-box.scrolling::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 70%, transparent); }
.check-menu { max-height: 320px; overflow-y: auto; padding: 6px; }
.check-row { padding: 7px 8px; border-radius: 8px; }
.check-row:hover { background: var(--panel-2); }
.check-row .muted { margin-left: auto; }
.check-row > span:not(.muted) { color: var(--text); font-weight: 600; }
.cmd-item { border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.cmd-item.dirty { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.cmd-item.open { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.cmd-line { display: flex; align-items: center; gap: 10px; padding-right: 12px; }
.cmd-line .cmd-head { flex: 1; min-width: 0; }
.cmd-quick { flex: 0 0 auto; }
.cmd-brief { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
.cmd-quick-fixed { flex: 0 0 52px; text-align: center; font-size: 11px; }
.cmd-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cmd-head code { font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-weight: 700; color: var(--accent); }
.cmd-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-tags { display: flex; align-items: center; gap: 8px; justify-content: flex-end; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-tags .tag { flex: none; }
@media (max-width: 700px) { .cmd-head { grid-template-columns: 1fr; } .cmd-tags { justify-content: flex-start; max-width: none; overflow: visible; } .cmd-desc { white-space: normal; } }
.cmd-edit { padding: 4px 12px 14px; border-top: 1px solid var(--border); }
.staff-cols { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.st-group + .st-group { margin-top: 16px; }
.st-group-head { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-family: var(--font-body); font-weight: 700; }
.st-about { font-size: 12px; line-height: 1.3; color: var(--muted); }
.cmd-tip { position: fixed; z-index: 90; pointer-events: none; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 10px 30px rgba(0,0,0,.45); opacity: 0; transform: translateY(4px); transition: opacity var(--t-quick) var(--ease-out), transform var(--t-quick) var(--ease-out); }
.cmd-tip.on { opacity: 1; transform: none; }
.cmd-tip code { font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.cmd-tip-k { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
@media (hover: none) { .cmd-tip { display: none; } }
.staff-col .sub-head { margin-top: 0; font-size: clamp(18px, 1.6vw, 24px); white-space: nowrap; }
.staff-list { display: flex; flex-direction: column; gap: 10px; }
.st-tile { flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.staff-list .st-tile { padding: 10px 12px; }
.staff-list .st-glyph svg { width: 32px; height: 32px; }
.staff-list .st-head h3 { font-size: 17px; }
.home-actions .st-tile { align-items: center; }
/* Tile glyphs: big and white, no box; an accent bar divides them from the text. */
.st-tile::before { display: none; }
.st-tile { align-items: center; }
.st-glyph { flex: 0 0 auto; display: grid; place-items: center; align-self: stretch; padding-right: 14px; color: #fff; border-right: 3px solid var(--accent); }
.st-glyph svg { width: 38px; height: 38px; }
.soon-tile .st-glyph { color: var(--muted); border-right-color: var(--dim); }
.st-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.st-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-head h3 { font-size: 18px; }
.staff-logs .log-card { padding: 7px 9px 7px 11px; }
.staff-logs .log-card .dc-body { font-size: 12px; line-height: 1.35; }
.staff-logs .log-time { font-size: 11px; margin-bottom: 2px; }
.setup-slot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px 16px; align-items: start; padding-top: 12px; border-top: 1px solid var(--border); }
.setup-slot:first-of-type { border-top: 0; padding-top: 0; }
.setup-label { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 680px) { .setup-slot { grid-template-columns: 1fr; } }
.setup-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
@media (max-width: 759px) { .setup-bar { bottom: 74px; } }
.sq-alert-row + .sq-alert-row { padding-top: 10px; border-top: 1px solid var(--border); }
.sq-list { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 860px) { .sq-list { grid-template-columns: 1fr; } }
.sq-card { cursor: pointer; transition: border-color var(--t-quick) var(--ease-out); }
.sq-card:hover, .sq-card:focus-visible { border-color: var(--accent); outline: none; }
.sq-card .sq-card-head { cursor: pointer; flex-wrap: wrap; row-gap: 6px; }
.sq-card-head .bell-btn { margin-left: auto; }
.sq-tagline { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 18px; }
.sq-tagline span { font-size: 10.5px; padding: 1px 6px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
button.sq-cell { cursor: pointer; }
button.sq-cell:hover { border-color: var(--accent); }
.sheet-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet-left { margin-right: auto; }
.sq-slot.me { cursor: pointer; }
.sq-slot.filled { padding: 0; }
.sq-open { width: 100%; height: 100%; min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.sq-open img, .sq-open .ph { width: 64px; height: 64px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 26px; color: var(--accent); }
.sq-open .n { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 20px; line-height: 1; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); cursor: pointer; transition: background var(--t-quick) var(--ease-out), color var(--t-quick) var(--ease-out); }
.sq-x:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.stats-pop { position: fixed; z-index: 85; width: min(460px, calc(100vw / var(--z) - 16px)); display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--radius); background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 18px 50px rgba(0,0,0,.55); animation: drop-in var(--t-base) var(--ease-out) both; }
.stats-pop .pic img { width: 100%; height: auto; display: block; border-radius: 8px; }
.stats-pop .pic { min-height: 120px; }
.notes-add.row { flex-wrap: nowrap; }
.notes-add.row .search-wrap { flex: 1; min-width: 0; }
.sq-card { border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); padding: 12px 14px 14px; }
.sq-card-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 0 10px; border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.sq-card-head h3 { font-size: 20px; }
.sq-chev { margin-left: auto; color: var(--muted); display: grid; transition: transform var(--t-base) var(--ease-out); }
.sq-chev svg { width: 18px; height: 18px; }
.sq-card.open .sq-chev { transform: rotate(180deg); }
.sq-row { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .sq-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sq-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); color: var(--text); font: inherit; text-align: center; min-width: 0; }
.sq-cell img, .sq-cell .ph { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--panel-2); font-weight: 700; font-size: 20px; }
.sq-cell .n { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-cell.empty { border-style: dashed; color: var(--muted); justify-content: center; }
.sq-cell .plus { font-size: 24px; line-height: 1; }
button.sq-cell { cursor: default; }
.sq-cell.has-note { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.sq-tags { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px; padding: 8px; border-radius: 10px; background: color-mix(in srgb, var(--panel) 94%, transparent); opacity: 0; pointer-events: none; transition: opacity var(--t-quick) var(--ease-out); }
.sq-tags span { font-size: 12px; padding: 2px 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--border); }
.sq-tags span.muted { background: none; border: 0; }
.sq-cell:hover .sq-tags, .sq-cell:focus-visible .sq-tags, .sq-cell.show .sq-tags { opacity: 1; }
.sq-more { display: none; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.sq-card.open .sq-more { display: flex; }
.sum-saved { display: flex; flex-direction: column; gap: 10px; }
.sum-card { gap: 0; padding: 0; overflow: hidden; }
.sum-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sum-body { display: none; padding: 0 14px 14px; }
.sum-card.open .sum-body { display: flex; }
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-card { position: relative; padding: 10px 14px 10px 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); overflow: hidden; }
.log-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--log); }
.log-time { margin-bottom: 4px; }
.log-embed + .log-embed { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.log-title { font-weight: 700; margin-bottom: 2px; }
.log-fields { display: grid; gap: 6px 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 6px; font-size: 14px; }
.log-card .dc-body { font-size: 14.5px; }
.log-card .dc-mention { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); }
.st-tag { height: 18px; font-size: 10.5px; padding: 0 6px; }
.st-cmd { position: absolute; top: 6px; right: 10px; font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-size: 10.5px; line-height: 1; color: var(--dim); white-space: nowrap; letter-spacing: 0; transition: color var(--t-quick) var(--ease-out); }
.st-tile:hover .st-cmd { color: var(--muted); }
@media (max-width: 1100px) { .staff-layout { grid-template-columns: 1fr; } .staff-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .staff-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .staff-cols { grid-template-columns: 1fr; } }
.soon-tile::before { background: var(--dim); }
.member-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.member-head .big-avatar { margin: 0; }
.member-head-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.member-head-text h2 { font-size: 28px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.member-chips .chip { padding: 5px 10px; font-size: 13.5px; }
.chip.warn { border-color: var(--bad); color: var(--bad); }
.hist-panel { gap: 10px; }
.hist-title { font-size: 18px; margin: 6px 0 0; }
.hist-list { display: flex; flex-direction: column; gap: 6px; }
.hist-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.post-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.post-row .choice { flex: 1 1 220px; min-width: 0; }
.two { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }

/* Staff tools: lists, editors, Discord preview, clips, invites */
.link-item { color: var(--text); text-decoration: none; cursor: pointer; text-align: left; font: inherit; width: 100%; transition: border-color var(--t-quick) var(--ease-out); }
.link-item:hover { border-color: var(--accent); }
.link-plain { color: var(--text); text-decoration: none; }
.mono { font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; letter-spacing: .02em; }
.accent-text { color: var(--accent); font-weight: 600; }
.btn.disabled { opacity: .45; pointer-events: none; }
.an-snip { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.an-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--panel-2); }
.an-text { min-height: 160px; font-family: var(--font-body); line-height: 1.45; }
.ad-item { align-items: center; }
.ed-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.ed-grid > .stack:last-child { position: sticky; top: 72px; }
@media (max-width: 860px) { .ed-grid { grid-template-columns: 1fr; } .ed-grid > .stack:last-child { position: static; } }
.dc-preview { border-radius: var(--radius); background: #313338; border: 1px solid #1e1f22; overflow: hidden; color: #dbdee1; font-family: 'gg sans', 'Noto Sans', var(--font-body); }
.dc-channel { padding: 10px 16px; border-bottom: 1px solid #26272b; color: #f2f3f5; font-weight: 700; font-size: 15px; }
.dc-msg { display: flex; gap: 14px; padding: 14px 16px 16px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; }
.dc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dc-name { color: #f2f3f5; font-weight: 600; font-size: 15.5px; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.dc-time { color: #949ba4; font-size: 12px; margin-left: 2px; }
.dc-body { font-size: 15.5px; line-height: 1.375; overflow-wrap: anywhere; }
.dc-body.muted { color: #949ba4; }
.dc-body a { color: #00a8fc; }
.dc-body code { background: #2b2d31; border-radius: 4px; padding: 1px 4px; font-size: 85%; font-family: ui-monospace, Menlo, monospace; }
.dc-pre { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 8px; margin: 4px 0; white-space: pre-wrap; font-size: 13.5px; font-family: ui-monospace, Menlo, monospace; }
.dc-h1, .dc-h2, .dc-h3 { color: #f2f3f5; font-weight: 700; line-height: 1.25; margin: 6px 0 2px; }
.dc-h1 { font-size: 24px; } .dc-h2 { font-size: 20px; } .dc-h3 { font-size: 16px; }
.dc-sub { color: #949ba4; font-size: 12.5px; }
.dc-quote { border-left: 4px solid #4e5058; padding-left: 10px; }
.dc-li { position: relative; padding-left: 18px; }
.dc-li::before { content: '•'; position: absolute; left: 4px; }
.dc-li.num::before { content: attr(data-n); left: 0; }
.dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-stamp { background: rgba(255, 255, 255, .06); border-radius: 3px; padding: 0 2px; }
.dc-emoji { width: 22px; height: 22px; vertical-align: -5px; object-fit: contain; }
.dc-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; }
.dc-spoiler.open { background: rgba(255, 255, 255, .1); color: inherit; }
.dc-embed { border-left: 4px solid #ff5f00; background: #2b2d31; border-radius: 4px; padding: 10px 14px 12px; max-width: 520px; }
.dc-media img, .dc-media video { display: block; max-width: min(100%, 420px); max-height: 340px; border-radius: 8px; }
.clip { display: block; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.runner + .runner { border-top: 1px solid var(--border); padding-top: 14px; }
.inv-row { align-items: center; }
.inv-rank { width: 26px; flex: 0 0 auto; text-align: center; font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--muted); }
.inv-av img, .inv-av .ph { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; object-fit: cover; background: var(--panel-2); font-weight: 700; }
.inv-th { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .inv-th { grid-template-columns: 1fr; } }
.post-row > input { flex: 1 1 120px; min-width: 0; }
.sum-text { display: flex; flex-direction: column; gap: 6px; }
.sum-text p { margin: 0; padding-left: 16px; position: relative; line-height: 1.5; }
.sum-text p::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cmd-section { display: flex; flex-direction: column; gap: 10px; }
.cmd-group h3 { font-size: 18px; }
.cmd-row { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--border); }
.cmd-row:first-of-type { border-top: 0; }
.cmd-row code { color: var(--accent); font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 599px) { .cmd-row { grid-template-columns: 1fr auto; } .cmd-row > span:not(.tag) { grid-column: 1 / -1; } }
.about-hero { display: flex; gap: 18px; align-items: center; }
.about-hero img { width: 84px; height: 84px; border-radius: 50%; flex: 0 0 auto; }
.about-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin: 14px 0; }
.about-stat { padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.about-num { font-family: var(--font-head); font-weight: 700; font-size: 30px; }
.about-label { font-family: var(--font-head); font-weight: 700; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }
.about-notes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* The site's own dropdown (choice() in app.js) in place of <select>. */
.choice { position: relative; }
:is(.panel, .cascade, .party-settings, .field):has(.drop-menu:not(.hide)) { position: relative; z-index: 46; } /* an open dropdown sits above the cards after it */
.choice-btn { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; text-align: left; font-size: 16px; }
.choice-btn:hover:not(:disabled) { border-color: var(--muted); }
.choice-btn[aria-expanded='true'], .choice:has(.drop-menu:not(.hide):not(.leaving)) .choice-btn { border-color: var(--accent); }
.choice-btn:disabled { opacity: .5; cursor: not-allowed; }
.choice-btn svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); transition: transform var(--t-base) var(--ease-spring); }
.choice:has(.drop-menu:not(.hide):not(.leaving)) .choice-btn svg { transform: rotate(180deg); }
.choice-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-menu { left: 0; right: 0; min-width: 0; max-height: min(calc(46vh / var(--z)), 320px); overflow-y: auto; transform-origin: 50% 0; }
.choice-menu .drop-item { font-family: inherit; font-weight: 500; }
.sort-row { display: flex; align-items: center; gap: 4px; }
.sort-row .drop-item { flex: 1; white-space: nowrap; }
.drop-menu:has(.sort-row) { min-width: 220px; }
.rev { width: 32px; height: 32px; flex: 0 0 auto; background: transparent; border-color: transparent; color: var(--muted); }
.rev svg { width: 16px; height: 16px; transition: transform var(--t-base) var(--ease-spring); }
.rev.flip svg { transform: rotate(180deg); }

/* ---------- motion: dropdowns and the attachment picker ---------- */
.picker, .drop-menu, .search-drop:not(.hide) { animation: drop-in var(--t-base) var(--ease-spring) both; transform-origin: 50% 0; }
.drop-menu { transform-origin: 100% 0; }
.picker.sheet-pick { animation: pick-up var(--t-sheet) var(--ease-ios) both; }
.drop-menu.leaving { animation: drop-out var(--t-quick) var(--ease-out) both; pointer-events: none; }
.picker.leaving { animation: drop-out var(--t-quick) var(--ease-out) both; pointer-events: none; }
.picker.sheet-pick.leaving { animation: pick-down var(--t-quick) var(--ease-out) both; }
@keyframes drop-in { from { opacity: 0; scale: .94; } }
@keyframes drop-out { to { opacity: 0; scale: .96; } }
@keyframes pick-up { from { translate: 0 100%; } }
@keyframes pick-down { to { translate: 0 100%; } }

/* ---------- motion: lists cascade in when a page opens ---------- */
.cascade { animation: item-in var(--t-base) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes item-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* ---------- motion: chat bubbles, toasts ---------- */
.bubble, .bot-line, .gmsg { animation: bubble-in var(--t-base) var(--ease-out) both; }
.bubble.me { transform-origin: 100% 100%; }
.bot-line, .bubble.bot { transform-origin: 0 100%; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.toast { animation: toast-in var(--t-base) var(--ease-spring) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }

/* ---------- motion: sheets and pop-ups spring up; the backdrop blurs in ---------- */
.sheet-backdrop { animation: veil-in var(--t-base) var(--ease-out) both; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet { animation: sheet-in var(--t-sheet) var(--ease-ios) both; }
@media (min-width: 700px) { .sheet { animation-name: pop-in; } }
/* Phones: confirmations are a small pop-up in the middle of the screen */
@media (max-width: 699px) {
  .sheet-backdrop.confirm { place-items: center; padding: 16px; }
  .sheet-backdrop.confirm .sheet { width: min(100%, 340px); border-radius: 18px; padding: 20px 18px 16px; text-align: center; animation-name: pop-in; }
  .sheet-backdrop.confirm .sheet h2 { font-size: 20px; margin: 0; }
  .sheet-backdrop.confirm .sheet p { margin: 0; }
  .sheet-backdrop.confirm .sheet-actions { flex-wrap: nowrap; margin-top: 6px; }
  .sheet-backdrop.confirm .sheet-actions .btn { flex: 1 1 0; min-width: 0; }
  .sheet-backdrop.confirm.leaving .sheet { animation-name: pop-out; }
}
@keyframes pop-out { to { transform: scale(.92); opacity: 0; } }
.sheet-backdrop.leaving { animation: veil-out var(--t-quick) ease both; }
.sheet-backdrop.leaving .sheet { animation: sheet-out var(--t-quick) var(--ease-out) both; }
@keyframes veil-in { from { opacity: 0; backdrop-filter: blur(0); } }
@keyframes veil-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(60px); opacity: 0; } }
@keyframes pop-in { from { transform: translateY(18px) scale(.94); opacity: 0; } }
@keyframes sheet-out { to { transform: translateY(24px) scale(.97); opacity: 0; } }
.lightbox { animation: none; background: rgba(0,0,0,0); transition: background var(--t-sheet) var(--ease-out); backdrop-filter: blur(0); }
.lightbox.on { background: rgba(0,0,0,.88); backdrop-filter: blur(8px); }
.lightbox .lb-close { opacity: 0; transition: opacity var(--t-base) ease .1s; }
.lightbox.on .lb-close { opacity: 1; }

/* ---------- motion: the typewriter greeting ---------- */
.caret { display: inline-block; width: .08em; height: .9em; margin-left: .06em; vertical-align: -.08em; background: var(--accent); border-radius: 2px; animation: caret 1s steps(1) infinite; transition: opacity var(--t-base) ease; }
.caret.done { opacity: 0; }
@keyframes caret { 50% { opacity: 0; } }

/* Reduced motion: everything settles instantly. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .spinner, .spin { animation-duration: .8s !important; }
}

/* Phones: the menu button is a long pill at the bottom center (the menu opens upward, centered), the chat tabs
   sit higher so the pill stays clear, and the pill steps aside while a chat window is open. */
.morph-label { display: none; }
@media (max-width: 759px) {
  .morph { top: auto; left: 50%; translate: -50% 0; bottom: calc(14px + env(safe-area-inset-bottom)); width: 150px; height: 46px; border-radius: 23px; }
  .morph.open { width: min(300px, calc(100vw / var(--z) - 32px)); border-radius: 20px; }
  .morph-btn { top: auto; bottom: 0; left: 0; width: 100%; height: 44px; display: flex; align-items: center; justify-content: center; gap: 10px; }
  .morph-label { display: inline; font-family: var(--font-head); font-weight: 700; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; }
  .morph-list { top: auto; bottom: 48px; left: 0; width: 100%; align-items: stretch; text-align: left; padding: 8px 10px 4px; }
  .morph-list a { text-align: left; transform: translateY(8px); }
  .morph-list a.out { border-radius: 9px; }
  .chat-tab { bottom: calc(120px + env(safe-area-inset-bottom)); }
  main { padding-top: calc(var(--banner-h) + 20px + env(safe-area-inset-top)); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  body:has(.chat-win:not(.closing)) .morph:not(.open) { opacity: 0; pointer-events: none; transform: scale(.8); }
}
}


/* ==================== FRONT PAGE (logged out) ====================
   Same motion guideline: things rise/zoom in as they scroll into view ([data-rv] -> .in), the story
   section keeps its picture pinned while the steps scroll, parallax only moves transforms. */
html.landing-on { scroll-behavior: auto; }
.ld { position: relative; z-index: 1; overflow-x: clip; }
/* Every scrolling page: the same bar as the front page, along the bottom edge of the banner. */
.page-progress { position: fixed; left: 0; right: 0; top: calc(var(--banner-h) + env(safe-area-inset-top) - 2px); height: 3px; z-index: 46; pointer-events: none; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #fff)); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; transition: opacity var(--t-quick) var(--ease-out); }
.page-progress.on { opacity: 1; }
.ld-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #fff)); transform-origin: 0 50%; transform: scaleX(0); }
.ld-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 70; display: flex; align-items: center; gap: 18px; padding: 12px max(16px, calc(50% - 600px)); transition: background var(--t-base) ease, box-shadow var(--t-base) ease, backdrop-filter var(--t-base) ease; }
.ld-nav.solid { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 1px 0 var(--border); }
.ld-brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text); font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
.ld-brand img { width: 34px; height: 34px; border-radius: 50%; }
.ld-links { display: flex; gap: 4px; margin-left: auto; }
.ld-links a { padding: 8px 12px; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: 15px; transition: color var(--t-quick) ease, background var(--t-quick) ease; }
.ld-links a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
@media (max-width: 899px) { .ld-links { display: none; } .ld-nav > :last-child { margin-left: auto; } }
@media (max-width: 420px) { .ld-brand { font-size: 17px; } .ld-brand img { width: 30px; height: 30px; } }

.ld-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 99px; font-family: var(--font-head); font-weight: 700; font-size: 18px; letter-spacing: .04em; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: transform var(--t-quick) var(--ease-spring), box-shadow var(--t-base) ease, background var(--t-quick) ease; }
.ld-btn svg { width: 20px; height: 20px; }
.ld-btn.small { min-height: 38px; padding: 0 16px; font-size: 15px; }
.ld-btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
.ld-btn.primary:hover { box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-2px); }
.ld-btn.ghost { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--text) 18%, transparent); backdrop-filter: blur(8px); }
.ld-btn.ghost:hover { background: color-mix(in srgb, var(--text) 12%, transparent); transform: translateY(-2px); }
.ld-btn.off { opacity: .6; cursor: default; }
.ld-btn:active { transform: scale(.96); }

.ld-section { scroll-margin-top: 64px; position: relative; padding: clamp(64px, 10vw, 120px) max(16px, calc(50% - 580px)); }
.ld-head { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.ld-head h2, .ld-chat-copy h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.04; letter-spacing: .01em; }
.ld-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.ld-sub { color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.5; margin: 14px auto 0; max-width: 640px; }
.ld-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 70%, transparent); animation: ld-pulse 1.8s var(--ease-out) infinite; flex: 0 0 auto; }
@keyframes ld-pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* scroll reveal */
[data-rv] { opacity: 0; transition: opacity .7s var(--ease-out), transform .8s var(--ease-ios); transition-delay: var(--d, 0ms); will-change: transform, opacity; }
[data-rv='up'] { transform: translateY(36px); }
[data-rv='left'] { transform: translateX(-48px); }
[data-rv='right'] { transform: translateX(48px); }
[data-rv='zoom'] { transform: scale(.9); }
[data-rv].in { opacity: 1; transform: none; }

/* hero */
.ld-hero { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 40px; padding: 110px max(16px, calc(50% - 600px)) 80px; }
.ld-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 30% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), radial-gradient(40% 40% at 80% 70%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.ld-avatar { position: relative; width: 96px; height: 96px; margin-bottom: 20px; }
.ld-avatar img { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent), 0 20px 50px rgba(0,0,0,.5); animation: ld-float 5s ease-in-out infinite; }
.ld-live-dot { position: absolute; right: 4px; bottom: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--good); border: 3px solid var(--bg); }
@keyframes ld-float { 50% { transform: translateY(-8px); } }
.ld-title { font-size: clamp(44px, 7.4vw, 92px); line-height: .98; letter-spacing: .005em; }
.ld-grad { background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #fff) 60%, var(--accent)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ld-sheen 6s ease-in-out infinite; }
@keyframes ld-sheen { 50% { background-position: 100% 0; } }
.ld-lead { font-size: clamp(17px, 1.8vw, 21px); line-height: 1.5; color: var(--muted); margin: 18px 0 28px; max-width: 560px; }
.ld-cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ld-error { margin-top: 16px; color: var(--bad); font-weight: 600; }
.ld-hero-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 28px; color: var(--muted); font-size: 15px; }
.ld-hero-stats b { color: var(--text); font-size: 17px; }
.ld-hero-stats .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--dim); }
.ld-hero-cards { position: relative; height: min(560px, 60vw); perspective: 1200px; --rx: 0deg; --ry: 0deg; }
.ld-hero-cards .hc { position: absolute; border-radius: 14px; box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); transition: transform .5s var(--ease-out); }
.hc1 { width: 88%; left: 2%; top: 8%; transform: rotateX(var(--rx)) rotateY(var(--ry)) rotate(-5deg); animation: ld-in-1 1s var(--ease-ios) both .15s; }
.hc2 { width: 52%; right: -2%; top: 46%; transform: rotateX(var(--rx)) rotateY(var(--ry)) rotate(6deg); animation: ld-in-2 1s var(--ease-ios) both .3s; }
.hc3 { width: 50%; left: -4%; top: 58%; transform: rotateX(var(--rx)) rotateY(var(--ry)) rotate(-3deg); animation: ld-in-3 1s var(--ease-ios) both .45s; }
@keyframes ld-in-1 { from { opacity: 0; translate: 0 60px; scale: .92; } }
@keyframes ld-in-2 { from { opacity: 0; translate: 60px 40px; scale: .9; } }
@keyframes ld-in-3 { from { opacity: 0; translate: -60px 40px; scale: .9; } }
.ld-scroll { position: absolute; left: 50%; bottom: 24px; width: 44px; height: 44px; margin-left: -22px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); border: 1px solid var(--border); animation: ld-bob 2s ease-in-out infinite; }
.ld-scroll svg { width: 22px; height: 22px; }
@keyframes ld-bob { 50% { transform: translateY(8px); } }
@media (max-width: 859px) {
  .ld-hero { grid-template-columns: 1fr; text-align: center; padding-top: 96px; gap: 10px; }
  .ld-avatar { margin: 0 auto 18px; }
  .ld-lead { margin-left: auto; margin-right: auto; }
  .ld-cta-row, .ld-hero-stats { justify-content: center; }
  .ld-hero-cards { height: 92vw; max-height: 480px; }
  .ld-scroll { display: none; }
}

/* live numbers */
.ld-stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 899px) { .ld-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ld-stat { position: relative; overflow: hidden; padding: 24px 22px; border-radius: 20px; background: color-mix(in srgb, var(--panel) 82%, transparent); border: 1px solid var(--border); backdrop-filter: blur(10px); }
.ld-stat::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); pointer-events: none; }
.ld-stat:nth-child(2) { transition-delay: 80ms; } .ld-stat:nth-child(3) { transition-delay: 160ms; } .ld-stat:nth-child(4) { transition-delay: 240ms; }
.ld-stat-num { font-family: var(--font-head); font-weight: 700; font-size: clamp(40px, 5.4vw, 64px); line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.ld-stat-label { margin-top: 8px; font-family: var(--font-head); font-weight: 700; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ld-stat-sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.ld-week-bars { display: flex; align-items: flex-end; gap: 6px; height: 46px; margin-top: 14px; }
.ld-wb { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.ld-wb-stack { width: 100%; min-height: 3px; display: flex; flex-direction: column; border-radius: 4px; overflow: hidden; transform-origin: 50% 100%; }
.ld-stat.in .ld-wb-stack { animation: ld-grow .9s var(--ease-ios) both; }
.ld-wb:nth-child(2) .ld-wb-stack { animation-delay: 60ms; } .ld-wb:nth-child(3) .ld-wb-stack { animation-delay: 120ms; } .ld-wb:nth-child(4) .ld-wb-stack { animation-delay: 180ms; } .ld-wb:nth-child(5) .ld-wb-stack { animation-delay: 240ms; } .ld-wb:nth-child(6) .ld-wb-stack { animation-delay: 300ms; } .ld-wb:nth-child(7) .ld-wb-stack { animation-delay: 360ms; }
@keyframes ld-grow { from { transform: scaleY(0); } }
.ld-wb-stack .discord { background: var(--accent); } .ld-wb-stack .chatbot { background: color-mix(in srgb, var(--accent) 55%, #fff); } .ld-wb-stack .web { background: color-mix(in srgb, var(--text) 45%, transparent); }
.ld-wb-stack > div { min-height: 0; }

/* story: sticky picture, scrolling steps */
.ld-story-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; }
.ld-story-sticky { position: sticky; top: 90px; height: calc(100vh - 120px); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.ld-story-stage { position: relative; aspect-ratio: 16 / 10; }
.ld-story-img { position: absolute; inset: 0; opacity: 0; transform: translateY(24px) scale(.96); transition: opacity .55s var(--ease-out), transform .7s var(--ease-ios); filter: drop-shadow(0 30px 50px rgba(0,0,0,.5)); pointer-events: none; }
.ld-story-img .ld-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* slideshows: cards crossfade with a small zoom settle */
.ld-slides { display: grid; }
.ld-slide { grid-area: 1 / 1; width: 100%; opacity: 0; transform: scale(1.025); transition: opacity .6s var(--ease-out), transform 1.2s var(--ease-out); cursor: zoom-in; pointer-events: none; }
.ld-slide.on { opacity: 1; transform: none; pointer-events: auto; }
.ld-story-img.on { opacity: 1; transform: none; pointer-events: auto; }
.ld-story-dots { display: flex; justify-content: center; gap: 8px; }
.ld-story-dots span { width: 8px; height: 8px; border-radius: 99px; background: var(--dim); transition: width var(--t-base) var(--ease-spring), background var(--t-base) ease; }
.ld-story-dots span.on { width: 28px; background: var(--accent); }
.ld-steps { display: flex; flex-direction: column; }
.ld-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transform: translateX(10px); transition: opacity .5s ease, transform .6s var(--ease-ios); }
.ld-step.on { opacity: 1; transform: none; }
.ld-step h3 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.08; margin: 12px 0 10px; }
.ld-step p { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 0 0 14px; }
.ld-step ul, .ld-ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ld-step li, .ld-ticks li { position: relative; padding-left: 28px; font-weight: 600; }
.ld-step li::before, .ld-ticks li::before { content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 25%, transparent); box-shadow: inset 0 0 0 5px var(--accent); }
.ld-chip { align-self: flex-start; display: inline-block; padding: 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: .06em; border: 0; }
.ld-step-img { display: none; }
@media (max-width: 859px) {
  .ld-story-grid { grid-template-columns: 1fr; }
  .ld-story-sticky { display: none; }
  .ld-step { min-height: 0; opacity: 1; transform: none; padding: 26px 0; }
  .ld-step-img { display: grid; width: 100%; margin-top: 18px; align-items: center; }
  .ld-step-img .ld-slide { border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,.45); }
}

/* make it yours */
.ld-yours-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 36px; align-items: center; }
.ld-yours-controls h3 { font-size: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.ld-yours-controls h3:not(:first-child) { margin-top: 24px; }
.ld-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.ld-swatch { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: conic-gradient(var(--a) 0 50%, var(--b) 0 100%); box-shadow: 0 0 0 2px var(--border); transition: transform var(--t-quick) var(--ease-spring), box-shadow var(--t-quick) ease; }
.ld-swatch:hover { transform: scale(1.1); }
.ld-swatch.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--a); transform: scale(1.08); }
.ld-wall-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ld-your-pic, .ld-roll-pic { position: relative; }
.ld-your-pic img, .ld-roll-pic img { width: 100%; border-radius: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.ld-spin { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--text) 25%, transparent); border-top-color: var(--accent); opacity: 0; transition: opacity var(--t-quick) ease; animation: spin .8s linear infinite; }
.busy .ld-spin { opacity: 1; }
.busy img { filter: saturate(.6) brightness(.85); transition: filter var(--t-base) ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.ld-roll { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 36px; align-items: center; margin-top: 70px; }
.ld-roll-text h3 { font-size: clamp(26px, 3vw, 36px); }
.ld-roll-text p { color: var(--muted); font-size: 17px; margin: 10px 0 20px; }
@media (max-width: 859px) { .ld-yours-grid, .ld-roll { grid-template-columns: 1fr; text-align: center; } .ld-swatches, .ld-wall-chips { justify-content: center; } }

/* chat demo */
.ld-chat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: center; }
.ld-chat-copy p { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 16px 0 18px; }
.ld-chat-win { border-radius: 22px; overflow: hidden; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--border); box-shadow: 0 30px 70px rgba(0,0,0,.5); display: flex; flex-direction: column; height: 600px; }
.ld-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ld-chat-head img { width: 36px; height: 36px; border-radius: 50%; }
.ld-chat-head span { display: block; color: var(--good); font-size: 13px; }
.ld-chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ld-bubble { max-width: 86%; padding: 10px 14px; border-radius: 18px; line-height: 1.45; animation: bubble-in var(--t-base) var(--ease-out) both; }
.ld-bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; transform-origin: 100% 100%; }
.ld-bubble.bot { align-self: flex-start; display: flex; gap: 10px; background: var(--panel-2); border-bottom-left-radius: 6px; transform-origin: 0 100%; }
.ld-bubble-av { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; }
.ld-bubble-body { min-width: 0; }
.ld-bubble-chart { display: block; width: 100%; max-width: 320px; margin-top: 8px; border-radius: 10px; cursor: zoom-in; }
.ld-me-row { align-self: flex-end; display: flex; align-items: flex-end; gap: 8px; max-width: 90%; }
.ld-me-row .ld-bubble { max-width: none; }
.ld-av { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; }
.ld-later { opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease-out), transform .5s var(--ease-ios); }
.ld-later.in { opacity: 1; transform: none; }
.ld-rich { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ld-embed { border-left: 4px solid var(--c); border-radius: 4px; padding: 8px 12px; background: color-mix(in srgb, var(--bg) 70%, var(--panel)); font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.ld-embed-title { font-weight: 700; font-size: 14.5px; }
.ld-embed-small { color: var(--muted); font-size: 12px; }
.ld-dc-row { display: flex; }
.ld-dc-btn { padding: 7px 14px; border-radius: 4px; border: 0; background: #4e5058; color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; transition: background var(--t-quick) ease, transform var(--t-quick) var(--ease-spring); }
.ld-dc-btn:hover:not(:disabled) { background: #6d6f78; }
.ld-dc-btn:disabled { background: #248046; cursor: default; }
.ld-on-list { display: flex; flex-direction: column; gap: 4px; }
.ld-on { display: grid; grid-template-columns: 26px minmax(0, auto) 1fr; align-items: center; gap: 8px; font-size: 14px; }
.ld-on .ld-av { width: 26px; height: 26px; }
.ld-on span { color: var(--good); font-size: 12.5px; text-align: right; }
.ld-on.traitor span { color: var(--bad); font-weight: 700; }
.ld-bubble.typing { display: flex; gap: 5px; padding: 14px 16px; }
.ld-bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ld-dot 1s ease-in-out infinite; }
.ld-bubble.typing span:nth-child(2) { animation-delay: .15s; } .ld-bubble.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ld-dot { 50% { transform: translateY(-5px); opacity: .5; } }
.ld-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; max-height: 104px; overflow-y: auto; padding: 12px 14px; border-top: 1px solid var(--border); scrollbar-width: none; }
.ld-chat-chips::-webkit-scrollbar { display: none; }
.ld-chip.btnlike { cursor: pointer; white-space: nowrap; transition: background var(--t-quick) ease, transform var(--t-quick) var(--ease-spring); }
.ld-chip.btnlike:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.ld-chip.btnlike:active { transform: scale(.94); }
@media (max-width: 859px) { .ld-chat-grid { grid-template-columns: 1fr; } .ld-chat-win { height: min(640px, 82vh); } .ld-chat-chips { max-height: 92px; } .ld-on span { white-space: nowrap; } }

/* Front page spotlights: party chat (Discord + website side by side), animated show-offs, the Staff Panel */
.ld-pc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: stretch; gap: 0; max-width: 1040px; margin: 0 auto; }
.ld-pc-win { border-radius: 20px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 30px 70px rgba(0,0,0,.45); display: flex; flex-direction: column; height: 430px; background: color-mix(in srgb, var(--panel) 92%, transparent); }
.ld-pc-win.dc { background: #313338; border-color: #1e1f22; color: #dbdee1; }
.ld-pc-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ld-pc-win.dc .ld-pc-head { border-color: #1e1f22; background: #2b2d31; }
.ld-pc-head img { width: 32px; height: 32px; border-radius: 50%; }
.ld-pc-head span { display: block; font-size: 12px; color: var(--muted); }
.ld-pc-win.dc .ld-pc-head span { color: #949ba4; }
.ld-pc-hash { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #1e1f22; color: #949ba4; }
.ld-pc-hash svg { width: 16px; height: 16px; }
.ld-pc-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; }
.ld-pc-log::-webkit-scrollbar { display: none; }
.ld-pc-msg { display: flex; gap: 10px; align-items: flex-start; animation: bubble-in var(--t-base) var(--ease-out) both; }
.ld-pc-msg .ld-av { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; }
.ld-pc-top { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.ld-pc-msg.dc .ld-pc-top b { color: #f2f3f5; }
.ld-pc-app { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: #5865f2; color: #fff; }
.ld-pc-time { font-size: 11px; color: var(--muted); }
.ld-pc-msg.dc .ld-pc-time { color: #949ba4; }
.ld-pc-text { font-size: 15px; line-height: 1.4; }
.ld-pc-pic { display: block; width: 100%; max-width: 200px; aspect-ratio: 16 / 10; object-fit: cover; margin-top: 6px; border-radius: 8px; }
.ld-pc-link { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
.ld-pc-link span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ld-pc-flow 1.2s ease-in-out infinite; }
.ld-pc-link span:nth-child(2) { animation-delay: .2s; } .ld-pc-link span:nth-child(3) { animation-delay: .4s; }
@keyframes ld-pc-flow { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
.ld-pc-points { list-style: none; padding: 0; margin: 34px auto 0; max-width: 1040px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ld-pc-points li { padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid var(--border); color: var(--muted); font-size: 15px; line-height: 1.45; }
.ld-pc-points b { display: block; color: var(--text); font-family: var(--font-head); font-size: 17px; margin-bottom: 4px; }
@media (max-width: 859px) {
  .ld-pc-grid { grid-template-columns: 1fr; gap: 0; }
  .ld-pc-win { height: 330px; }
  .ld-pc-link { flex-direction: row; height: 44px; }
  .ld-pc-points { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .ld-pc-points { grid-template-columns: 1fr; } }

.ld-anim-copy h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.04; }
.ld-anim-copy p { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 16px 0 18px; }
.ld-anim-seg { margin: 22px 0 14px; }
.ld-anim-pic { position: relative; }
.ld-anim-pic img { display: block; width: 100%; min-height: 120px; border-radius: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.5); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.ld-anim-wait { position: absolute; inset: auto 14px 14px auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 99px; background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--border); font-size: 13px; color: var(--muted); opacity: 0; transform: translateY(6px); transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); pointer-events: none; }
.ld-anim-wait .ld-spin { position: static; width: 18px; height: 18px; border-width: 2px; opacity: 1; animation: spin .8s linear infinite; }
.ld-anim-pic.busy .ld-anim-wait { opacity: 1; transform: none; }
@media (max-width: 859px) { .ld-anim-seg { justify-content: center; } }

.ld-st-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; max-width: 1080px; margin: 0 auto; }
.ld-st-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ld-st-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; border-radius: 16px; background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid var(--border); font-family: var(--font-head); font-weight: 600; font-size: 14px; text-align: center; }
.ld-st-tiles.in .ld-st-tile { animation: bubble-in var(--t-base) var(--ease-out) var(--d) both; }
.ld-st-glyph { width: 34px; height: 34px; color: var(--text); padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.ld-st-glyph svg { width: 34px; height: 34px; }
.ld-st-demo { border-radius: 20px; overflow: hidden; border: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: 0 30px 70px rgba(0,0,0,.45); }
.ld-st-demo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ld-st-demo-head b { font-family: var(--font-head); font-size: 20px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.ld-st-demo-head span { color: var(--muted); font-size: 13px; }
.ld-st-cmds { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.ld-st-cmd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); transition: border-color var(--t-quick) var(--ease-out); }
.ld-st-cmd.dirty { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.ld-st-cmd > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.ld-st-cmd code { font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-weight: 700; color: var(--accent); }
.ld-st-cmd > div > span:not(.cmd-tags) { color: var(--muted); font-size: 13px; }
.ld-st-cmd .cmd-tags { max-width: none; overflow: visible; }
.ld-st-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; transition: background var(--t-base) var(--ease-out); }
.ld-st-bar.on { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text); }
@media (max-width: 859px) { .ld-st-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .ld-st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* down detector, website, more */
.ld-dd { max-width: 1000px; margin: 0 auto; }
.ld-web-grid, .ld-more-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.ld-web-card, .ld-more-card { --mx: 50%; --my: 0%; position: relative; padding: 22px; border-radius: 20px; background: radial-gradient(400px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--border); transition: opacity .7s var(--ease-out), transform .45s var(--ease-out), border-color var(--t-base) ease; transition-delay: var(--d, 0ms), 0ms, 0ms; }
.ld-web-card:hover, .ld-more-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.ld-web-card h3, .ld-more-card h3 { font-size: 20px; margin: 0 0 6px; }
.ld-web-card p, .ld-more-card p { color: var(--muted); margin: 0; line-height: 1.45; }
.ld-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.ld-icon svg { width: 24px; height: 24px; }
.ld-more-card { padding: 18px 20px; }

/* commands */
.ld-cmd-box { max-width: 900px; margin: 0 auto; border-radius: 22px; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--border); overflow: hidden; }
.ld-cmd-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--border); }
.ld-cmd-bar input { flex: 1 1 240px; }
.ld-cmd-scope { margin: 0; }
.ld-cmd-list { max-height: 460px; overflow-y: auto; padding: 8px; }
.ld-cmd { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 14px; padding: 10px 12px; border-radius: 10px; animation: item-in var(--t-base) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 22ms); }
.ld-cmd:hover { background: var(--panel-2); }
.ld-cmd code { color: var(--accent); font-weight: 700; overflow-wrap: anywhere; }
.ld-cmd span { color: var(--muted); }
@media (max-width: 599px) { .ld-cmd { grid-template-columns: 1fr; gap: 2px; } }

/* age + final */
.ld-age { text-align: center; }
.ld-clock { display: flex; justify-content: center; gap: clamp(10px, 3vw, 28px); }
.ld-clock div { min-width: clamp(70px, 14vw, 130px); padding: 18px 10px; border-radius: 18px; background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--border); }
.ld-clock b { display: block; font-family: var(--font-head); font-size: clamp(34px, 6vw, 64px); line-height: 1; font-variant-numeric: tabular-nums; }
.ld-clock span { color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.ld-final { text-align: center; margin: 0 max(16px, calc(50% - 560px)) 60px; padding: 70px 24px; border-radius: 32px; background: radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.ld-final h2 { font-size: clamp(34px, 5.4vw, 62px); }
.ld-final .ld-cta-row { justify-content: center; margin-top: 26px; }
.ld-final-av { width: 84px; height: 84px; border-radius: 50%; margin-bottom: 16px; animation: ld-float 5s ease-in-out infinite; }
.ld-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 26px max(16px, calc(50% - 580px)) 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }

@media (prefers-reduced-motion: reduce) { [data-rv] { opacity: 1; transform: none; } }

/* Front page: the floating buttons (bottom left) and back to top (bottom right), sliding in once the big buttons are out of view */
.ld-dock { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 75; display: flex; gap: 8px; padding: 6px; border-radius: 99px; background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid var(--border); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 16px 40px rgba(0,0,0,.45); transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; transition: transform var(--t-sheet) var(--ease-ios), opacity var(--t-base) ease; }
.ld-dock.show { transform: none; opacity: 1; pointer-events: auto; }
.ld-dock .ld-btn.primary { box-shadow: none; }
.ld-totop { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 75; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--text); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(0,0,0,.45); cursor: pointer; transform: translateY(calc(100% + 30px)) scale(.8); opacity: 0; pointer-events: none; transition: transform var(--t-sheet) var(--ease-spring), opacity var(--t-base) ease, color var(--t-quick) ease, border-color var(--t-quick) ease; }
.ld-totop svg { width: 22px; height: 22px; }
.ld-totop.show { transform: none; opacity: 1; pointer-events: auto; }
.ld-totop:hover { color: var(--accent); border-color: var(--accent); }
.ld-totop:active { transform: scale(.92); }
.ld-dock { max-width: calc(100% - 98px); }
@media (max-width: 360px) { .ld-dock .ld-your { display: none; } }


/* Delete messages preview, Records */
.del-item { align-items: flex-start; gap: 10px; }
.del-av { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; font-size: 14px; object-fit: cover; }
span.del-av { display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border); font-weight: 700; }
.del-text { white-space: pre-wrap; word-break: break-word; }
.del-list { max-height: 60vh; overflow: auto; }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.rec-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.rec-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.rec-stat b { font-family: var(--font-head); font-size: 28px; line-height: 1; }

/* Charts (AI usage): one accent series, thin marks, recessive grid, hover tooltip, Table view */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; opacity: .6; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar { fill: var(--accent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 13px; box-shadow: 0 6px 22px rgba(0,0,0,.35); opacity: 0; transform: translateY(4px); transition: opacity var(--t-quick) var(--ease-out), transform var(--t-quick) var(--ease-out); }
.chart-tip.on { opacity: 1; transform: none; }
.chart-tip span { color: var(--muted); }
.chart-table { max-height: 260px; overflow: auto; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chart-table th, .chart-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.chart-table th { color: var(--muted); font-weight: 600; }
.chart-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .chart-pair { grid-template-columns: 1fr; } }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 10px; align-items: center; }
.hb-label { display: flex; flex-direction: column; min-width: 0; }
.hb-label span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hb-track { position: relative; height: 12px; border-radius: 4px; background: var(--panel-2); }
.hb-fill { height: 100%; border-radius: 4px; background: var(--accent); min-width: 0; }
.hb-cap { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; box-shadow: 0 0 0 2px var(--panel); }
.hb-val { font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
@media (max-width: 600px) { .hb-row { grid-template-columns: 1fr auto; } .hb-track { grid-column: 1 / -1; grid-row: 2; } }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ai-alert { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); }
/* Chatbot memory */
.cb-person { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.cb-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.cb-notes { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.cb-note { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); }
.cb-n { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 20px; }
/* Stats refresh, Test Lab */
.edit-stat { display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 600px) { .edit-stat { grid-template-columns: 1fr; } }
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.test-tile { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: inherit; font: inherit; cursor: pointer; transition: border-color var(--t-quick) var(--ease-out), transform var(--t-press) var(--ease-out); }
.test-tile:hover { border-color: var(--accent); }
.test-tile:active { transform: scale(.98); }
.test-tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.test-card { width: 100%; height: auto; border-radius: 10px; }
.test-send { flex-wrap: wrap; }
/* XP and levels, Trophies (Staff Panel) */
.xp-src { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); transition: opacity var(--t-quick) var(--ease-out); }
.xp-src:first-of-type { border-top: 0; padding-top: 0; }
.xp-src.off .xp-nums { opacity: .45; }
.xp-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.xp-num input { width: 100%; }
.boost-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.boost-row .field { flex: 1 1 140px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.tr-head { display: flex !important; align-items: center; gap: 12px; }
.tr-medal { width: 44px; height: 44px; flex: 0 0 auto; }
.tr-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tr-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-item.off .tr-medal { filter: grayscale(1); opacity: .5; }
.tr-who .chip { font-size: 13px; }
/* Banner creator */
.bn-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bn-bar > .choice { flex: 1 1 170px; min-width: 150px; }
.bn-acts { margin-left: auto; flex-wrap: wrap; }
.bn-stage { display: flex; flex-direction: column; gap: 6px; }
.bn-stage .pic { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background-color: #20252c; background-image: linear-gradient(45deg, #2a3038 25%, transparent 25%, transparent 75%, #2a3038 75%), linear-gradient(45deg, #2a3038 25%, transparent 25%, transparent 75%, #2a3038 75%); background-size: 20px 20px; background-position: 0 0, 10px 10px; }
.bn-stage .pic img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain; }
.bn-els { margin-bottom: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 18px; }
.tool-row { display: flex; flex-direction: column; gap: 5px; }
.tool-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.tool-ctl { display: flex; flex-direction: column; gap: 6px; }
.tool-seg { margin-bottom: 0; flex-wrap: wrap; }
.tool-seg button { min-height: 32px; font-size: 13px; }
.style-chips { gap: 6px; }
.chip-toggle { border: 1px solid var(--border); background: var(--panel); color: var(--muted); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; transition: background var(--t-quick) var(--ease-out), color var(--t-quick) var(--ease-out); }
.chip-toggle.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cp-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cp-btn { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg); color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.cp-btn:hover { border-color: var(--accent); }
.cp-dot { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.grad-strip { flex: 1 1 100%; height: 10px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.cp-row { display: flex; gap: 10px; align-items: center; }
.cp-now { width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.cp-native { width: 54px; height: 42px; padding: 2px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; }
.cp-row input[type=text] { flex: 1; }
.cp-slots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.cp-slot { aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); color: var(--muted); font-size: 18px; background: var(--panel-2); transition: transform var(--t-press) var(--ease-out); }
.cp-slot:active { transform: scale(.94); }
.cp-slot.on { border-color: var(--text); }
.bn-text { width: 100%; resize: vertical; }
.bn-text.one { min-height: 44px; }
.bn-pic { padding: 12px; border-radius: 10px; border: 1px dashed var(--border); }
.bn-range { width: 100%; accent-color: var(--accent); }
.bn-post-img { max-width: 100%; border-radius: 8px; display: block; }
.bn-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bn-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); }
.bn-thumb { padding: 0; border: 0; background: #20252c; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.bn-thumb img { display: block; width: 100%; height: auto; }
.bn-meta { display: flex; flex-direction: column; gap: 2px; }
.bn-card-acts { flex-wrap: wrap; }
.bn-full { width: 100%; height: auto; border-radius: 8px; }
@media (max-width: 600px) { .cp-slots { grid-template-columns: repeat(5, 1fr); } .bn-acts { margin-left: 0; } }
/* Member list: recent actions */
.recent-act .tag { font-size: 11px; }
.tag.act-warn { color: #f59e0b; border-color: color-mix(in srgb, #f59e0b 50%, var(--border)); }
.tag.act-mute { color: #ef4444; border-color: color-mix(in srgb, #ef4444 50%, var(--border)); }
.tag.act-kick { color: #dc2626; border-color: color-mix(in srgb, #dc2626 50%, var(--border)); }
.tag.act-ban { color: #fff; background: #991b1b; border-color: #991b1b; }
.swatch .nm .st.anim { color: var(--muted); font-size: 10px; }
.swatch .nm .st.anim.on { color: var(--good); }

/* Phones: unsaved changes = a round Save button beside the Menu pill (the pill slides left to make room). */
.mob-save { display: none; }
@media (max-width: 759px) {
  .setup-bar { display: none; }
  .morph { transition: width .38s cubic-bezier(.2, 1.25, .35, 1), height .42s cubic-bezier(.2, 1.15, .35, 1), border-radius .3s ease, background .25s ease, box-shadow .3s ease, border-color .2s ease, translate var(--t-page) var(--ease-ios); }
  .morph.open { transition: width .32s cubic-bezier(.2, 1.25, .35, 1), height .46s cubic-bezier(.2, 1.12, .35, 1) .04s, border-radius .25s ease, background .2s ease, box-shadow .3s ease, border-color .2s ease, translate var(--t-page) var(--ease-ios); }
  body.save-ready .morph:not(.open) { translate: calc(-50% - 30px) 0; }
  /* app.js syncMobSave: .show pops it in, .hiding shrinks it away */
  .mob-save { display: none; place-items: center; position: fixed; z-index: 62; bottom: calc(14px + env(safe-area-inset-bottom)); left: calc(50% + 59px); width: 46px; height: 46px; margin: 0; padding: 0; border-radius: 50%; border: 0; -webkit-appearance: none; appearance: none; background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(0,0,0,.35); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mob-save svg { width: 22px; height: 22px; display: block; }
  .mob-save.show { display: grid; transform-origin: right center; animation: mob-save-in var(--t-base) var(--ease-spring) .08s backwards; } /* grows out of its right edge */
  .mob-save.show:active { transform: scale(.92); }
  .mob-save.hiding { display: grid; pointer-events: none; transform-origin: right center; animation: mob-save-out var(--t-quick) ease-in forwards; } /* shrinks into its right edge */
}
@keyframes mob-save-in { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
@keyframes mob-save-out { to { opacity: 0; transform: scale(0); } }
@media (max-width: 759px) and (prefers-reduced-motion: reduce) { .morph, .morph.open { transition: none !important; } .mob-save.show { animation: none; } }
