/* ───────────────────────────────────────────────────────────────
   Utopians design system
   Deep navy foundation · turquoise for action · lime for contribution
   Fraunces (brand & page titles) + Instrument Sans (interface)
   ─────────────────────────────────────────────────────────────── */
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-opsz-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --font-ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Ethiopic', sans-serif;
  --font-brand: 'Fraunces', Georgia, 'Times New Roman', serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --nav-h: 64px; --top-h: calc(56px + env(safe-area-inset-top, 0px));
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;

  /* Dark (default) */
  --bg: #08142c;
  --bg-deep: #050e20;
  --surface: #0e1d3b;
  --surface-2: #142749;
  --surface-3: #1b315a;
  --line: #213760;
  --line-soft: #1a2d50;
  --text: #e9eef8;
  --text-2: #b7c3da;
  --muted: #8797b6;
  --brand: #22c9c1;
  --brand-strong: #4fe0d8;
  --brand-ink: #032625;
  --brand-wash: rgba(34, 201, 193, .12);
  --lime: #b5e64a;
  --lime-ink: #1d2a00;
  --lime-wash: rgba(181, 230, 74, .12);
  --danger: #ff7676;
  --danger-wash: rgba(255, 118, 118, .12);
  --warn: #f2bf57;
  --warn-wash: rgba(242, 191, 87, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .7);
  --focus: 0 0 0 3px rgba(79, 224, 216, .45);
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f6fb; --bg-deep: #e8eef7; --surface: #ffffff; --surface-2: #f0f4fa; --surface-3: #e5ecf6;
  --line: #d6dfec; --line-soft: #e4eaf3; --text: #0c1a35; --text-2: #33445f; --muted: #5d6d8b;
  --brand: #0d9f98; --brand-strong: #0a807a; --brand-ink: #ffffff; --brand-wash: rgba(13, 159, 152, .1);
  --lime: #4f8a00; --lime-ink: #ffffff; --lime-wash: rgba(110, 170, 20, .12);
  --danger: #d23b3b; --danger-wash: rgba(210, 59, 59, .08); --warn: #a86a00; --warn-wash: rgba(200, 140, 0, .1);
  --shadow: 0 1px 2px rgba(12, 26, 53, .05), 0 8px 24px -16px rgba(12, 26, 53, .25);
  --focus: 0 0 0 3px rgba(13, 159, 152, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 15.5px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh;
}
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; }
p { margin: 0 0 var(--s3); }

/* ───────── Brand ───────── */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 600 22px/1 var(--font-brand); letter-spacing: -.01em; font-variation-settings: 'opsz' 48; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.page-title { font: 600 26px/1.15 var(--font-brand); letter-spacing: -.015em; font-variation-settings: 'opsz' 60; }
.section-title { font-size: 15px; font-weight: 650; color: var(--text); margin-bottom: var(--s3); }

/* ───────── App shell ───────── */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) max(var(--s4), env(safe-area-inset-right, 0px)) 0 max(var(--s4), env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft);
}
#root.bare { padding-top: env(safe-area-inset-top, 0px); }
.topbar-actions { display: flex; gap: var(--s1); }
.main { padding: var(--s4) var(--s4) calc(var(--nav-h) + var(--s6)); max-width: 680px; width: 100%; margin: 0 auto; min-width: 0; }
.sidenav { display: none; }
.aside { display: none; }
.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 30; height: var(--nav-h); display: grid; grid-template-columns: repeat(6, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; position: relative; }
.bottomnav a:hover { text-decoration: none; }
.bottomnav a[aria-current='page'] { color: var(--text); }
.bottomnav a[aria-current='page'] svg { color: var(--brand); }
.bottomnav .create-btn span.ico { background: var(--brand); color: var(--brand-ink); border-radius: 14px; width: 44px; height: 32px; display: grid; place-items: center; }
.bottomnav .create-btn svg { color: var(--brand-ink) !important; }

@media (min-width: 760px) {
  .shell { grid-template-columns: 84px minmax(0, 1fr); }
  .topbar .brand-word { display: none; }
  .sidenav { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: var(--s4) var(--s3); border-right: 1px solid var(--line-soft); gap: var(--s1); align-items: center; }
  .sidenav .nav-label { display: none; }
  .bottomnav { display: none; }
  .topbar { display: none; }
  .main { padding: var(--s5) var(--s5) var(--s7); }
}
@media (min-width: 1100px) {
  .shell { grid-template-columns: 250px minmax(0, 680px) 340px; justify-content: center; }
  .sidenav { align-items: stretch; padding: var(--s5) var(--s4); }
  .sidenav .nav-label { display: inline; }
  .aside { display: block; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: var(--s5) var(--s4); border-left: 1px solid var(--line-soft); }
}
.sidenav .brand { margin: 0 var(--s2) var(--s5); }
@media (max-width: 1099px) { .sidenav .brand-word { display: none; } .sidenav .brand { margin: 0 0 var(--s5); } }
.navlink {
  display: flex; align-items: center; gap: var(--s3); padding: 10px 12px; border-radius: var(--r-md); color: var(--text-2); font-weight: 550; position: relative;
}
.navlink:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.navlink[aria-current='page'] { color: var(--text); background: var(--surface-2); }
.navlink[aria-current='page'] svg { color: var(--brand); }
.navlink.primary { background: var(--brand); color: var(--brand-ink); justify-content: center; margin-top: var(--s3); }
.navlink.primary:hover { background: var(--brand-strong); color: var(--brand-ink); }
.nav-spacer { flex: 1; }
.dot-badge { position: absolute; top: 6px; left: 26px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--lime); color: var(--lime-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.bottomnav .dot-badge { top: 6px; left: calc(50% + 4px); }

/* ───────── Primitives ───────── */
.ico svg { width: 22px; height: 22px; display: block; }
.ico.sm svg { width: 18px; height: 18px; }
.ico.xs svg { width: 15px; height: 15px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy='true'] { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.positive { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.btn.danger { background: var(--danger-wash); border-color: transparent; color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot-badge { left: 22px; top: 2px; }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--s3); }
.stack > * + * { margin-top: var(--s3); }
.stack-lg > * + * { margin-top: var(--s5); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 650; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--line-soft); margin: var(--s4) 0; border: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; font-weight: 550; cursor: pointer; }
.chip[aria-pressed='true'], .chip.on { background: var(--brand-wash); border-color: var(--brand); color: var(--text); }
.chip.static { cursor: default; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; }
.tag.brand { background: var(--brand-wash); color: var(--brand-strong); }
.tag.lime { background: var(--lime-wash); color: var(--lime); }
.tag.warn { background: var(--warn-wash); color: var(--warn); }
.tag.danger { background: var(--danger-wash); color: var(--danger); }

/* Forms */
.field { display: block; }
.field + .field { margin-top: var(--s4); }
.label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--focus); outline: none; }
.input[aria-invalid='true'] { border-color: var(--danger); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.check { display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); }
.switch-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 13px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.form-error { background: var(--danger-wash); color: var(--danger); padding: 10px 12px; border-radius: var(--r-md); font-size: 14px; }
.notice { background: var(--brand-wash); color: var(--text); padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.notice.warn { background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.danger { background: var(--danger-wash); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

/* Tabs */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line-soft); margin: 0 calc(var(--s4) * -1) var(--s4); padding: 0 var(--s4); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: none; padding: 12px 12px 10px; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tab[aria-selected='true'] { color: var(--text); border-bottom-color: var(--brand); }
.tab:hover { color: var(--text); }

/* Avatar */
.avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 16px; color: var(--brand-ink); background: var(--brand); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 84px; height: 84px; font-size: 32px; border: 3px solid var(--bg); }
.avatar.xs { width: 24px; height: 24px; font-size: 11px; }
.verified { color: var(--brand); display: inline-flex; vertical-align: -3px; }
.verified svg { width: 16px; height: 16px; }

/* ───────── Posts ───────── */
.post { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow); }
.post + .post, .feed > * + * { margin-top: var(--s3); }
.post-head { display: flex; gap: var(--s3); align-items: flex-start; }
.post-meta { min-width: 0; flex: 1; line-height: 1.3; }
.post-meta .name { font-weight: 650; color: var(--text); }
.post-meta .handle, .post-meta .time { color: var(--muted); font-size: 13.5px; }
.post-context { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: var(--s2); }
.post-body { margin-top: var(--s3); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.55; }
.post-body.article { white-space: pre-wrap; }
.post-title { font: 600 21px/1.25 var(--font-brand); margin-top: var(--s3); font-variation-settings: 'opsz' 36; }
.post-title.question::before { content: 'Q '; color: var(--lime); }
.post-body a, .comment-body a { color: var(--brand-strong); }
.post-media { margin-top: var(--s3); display: grid; gap: 4px; border-radius: var(--r-md); overflow: hidden; }
.post-media.n2 { grid-template-columns: 1fr 1fr; }
.post-media.n3, .post-media.n4, .post-media.nmany { grid-template-columns: 1fr 1fr; }
.post-media img, .post-media video { width: 100%; height: 100%; max-height: 520px; object-fit: cover; background: var(--bg-deep); }
.post-media.n1 img { object-fit: contain; max-height: 560px; }
.media-btn { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.quote { margin-top: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); background: var(--bg); }
.quote .post-body { font-size: 14.5px; margin-top: 6px; }
.label-banner { margin-top: var(--s3); padding: 8px 12px; border-radius: var(--r-md); background: var(--warn-wash); color: var(--text); font-size: 13.5px; display: flex; gap: 8px; }
.content-label { margin-top: var(--s2); }
.sources { margin-top: var(--s2); font-size: 13px; }
.sources a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-actions { display: flex; justify-content: space-between; margin-top: var(--s3); margin-left: -8px; max-width: 460px; }
.act { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); cursor: pointer; font-size: 13.5px; font-weight: 600; }
.act:hover { background: var(--surface-2); color: var(--text); }
.act.on { color: var(--brand-strong); }
.act.on.react { color: var(--lime); }
.act .emoji { font-size: 16px; line-height: 1; }
.why { margin-top: var(--s2); font-size: 12.5px; color: var(--muted); }
.why summary { cursor: pointer; list-style: none; display: inline-flex; gap: 4px; align-items: center; }
.why summary::-webkit-details-marker { display: none; }
.react-pop { display: flex; gap: 4px; padding: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--shadow); }
.react-pop button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; font-size: 22px; cursor: pointer; transition: transform .12s var(--ease); }
.react-pop button:hover, .react-pop button:focus-visible { transform: scale(1.2); background: var(--surface-3); }

/* Composer */
.composer { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow); }
.composer .textarea { background: transparent; border: 0; padding: 4px 0; font-size: 17px; min-height: 80px; box-shadow: none; }
.composer .title-input { background: transparent; border: 0; padding: 4px 0; font: 600 21px/1.3 var(--font-brand); box-shadow: none; }
.composer-bar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: var(--s3); margin-top: var(--s3); }
.composer-opts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.composer-opts .select { width: auto; padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; border-radius: var(--r-pill); }
.counter { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.counter.over { color: var(--danger); }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s2); margin-top: var(--s3); }
.attachment { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--bg-deep); border: 1px solid var(--line); }
.attachment img, .attachment video { width: 100%; height: 110px; object-fit: cover; }
.attachment .alt-input { border: 0; border-top: 1px solid var(--line); border-radius: 0; font-size: 12px; padding: 6px 8px; }
.attachment .remove { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; display: grid; place-items: center; }
.attachment .progress { position: absolute; inset: auto 0 0 0; height: 3px; background: var(--lime); }

/* Comments */
.comments { margin-top: var(--s4); }
.comment { display: flex; gap: var(--s3); padding: var(--s3) 0; }
.comment + .comment { border-top: 1px solid var(--line-soft); }
.comment .replies { margin-top: var(--s2); padding-left: var(--s3); border-left: 2px solid var(--line); }
.comment .replies .comment { border-top: 0; padding: var(--s2) 0; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comment-actions { display: flex; gap: var(--s1); margin-top: 4px; margin-left: -10px; }
.comment-actions .act { height: 28px; font-size: 12.5px; }

/* People & lists */
.person { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; }
.person + .person { border-top: 1px solid var(--line-soft); }
.person .who { min-width: 0; flex: 1; line-height: 1.3; }
.list-item { display: flex; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); align-items: flex-start; color: var(--text); }
.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item.unread { background: var(--brand-wash); }

/* Profile */
.profile-hero { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line-soft); }
.profile-cover { height: 120px; background:
  radial-gradient(120% 140% at 0% 100%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%),
  radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--lime) 40%, transparent), transparent 55%), var(--surface-3); }
.profile-body { padding: 0 var(--s4) var(--s4); margin-top: -42px; }
.profile-name { font: 600 24px/1.2 var(--font-brand); margin-top: var(--s2); font-variation-settings: 'opsz' 48; }
.stats { display: flex; gap: var(--s4); margin-top: var(--s3); font-size: 14px; }
.stats b { color: var(--text); }
.stats a, .stats span { color: var(--muted); }

/* Messages */
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - var(--nav-h) - var(--s5)); min-height: 380px; }
@media (min-width: 760px) { .chat { height: calc(100vh - 2 * var(--s5)); } }
.chat-head { display: flex; align-items: center; gap: var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--line-soft); }
.chat-log { flex: 1; overflow-y: auto; padding: var(--s4) 2px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 18px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; position: relative; }
.bubble.mine { background: var(--brand); color: var(--brand-ink); align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble:not(.mine) { border-bottom-left-radius: 6px; }
.bubble.deleted { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-style: italic; }
.bubble .meta { font-size: 11px; opacity: .7; margin-top: 2px; }
.bubble img, .bubble video { border-radius: 12px; max-height: 260px; margin-top: 4px; }
.bubble-tools { display: none; gap: 2px; align-self: center; }
.msg-row { display: flex; gap: 6px; align-items: center; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-row:hover .bubble-tools, .msg-row:focus-within .bubble-tools { display: flex; }
.chat-input { display: flex; gap: var(--s2); align-items: flex-end; padding-top: var(--s3); border-top: 1px solid var(--line-soft); }
.chat-input .textarea { min-height: 44px; max-height: 160px; border-radius: 22px; padding: 10px 16px; }
.typing { font-size: 12.5px; color: var(--muted); height: 18px; }
.e2e-note { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* Community */
.community-badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font: 600 20px var(--font-brand); background: var(--lime-wash); color: var(--lime); flex: none; }
.community-badge.lg { width: 64px; height: 64px; font-size: 28px; border-radius: 18px; }

/* Aside widgets */
.widget { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--s4); }
.widget + .widget { margin-top: var(--s4); }
.trend { display: flex; justify-content: space-between; padding: 8px 0; color: var(--text); }
.trend:hover { text-decoration: none; color: var(--brand-strong); }
.trend + .trend { border-top: 1px solid var(--line-soft); }
.footer-links { font-size: 12.5px; color: var(--muted); margin-top: var(--s4); line-height: 1.8; }
.footer-links a { color: var(--muted); margin-right: 10px; }
.pledge-mini { font: italic 400 14px/1.5 var(--font-brand); color: var(--text-2); }

/* ───────── Welcome / auth ───────── */
.welcome { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--bg-deep); }
@media (min-width: 960px) { .welcome { grid-template-columns: 1.1fr 1fr; } }
.welcome-art { position: relative; overflow: hidden; padding: var(--s6) var(--s5); display: flex; flex-direction: column; justify-content: space-between; min-height: 330px;
  background: radial-gradient(80% 60% at 30% 110%, rgba(34, 201, 193, .35), transparent 70%), radial-gradient(50% 40% at 85% 10%, rgba(181, 230, 74, .18), transparent 70%), #061230; color: #e9eef8; }
.welcome-art .island { position: absolute; right: -60px; bottom: -80px; width: min(560px, 90vw); opacity: .9; pointer-events: none; }
.welcome-art .brand { color: #e9eef8; }
.welcome-headline { font: 500 clamp(36px, 6vw, 64px)/1.02 var(--font-brand); letter-spacing: -.025em; max-width: 12ch; font-variation-settings: 'opsz' 144; position: relative; }
.welcome-sub { color: #b7c3da; max-width: 38ch; font-size: 17px; margin-top: var(--s4); position: relative; }
.welcome-panel { padding: var(--s6) var(--s5); display: flex; align-items: center; justify-content: center; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font: 600 28px/1.15 var(--font-brand); margin-bottom: var(--s2); }
.auth-alt { margin-top: var(--s4); font-size: 14px; color: var(--muted); }
.values { display: flex; flex-wrap: wrap; gap: 8px; position: relative; margin-top: var(--s5); }
.values span { font-size: 13px; color: #cfe9e7; border: 1px solid rgba(207, 233, 231, .25); padding: 4px 10px; border-radius: 999px; }

/* Onboarding */
.onboard { max-width: 560px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
.progress-track { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; margin: var(--s3) 0 var(--s5); }
.progress-track span { display: block; height: 100%; background: var(--lime); transition: width .35s var(--ease); }
.rule { padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); }
.rule:last-child { border-bottom: 0; }
.rule h3 { font-size: 15.5px; display: flex; gap: 10px; align-items: baseline; }
.rule h3 .n { font: 600 14px var(--font-brand); color: var(--brand); min-width: 22px; }
.rule ul { margin: 6px 0 0 32px; padding: 0; color: var(--text-2); font-size: 14px; }
.rule p { margin: 4px 0 0 32px; color: var(--text-2); font-size: 14.5px; }
.pledge { font: 500 19px/1.5 var(--font-brand); padding: var(--s4); border-radius: var(--r-lg); background: var(--lime-wash); border: 1px solid color-mix(in srgb, var(--lime) 35%, transparent); color: var(--text); font-variation-settings: 'opsz' 30; }
.topic-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* Modal (native dialog) */
dialog.modal { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
dialog.modal::backdrop { background: rgba(3, 9, 22, .62); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: var(--s4); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s4); border-top: 1px solid var(--line-soft); }
dialog.lightbox { background: transparent; border: 0; padding: 0; max-width: 96vw; max-height: 96vh; }
dialog.lightbox img { max-height: 90vh; border-radius: var(--r-md); }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .85); }

/* Menu popover */
.menu { position: fixed; z-index: 60; min-width: 220px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: var(--r-sm); text-align: left; cursor: pointer; color: var(--text); font-size: 14.5px; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* Toasts */
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 760px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); animation: toast-in .25s var(--ease); max-width: 90vw; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok::before { content: '✓  '; color: var(--lime-ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* States */
.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--muted); }
.empty h3 { color: var(--text); font: 600 19px/1.3 var(--font-brand); margin-bottom: 6px; }
.empty .btn { margin-top: var(--s4); }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-lg); height: 140px; border: 1px solid var(--line-soft); }
.skeleton + .skeleton { margin-top: var(--s3); }
@keyframes shimmer { to { background-position: -200% 0; } }
.load-more { display: flex; justify-content: center; margin-top: var(--s4); }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--warn); color: #1d1300; text-align: center; font-size: 13px; font-weight: 600; padding: 6px; }
.status-banner { margin-bottom: var(--s4); }

/* Tables (admin/mod) */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.kv .stat { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s3); }
.kv .stat b { display: block; font: 600 24px/1.1 var(--font-brand); color: var(--text); }
.kv .stat span { font-size: 12.5px; color: var(--muted); }
.priority-4 { border-left: 3px solid var(--danger); }
.priority-3 { border-left: 3px solid var(--warn); }
.evidence { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.codebox { background: var(--bg); border: 1px dashed var(--line); padding: var(--s3); border-radius: var(--r-md); word-break: break-all; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
[dir='rtl'] .comment .replies { padding-left: 0; padding-right: var(--s3); border-left: 0; border-right: 2px solid var(--line); }

/* Refinements */
.main:focus, .main:focus-visible { box-shadow: none; outline: none; }
.composer-opts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.composer-opts::-webkit-scrollbar { display: none; }
.composer-opts .select { flex: none; }

/* ───────── Watch: vertical video feed ───────── */
.main.watch-mode { max-width: 520px; padding: 0; }
.watch-feed { height: calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-bottom, 0px)); overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; background: #000; outline: none; }
.watch-feed::-webkit-scrollbar { display: none; }
@media (min-width: 760px) { .watch-feed { height: 100dvh; border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); } }
.watch-slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; background: #000; overflow: hidden; color: #fff; }
.watch-slide video { width: 100%; height: 100%; object-fit: contain; background: #000; cursor: pointer; }
.watch-paused { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.watch-paused svg { width: 72px; height: 72px; color: rgba(255,255,255,.85); fill: rgba(255,255,255,.85); }
.watch-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.18); }
.watch-progress span { display: block; height: 100%; width: 0; background: var(--lime); }
.watch-caption { position: absolute; left: 14px; right: 84px; bottom: 18px; display: flex; flex-direction: column; gap: 6px; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.watch-caption::before { content: ''; position: absolute; inset: -60px -14px -18px -14px; z-index: -1; background: linear-gradient(transparent, rgba(0,0,0,.55)); pointer-events: none; }
.watch-author { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.watch-author .muted { color: rgba(255,255,255,.75); font-weight: 400; }
.watch-text { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.watch-text a { color: #9ff3ee; }
.watch-actions { position: absolute; right: 8px; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.watch-act { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.watch-act:hover { text-decoration: none; }
.watch-act .ico svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.watch-act.on { color: var(--lime); }
.watch-act.on .ico svg { fill: currentColor; }
.watch-act .avatar { border: 2px solid #fff; }
.watch-end { color: var(--text); background: var(--bg); text-align: center; padding: 24px; }
.watch-end h3 { font: 600 22px/1.3 var(--font-brand); margin: 10px 0 6px; }
.watch-end .ico svg { width: 44px; height: 44px; color: var(--brand); }
.watch-more { height: 1px; }
body.watching .topbar { background: var(--bg); }

/* Embedded in the iOS app: the native app provides navigation. */
html.embedded .sidenav, html.embedded .topbar, html.embedded .bottomnav, html.embedded .aside { display: none !important; }
html.embedded .shell { display: block; }
html.embedded .main { padding-bottom: 24px; }

/* ───────── Social sign-in ───────── */
.social-buttons { display: grid; gap: 10px; margin: var(--s4) 0 var(--s2); }
.btn.social { justify-content: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.btn.social:hover { border-color: var(--brand); }
.social-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font: 700 14px/1 system-ui, sans-serif; color: #fff; }
.social-google .social-mark { background: #fff; color: #4285f4; border: 1px solid #dadce0; }
.btn.social.social-apple { background: #000; border-color: #000; color: #fff; }
.social-apple .social-mark { background: #000; }
.social-apple .social-mark::before { content: ''; width: 10px; height: 12px; border-radius: 50% 50% 45% 45%; background: #fff; }
.social-facebook .social-mark { background: #1877f2; font-family: Georgia, serif; }
.social-microsoft .social-mark { background: conic-gradient(#f25022 0 25%, #7fba00 0 50%, #ffb900 0 75%, #00a4ef 0); color: transparent; border-radius: 2px; }
.social-linkedin .social-mark { background: #0a66c2; font-size: 12px; }
.or-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin-top: 4px; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.invite-box { display: flex; gap: 8px; align-items: center; }
.invite-box .input { font-family: var(--font-mono, monospace); font-size: 13px; }

/* ───────── The Invisible Best Friend 👤 ───────── */
.ibf-head { margin-bottom: var(--s4); }
.ibf-head .back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); margin-bottom: 6px; }
.ibf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s4); }
.ibf-eyebrow { font-family: var(--font-brand); font-weight: 650; font-size: 14px; color: var(--text); }
.ibf-card { background: linear-gradient(160deg, var(--brand-wash), var(--surface) 55%); border: 1px solid var(--line); border-radius: var(--r-lg, 18px); padding: var(--s4, 18px); display: flex; flex-direction: column; gap: 10px; }
.ibf-card-top { display: flex; align-items: center; gap: 10px; }
.ibf-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px dashed var(--line); font-size: 20px; flex: none; }
.ibf-quote { margin: 0; font-size: 18px; line-height: 1.5; color: var(--text); font-family: var(--font-brand); overflow-wrap: anywhere; }
.ibf-quote.small { font-size: 15px; }
.ibf-card-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ibf-card details summary { cursor: pointer; color: var(--muted); }
.ibf-daily { background: var(--lime-wash); border-radius: var(--r-lg, 18px); padding: 14px 16px; margin-bottom: var(--s4); border: 1px solid color-mix(in srgb, var(--lime) 40%, transparent); }
.ibf-daily-text { margin: 6px 0; font-size: 16px; }
.ibf-empty { text-align: center; padding: 28px 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ibf-empty-mark { font-size: 34px; }
.ibf-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 var(--s4); counter-reset: s; flex-wrap: wrap; }
.ibf-steps li { counter-increment: s; font-size: 13px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); }
.ibf-steps li::before { content: counter(s) '. '; }
.ibf-steps li.on { background: var(--brand); color: #fff; font-weight: 650; }
.ibf-steps li.done { background: var(--brand-wash); color: var(--text); }
.ibf-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ibf-cat { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text); font: inherit; }
.ibf-cat:hover, .ibf-cat.on { border-color: var(--brand); background: var(--brand-wash); }
.ibf-cat:focus-visible, .ibf-person:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ibf-person { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; font: inherit; color: var(--text); }
.ibf-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.ibf-ideas .chip { height: auto; padding: 6px 11px; white-space: normal; text-align: left; }
.ibf-colls { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s3) 0; }
.ibf-option { padding: 8px 0; }
.ibf-policy { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .ibf-card, .ibf-cat { transition: none; } }

/* ───────── The Secret Celebration Room 🎉 ───────── */
.cel-themed { --cel-a: #2b2d42; --cel-b: #8d99ae; --cel-c: #edf2f4; --cel-ink: #ffffff; --cel-accent: var(--brand); --cel-paper: #fffdf8; --cel-paper-ink: #1d2435; }
.cel-theme-party { --cel-a: #ff5d8f; --cel-b: #ffb347; --cel-c: #06d6a0; --cel-accent: #ff5d8f; }
.cel-theme-graduation { --cel-a: #14274e; --cel-b: #394867; --cel-c: #f1c40f; --cel-accent: #f1c40f; }
.cel-theme-wedding { --cel-a: #b08968; --cel-b: #ddb892; --cel-c: #fdf0d5; --cel-accent: #b08968; }
.cel-theme-friendship { --cel-a: #4ea8de; --cel-b: #7bdff2; --cel-c: #f7d6e0; --cel-accent: #4ea8de; }
.cel-theme-minimal { --cel-a: #222831; --cel-b: #393e46; --cel-c: #00adb5; --cel-accent: #00adb5; }
.cel-theme-family { --cel-a: #e76f51; --cel-b: #f4a261; --cel-c: #2a9d8f; --cel-accent: #e76f51; }
.cel-theme-elegant { --cel-a: #2b2d42; --cel-b: #5c677d; --cel-c: #c9ada7; --cel-accent: #c9ada7; }
.cel-theme-custom { --cel-a: var(--cel-accent); --cel-b: color-mix(in srgb, var(--cel-accent) 55%, #000); --cel-c: color-mix(in srgb, var(--cel-accent) 30%, #fff); }
.cel-themed { background-color: var(--cel-a); background-image: linear-gradient(135deg, color-mix(in srgb, var(--cel-a) 92%, transparent), color-mix(in srgb, var(--cel-b) 88%, transparent)), var(--cel-photo, none); background-size: cover; background-position: center; color: var(--cel-ink); }
.cel-pattern-confetti { background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.18) 0 3px, transparent 4px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.14) 0 4px, transparent 5px), linear-gradient(135deg, color-mix(in srgb, var(--cel-a) 92%, transparent), color-mix(in srgb, var(--cel-b) 88%, transparent)), var(--cel-photo, none); background-size: 60px 60px, 90px 90px, cover, cover; }
.cel-pattern-dots { background-image: radial-gradient(rgba(255,255,255,.16) 1.5px, transparent 2px), linear-gradient(135deg, var(--cel-a), var(--cel-b)), var(--cel-photo, none); background-size: 18px 18px, cover, cover; }
.cel-pattern-stars { background-image: radial-gradient(circle, rgba(255,255,255,.35) 0 1px, transparent 2px), radial-gradient(circle, rgba(255,255,255,.2) 0 1.5px, transparent 2.5px), linear-gradient(160deg, var(--cel-a), var(--cel-b)), var(--cel-photo, none); background-size: 70px 70px, 130px 130px, cover, cover; background-position: 0 0, 35px 50px, center, center; }
.cel-pattern-hearts { background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,.14) 0 6px, transparent 7px), linear-gradient(135deg, var(--cel-a), var(--cel-b)), var(--cel-photo, none); background-size: 46px 46px, cover, cover; }
.cel-pattern-waves { background-image: repeating-radial-gradient(circle at 0 100%, rgba(255,255,255,.07) 0 12px, transparent 12px 24px), linear-gradient(135deg, var(--cel-a), var(--cel-b)), var(--cel-photo, none); }

.cel-head { margin-bottom: var(--s4); }
.cel-head .back-link, .cel-banner .back-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; opacity: .85; margin-bottom: 6px; }
.cel-hero-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: var(--s4); }
.cel-big-action { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(150deg, var(--brand-wash), var(--surface) 60%); color: var(--text); text-decoration: none; }
.cel-big-action:hover { border-color: var(--brand); }
.cel-big-emoji { font-size: 30px; }
.cel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cel-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); color: var(--text); text-decoration: none; }
.cel-card:hover, .cel-card:focus-visible { border-color: var(--brand); }
.cel-card-band { height: 54px; }
.cel-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.cel-card-title { font-family: var(--font-brand); font-size: 17px; }
.cel-settings summary { cursor: pointer; }
.cel-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cel-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.cel-choice:hover, .cel-choice.on { border-color: var(--brand); background: var(--brand-wash); }
.cel-choice:focus-visible, .cel-tile:focus-visible, .cel-photo:focus-visible, .cel-tl-entry:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.cel-choice-emoji { font-size: 26px; }
.cel-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cel-fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.cel-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cel-theme-option { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.cel-theme-option:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); }
.cel-theme-option input { position: absolute; opacity: 0; }
.cel-theme-option:has(input:focus-visible) { outline: 3px solid var(--brand); }
.cel-theme-swatch { height: 46px; border-radius: 8px; display: block; }
.cel-color { width: 56px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; }
.cel-review-card { border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.cel-review-title, .cel-banner-title { font-family: var(--font-brand); font-size: clamp(22px, 4vw, 30px); line-height: 1.15; margin: 0; }
.cel-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.cel-dl dt { color: var(--muted); }
.cel-dl dd { margin: 0; }
.cel-banner { border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s3); }
.cel-banner .tag { background: rgba(255,255,255,.18); color: inherit; }
.cel-countdown { font-variant-numeric: tabular-nums; font-weight: 650; }
.cel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cel-actions .btn { background: rgba(255,255,255,.92); color: #102033; border-color: transparent; }
.cel-actions .btn.primary { background: #ffffff; color: #0b3d39; font-weight: 700; }
.cel-actions .btn.ghost { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.5); }
.cel-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cel-checklist li.done { color: var(--muted); }
.cel-review.excluded { opacity: .7; border-style: dashed; }
.cel-review, .cel-contrib { display: flex; flex-direction: column; gap: 8px; }
.cel-mosaic-admin { display: grid; gap: 4px; }
.cel-admin-tile { border: 1px dashed var(--line); border-radius: 8px; padding: 6px; min-height: 58px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.cel-admin-tile.filled { border-style: solid; border-color: var(--brand); background: var(--brand-wash); }
.cel-mosaic-preview { max-width: 260px; border-radius: 12px; }
.cel-seq { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.cel-seq li > span, .cel-seq li { display: flex; align-items: center; gap: 6px; }
.cel-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cel-editor { border-color: var(--brand); }
.cel-date { display: grid; grid-template-columns: 110px 1fr 90px; gap: 8px; }
.cel-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.cel-file { display: flex; flex-direction: column; gap: 6px; }
.cel-file img, .cel-file video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #000; }
.cel-file audio { width: 100%; }
.cel-rec-live, .cel-rec-playback { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; }
.cel-rec-meter { font-size: 48px; text-align: center; padding: 20px; }
.progress-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-bar .progress { height: 100%; background: var(--brand); transition: width .2s; }
.cel-invite { border-color: var(--brand); }
.cel-text p { margin: 0 0 .7em; line-height: 1.6; }
.cel-text p:last-child { margin-bottom: 0; }
.cel-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.cel-media figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cel-media figcaption { font-size: 13px; opacity: .85; }
.cel-media video { width: 100%; border-radius: 10px; background: #000; max-height: 70vh; }
.cel-media-video { grid-template-columns: 1fr; }
.cel-photo { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; border-radius: 10px; overflow: hidden; }
.cel-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cel-audio audio { width: 100%; }

/* The reveal stage */
.cel-stage { border-radius: var(--r-lg); padding: clamp(16px, 4vw, 36px); min-height: 70vh; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 18px; }
.cel-preview-banner { color: var(--text); }
.cel-welcome { text-align: center; max-width: 640px; margin: auto; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 30px 0; }
.motion-full .cel-welcome, .motion-gentle .cel-welcome { animation: cel-rise .9s var(--ease) both; }
.cel-welcome-emoji { font-size: 64px; }
.motion-full .cel-welcome-emoji { animation: cel-bounce 1.6s ease-in-out infinite; }
.cel-occasion { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; opacity: .9; }
.cel-welcome-title { font-family: var(--font-brand); font-size: clamp(30px, 6vw, 52px); line-height: 1.1; margin: 0; }
.cel-welcome-title.small { font-size: clamp(22px, 4vw, 32px); }
.cel-welcome .cel-text { font-size: 18px; }
.cel-welcome-actions { gap: 10px; flex-wrap: wrap; justify-content: center; }
.cel-stage .btn.ghost { color: inherit; border: 1px solid rgba(255,255,255,.55); }
.cel-begin { font-size: 18px; padding: 12px 26px; background: #ffffff; color: #0b2b2a; border-color: #ffffff; }
.cel-journey-top, .cel-all-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cel-dots { display: flex; gap: 6px; }
.cel-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.35); }
.cel-dots span.on { background: #ffffff; transform: scale(1.3); }
.cel-dots span.done { background: rgba(255,255,255,.75); }
.cel-journey-nav { justify-content: space-between; }
.cel-section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 80px; }
.motion-full .cel-section, .motion-gentle .cel-section { animation: cel-rise .6s var(--ease) both; }
.cel-section-title { font-family: var(--font-brand); font-size: clamp(22px, 4vw, 30px); margin: 0; outline: none; }
.cel-jump { display: flex; gap: 6px; flex-wrap: wrap; }
.cel-jump .chip, .cel-stage .chip { background: rgba(255,255,255,.16); color: inherit; border-color: rgba(255,255,255,.3); }
.cel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.cel-contrib-card { background: var(--cel-paper); color: var(--cel-paper-ink); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 30px -18px rgba(0,0,0,.5); }
.cel-contrib-card a { color: #0b6f6a; }
.cel-contrib-card.letter { font-family: var(--font-brand); font-size: 17px; }
.cel-contrib-card.joke { background: #fff8dc; }
.cel-contrib-card.video { grid-column: 1 / -1; max-width: 760px; }
.cel-contrib-title { font-family: var(--font-brand); margin: 0; font-size: 20px; }
.cel-meta-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; opacity: .85; }
.cel-from { font-weight: 600; }
.cel-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid rgba(0,0,0,.08); padding-top: 10px; }
.cel-card-actions .btn { color: #1d2435; background: #eef2f7; border-color: #d7dee9; }
.cel-reactions { display: flex; gap: 2px; }
.cel-react { border: 1px solid transparent; background: none; border-radius: 99px; font-size: 20px; padding: 2px 6px; cursor: pointer; }
.cel-react.on { border-color: #0b6f6a; background: #e1f5f3; }
.cel-react:focus-visible { outline: 2px solid #0b6f6a; }
.cel-more summary { cursor: pointer; }
.cel-music { position: sticky; top: 8px; float: right; z-index: 3; border-radius: 99px; border: 1px solid rgba(255,255,255,.6); background: rgba(0,0,0,.25); color: inherit; padding: 6px 12px; cursor: pointer; }

/* Memory Mosaic */
.cel-mosaic-wrap { align-items: center; }
.cel-mosaic-intro { font-family: var(--font-brand); font-size: 20px; text-align: center; max-width: 560px; margin: 0; }
.cel-mosaic { display: grid; gap: 3px; width: min(100%, 560px); aspect-ratio: 1; position: relative; }
.cel-mosaic.complete { gap: 0; transition: gap .8s; }
.cel-tile { position: relative; padding: 0; border: 0; border-radius: 4px; overflow: hidden; cursor: pointer; background: transparent; transition: transform .7s var(--ease), opacity .7s var(--ease); }
.cel-mosaic.complete .cel-tile { border-radius: 0; }
.cel-tile-face { position: absolute; inset: 0; background-repeat: no-repeat; }
.cel-tile-cover { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(14px, 3vw, 24px); background: linear-gradient(135deg, var(--cel-c), color-mix(in srgb, var(--cel-c) 70%, #000)); color: #fff; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.cel-tile.open .cel-tile-cover { opacity: 0; transform: rotateY(90deg); pointer-events: none; }
.cel-tile.open.has::after { content: '💛'; position: absolute; right: 3px; bottom: 2px; font-size: 11px; opacity: .85; }
.cel-mosaic.complete .cel-tile.has::after { opacity: 0; }
.cel-mosaic.complete .cel-tile:hover::after, .cel-mosaic.complete .cel-tile:focus-visible::after { opacity: 1; }
.cel-countdown-big { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-family: var(--font-brand); color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.4); z-index: 2; }
.cel-mosaic-done { text-align: center; }

/* Gallery, slideshow, viewer */
.cel-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cel-gallery-item { margin: 0; position: relative; }
.cel-gallery-item figcaption { margin-top: 4px; opacity: .9; }
.cel-star { position: absolute; top: 6px; right: 6px; border: 0; border-radius: 99px; background: rgba(0,0,0,.45); color: #fff; width: 32px; height: 32px; font-size: 18px; cursor: pointer; }
.cel-star.on { color: #ffd166; }
.cel-slideshow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.cel-slideshow figure { margin: 0; text-align: center; }
.cel-slideshow img { max-width: 100%; max-height: 65vh; border-radius: 12px; }
.cel-slideshow .icon-btn, .cel-viewer .icon-btn { color: inherit; }
.cel-viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; border: 0; padding: 12px; background: rgba(5, 10, 20, .96); color: #fff; display: flex; flex-direction: column; gap: 8px; }
.cel-viewer:not([open]) { display: none; }
.cel-viewer-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cel-viewer-stage { flex: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-height: 0; }
.cel-viewer-stage img { max-width: 100%; max-height: calc(100vh - 120px); margin: auto; display: block; object-fit: contain; }
.cel-viewer-cap { text-align: center; font-size: 14px; }

/* Timeline */
.cel-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid rgba(255,255,255,.45); display: grid; gap: 10px; }
.cel-timeline li { position: relative; }
.cel-timeline li::before { content: ''; position: absolute; left: -25px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--cel-accent); }
.cel-tl-entry { display: grid; grid-template-columns: 120px auto 1fr; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px; border-radius: 12px; border: 0; background: rgba(255,255,255,.14); color: inherit; font: inherit; cursor: pointer; }
.cel-tl-entry:hover { background: rgba(255,255,255,.24); }
.cel-tl-entry img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.cel-tl-date { font-weight: 650; font-size: 13px; }
.cel-chapter h3 { font-family: var(--font-brand); margin: 6px 0; }

/* Finale */
.cel-finale-quote { margin: 0; font-family: var(--font-brand); font-size: clamp(18px, 3vw, 24px); text-align: center; }
.cel-collage { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 4px; }
.cel-collage img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.cel-quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cel-quotes figure { margin: 0; background: rgba(255,255,255,.14); border-radius: 12px; padding: 12px; }
.cel-quotes blockquote { margin: 0 0 6px; font-family: var(--font-brand); }
.cel-signoff { text-align: center; }
.cel-montage-video { width: 100%; max-height: 65vh; background: #000; border-radius: 12px; }
.cel-keepsake { background: var(--cel-paper); color: var(--cel-paper-ink); border-radius: 16px; padding: 18px; }
.cel-keepsake .card { background: #f6f8fb; color: inherit; border-color: #dfe5ee; }
.cel-keepsake .btn.ghost { color: #1d2435; border-color: #cfd8e5; }
.danger-text { color: var(--danger) !important; }
.cel-preview-wrap { padding: 16px; border-radius: 14px; }

/* Confetti */
.cel-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cel-confetti i { position: absolute; top: -12px; width: 8px; height: 14px; background: hsl(var(--hue), 85%, 62%); border-radius: 2px; animation: cel-fall linear forwards; }
@keyframes cel-fall { to { transform: translateY(110vh) rotate(720deg); opacity: .6; } }
@keyframes cel-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cel-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .cel-confetti { display: none; }
  .cel-welcome, .cel-section, .cel-welcome-emoji, .cel-tile, .cel-tile-cover { animation: none !important; transition: none !important; }
}
.motion-none .cel-tile, .motion-none .cel-tile-cover { transition: none; }
@media (max-width: 600px) {
  .cel-tl-entry { grid-template-columns: 1fr auto; }
  .cel-tl-date { grid-column: 1 / -1; }
  .cel-date { grid-template-columns: 1fr 1fr 1fr; }
  .cel-stage { border-radius: 0; margin: 0 calc(var(--s4) * -1); }
  .cel-contrib-card.video { grid-column: auto; }
}

/* ───────── Public Reading Rooms 📚 ───────── */
.lib-head { margin-bottom: var(--s3); }
.lib-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s3); }
.lib-public { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.lib-hero { border-radius: var(--r-lg); padding: clamp(16px, 3vw, 26px); background: linear-gradient(140deg, var(--brand-wash), var(--surface) 65%); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.lib-eyebrow { font-size: 12px; letter-spacing: .12em; font-weight: 700; color: var(--brand-strong); }
.lib-hero-grid { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 20px; align-items: start; }
.lib-hero-title { font-family: var(--font-brand); font-size: clamp(24px, 4vw, 34px); line-height: 1.15; margin: 0; }
.lib-cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px 10px 10px 6px; box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); background: var(--surface-2); display: block; }
.lib-cover.sm { width: 64px; }
.lib-cover.xs { width: 40px; }
.lib-cover.lg { max-width: 190px; }
.lib-cover.gen { display: flex; flex-direction: column; justify-content: space-between; padding: 12% 10%; color: #fff; background: linear-gradient(160deg, hsl(var(--hue) 45% 38%), hsl(calc(var(--hue) + 40) 50% 24%)); border-left: 4px solid rgba(0,0,0,.25); box-sizing: border-box; overflow: hidden; }
.lib-cover.gen .lib-cover-title { font-family: var(--font-brand); font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.lib-cover.gen .lib-cover-author { font-size: 11px; opacity: .85; }
.lib-cover-initial { display: none; }
.lib-cover.gen.sm, .lib-cover.gen.xs { justify-content: center; align-items: center; padding: 0; }
.lib-cover.gen.sm .lib-cover-initial, .lib-cover.gen.xs .lib-cover-initial { display: block; font-family: var(--font-brand); font-size: 26px; }
.lib-cover.gen.xs .lib-cover-initial { font-size: 18px; }
.lib-cover.gen.sm .lib-cover-title, .lib-cover.gen.xs .lib-cover-title, .lib-cover.gen.sm .lib-cover-author, .lib-cover.gen.xs .lib-cover-author { display: none; }
.lib-days { display: flex; flex-direction: column; gap: 4px; }
.lib-days-bar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; max-width: 280px; }
.lib-days-bar span { height: 8px; border-radius: 4px; background: var(--line); }
.lib-days-bar span.on { background: var(--brand); }
.lib-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.lib-tile { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); text-decoration: none; align-items: flex-start; }
.lib-tile:hover, .lib-tile:focus-visible { border-color: var(--brand); }
.lib-tile-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lib-tile-title { overflow-wrap: anywhere; }
.lib-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.lib-room { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; }
.lib-room:hover, .lib-room:focus-visible { border-color: var(--brand); background: var(--brand-wash); }
.lib-room-emoji { font-size: 24px; }
.lib-search { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; margin-bottom: 12px; }
.lib-book { display: grid; grid-template-columns: minmax(110px, 190px) 1fr; gap: 20px; align-items: start; margin-bottom: 12px; }
.lib-stars { display: flex; gap: 2px; }
.lib-star { border: 0; background: none; font-size: 24px; color: var(--line); cursor: pointer; padding: 0 2px; }
.lib-star.on { color: #f5b301; }
.lib-star:focus-visible { outline: 2px solid var(--brand); border-radius: 4px; }
.lib-list-item { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 12px; }
.lib-quote { margin: 0; font-family: var(--font-brand); font-size: 17px; }
.lib-flags { margin: 0; padding-left: 4px; list-style: none; display: grid; gap: 4px; color: var(--warn); }
.lib-calendar { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lib-calendar li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.lib-calendar li.empty { opacity: .7; }
.lib-admin-row { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); font: inherit; cursor: pointer; }
.lib-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lib-table th, .lib-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.lib-table th { color: var(--muted); font-weight: 600; }
.linklike { border: 0; background: none; padding: 0; color: var(--brand-strong); cursor: pointer; font: inherit; text-align: left; }
.linklike:hover { text-decoration: underline; }

/* Reader */
.lib-reader { --lib-size: 19px; --lib-spacing: 1.7; --lib-bg: #fbfaf7; --lib-ink: #1b1f27; --lib-muted: #687080; border-radius: var(--r-lg); background: var(--lib-bg); color: var(--lib-ink); padding: 12px clamp(12px, 4vw, 40px) 20px; display: flex; flex-direction: column; gap: 10px; }
.lib-reader.theme-sepia { --lib-bg: #f4ecd8; --lib-ink: #3b2f1e; --lib-muted: #7a6a52; }
.lib-reader.theme-dark { --lib-bg: #11151c; --lib-ink: #dfe4ec; --lib-muted: #8a93a3; }
.lib-reader:fullscreen { border-radius: 0; overflow-y: auto; padding: 20px max(16px, calc((100vw - 760px) / 2)); }
.lib-reader .btn.ghost, .lib-reader .btn { color: var(--lib-ink); border-color: color-mix(in srgb, var(--lib-ink) 20%, transparent); background: transparent; }
.lib-reader .muted, .lib-reader .tiny { color: var(--lib-muted); }
.lib-reader-top { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--lib-bg); padding: 6px 0; z-index: 2; }
.lib-reader-title { flex: 1; min-width: 0; }
.lib-reader-title > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-tools { display: flex; gap: 2px; }
.lib-tool { min-width: 36px; justify-content: center; }
.lib-progress { height: 3px; background: color-mix(in srgb, var(--lib-ink) 12%, transparent); border-radius: 2px; overflow: hidden; }
.lib-progress span { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.lib-page { max-width: 680px; width: 100%; margin: 0 auto; font-family: Georgia, 'Noto Serif', 'Noto Serif Ethiopic', 'Nyala', serif; font-size: var(--lib-size); line-height: var(--lib-spacing); min-height: 50vh; outline: none; }
.lib-page p { margin: 0 0 1em; text-align: start; hyphens: auto; }
.lib-page mark { background: #ffe58a; color: #1b1f27; }
.lib-ch-title { font-family: var(--font-brand); font-size: 1.3em; margin: .4em 0 .8em; line-height: 1.25; }
.lib-reader-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 680px; width: 100%; margin: 0 auto; }
.lib-reader-foot .tiny { text-align: center; }
.lib-reader-note { text-align: center; }
.lib-passage-btn { position: sticky; bottom: 12px; align-self: center; background: var(--brand) !important; color: #fff !important; }
.lib-toc { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.lib-results { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; max-height: 60vh; overflow: auto; }
@media (max-width: 640px) {
  .lib-hero-grid, .lib-book { grid-template-columns: 96px 1fr; gap: 12px; }
  .lib-search { grid-template-columns: 1fr 1fr; }
  .lib-search input { grid-column: 1 / -1; }
  .lib-list-item { grid-template-columns: 1fr; }
  .lib-reader { border-radius: 0; margin: 0 calc(var(--s4) * -1); }
}
@media (max-width: 759px) {
  .lib-reader-top { top: var(--top-h); }
  .lib-reader { scroll-margin-top: var(--top-h); }
}

/* ───────── Skill Gift Economy 🎁 ───────── */
.sk-head .sk-tagline { font-family: var(--font-brand); font-size: 18px; color: var(--text); margin: 4px 0; }
.sk-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: thin; }
.sk-nav .chip { flex: none; }
@media (min-width: 900px) { .sk-nav { flex-wrap: wrap; overflow: visible; } }
.sk-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 700; }
.sk-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.sk-card { display: flex; flex-direction: column; gap: 8px; padding: var(--s4); min-width: 0; }
.sk-card-top { display: flex; gap: 10px; align-items: flex-start; }
.sk-emoji { font-size: 26px; line-height: 1; flex: none; }
.sk-title { font-size: 16px; font-weight: 650; margin: 0; overflow-wrap: anywhere; }
.sk-sub { font-size: 14px; font-weight: 650; color: var(--text-2); margin: 6px 0 0; }
.sk-person { gap: 8px; align-items: center; }
.sk-free { align-self: flex-start; font-size: 11px; font-weight: 750; letter-spacing: .04em; color: var(--lime); background: var(--lime-wash); border-radius: 6px; padding: 3px 8px; }
.sk-free-note { display: flex; flex-direction: column; gap: 4px; }
.sk-boundary { font-size: 13px; background: var(--warn-wash); color: var(--text); border-radius: var(--r-sm); padding: 8px 10px; }
label.sk-boundary { display: flex; gap: 8px; align-items: flex-start; }
.sk-facts { display: flex; flex-wrap: wrap; gap: 5px; }
.sk-why { background: var(--brand-wash); border-radius: var(--r-sm); padding: 8px 10px; }
.sk-why ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.sk-why .sk-cautions { color: var(--muted); list-style: '– '; }
.sk-why-list { margin: 0; padding-left: 18px; }
.sk-actions { gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.sk-filters { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.sk-filters > * { width: 100%; min-width: 0; }
.sk-filters input[type=search] { grid-column: 1 / -1; }
.sk-two { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.sk-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sk-slot { gap: 6px; flex-wrap: wrap; }
.sk-slot .select, .sk-slot .input { width: auto; flex: 1 1 90px; }
.sk-note { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; }
.sk-sec-head { align-items: center; gap: 8px; flex-wrap: wrap; }
.sk-exchange { border-color: var(--brand); }
.sk-swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; background: var(--surface-2); border-radius: var(--r-md); padding: 10px; }
.sk-swap-ico { font-size: 22px; color: var(--brand-strong); }
.sk-lesson.declined, .sk-lesson.cancelled { opacity: .7; }
.sk-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--line); padding-left: 10px; }
.sk-thread li.mine { border-left: 2px solid var(--brand); margin-left: -12px; padding-left: 10px; }
.sk-times { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; align-self: flex-start; }
.sk-rooms { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.sk-room-tile { display: flex; gap: 10px; align-items: center; padding: 12px; color: inherit; text-decoration: none; }
.sk-room-tile:hover { border-color: var(--brand); }
.sk-follow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sk-when { font-size: 14px; font-weight: 600; }
.sk-when.big { font-size: 16px; }
.sk-workshop { color: inherit; text-decoration: none; }
.sk-workshop:hover { border-color: var(--brand); }
.sk-workshop-page { max-width: 760px; }
.sk-milestones { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sk-milestone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: var(--r-md); border: 1px dashed var(--line); background: var(--surface); color: var(--muted); cursor: pointer; text-align: center; }
.sk-milestone.on { border-style: solid; border-color: var(--lime); background: var(--lime-wash); color: var(--text); }
.sk-milestone:disabled { cursor: default; }
.sk-ms-emoji { font-size: 26px; filter: grayscale(1); opacity: .5; }
.sk-milestone.on .sk-ms-emoji { filter: none; opacity: 1; }
.sk-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.sk-stats { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sk-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.sk-stat-n { font-family: var(--font-brand); font-size: 28px; font-weight: 600; color: var(--brand-strong); }
.sk-ripple { background: linear-gradient(140deg, var(--brand-wash), var(--surface) 70%); }
.sk-thanks { margin: 0; padding: 10px 14px; border-left: 3px solid var(--lime); background: var(--surface); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.sk-fb { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.sk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sk-profile-wrap:empty { display: none; }
.sk-profile-wrap { margin-top: var(--s3); }
.sk-trend { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 120px; align-items: end; }
.sk-trend-col { display: flex; gap: 1px; align-items: flex-end; height: 100%; }
.sk-bar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; }
.sk-bar.offers, .sk-key.offers { background: var(--brand); }
.sk-bar.requests, .sk-key.requests { background: var(--lime); }
.sk-bar.sessions, .sk-key.sessions { background: var(--warn); }
.sk-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.sk-cat-row { align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
/* Learning room */
.sk-room { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.sk-room-head { display: flex; gap: var(--s3); align-items: flex-start; flex-wrap: wrap; }
.sk-members { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sk-member { display: inline-flex; align-items: center; gap: 6px; }
.sk-safety { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 12px; }
.sk-call { padding: var(--s3); display: flex; flex-direction: column; gap: 10px; }
.sk-call-controls { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sk-call-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.sk-call-grid:empty { display: none; }
.sk-tile { position: relative; background: #000; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16 / 9; }
.sk-tile video { width: 100%; height: 100%; object-fit: contain; display: block; }
.sk-tile.me video { transform: scaleX(-1); }
.sk-tile-name { position: absolute; left: 8px; bottom: 6px; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .55); padding: 2px 8px; border-radius: 6px; }
.sk-rec { color: #fff; background: #c62828; border-radius: var(--r-sm); padding: 6px 10px; font-size: 13px; font-weight: 650; }
.sk-room-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.sk-room-tabs .chip { flex: none; }
.sk-chat-list { display: flex; flex-direction: column; gap: 10px; max-height: min(60vh, 520px); min-height: 200px; overflow-y: auto; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.sk-msg { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; max-width: 100%; }
.sk-msg.mine { align-items: flex-end; }
.sk-msg.mine .bubble { background: var(--brand-wash); align-self: flex-end; }
.sk-call-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sk-call-title { flex: 1 1 180px; min-width: 0; }
.sk-member .tag { white-space: nowrap; }
.sk-member .small { white-space: nowrap; }
.sk-msg-img { max-width: min(280px, 100%); border-radius: var(--r-md); }
.sk-chat-compose { gap: 6px; align-items: flex-end; }
.sk-chat-compose .textarea { flex: 1; min-width: 0; resize: vertical; }
.sk-notes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; min-height: 260px; }
.sk-conflict { border: 1px solid var(--warn); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.sk-pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow: auto; margin: 0; font-size: 13px; background: var(--surface-2); padding: 8px; border-radius: 6px; }
.sk-res-list, .sk-sessions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sk-res { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.sk-res .tag { margin-left: 6px; }
.sk-session { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sk-session.cancelled { opacity: .65; }
.sk-q { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sk-q legend { width: 100%; margin-bottom: 4px; }

/* ───────── Installable app (PWA) ───────── */
.pwa-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-color: var(--brand); background: linear-gradient(120deg, var(--brand-wash), var(--surface) 70%); }
.pwa-banner img { border-radius: 11px; flex: none; }
.pwa-step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pwa-step-list li { display: flex; gap: 12px; align-items: flex-start; }
.pwa-step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 14px; }
.toast.pwa-update { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (display-mode: standalone) { .skip-link { top: env(safe-area-inset-top, 0px); } }
.empty.local-off { max-width: 30rem; margin: 15vh auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 16px; }
.empty.local-off img { border-radius: 16px; }

/* ───────── My Private Universe 🪐 ───────── */
:root { --acc: var(--brand); --uv-sky1: #070d22; --uv-sky2: #1a1446; --uv-meaning: #f2b950; --uv-commit: #8fd16a; --uv-messenger: #b59bff; --uv-museum: #e7a07a; --uv-ink: #f4f1ff; }
:root[data-theme='light'] { --uv-sky1: #1b1f4b; --uv-sky2: #3b2f7a; --uv-meaning: #a8690a; --uv-commit: #3f7d1c; --uv-messenger: #6a4fd1; --uv-museum: #a6532c; }
.uv-page { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; --acc: var(--brand); }
.uv-page.narrow, .narrow-col { max-width: 760px; width: 100%; }
.uv-page.w-meaning { --acc: var(--uv-meaning); } .uv-page.w-commit { --acc: var(--uv-commit); } .uv-page.w-messenger { --acc: var(--uv-messenger); } .uv-page.w-museum { --acc: var(--uv-museum); }
html.uv-hidden .uv-page, html.uv-hidden .uv-gate { filter: blur(22px); }
.uv-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.uv-home-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-brand); font-weight: 600; color: var(--text); text-decoration: none; }
.uv-crumb { color: var(--muted); font-size: 14px; }
.uv-orbit { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0 8%, var(--uv-messenger) 9% 45%, transparent 46%); border: 2px solid var(--uv-meaning); transform: rotate(-20deg); display: inline-block; flex: none; box-shadow: 0 0 12px rgba(181, 155, 255, .45); }
.uv-orbit.big { width: 64px; height: 64px; border-width: 3px; margin: 0 auto; }
.uv-h1 { font-family: var(--font-brand); font-size: clamp(26px, 4vw, 36px); font-weight: 600; margin: 0; line-height: 1.15; overflow-wrap: anywhere; }
.uv-h2 { font-family: var(--font-brand); font-size: 20px; font-weight: 600; margin: 8px 0 0; }
.uv-lede { max-width: 62ch; }
.uv-world-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.uv-world-head .btn.primary, .uv-page .btn.primary { background: var(--acc); border-color: var(--acc); color: #10131f; }
.uv-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.uv-tabs .chip { flex: none; }
.uv-tabs .chip.on { background: var(--acc); color: #10131f; border-color: var(--acc); }
.uv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.uv-card h2 { font-family: var(--font-brand); font-size: 19px; font-weight: 600; margin: 0; }
.uv-two { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.uv-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.uv-line.big { padding: 12px 0; }
.uv-foot { text-align: center; margin-top: var(--s5); }
.uv-warn { background: var(--warn-wash); border-radius: var(--r-md); padding: 10px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.uv-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; background:
  radial-gradient(1px 1px at 12% 22%, #fff 99%, transparent), radial-gradient(1px 1px at 28% 70%, #fff 99%, transparent), radial-gradient(1.5px 1.5px at 44% 35%, #fff 99%, transparent),
  radial-gradient(1px 1px at 63% 18%, #fff 99%, transparent), radial-gradient(1.5px 1.5px at 78% 60%, #fff 99%, transparent), radial-gradient(1px 1px at 88% 28%, #fff 99%, transparent),
  radial-gradient(1px 1px at 52% 82%, #fff 99%, transparent), radial-gradient(1px 1px at 6% 86%, #fff 99%, transparent), radial-gradient(1.2px 1.2px at 35% 12%, #fff 99%, transparent),
  radial-gradient(900px 400px at 85% -10%, rgba(181, 155, 255, .35), transparent 60%), radial-gradient(700px 360px at 0% 110%, rgba(242, 185, 80, .18), transparent 60%),
  linear-gradient(160deg, var(--uv-sky1), var(--uv-sky2)); opacity: 1; }
/* Lock screen and setup */
.uv-gate { position: relative; min-height: min(78vh, 760px); display: grid; place-items: center; border-radius: var(--r-lg); overflow: hidden; padding: 24px 12px; }
.uv-gate-card { position: relative; z-index: 1; color: var(--uv-ink); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 360px; width: 100%; }
.uv-gate-card.wide { max-width: 640px; }
.uv-gate-card h1 { font-family: var(--font-brand); font-weight: 600; font-size: clamp(28px, 5vw, 40px); margin: 6px 0 0; }
.uv-gate-card .muted, .uv-gate-card .tiny, .uv-gate-card .hint { color: rgba(244, 241, 255, .72); }
.uv-gate-card .field { text-align: left; width: 100%; }
.uv-gate-card .field .label { color: var(--uv-ink); }
.uv-gate-card .linkish { color: rgba(244, 241, 255, .8); }
.uv-tagline { font-family: var(--font-brand); font-style: italic; font-size: 18px; margin: 0; }
.uv-promises { text-align: left; margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.uv-pinpad { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.uv-pinpad.shake { animation: uv-shake .35s; }
@keyframes uv-shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.uv-dots { display: flex; gap: 14px; }
.uv-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(244, 241, 255, .8); transition: background .15s; }
.uv-dots span.on { background: var(--uv-meaning); border-color: var(--uv-meaning); box-shadow: 0 0 10px var(--uv-meaning); }
.uv-pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.uv-keys { display: grid; grid-template-columns: repeat(3, 64px); gap: 12px; }
.uv-key { width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(244, 241, 255, .25); background: rgba(255, 255, 255, .06); color: var(--uv-ink); font-size: 24px; font-family: var(--font-ui); cursor: pointer; }
.uv-key:hover { background: rgba(255, 255, 255, .14); }
.uv-key:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--uv-meaning); }
.uv-pin-msg { min-height: 1.4em; color: #ffd18a; font-size: 14px; margin: 0; }
.uv-worlds.mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 8px; width: 100%; text-align: left; }
.uv-world-mini { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.uv-world-mini > span { font-size: 22px; }
.uv-gate .select { background: rgba(255, 255, 255, .92); color: #10131f; }
/* Home */
.uv-hero { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: clamp(22px, 5vw, 44px); color: var(--uv-ink); display: flex; flex-direction: column; gap: 8px; }
.uv-hero > :not(.uv-sky) { position: relative; z-index: 1; }
.uv-hero h1 { font-family: var(--font-brand); font-weight: 600; font-size: clamp(28px, 5vw, 46px); margin: 0; }
.uv-date { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 650; margin: 0; opacity: .8; }
.uv-notice { align-self: flex-start; background: rgba(255, 255, 255, .14); color: var(--uv-ink); padding: 6px 12px; border-radius: 999px; text-decoration: none; font-size: 14px; }
.uv-worlds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s3); }
.uv-world { --c: var(--brand); position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); overflow: hidden; min-height: 150px; transition: transform .2s var(--ease), border-color .2s; }
.uv-world::after { content: ''; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 70%); opacity: .25; }
.uv-world:hover { transform: translateY(-2px); border-color: var(--c); }
.uv-world.w-meaning, .uv-world-mini.w-meaning { --c: var(--uv-meaning); } .uv-world.w-commit, .uv-world-mini.w-commit { --c: var(--uv-commit); }
.uv-world.w-messenger, .uv-world-mini.w-messenger { --c: var(--uv-messenger); } .uv-world.w-museum, .uv-world-mini.w-museum { --c: var(--uv-museum); }
.uv-world-emoji { font-size: 30px; }
.uv-world-title { font-family: var(--font-brand); font-size: 19px; font-weight: 600; }
.uv-world-line { color: var(--muted); font-size: 14px; }
.uv-world-fact { margin-top: auto; font-size: 13px; color: var(--c); font-weight: 600; }
.uv-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--s3); }
.uv-home-grid .btn.primary { align-self: flex-start; }
/* Meaning */
.uv-qotd { border-left: 3px solid var(--acc); padding: 6px 14px; }
.uv-q { font-family: var(--font-brand); font-style: italic; font-size: 18px; }
.uv-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.uv-filters .select { width: auto; max-width: 100%; }
.uv-timeline { display: flex; flex-direction: column; gap: 6px; }
.uv-month { font-family: var(--font-brand); font-size: 18px; font-weight: 600; margin: 14px 0 2px; color: var(--acc); }
.uv-entry { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); position: relative; min-width: 0; }
.uv-entry.imp-3 { border-color: var(--acc); }
.uv-entry-day { display: flex; flex-direction: column; align-items: center; width: 42px; flex: none; }
.uv-entry-day .d { font-family: var(--font-brand); font-size: 24px; line-height: 1; }
.uv-entry-day .w { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.uv-entry-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.uv-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uv-star { color: var(--acc); font-size: 18px; }
.uv-cats { display: flex; flex-wrap: wrap; gap: 5px; }
.uv-cat { --c: var(--brand); display: inline-flex; align-items: center; gap: 2px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.uv-cat.plain { --c: var(--muted); }
.uv-cat.btn-like { cursor: pointer; font-size: 14px; padding: 6px 12px; background: transparent; font-family: inherit; }
.uv-cat.btn-like.on { background: color-mix(in srgb, var(--c) 30%, transparent); border-color: var(--c); font-weight: 600; }
.uv-cat-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.uv-imp { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.uv-writing { font-size: 17px; line-height: 1.65; min-height: 200px; }
.uv-title-input { font-family: var(--font-brand); font-size: 20px; }
.uv-read { display: flex; flex-direction: column; gap: 12px; }
.uv-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 16px; }
.uv-lesson { margin: 0; border-left: 3px solid var(--acc); padding: 8px 14px; background: var(--surface); border-radius: 0 var(--r-md) var(--r-md) 0; display: flex; flex-direction: column; gap: 2px; }
.uv-gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.uv-gallery.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.uv-file { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.uv-file img, .uv-file video { width: 100%; max-width: 100%; border-radius: var(--r-md); background: var(--surface-2); display: block; }
.uv-file.compact img, .uv-file.compact video { aspect-ratio: 1; object-fit: cover; }
.uv-file audio { width: 100%; }
.uv-doc { display: block; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text); overflow-wrap: anywhere; }
.uv-file-missing { padding: 18px 10px; border-radius: var(--r-md); background: var(--surface-2); text-align: center; }
.uv-attach-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.uv-attach-list:empty { display: none; }
.uv-attach { position: relative; }
.uv-attach .uv-file.audio, .uv-attach .uv-file.document { padding-top: 22px; }
.uv-attach-rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; }
.uv-badge { position: absolute; left: 4px; top: 4px; font-size: 12px; background: rgba(0, 0, 0, .55); border-radius: 6px; padding: 1px 4px; }
.uv-attach-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.uv-where { width: auto; max-width: 100%; font-size: 13px; }
.uv-map { padding: 8px; overflow-x: auto; }
.uv-map-svg { width: 100%; min-width: 520px; height: auto; display: block; }
.uv-map-line { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 5; }
.uv-map-emoji { font-size: 20px; }
.uv-map-label { font-size: 12.5px; fill: var(--text-2); font-family: var(--font-ui); }
.uv-map-label.strong { fill: var(--text); font-weight: 650; }
.uv-map-you { fill: var(--uv-meaning); }
.uv-flow { display: flex; flex-direction: column; gap: 6px; }
.uv-flow-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 28px; gap: 8px; align-items: center; }
.uv-flow-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); gap: 1px; }
.uv-flow-seg { min-width: 3px; }
.uv-flow-n { text-align: right; font-variant-numeric: tabular-nums; }
.uv-legend { display: flex; flex-wrap: wrap; gap: 5px; }
.uv-tl { display: flex; flex-direction: column; border-left: 2px solid var(--line); margin-left: 6px; }
.uv-tl-item { display: grid; grid-template-columns: 14px 90px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 0 5px 0; margin-left: -8px; color: var(--text); text-decoration: none; }
.uv-tl-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg); }
.uv-tl-item.imp-3 .uv-tl-dot { box-shadow: 0 0 0 3px var(--acc); }
.uv-review-pick { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.uv-pick { text-decoration: none; color: var(--text); }
.uv-pick:hover { border-color: var(--acc); }
.uv-review-nav { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.uv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.uv-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; }
.uv-stats b { font-family: var(--font-brand); font-size: 26px; font-weight: 600; color: var(--acc); font-variant-numeric: tabular-nums; }
.uv-stats span { font-size: 12px; color: var(--muted); }
.btn.on { border-color: var(--acc); color: var(--acc); }
.uv-cat-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px auto; gap: 8px; align-items: center; }
.uv-cat-row.archived { opacity: .55; }
.uv-emoji-in { text-align: center; }
.uv-color { width: 44px; height: 38px; border: 0; background: none; padding: 0; }
/* Commitments */
.uv-commit-list { display: flex; flex-direction: column; gap: 8px; }
.uv-commit { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); min-width: 0; }
.uv-commit.paused { opacity: .75; } .uv-commit.released { opacity: .7; }
.uv-ring { --p: 0; flex: none; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--acc) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; }
.uv-ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.uv-commit-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.uv-commit-head .uv-ring { width: 84px; height: 84px; } .uv-commit-head .uv-ring span { width: 66px; height: 66px; font-size: 17px; }
.uv-commit-head .grow { min-width: 0; flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; }
.uv-commit-head p { margin: 0; }
.uv-actions { gap: 6px; flex-wrap: wrap; }
.uv-log { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.uv-log-item { position: relative; }
.uv-log-item::before { content: ''; position: absolute; left: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--acc); }
.uv-log-item.reflection::before { background: var(--uv-messenger); }
.uv-log-item p { margin: 4px 0; overflow-wrap: anywhere; }
.uv-range { flex: 1; accent-color: var(--acc); }
.uv-feel { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio span { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.chip-radio input:checked + span { background: var(--acc); color: #10131f; border-color: var(--acc); }
.chip-radio input:focus-visible + span { box-shadow: var(--focus); }
.uv-closed summary { cursor: pointer; }
/* Messenger */
.uv-env-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.uv-envelope { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 16px 14px; border-radius: 10px; text-decoration: none; color: var(--text); background: linear-gradient(170deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); overflow: hidden; min-height: 140px; }
.uv-envelope::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 60px; background: linear-gradient(160deg, transparent 49%, var(--line) 50%, transparent 51%), linear-gradient(200deg, transparent 49%, var(--line) 50%, transparent 51%); opacity: .6; pointer-events: none; }
.uv-envelope.arrived { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 10px 30px -14px var(--acc); }
.uv-envelope.invite { border-style: dashed; border-color: var(--acc); }
.uv-env-seal { position: relative; font-size: 28px; }
.uv-env-title { font-family: var(--font-brand); font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.uv-env-when { margin-top: auto; font-size: 13px; color: var(--acc); font-weight: 600; }
.uv-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.uv-seg-btn { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; }
.uv-seg-btn.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.uv-friend-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); max-height: 260px; overflow-y: auto; }
.uv-friend { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: var(--r-sm); border: 1px solid var(--line-soft); cursor: pointer; }
.uv-when { font-family: var(--font-brand); font-style: italic; font-size: 18px; color: var(--acc); margin: 0; }
.uv-people { display: flex; flex-wrap: wrap; gap: 8px; }
.uv-person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface-2); }
.uv-person.invited, .uv-person.declined, .uv-person.left { opacity: .65; }
.uv-sealed { padding: 16px; border-radius: var(--r-md); border: 1px dashed var(--acc); text-align: center; color: var(--text-2); }
.uv-letter { background: var(--surface); border: 1px solid var(--line); border-radius: 4px var(--r-md) var(--r-md) var(--r-md); padding: clamp(16px, 4vw, 28px); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.uv-letter .uv-body { font-family: var(--font-brand); font-size: 18px; line-height: 1.75; }
.uv-open { align-items: center; text-align: center; padding: 30px 12px; }
.uv-open-env { font-size: 72px; animation: uv-float 3s ease-in-out infinite; }
@keyframes uv-float { 50% { transform: translateY(-8px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .uv-open-env { animation: none; } .uv-world { transition: none; } }
/* Museum */
.uv-rooms, .uv-chapters { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.uv-room { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.uv-room:hover { border-color: var(--acc); }
.uv-room-cover { aspect-ratio: 16 / 10; background: linear-gradient(140deg, color-mix(in srgb, var(--acc) 35%, var(--surface-2)), var(--surface-2)); display: grid; place-items: center; overflow: hidden; }
.uv-room-cover .uv-file, .uv-room-cover img, .uv-room-cover video { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; border-radius: 0; }
.uv-room-ph { font-size: 44px; }
.uv-room-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.uv-room-body strong { font-family: var(--font-brand); font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.uv-items { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.uv-item { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
.uv-item-ph { aspect-ratio: 1; border-radius: var(--r-md); background: var(--surface-2); display: grid; place-items: center; font-size: 34px; }
.uv-item.pending { opacity: .75; }
.uv-item-body { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.uv-room-head { display: flex; flex-direction: column; gap: 6px; padding: 18px 0 6px; border-bottom: 1px solid var(--line-soft); }
.uv-room-intro { font-family: var(--font-brand); font-size: 18px; max-width: 64ch; margin: 0; color: var(--text-2); }
.uv-exhibit { display: flex; flex-direction: column; gap: clamp(20px, 4vw, 40px); }
.uv-piece { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(14px, 3vw, 28px); align-items: start; }
.uv-piece:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.uv-piece:nth-child(even) .uv-piece-media, .uv-piece:nth-child(even) .uv-piece-ph { order: 2; }
.uv-piece-media { display: grid; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
.uv-piece-ph { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 52px; background: var(--surface-2); border-radius: var(--r-md); }
.uv-piece-ph.big { font-size: 80px; }
.uv-piece-label { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.uv-piece-label h3 { font-family: var(--font-brand); font-size: 22px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.uv-note { border-left: 3px solid var(--acc); padding: 6px 12px; font-family: var(--font-brand); font-style: italic; line-height: 1.6; }
.uv-note > .tiny { font-family: var(--font-ui); font-style: normal; text-transform: uppercase; letter-spacing: .1em; color: var(--acc); display: block; }
.uv-note.big { font-size: 19px; }
.uv-piece[draggable='true'] { cursor: grab; }
.uv-pending { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.uv-pending .uv-item { width: 160px; }
.uv-guestbook .uv-gb { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.uv-gb.hidden-entry { opacity: .5; }
.uv-tour { min-height: 70vh; }
.uv-tour-stage { flex: 1; }
.uv-tour-piece { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(16px, 4vw, 40px); align-items: center; }
.uv-tour-media img, .uv-tour-media video { max-height: 70vh; object-fit: contain; }
.uv-tour-text h2 { font-family: var(--font-brand); font-size: clamp(24px, 4vw, 34px); font-weight: 600; margin: 4px 0 10px; }
.uv-tour-nav { justify-content: space-between; gap: 8px; }
@media (max-width: 760px) {
  .uv-piece, .uv-piece:nth-child(even), .uv-tour-piece { grid-template-columns: minmax(0, 1fr); }
  .uv-piece:nth-child(even) .uv-piece-media, .uv-piece:nth-child(even) .uv-piece-ph { order: 0; }
  .uv-keys { grid-template-columns: repeat(3, 60px); } .uv-key { width: 60px; height: 60px; }
  .uv-cat-row { grid-template-columns: 52px minmax(0, 1fr) 40px; } .uv-cat-row > .btn { grid-column: 1 / -1; justify-self: start; }
}
.uv-piece-text { padding: clamp(18px, 4vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); font-family: var(--font-brand); font-size: 17px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; position: relative; }
.uv-piece-text p { margin: 0; }
.uv-piece-text-emoji { position: absolute; top: -14px; left: 14px; font-size: 24px; }
.uv-piece:nth-child(even) .uv-piece-text { order: 2; }
@media (max-width: 760px) { .uv-piece:nth-child(even) .uv-piece-text { order: 0; } }
.uv-bar { flex-wrap: nowrap; }
.uv-bar .uv-home-link { flex: none; }
.uv-crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.uv-bar .grow { flex: 1 1 0; min-width: 4px; }
.uv-bar .btn { flex: none; }
.uv-map-svg { min-width: 0; }
@media (max-width: 520px) {
  .uv-crumb { display: none; }
  .uv-home-link { font-size: 15px; }
  .uv-bar .btn.sm { padding-inline: 8px; }
  .uv-map-label { font-size: 15px; }
}

/* ───────── Sponsored Announcements 📣 ───────── */
.sp-slot.sp-feed { margin-bottom: var(--s3); }
.sp-slot.sp-sidebar { margin-bottom: var(--s4); }
.sp-card { position: relative; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.sp-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--lime)); }
.sp-card.primary::before { height: 4px; }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 12px 8px 0 var(--s4); min-width: 0; }
.sp-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sp-label { margin-left: auto; flex: none; font-size: 11.5px; font-weight: 650; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px 9px; white-space: nowrap; }
.sp-more { width: 34px; height: 34px; flex: none; }
.sp-who { display: flex; align-items: center; gap: 10px; padding: 8px var(--s4) 10px; min-width: 0; }
.sp-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: none; border: 1px solid var(--line-soft); }
.sp-logo-ph { display: grid; place-items: center; font: 700 18px var(--font-brand); color: var(--brand); }
.sp-who-text { display: flex; flex-direction: column; min-width: 0; }
.sp-adv { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-verified { color: var(--brand); font-weight: 700; margin-left: 4px; }
.sp-media { display: block; width: 100%; max-height: 420px; object-fit: cover; background: var(--bg-deep); }
video.sp-media { object-fit: contain; background: #000; }
.sp-body { padding: 12px var(--s4) var(--s4); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sp-title { font: 600 20px/1.25 var(--font-brand); margin: 0; overflow-wrap: anywhere; }
.sp-offer { align-self: flex-start; background: var(--lime-wash); color: var(--text); border: 1px solid color-mix(in srgb, var(--lime) 45%, transparent); border-radius: var(--r-md); padding: 5px 10px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.sp-text { margin: 0; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.sp-text.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sp-details summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-2); }
.sp-details p { margin: 6px 0 0; white-space: pre-line; color: var(--text-2); overflow-wrap: anywhere; }
.sp-contact { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-2); }
.sp-contact a { color: var(--text-2); }
.sp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 4px; }
.sp-cta { text-decoration: none; }
.sp-why { margin-left: auto; align-self: center; }
.sp-card.compact .sp-title { font-size: 17px; }
.sp-card.compact .sp-media { max-height: 180px; }
.sp-card.compact .sp-actions .sp-cta { width: 100%; justify-content: center; }
.sp-card.compact .sp-why { margin-left: 0; }
.sp-hidden-note { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 12px var(--s4); margin-bottom: var(--s3); }
.sp-why-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Admin department */
.sp-admin { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.sp-admin-head { margin-bottom: 8px; }
.sp-tabs { margin-bottom: var(--s4); }
.sp-tabs .tab { white-space: nowrap; }
.sp-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sp-sec + .sp-sec, .card + .sp-sec { margin-top: 0; }
.sp-kv .stat { display: flex; flex-direction: column; gap: 2px; }
.sp-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--s4); align-items: start; }
.sp-grid2 > .card + .card { margin-top: 0; }
.sp-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.sp-3col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.sp-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); text-decoration: none; min-width: 0; }
.sp-row:last-child { border-bottom: 0; }
.sp-row:hover { text-decoration: none; background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.sp-row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sp-row-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.sp-thumb.round { border-radius: 50%; }
.sp-thumb-ph { display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--brand); }
.sp-logo-lg { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.sp-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.sp-chip.ok { background: var(--lime-wash); color: var(--text); border-color: color-mix(in srgb, var(--lime) 50%, transparent); }
.sp-chip.warn { background: var(--warn-wash); color: var(--text); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.sp-chip.danger { background: var(--danger-wash); color: var(--danger); }
.sp-chip.info { background: var(--brand-wash); color: var(--text); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.sp-chip.neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }
.sp-cap { margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.sp-preview-pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.sp-create { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.sp-create-form { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.sp-create-form > .card + .card { margin-top: 0; }
.sp-create-preview { position: sticky; top: calc(var(--top-h, 60px) + 12px); min-width: 0; }
.sp-slot-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.sp-slot-row.past { opacity: .6; }
.sp-media-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sp-save { justify-content: flex-end; flex-wrap: wrap; }
.sp-camp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; }
.sp-camp-head > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-camp-title { font: 600 26px/1.2 var(--font-brand); margin: 0; overflow-wrap: anywhere; }
.sp-actions-bar { justify-content: flex-end; }
.sp-camp-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.sp-camp-grid .stack > .card + .card { margin-top: 0; }
.sp-camp-grid .stack { display: flex; flex-direction: column; gap: var(--s4); }
.sp-camp-grid .stack > * + * { margin-top: 0; }
.sp-creative { display: flex; flex-direction: column; gap: 8px; }
.sp-creative.archived { opacity: .55; }
.sp-kv-small { display: grid; grid-template-columns: auto auto; gap: 4px 16px; font-size: 14px; justify-content: start; }
.sp-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.sp-log li { border-left: 2px solid var(--line); padding-left: 10px; overflow-wrap: anywhere; }
.sp-funnel { display: flex; flex-direction: column; gap: 10px; }
.sp-funnel-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 56px; gap: 10px; align-items: center; }
.sp-funnel-label { display: flex; flex-direction: column; min-width: 0; }
.sp-funnel-bar { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.sp-funnel-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--lime)); border-radius: 6px; }
.sp-funnel-n { text-align: right; font-variant-numeric: tabular-nums; }
.sp-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-bottom: 18px; position: relative; overflow-x: auto; }
.sp-bar { position: relative; flex: 1 0 14px; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 1px; }
.sp-bar span[class^='b-'] { width: 30%; min-width: 3px; border-radius: 2px 2px 0 0; }
.b-served { background: color-mix(in srgb, var(--brand) 35%, transparent); }
.b-seen { background: var(--brand); }
.b-click { background: var(--lime); }
.sp-bar-day { position: absolute; bottom: -17px; font-size: 10px; color: var(--muted); }
.sp-legend { display: flex; gap: 14px; position: absolute; top: 0; right: 0; }
.sp-legend .k::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.sp-legend .served::before { background: color-mix(in srgb, var(--brand) 35%, transparent); } .sp-legend .seen::before { background: var(--brand); } .sp-legend .click::before { background: var(--lime); }
.sp-approve { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.sp-days { display: flex; flex-direction: column; gap: 8px; }
.sp-day { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 10px 12px; }
.sp-day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.sp-day.past { opacity: .55; }
.sp-day-date { display: flex; flex-direction: column; align-items: center; width: 54px; flex: none; font-size: 13px; }
.sp-day-date b { text-transform: uppercase; font-size: 12px; color: var(--brand); }
.sp-day .select { max-width: 100%; }
.sp-subtabs { margin-bottom: 4px; }
.sp-list .sp-row { padding-left: 2px; padding-right: 2px; }
.sp-table-wrap { overflow-x: auto; max-width: 100%; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-table th, .sp-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.sp-table th { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.sp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-table .neg { color: var(--danger); }
.sp-table tfoot td { border-bottom: 0; }
.sp-table tfoot tr.strong td { font-weight: 700; border-top: 2px solid var(--line); }
.sp-lines { display: flex; flex-direction: column; gap: 6px; }
.sp-lines > * + * { margin-top: 0; }
.sp-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 130px 40px; gap: 6px; align-items: center; }
.sp-inv-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 14px; }
.sp-invoice { display: flex; flex-direction: column; gap: var(--s4); }
.sp-inv-top { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.sp-inv-seller { font: 600 22px var(--font-brand); }
.sp-inv-meta { text-align: right; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.sp-inv-meta h2 { margin: 0; font: 600 24px var(--font-brand); }
.sp-inv-pay { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; }
.pre { white-space: pre-line; }
.stack-tight > * + * { margin-top: 6px; }
.sp-report { padding: 10px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.sp-range { align-items: flex-end; }
.sp-range .field { margin: 0; }
.row.end { justify-content: flex-end; }
@media (max-width: 1100px) {
  .sp-create, .sp-camp-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-create-preview { position: static; order: -1; }
}
@media (max-width: 640px) {
  .sp-preview-pair, .sp-approve { grid-template-columns: minmax(0, 1fr); }
  .sp-slot-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sp-slot-row > :last-child { grid-column: 1 / -1; justify-self: start; }
  .sp-funnel-row { grid-template-columns: minmax(0, 1fr) 50px; }
  .sp-funnel-bar { grid-column: 1 / -1; grid-row: 2; }
  .sp-line { grid-template-columns: minmax(0, 1fr) 60px; }
  .sp-line > :nth-child(3) { grid-column: 1; } .sp-line-head { display: none; }
  .sp-title { font-size: 18px; }
  .sp-inv-meta { text-align: left; align-items: flex-start; }
  .sp-camp-title { font-size: 22px; }
}
@media print {
  body * { visibility: hidden; }
  .sp-invoice, .sp-invoice * { visibility: visible; }
  .sp-invoice { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: 0; }
  .no-print { display: none !important; }
}
/* Advertise on Utopians */
.ad-page { max-width: 880px; }
.ad-hero { background: linear-gradient(135deg, var(--brand-wash), var(--lime-wash)); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: clamp(20px, 4vw, 36px); display: flex; flex-direction: column; gap: 8px; }
.ad-hero h1 { font: 600 clamp(24px, 4vw, 34px)/1.15 var(--font-brand); margin: 0; }
.ad-hero p { margin: 0; color: var(--text-2); max-width: 62ch; }
.ad-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s3); }
.ad-grid > .card + .card { margin-top: 0; }
.ad-pkg { display: flex; flex-direction: column; gap: 6px; }
.ad-pkg h3 { margin: 0; font: 600 19px var(--font-brand); }
.ad-pkg p { margin: 0; flex: 1; }
.ad-pkg .btn { align-self: flex-start; }
.ad-pkg-emoji { font-size: 28px; }
.ad-price { font: 600 24px var(--font-brand); color: var(--text); }
.ad-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.ad-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.ad-2col > * + * { margin-top: 0 !important; }
.sp-card.compact .sp-head { flex-wrap: wrap; row-gap: 4px; }
.sp-card.compact .sp-eyebrow { flex: 1 1 auto; }
.sp-card.compact .sp-more { order: 1; }
.sp-card.compact .sp-label { order: 2; margin-left: 0; }
.sp-head { flex-wrap: wrap; row-gap: 4px; }
.sp-eyebrow { flex: 1 0 auto; overflow: visible; }
.sp-label { margin-left: 0; }
.sp-sec > .btn, .sp-sec > a.btn, .sp-sec > button.btn { align-self: flex-start; }
.sp-camp-grid .sp-slot-row, .sp-slots .sp-slot-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)) auto; }
.sp-camp-grid .stack:last-child .sp-slot-row { grid-template-columns: minmax(0, 1fr) auto; }
.sp-camp-grid .stack:last-child .sp-slot-row > .field:nth-child(2) { grid-column: 1; }
.sp-funnel-row { grid-template-columns: minmax(0, 1fr) 56px; grid-template-areas: 'label n' 'bar bar'; row-gap: 4px; }
.sp-funnel-label { grid-area: label; flex-direction: row; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.sp-funnel-bar { grid-area: bar; }
.sp-funnel-n { grid-area: n; }
.sp-bar { max-width: 44px; }
/* Department layout follows the space it actually has (container queries), not the window width. */
.sp-admin { container-type: inline-size; }
.sp-create, .sp-camp-grid, .sp-preview-pair { grid-template-columns: minmax(0, 1fr); }
.sp-create-preview { position: static; }
@container (min-width: 860px) {
  .sp-create { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .sp-create-preview { position: sticky; top: 12px; }
  .sp-camp-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
@container (min-width: 620px) { .sp-preview-pair { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
@media (max-width: 1100px) { .sp-create-preview { order: 0; } }
.sp-card.compact .sp-label { order: 1; margin-left: auto; }
.sp-card.compact .sp-more { order: 2; }
