/* Kofe — the phone app's door (welcome, sign up, log in).
 * Only the app draws these screens (html[data-app]); the website never does. */

:root[data-app] body { background: var(--bg); }
:root[data-app] .ad { min-height: 100dvh; color: var(--ink); }

/* ---- welcome: rooms drifting by, then the ways in */
.ad-start { display: flex; flex-direction: column; overflow: hidden; height: 100dvh; }
.ad-reel {
  position: relative; flex: 1 1 auto; min-height: 260px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 10px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 calc(env(safe-area-inset-top, 0px) + 70px), #000 62%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 calc(env(safe-area-inset-top, 0px) + 70px), #000 62%, transparent 100%);
}
.ad-col { position: relative; overflow: hidden; }
.ad-col-in { display: grid; gap: 10px; animation: ad-drift 46s linear infinite; will-change: transform; }
.ad-col-1 .ad-col-in { animation-direction: reverse; animation-duration: 54s; margin-top: -90px; }
.ad-col-2 .ad-col-in { animation-duration: 50s; margin-top: -40px; }
@keyframes ad-drift { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 5px)); } }
.ad-tile {
  position: relative; aspect-ratio: 3 / 4.2; overflow: hidden;
  border-radius: 999px 999px 18px 18px; background: #14110e;
  box-shadow: 0 10px 24px -14px rgba(20, 12, 4, 0.55);
}
.ad-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-tile span {
  position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 5px 8px; border-radius: 999px;
  background: rgba(251, 246, 236, 0.9); color: #1f1912; font-size: 11.5px; font-weight: 650;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ad-sheet {
  position: relative; z-index: 2; flex: 0 0 auto;
  display: grid; justify-items: center; gap: 0; text-align: center;
  padding: 0 24px calc(18px + env(safe-area-inset-bottom, 0px));
  margin-top: -36px;
}
.ad-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.ad-logo .logo-sym { height: 34px; width: auto; }
.ad-logo .logo-sym .logo-light { fill: var(--lamp); }
.ad-logo .logo-word { height: 34px; width: auto; fill: currentColor; stroke: currentColor; stroke-width: 6; stroke-linejoin: round; }
.ad-title { margin: 18px 0 0; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 8.6vw, 38px); line-height: 1.08; letter-spacing: -0.01em; }
.ad-lead { margin: 10px 0 0; max-width: 30ch; color: var(--muted); font-size: 15.5px; line-height: 1.45; }
.ad-ways { width: min(400px, 100%); display: grid; gap: 10px; margin-top: 24px; }
.ad-start .au-err:empty { display: none; }
.ad-start .au-err { margin-top: 10px; }

/* ---- buttons */
.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 0 20px; border-radius: 16px; border: 1px solid transparent;
  font: inherit; font-size: 16px; font-weight: 650; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform 0.12s ease, opacity 0.15s ease, background-color 0.15s ease;
}
.ad-btn:active { transform: scale(0.98); }
.ad-btn:disabled { opacity: 0.5; }
.ad-btn svg { flex: 0 0 auto; }
.ad-apple { background: #000; color: #fff; }
:root[data-theme="dark"] .ad-apple { background: #fff; color: #000; }
.ad-google { background: #fff; color: #1f1f1f; border-color: rgba(31, 25, 18, 0.18); }
.ad-google svg { width: 18px; height: 18px; }
.ad-mail { background: transparent; color: var(--ink); border-color: var(--line-2); }
.ad-go { background: var(--btn); color: var(--btn-ink); margin-top: 6px; }

.ad-switch { margin: 18px 0 0; font-size: 14.5px; color: var(--muted); text-align: center; }
.ad-switch a { color: var(--ink); font-weight: 700; text-decoration: none; margin-left: 2px; }
.ad-legal { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); }
.ad-legal a { color: inherit; text-decoration: none; }

/* ---- the form pages: back arrow, one question, big type */
.ad-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px; background: var(--bg);
}
.ad-back { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.ad-back:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.ad-top-tools .lang-btn, .ad-top-tools .lang { height: 36px; min-height: 36px; }
.ad-form-page { min-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px)); padding: 8px 24px calc(24px + env(safe-area-inset-bottom, 0px)); }
.ad-form { width: min(440px, 100%); margin: 0 auto; display: grid; gap: 0; }
.ad-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 26px; }
.ad-progress i { height: 4px; border-radius: 4px; background: var(--line-2); transition: background-color 0.35s var(--ease); }
.ad-progress i.is-on { background: var(--lamp); }
.ad-pane { animation: ad-in 0.38s var(--ease) both; }
@keyframes ad-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.ad-h { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(28px, 7.8vw, 34px); line-height: 1.12; letter-spacing: -0.01em; }
.ad-center { text-align: center; margin-top: 18px; }
.ad-p { margin: 10px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.45; }
.ad-fields { display: grid; gap: 12px; margin-top: 24px; }

/* a field whose label sits inside it and moves up when you type, as in the phone's own apps */
.ad-field { position: relative; display: block; }
.ad-field input {
  width: 100%; height: 58px; padding: 22px 16px 6px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ad-field input:focus { border-color: color-mix(in srgb, var(--ink) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp) 22%, transparent); }
.ad-field input[aria-invalid="true"] { border-color: var(--danger); }
.ad-field > span {
  position: absolute; left: 17px; top: 50%; transform: translateY(-50%); transform-origin: left center;
  color: var(--muted); font-size: 17px; pointer-events: none; transition: transform 0.18s var(--ease), top 0.18s var(--ease);
}
.ad-field input:focus + span, .ad-field input:not(:placeholder-shown) + span { top: 17px; transform: translateY(-50%) scale(0.76); }
.ad-passf input { padding-right: 54px; }
.ad-passf .au-eye { position: absolute; right: 6px; top: 50%; translate: 0 -50%; transform: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; }

.ad-tick { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); cursor: pointer; }
.ad-tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ad-tick i { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; transition: background-color 0.15s, border-color 0.15s; }
.ad-tick input:checked + i { background: var(--lamp); border-color: var(--lamp); }
.ad-tick input:checked + i::after { content: ""; width: 6px; height: 11px; border: solid var(--lamp-ink); border-width: 0 2.2px 2.2px 0; transform: translateY(-1px) rotate(45deg); }
.ad-tick input:focus-visible + i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp) 30%, transparent); }

.ad-form .au-err { margin: 12px 0 0; min-height: 0; font-size: 14px; color: var(--danger); }
.ad-form .au-err:empty { margin: 0; }
.ad-form .ad-go { margin-top: 20px; }
.ad-forgot { justify-self: center; margin-top: 14px; padding: 8px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.ad-or { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; color: var(--faint); font-size: 13px; }
.ad-or::before, .ad-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.ad-login .ad-ways { margin-top: 10px; width: 100%; }
.ad-logo-sm { justify-self: center; margin-top: 10px; }
.ad-logo-sm .logo-sym, .ad-logo-sm .logo-word { height: 30px; }

/* after sign-up: "check your email" replaces the form */
.ad-form > h1 { margin: 24px 0 0; font-family: var(--display); font-weight: 500; font-size: 32px; }
.ad-form > .lead-sm, .ad-form > .small { margin: 12px 0 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .ad-col-in, .ad-pane { animation: none; }
}

/* ================================================================
 * The whole app, not only its door: what makes it feel like an app.
 * html.is-app is set by native.js only inside the iPhone / Android app.
 * ================================================================ */
html.is-app { background: var(--bg); -webkit-text-size-adjust: 100%; }
html.is-app body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; overscroll-behavior-y: none; }

/* buttons, tabs and pictures are touched, not selected */
html.is-app :is(a, button, label, nav, header, .tabbar, .room-card, .topic-tile, .chip, img, svg) {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
html.is-app img { -webkit-user-drag: none; }
/* what people write stays selectable and copyable */
html.is-app :is(input, textarea, [contenteditable="true"], .msg, .msg *, .bubble, .bubble *) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* iPhone zooms into any field with text under 16px; keep them at 16 */
html.is-app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select) { font-size: max(16px, 1em); }

/* a press you can feel with the eye */
html.is-app :is(.btn, .ad-btn, .tabbar a, .look-btn, .chip, .room-card, .topic-tile) { transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.15s ease; }
html.is-app :is(.btn, .ad-btn, .look-btn, .chip):active { transform: scale(0.97); }
html.is-app :is(.room-card, .topic-tile):active { transform: scale(0.985); }
html.is-app .tabbar a:active { opacity: 0.6; }

/* glass bars, the way iOS draws them */
html.is-app .top:not(.over) {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
}
html.is-app .tabbar {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px);
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}
/* while the keyboard is up, the tab bar steps aside so the field and keyboard have the room */
html.is-app.kb-open .tabbar { transform: translateY(110%); opacity: 0; pointer-events: none; }

/* website-only parts have no place in the app */
html.is-app :is(.site-foot, .skip, .top-open, #install-group) { display: none !important; }

/* ================================================================
 * A room's conversation in the app: clean like Messages.
 * No card around the talk, a small segmented switch, and the writing bar docked at the bottom.
 * ================================================================ */
@media (max-width: 600px) {
  html.is-app.room-app .scene[style*="--room-img"] .talk {
    background: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    margin: 4px 0 0 !important; padding-top: 6px; border-radius: 0;
  }
  html.is-app.room-app .scene[style*="--room-img"] .talk-pane { padding-inline: 14px; }

  /* Conversation | Who's here, as an iPhone segmented switch */
  html.is-app .scene[style*="--room-img"] .talk-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: min(300px, calc(100% - 28px)); margin: 0 auto 4px; padding: 3px;
    border-radius: 12px; background: rgba(120, 100, 80, 0.12);
  }
  :root:not([data-theme="light"]) html.is-app .scene[style*="--room-img"] .talk-tabs { background: rgba(255, 255, 255, 0.08); }
  html.is-app .scene[style*="--room-img"] .talk-tabs button { min-height: 32px; border-radius: 9px; justify-content: center; font-size: 13.5px; padding: 0 10px; }
  html.is-app .scene[style*="--room-img"] .talk-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 3px rgba(30, 20, 8, 0.14); color: #1f1912; }
  :root:not([data-theme="light"]) html.is-app .scene[style*="--room-img"] .talk-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.16); color: var(--w-ink); }

  /* the writing bar: docked, full width, glass, the field a rounded pill inside it */
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer {
    margin: 0 -14px !important; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important; gap: 4px; align-items: flex-end;
    border-radius: 0 !important; background: rgba(250, 245, 236, 0.82) !important;
    -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px);
    box-shadow: 0 -0.5px 0 rgba(60, 40, 20, 0.16) !important;
  }
  :root:not([data-theme="light"]) html.is-app.room-app .scene[style*="--room-img"] .talk .composer { background: rgba(28, 23, 18, 0.86) !important; box-shadow: 0 -0.5px 0 rgba(255, 255, 255, 0.1) !important; }
  html.is-app.room-app.kb-open .scene[style*="--room-img"] .talk .composer { padding-bottom: 8px !important; margin-bottom: 0 !important; }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer textarea {
    min-height: 38px; padding: 8px 14px; border-radius: 20px; line-height: 1.3;
    background: rgba(255, 255, 255, 0.92); box-shadow: inset 0 0 0 1px rgba(60, 40, 20, 0.14); color: #1f1912;
  }
  :root:not([data-theme="light"]) html.is-app.room-app .scene[style*="--room-img"] .talk .composer textarea { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); color: var(--w-ink); }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer:focus-within { box-shadow: 0 -0.5px 0 rgba(60, 40, 20, 0.16) !important; }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer textarea:focus { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--w-lamp, #e0a23a) 70%, transparent); }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer .tool-btn { width: 36px; height: 38px; }
  html.is-app.room-app .scene[style*="--room-img"] .talk .send { width: 38px; height: 38px; }
  html.is-app.room-app .scene[style*="--room-img"] .talk .send svg { width: 17px; height: 17px; }

  /* names over messages: quieter */
  html.is-app .scene[style*="--room-img"] .talk .thread { padding-bottom: 12px; }
}

/* ================================================================
 * The tab bar, the way the newest iPhone draws it: a floating capsule of liquid glass,
 * the open tab sitting in a lens of lighter glass, and "Open your room" as its own
 * round glass button beside the bar.
 * ================================================================ */
@media (max-width: 760px) {
  html.is-app .tabbar {
    --gap: 12px; --btn: 60px; --h: 62px;
    left: 14px; right: calc(14px + var(--btn) + var(--gap)); bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) - 6px));
    min-height: var(--h); height: var(--h); padding: 4px; border-radius: 999px;
    grid-auto-columns: minmax(0, 1fr); gap: 0;
    background: rgba(252, 248, 241, 0.42);
    -webkit-backdrop-filter: blur(22px) saturate(1.9) brightness(1.06); backdrop-filter: blur(22px) saturate(1.9) brightness(1.06);
    box-shadow:
      inset 0 1px 0.5px rgba(255, 255, 255, 0.95),
      inset 0 -1px 1px rgba(255, 255, 255, 0.35),
      inset 0 0 0 0.5px rgba(255, 255, 255, 0.6),
      0 0 0 0.5px rgba(40, 25, 8, 0.08),
      0 12px 32px -10px rgba(40, 25, 8, 0.32),
      0 2px 6px -2px rgba(40, 25, 8, 0.12);
    isolation: isolate;
  }
  /* a soft sheen across the glass, brighter at the top edge, like light on a curved surface */
  html.is-app .tabbar::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
    background:
      radial-gradient(120% 90% at 20% -20%, rgba(255, 255, 255, 0.55), transparent 55%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 45%, rgba(255, 255, 255, 0.08));
  }
  :root:not([data-theme="light"]) html.is-app .tabbar,
  html.is-app:not([data-theme="light"]) .tabbar {
    background: rgba(40, 33, 26, 0.48);
    box-shadow:
      inset 0 1px 0.5px rgba(255, 255, 255, 0.22),
      inset 0 0 0 0.5px rgba(255, 255, 255, 0.14),
      0 12px 32px -10px rgba(0, 0, 0, 0.6);
  }
  html.is-app:not([data-theme="light"]) .tabbar::before { background: radial-gradient(120% 90% at 20% -20%, rgba(255, 255, 255, 0.14), transparent 55%); }

  html.is-app .tabbar a {
    min-height: 0; height: 100%; gap: 2px; padding: 0 2px; border-radius: 999px; font-size: 10.5px; font-weight: 650;
    color: rgba(31, 25, 18, 0.62); transition: background-color 0.25s var(--ease), transform 0.18s var(--ease), color 0.2s;
  }
  html.is-app:not([data-theme="light"]) .tabbar a { color: rgba(244, 238, 226, 0.62); }
  html.is-app .tabbar svg { width: 24px; height: 24px; }
  html.is-app .tabbar a:active { transform: scale(0.92); opacity: 1; }
  /* the open tab: a lens of lighter glass, the icon in Kofe's lamp gold */
  html.is-app .tabbar a[aria-current="page"] {
    color: #a86f12; background: rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 1), inset 0 0 0 0.5px rgba(255, 255, 255, 0.8), 0 2px 8px -3px rgba(40, 25, 8, 0.22);
  }
  html.is-app:not([data-theme="light"]) .tabbar a[aria-current="page"] {
    color: #f0bc63; background: rgba(255, 255, 255, 0.13);
    box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.25), inset 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  }
  html.is-app .tabbar a[aria-current="page"] .av { box-shadow: 0 0 0 2px currentColor; }
  html.is-app .tabbar .badge { top: 5px; left: calc(50% + 7px); }

  /* "Open your room": its own round glass button beside the bar */
  html.is-app .tabbar .tab-open {
    position: absolute; top: 50%; right: calc(-1 * (var(--btn) + var(--gap))); width: var(--btn); height: var(--btn); margin-top: calc(var(--btn) / -2);
    padding: 0; border-radius: 50%; display: grid; place-items: center; color: #3a2705;
    background: radial-gradient(120% 120% at 30% 15%, rgba(255, 236, 190, 0.95), rgba(232, 172, 72, 0.88) 55%, rgba(201, 138, 40, 0.9));
    -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
    box-shadow:
      inset 0 1px 0.5px rgba(255, 255, 255, 0.9),
      inset 0 -2px 4px rgba(120, 70, 0, 0.25),
      0 0 0 0.5px rgba(120, 70, 0, 0.2),
      0 12px 28px -10px rgba(170, 110, 20, 0.55);
  }
  html.is-app .tabbar .tab-open > span { display: none; }
  html.is-app .tabbar .tab-open i { width: auto; height: auto; background: none; color: inherit; }
  html.is-app .tabbar .tab-open i svg { width: 26px; height: 26px; }
  html.is-app .tabbar .tab-open[aria-current="page"] { background: radial-gradient(120% 120% at 30% 15%, #ffefc9, #e6a63f 60%, #c1852a); }

  /* the bar floats: the page can scroll under it, and steps aside while you type */
  html.is-app .main { padding-bottom: calc(var(--tab-h) + 48px + env(safe-area-inset-bottom, 0px)); }
  html.is-app .toast { bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom, 0px)); }
  html.is-app.kb-open .tabbar { transform: translateY(calc(100% + 60px)); opacity: 0; }
}
@media (max-width: 760px) {
  html.is-app .tabbar { background: rgba(252, 248, 241, 0.5); -webkit-backdrop-filter: blur(28px) saturate(1.9) brightness(1.06); backdrop-filter: blur(28px) saturate(1.9) brightness(1.06); }
  html.is-app:not([data-theme="light"]) .tabbar { background: rgba(40, 33, 26, 0.55); }
  html.is-app .tabbar a.tab-open, html.is-app:not([data-theme="light"]) .tabbar a.tab-open { color: #3a2705; }
}
/* "+" back in the middle of the glass bar, as a round gold glass button inside it */
@media (max-width: 760px) {
  html.is-app .tabbar { right: 14px; }
  html.is-app .tabbar .tab-open {
    position: relative; top: auto; right: auto; margin: 0 auto; align-self: center; justify-self: center;
    width: 50px; height: 50px; min-height: 0;
  }
  html.is-app .tabbar .tab-open i svg { width: 24px; height: 24px; }
  html.is-app .tabbar .tab-open:active { transform: scale(0.9); }
}
/* quieter, more elegant: a slimmer bar, finer type, a small ink-and-brass "+" */
@media (max-width: 760px) {
  html.is-app .tabbar { --h: 58px; height: var(--h); min-height: var(--h); padding: 4px 5px; }
  html.is-app .tabbar a { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; gap: 3px; }
  html.is-app .tabbar svg { width: 22px; height: 22px; stroke-width: 1.6; }
  html.is-app .tabbar a[aria-current="page"] { color: #8f6420; background: rgba(255, 255, 255, 0.55); }
  html.is-app:not([data-theme="light"]) .tabbar a[aria-current="page"] { color: #e8c58a; background: rgba(255, 255, 255, 0.1); }
  html.is-app .tabbar .badge {
    top: 6px; left: calc(50% + 5px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    font-size: 9.5px; font-weight: 700; line-height: 16px; background: #c8913a; color: #fffaf0;
    box-shadow: 0 0 0 1.5px rgba(252, 248, 241, 0.9);
  }
  html.is-app:not([data-theme="light"]) .tabbar .badge { box-shadow: 0 0 0 1.5px rgba(40, 33, 26, 0.9); }
  html.is-app .tabbar .av { --size: 24px; width: 24px !important; height: 24px !important; font-size: 10px !important; }

  /* "+": a small ink circle with a brass cross, the way a fine pen cap catches light */
  html.is-app .tabbar a.tab-open, html.is-app:not([data-theme="light"]) .tabbar a.tab-open {
    width: 42px; height: 42px; color: #e6c27e;
    background: linear-gradient(180deg, #34291f 0%, #1c1611 100%);
    box-shadow: inset 0 1px 0 rgba(255, 240, 210, 0.22), inset 0 0 0 0.5px rgba(230, 194, 126, 0.35), 0 6px 14px -6px rgba(20, 12, 4, 0.55);
  }
  html.is-app:not([data-theme="light"]) .tabbar a.tab-open {
    color: #2a1f14; background: linear-gradient(180deg, #faf4e8 0%, #e9dfcd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 14px -6px rgba(0, 0, 0, 0.6);
  }
  html.is-app .tabbar .tab-open i svg { width: 19px; height: 19px; stroke-width: 1.8; }
  html.is-app .tabbar .tab-open[aria-current="page"] { background: linear-gradient(180deg, #3d3024, #211a14); }
}
/* "+": light and delicate — a little frosted-glass disc with a fine brass ring and a brass cross */
@media (max-width: 760px) {
  html.is-app .tabbar a.tab-open {
    width: 42px; height: 42px; color: #a8762a;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 243, 230, 0.85) 100%);
    box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(200, 145, 58, 0.45), 0 4px 12px -5px rgba(150, 100, 30, 0.35);
  }
  html.is-app:not([data-theme="light"]) .tabbar a.tab-open {
    color: #e8c58a;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(232, 197, 138, 0.45), 0 4px 12px -5px rgba(0, 0, 0, 0.5);
  }
  html.is-app .tabbar .tab-open[aria-current="page"] { background: linear-gradient(180deg, #fffaf0, #f3e4c6); }
  html.is-app .tabbar .tab-open i svg { stroke-width: 1.6; }
}

/* ---- the liquid lens under the open tab (moved by native.js) */
@media (max-width: 760px) {
  html.is-app .tabbar { touch-action: none; }
  html.is-app .tabbar > a { position: relative; z-index: 1; }
  html.is-app .tabbar a[aria-current="page"]:not(.tab-open),
  html.is-app:not([data-theme="light"]) .tabbar a[aria-current="page"]:not(.tab-open) { background: transparent; box-shadow: none; }
  .tb-lens {
    position: absolute; left: 0; top: 4px; bottom: 4px; z-index: 0; border-radius: 999px; pointer-events: none;
    transform-origin: 50% 50%; will-change: transform;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5));
    box-shadow: inset 0 1px 0.5px #fff, inset 0 -1px 1px rgba(255, 255, 255, 0.5), inset 0 0 0 0.5px rgba(255, 255, 255, 0.9), 0 3px 10px -4px rgba(40, 25, 8, 0.25);
    transition: opacity 0.2s, background 0.25s, box-shadow 0.25s;
  }
  html.is-app:not([data-theme="light"]) .tb-lens {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
    box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.3), inset 0 0 0 0.5px rgba(255, 255, 255, 0.16), 0 3px 10px -4px rgba(0, 0, 0, 0.4);
  }
  /* held: the drop swells and turns clear, like water lifting off the glass */
  .tb-lens.is-press {
    background: radial-gradient(120% 140% at 50% 0%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12) 70%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95), inset 0 2px 2px rgba(255, 255, 255, 0.9), inset 0 -3px 6px rgba(255, 255, 255, 0.35), 0 10px 26px -8px rgba(40, 25, 8, 0.38);
    -webkit-backdrop-filter: saturate(1.8) brightness(1.08); backdrop-filter: saturate(1.8) brightness(1.08);
  }
  .tb-lens.is-off { opacity: 0; }
  html.is-app .tabbar.tb-dragging a[aria-current="page"]:not(.is-under) { color: rgba(31, 25, 18, 0.62); }
  html.is-app:not([data-theme="light"]) .tabbar.tb-dragging a[aria-current="page"]:not(.is-under) { color: rgba(244, 238, 226, 0.62); }
  html.is-app .tabbar a.is-under { color: #8f6420; }
  html.is-app:not([data-theme="light"]) .tabbar a.is-under { color: #e8c58a; }
}

/* ---- a room's writing bar, the same as in messages: the field in a glass pill, the microphone on the right
 * (hold it to talk, let go to send, slide left to throw it away), and send appears once you write */
@media (max-width: 600px) {
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer.tg { gap: 6px; align-items: flex-end; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important; }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer.tg textarea,
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer.tg textarea:focus {
    background: transparent; box-shadow: none; border-radius: 0; min-height: 44px; padding: 11px 4px; color: var(--w-ink);
  }
  html.is-app[data-theme="light"].room-app .scene[style*="--room-img"] .talk .composer.tg textarea { color: #1f1912; }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer.tg .cmp-pill { background: rgba(255, 255, 255, 0.9); box-shadow: inset 0 0 0 1px rgba(60, 40, 20, 0.12), 0 4px 14px -10px rgba(40, 25, 8, 0.35); }
  html.is-app:not([data-theme="light"]).room-app .scene[style*="--room-img"] .talk .composer.tg .cmp-pill { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer.tg .cmp-pill:focus-within { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--w-lamp, #e0a23a) 60%, transparent); }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer.tg .tool-btn { width: 40px; height: 44px; }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer.tg .cmp-round { width: 44px; height: 44px; }
  html.is-app.room-app .scene[style*="--room-img"] .talk .composer.tg .tool-voice { background: rgba(255, 255, 255, 0.9); color: #1f1912; box-shadow: inset 0 0 0 1px rgba(60, 40, 20, 0.12); }
  html.is-app:not([data-theme="light"]).room-app .scene[style*="--room-img"] .talk .composer.tg .tool-voice { background: rgba(255, 255, 255, 0.1); color: var(--w-ink); }
}
@media (max-width: 760px) { html.is-app .tabbar a { -webkit-user-drag: none; user-drag: none; } }

/* ================================================================
 * Rooms home on a phone: "Open now" is a row of story cards you swipe left and right
 * ================================================================ */
@media (max-width: 760px) {
  .tier-now .doors-story > * { flex: 0 0 46%; min-height: 0; aspect-ratio: 3 / 4.6; padding: 14px 12px 12px; scroll-snap-align: start; border-radius: 120px 120px 22px 22px; }
  .tier-now .doors-story > :only-child { flex-basis: 62%; }
  .tier-now .doors-story .rc-topic { font-size: 11.5px; letter-spacing: 0.02em; }
  .tier-now .doors-story .rc-q { font-size: 16.5px; line-height: 1.2; margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .tier-now .doors-story .rc-foot { min-height: 0; flex-direction: column; align-items: flex-start; gap: 6px; }
  .tier-now .doors-story .rc-state { font-size: 12px; gap: 6px; }
  .tier-now .doors-story .rc-faces .av { width: 20px !important; height: 20px !important; }
  .tier-now .doors-story .rc-act { display: none; }
  .tier-now .doors-story .skel-card { flex: 0 0 46%; aspect-ratio: 3 / 4.6; border-radius: 120px 120px 22px 22px; }
  .tier-now { margin-bottom: 6px; }
}
.now-empty {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; text-decoration: none; color: var(--ink);
  background: var(--glass-2, rgba(255, 255, 255, 0.55)); box-shadow: inset 0 1px 0 var(--glass-top, #fff), inset 0 0 0 1px var(--glass-edge, rgba(0, 0, 0, 0.06));
}
.now-empty b { display: block; font-size: 15.5px; }
.now-empty small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.ne-ic { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #a8762a; background: linear-gradient(180deg, #fff, #f6ecda); box-shadow: inset 0 0 0 1px rgba(200, 145, 58, 0.4); }
.ne-ic svg { width: 20px; height: 20px; }

/* ================================================================
 * Opening a room on a phone: three calm steps, one screen each
 * ================================================================ */
.cw {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px); background: var(--bg); color: var(--ink);
}
.cw-top { flex: none; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 12px; padding: 6px 12px 4px; }
.cw-ic { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; text-decoration: none; }
.cw-ic svg { width: 22px; height: 22px; }
.cw-ic:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.cw-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cw-steps i { height: 4px; border-radius: 4px; background: var(--line-2); transition: background-color 0.3s var(--ease); }
.cw-steps i.is-on { background: var(--lamp); }
.cw-form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cw-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 20px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cw-pane { display: grid; gap: 14px; align-content: start; animation: cw-in 0.35s var(--ease) both; }
@keyframes cw-in { from { opacity: 0; transform: translateX(16px); } }
.cw-pane h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.1; letter-spacing: -0.01em; }
.cw-lead { margin: -6px 0 2px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.cw-k { margin: 4px 0 -4px; color: var(--muted); font-size: 13px; font-weight: 650; }
.cw-topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cw-topics .topic-tile { min-height: 0; aspect-ratio: 1 / 1.08; border-radius: 60px 60px 16px 16px; }
.cw-topics .topic-tile span { font-size: 12.5px; }
.cw-topics .topic-tile[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px var(--lamp); }
.cw-chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--glass-2, rgba(255, 255, 255, 0.6)); box-shadow: inset 0 0 0 1px var(--glass-edge, rgba(0, 0, 0, 0.06)); font-size: 13.5px; font-weight: 650; }
.cw-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: var(--x, 50%) 50%; }
.cw-q textarea { min-height: 112px; font-family: var(--display); font-size: 21px; line-height: 1.3; padding: 14px 16px; border-radius: 18px; }
.cw .ideas { display: grid; gap: 8px; }
.cw-preview { display: grid; justify-items: center; }
.cw-preview .room-card { width: min(62%, 240px); min-height: 0; aspect-ratio: 3 / 4.3; border-radius: 140px 140px 22px 22px; padding: 16px 14px 14px; }
.cw-preview .rc-q { font-size: 18px; }
.cw-hello textarea { min-height: 64px; border-radius: 16px; }
.cw-opts { display: grid; gap: 10px; }
.cw-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 16px; background: var(--glass-2, rgba(255, 255, 255, 0.55)); box-shadow: inset 0 0 0 1px var(--glass-edge, rgba(0, 0, 0, 0.06)); }
.cw-opt > span, .cw-opt > label { font-weight: 650; font-size: 15px; }
.cw-opt input { min-height: 40px; border: 0; background: transparent; color: var(--ink); font: inherit; }
.cw-go { flex: none; padding: 8px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.cw-go .err:empty { display: none; }
.cw-go .err { margin: 0 0 8px; text-align: center; }
.cw-next { width: 100%; min-height: 54px; border: 0; border-radius: 16px; background: var(--btn); color: var(--btn-ink); font: inherit; font-size: 17px; font-weight: 650; cursor: pointer; transition: transform 0.12s ease; }
.cw-next:active { transform: scale(0.98); }
.cw-next:disabled { opacity: 0.55; }
html.kb-open .cw-go { padding-bottom: 8px; }

/* ================================================================ Games */
.games { display: grid; gap: 16px; }
.game-card {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  min-height: 300px; padding: 22px 20px; border-radius: 28px; color: #f4eee2; text-decoration: none;
  box-shadow: 0 24px 50px -26px rgba(30, 18, 6, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.game-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(12, 9, 7, 0.1), rgba(12, 9, 7, 0.35) 45%, rgba(12, 9, 7, 0.92)); }
.gc-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.gc-cards { position: absolute; top: 22px; right: 18px; display: flex; }
.gc-cards img { width: 54px; height: auto; border-radius: 6px; box-shadow: 0 10px 20px -6px rgba(0, 0, 0, 0.6); }
.gc-cards img + img { margin-left: -26px; }
.gc-cards img:nth-child(1) { transform: rotate(-12deg) translateY(6px); }
.gc-cards img:nth-child(2) { transform: rotate(-4deg); }
.gc-cards img:nth-child(3) { transform: rotate(4deg); }
.gc-cards img:nth-child(4) { transform: rotate(12deg) translateY(6px); }
.gc-text { display: grid; gap: 4px; max-width: 32ch; }
.gc-text small { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #e2bd76; }
.gc-text b { font-family: var(--display); font-weight: 500; font-size: 34px; line-height: 1.05; }
.gc-text span { font-size: 14.5px; line-height: 1.4; color: rgba(244, 238, 226, 0.82); }
.gc-go { align-self: flex-start; margin-top: 10px; padding: 11px 26px; border-radius: 999px; background: #f4eee2; color: #1f1912; font-weight: 700; font-size: 15px; }
.game-card:active { transform: scale(0.985); transition: transform 0.12s ease; }
.game-card.is-soon { min-height: 220px; }
.game-card.is-soon .gc-bg { filter: saturate(0.7) brightness(0.85); }
.gc-soon {
  position: absolute; top: 18px; right: 18px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: #fff; background: rgba(255, 255, 255, 0.18); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.ph-tools { display: inline-flex; gap: 8px; align-items: center; }
.ph-friends { position: relative; }
.ph-friends .badge { position: absolute; top: -4px; right: -4px; }

/* ================================================================
 * Messages: stories on top, then Chats | Friends
 * ================================================================ */
.stories { display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; margin: -2px calc(var(--gutter) * -1) 12px; padding: 4px var(--gutter) 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.stories::-webkit-scrollbar { display: none; }
.sto { position: relative; flex: none; width: 68px; display: grid; justify-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; text-align: center; -webkit-tap-highlight-color: transparent; }
.sto-hit { display: grid; justify-items: center; gap: 5px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.sto b { max-width: 68px; font-size: 11.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sto-ring { width: 68px; height: 68px; border-radius: 50%; padding: 3.5px; display: grid; place-items: center; background: conic-gradient(from 200deg, #ffd56b, #ff9f43, #f2545b, #d6336c, #b23a9a, #f2545b, #ff9f43, #ffd56b); box-shadow: 0 2px 10px -2px rgba(242, 84, 91, 0.45); transition: transform 0.15s ease; }
.sto-ring .av { width: 55px !important; height: 55px !important; box-shadow: 0 0 0 3px var(--bg) !important; }
.sto-ring.is-seen { box-shadow: none; background: radial-gradient(closest-side, transparent calc(100% - 1.6px), color-mix(in srgb, var(--ink) 24%, transparent) calc(100% - 1.4px)); }
.sto-ring.is-none { background: none; }
.sto:active .sto-ring, .sto-hit:active .sto-ring { transform: scale(0.94); }
.sto-plus { position: absolute; top: 46px; right: 1px; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--bg); display: grid; place-items: center; padding: 0; background: linear-gradient(160deg, #ff9f43, #f2545b); color: #fff; cursor: pointer; }
.sto-plus svg { width: 13px; height: 13px; stroke-width: 2.6; }

.msg-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0 0 12px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.msg-seg button { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.msg-seg button[aria-selected="true"] { background: var(--raised, #fff); color: var(--ink); box-shadow: 0 1px 3px rgba(30, 20, 8, 0.14); }
.msg-seg .badge { position: static; }

/* friends, as a calm list */
.fl { display: grid; }
.fl-req { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 0 0 8px; border-radius: 18px; background: var(--glass-2, rgba(255, 255, 255, 0.6)); box-shadow: inset 0 1px 0 var(--glass-top, #fff), inset 0 0 0 1px var(--glass-edge, rgba(0, 0, 0, 0.05)); }
.fl-t { flex: 1; min-width: 0; display: grid; text-decoration: none; color: var(--ink); }
.fl-t b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-t small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.fl-t small.is-live { color: #8f6420; font-weight: 650; }
:root:not([data-theme="light"]) .fl-t small.is-live { color: #e8c58a; }
.fl-ok { flex: none; padding: 8px 14px; border: 0; border-radius: 999px; background: #e3ad54; color: #2a1c05; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.fl-no { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); cursor: pointer; }
.fl-no svg { width: 14px; height: 14px; }
.fl-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.fl-face { position: relative; flex: none; display: block; }
.fl-dot { position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; background: #e3ad54; border: 2.5px solid var(--bg); }
.fl-go { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font: inherit; font-weight: 650; font-size: 13.5px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.fl-go svg { width: 15px; height: 15px; }
.fl-go.is-join { background: var(--btn); color: var(--btn-ink); }
.fl-k { margin: 18px 2px 2px; font-size: 13px; font-weight: 650; color: var(--muted); }
.fl-find { display: flex; justify-content: center; padding: 16px 0 8px; }
.fl-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 36px 16px; color: var(--muted); }
.fl-empty b { color: var(--ink); font-size: 18px; }

/* ---- the story viewer: full screen, the bars on top, the reply below */
html.sv-open, html.sv-open body { overflow: hidden; }
html.sv-open .tabbar { opacity: 0; pointer-events: none; }
.sv { position: fixed; inset: 0; z-index: 200; background: #0b0907; color: #fff; overflow: hidden; touch-action: none; animation: sv-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; -webkit-user-select: none; user-select: none; }
@keyframes sv-in { from { opacity: 0; transform: scale(0.96); } }
.sv-stage { position: absolute; inset: 0; display: grid; place-items: end start; }
.sv-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sv-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 22%, transparent 55%, rgba(0, 0, 0, 0.6)); pointer-events: none; }
.sv-words { position: relative; z-index: 1; margin: 0 22px calc(130px + env(safe-area-inset-bottom, 0px)); font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.25; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55); white-space: pre-wrap; }
.sv-stage.is-text { place-items: center; }
.sv-stage.is-text::after { display: none; }
.sv-stage.is-text .sv-words { margin: 0 28px; font-size: 32px; text-align: center; text-shadow: none; }
.tint-cream { background: radial-gradient(120% 80% at 30% 20%, #fffaf0, #efe3c8); color: #2a1f14; }
.tint-walnut { background: radial-gradient(120% 80% at 30% 20%, #6b4a2e, #2a1c12); color: #f6ecda; }
.tint-burgundy { background: radial-gradient(120% 80% at 30% 20%, #7a2b33, #2e0f13); color: #f8e6e0; }
.tint-sage { background: radial-gradient(120% 80% at 30% 20%, #a9b89a, #5d6b52); color: #fbfaf2; }
.tint-night { background: radial-gradient(120% 80% at 30% 20%, #2b3448, #0d1018); color: #eef1f8; }
.sv-top { position: absolute; z-index: 3; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 0; }
.sv-bars { display: flex; gap: 4px; }
.sv-bars i { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.sv-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sv-bars i.is-done b { width: 100%; }
.sv-who { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.sv-who span { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.sv-who b { font-size: 15px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }
.sv-who small { font-size: 13px; opacity: 0.75; }
.sv-ic { width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; background: none; color: #fff; cursor: pointer; }
.sv-ic svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4)); }
.sv-only { display: table; margin: 8px auto 0; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 650; background: rgba(0, 0, 0, 0.32); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sv-stage.is-text ~ .sv-top .sv-only, .sv-stage.is-text ~ .sv-top .sv-who { color: inherit; }
.sv-tap { position: absolute; z-index: 2; top: 120px; bottom: 120px; border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sv-prev { left: 0; width: 33%; }
.sv-next { right: 0; width: 67%; }
.sv-reply { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 8px; }
.sv-reply input { flex: 1; min-width: 0; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.55); background: rgba(0, 0, 0, 0.22); color: #fff; font: inherit; font-size: 16px; outline: none; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sv-reply input::placeholder { color: rgba(255, 255, 255, 0.8); }
.sv-react { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.sv-react.is-pop { animation: sv-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes sv-pop { 40% { transform: scale(1.5); } }

/* ---- adding to your story */
.story-sheet h2 { margin: 0 0 4px; }
.ss-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 12px; }
.ss-kinds button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.ss-kinds button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.ss-kinds svg { width: 19px; height: 19px; }
.ss-aa { font-family: var(--display); font-size: 18px; }
.ss-card { position: relative; display: grid; gap: 10px; padding: 12px; border-radius: 20px; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.ss-card img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px; }
.ss-card textarea { width: 100%; min-height: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 17px; resize: none; outline: none; padding: 6px 4px; }
.ss-card[class*="tint-"] { min-height: 180px; place-items: center; }
.ss-card[class*="tint-"] textarea { font-family: var(--display); font-size: 24px; text-align: center; }
.ss-card[class*="tint-"] textarea::placeholder { color: inherit; opacity: 0.55; }
.ss-pick { display: grid; justify-items: center; gap: 8px; padding: 34px 10px; border: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 14px; background: none; color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.ss-pick svg { width: 26px; height: 26px; }
.ss-tints { display: flex; gap: 10px; justify-content: center; margin: 12px 0 2px; }
.ss-tints button { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.ss-tints button[aria-checked="true"] { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px #e3ad54; }
.ss-go { width: 100%; margin-top: 12px; min-height: 50px; }
.story-sheet .err:empty { display: none; }
.sv-who .av { width: 34px !important; height: 34px !important; flex: none; font-size: 13px !important; }
.ss-card.tint-cream { background: radial-gradient(120% 80% at 30% 20%, #fffaf0, #efe3c8); color: #2a1f14; }
.ss-card.tint-walnut { background: radial-gradient(120% 80% at 30% 20%, #6b4a2e, #2a1c12); color: #f6ecda; }
.ss-card.tint-burgundy { background: radial-gradient(120% 80% at 30% 20%, #7a2b33, #2e0f13); color: #f8e6e0; }
.ss-card.tint-sage { background: radial-gradient(120% 80% at 30% 20%, #a9b89a, #5d6b52); color: #fbfaf2; }
.ss-card.tint-night { background: radial-gradient(120% 80% at 30% 20%, #2b3448, #0d1018); color: #eef1f8; }
.ss-tints .tint-cream { background: #f6ecd8; } .ss-tints .tint-walnut { background: #4a3220; } .ss-tints .tint-burgundy { background: #5a1f26; } .ss-tints .tint-sage { background: #8a9a7c; } .ss-tints .tint-night { background: #1c2232; }
html.is-app .ss-card[class*="tint-"] textarea, .ss-card[class*="tint-"] textarea { font-size: 24px; line-height: 1.3; }
/* games: just the picture, the name and one quiet label */
.game-card { justify-content: flex-end; min-height: 250px; padding: 20px; }
.game-card::before { background: linear-gradient(180deg, rgba(12, 9, 7, 0) 40%, rgba(12, 9, 7, 0.72)); }
.game-card.is-soon { min-height: 200px; }
.gc-pill { position: absolute; top: 18px; left: 18px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.02em; color: #fff;
  background: rgba(255, 255, 255, 0.16); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.game-card.is-soon .gc-pill { left: auto; right: 18px; }
.gc-live { width: 7px; height: 7px; border-radius: 50%; background: #f2c46b; box-shadow: 0 0 0 3px rgba(242, 196, 107, 0.25); animation: gc-pulse 2s ease-in-out infinite; }
@keyframes gc-pulse { 50% { box-shadow: 0 0 0 6px rgba(242, 196, 107, 0); } }
.gc-cards { top: 16px; right: 16px; }
.gc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.gc-name { font-family: var(--display); font-weight: 500; font-size: 40px; line-height: 1; letter-spacing: -0.01em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.gc-foot .gc-go { margin: 0; padding: 11px 24px; background: rgba(255, 255, 255, 0.92); }

/* ------------------------------------------------------------------ the story maker (story-editor.js) */
html.se-open, html.se-open body { overflow: hidden; }
.se { position: fixed; inset: 0; z-index: 260; background: #000; color: #fff; font-family: -apple-system, "Hanken Grotesk", "Noto Sans Armenian", Helvetica, sans-serif; -webkit-user-select: none; user-select: none; animation: sv-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.se button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.se svg { width: 24px; height: 24px; display: block; }
.se-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.32); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.se-ic.is-on { background: #fff; color: #111; }
.se-aa { font: 700 19px/1 -apple-system, Helvetica, sans-serif; letter-spacing: -0.02em; }

/* where it starts */
.se-src { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(120% 70% at 50% 0%, #3a2a1c, #0b0907 70%); }
.se-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 14px; }
.se-src-in { width: min(340px, 86vw); text-align: center; }
.se-src-in h2 { margin: 0 0 8px; font: 500 30px/1.1 "Bodoni Moda", "Noto Serif Armenian", Georgia, serif; }
.se-src-in p { margin: 0 0 30px; color: rgba(255, 255, 255, 0.66); font-size: 15px; line-height: 1.4; }
.se-src-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.se .se-src-btns button { display: grid; justify-items: center; gap: 10px; padding: 18px 6px 14px; border-radius: 22px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); transition: transform 0.15s; }
.se-src-btns button:active { transform: scale(0.95); }
.se-src-btns span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, #f6dfb0, #c8913a); color: #2a1c12; }
.se-src-btns span svg { width: 26px; height: 26px; }
.se-src-btns span.se-aa { font-size: 22px; }
.se-src-btns b { font-size: 14px; font-weight: 600; }

/* the picture: always 9 by 16, like the story friends will see */
.se-stage { position: absolute; inset: 0; }
.se-canvas { touch-action: none; position: absolute; left: 50%; top: calc(6px + env(safe-area-inset-top, 0px)); width: min(100vw, calc((100dvh - 86px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 9 / 16)); aspect-ratio: 9 / 16; transform: translateX(-50%); border-radius: 18px; overflow: hidden; background: #1a1410; }
.se-bg { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center; pointer-events: none; will-change: transform; }
.se-items { position: absolute; inset: 0; }
.se-item { position: absolute; transform-origin: center; touch-action: none; will-change: transform; }
.se-item.is-held { opacity: 0.92; }
.se-text { max-width: 82%; width: max-content; font-size: 28px; line-height: 1.22; text-align: center; color: var(--c); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); white-space: pre-wrap; overflow-wrap: anywhere; }
.se-text.has-box { text-shadow: none; }
.se-text.has-box { background: var(--bc); padding: 4px 12px; border-radius: 10px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* the song sticker */
.se-music { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 16px; max-width: 78%; min-width: 180px; text-align: left; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }
.se-music img, .se-music .se-mart { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; background: rgba(0, 0, 0, 0.12); pointer-events: none; }
.se-music .se-mart svg { width: 22px; height: 22px; }
.se-mt { display: grid; min-width: 0; flex: 1; }
.se-mt b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-mt small { font-size: 12px; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-music.look-light { background: #fff; color: #17120d; }
.se-music.look-dark { background: rgba(20, 15, 10, 0.86); color: #fff; }
.se-music.look-clear { background: rgba(255, 255, 255, 0.18); color: #fff; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.3); }
.se-wave { display: flex; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.se-wave i { width: 3px; border-radius: 2px; background: currentColor; opacity: 0.8; animation: se-wave 0.9s ease-in-out infinite; }
.se-wave i:nth-child(2) { animation-delay: -0.3s; } .se-wave i:nth-child(3) { animation-delay: -0.6s; } .se-wave i:nth-child(4) { animation-delay: -0.15s; }
.se-wave.is-muted i { animation: none; height: 3px; }
@keyframes se-wave { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* the bin */
.se-bin { position: absolute; left: 50%; bottom: 26px; width: 54px; height: 54px; margin-left: -27px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.4); border: 1.5px solid rgba(255, 255, 255, 0.6); opacity: 0; transform: scale(0.6); transition: opacity 0.2s, transform 0.2s, background 0.2s; pointer-events: none; }
.se-dragging .se-bin { opacity: 1; transform: scale(1); }
.se-bin.is-over { background: #e0533d; border-color: #e0533d; transform: scale(1.2); }
.se-dragging .se-top, .se-dragging .se-bottom { opacity: 0; pointer-events: none; }

/* the tools above */
.se-top { position: absolute; left: 50%; top: calc(18px + env(safe-area-inset-top, 0px)); width: min(100vw, calc((100dvh - 86px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 9 / 16)); transform: translateX(-50%); padding: 0 12px; display: flex; justify-content: space-between; align-items: flex-start; transition: opacity 0.2s; }
.se-tools { display: grid; gap: 12px; }
.se-tintbtn i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; }
.se-lookname { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font: 500 30px "Bodoni Moda", Georgia, serif; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; }
.se-lookname.is-on { animation: se-name 1.1s ease both; }
@keyframes se-name { 0% { opacity: 0; transform: scale(0.94); } 20%, 60% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* sharing, below */
.se-bottom { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: flex-end; padding: 0 16px; transition: opacity 0.2s; }
.se .se-share { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 16px 0 22px; border-radius: 999px; background: #fff !important; color: #17120d !important; font-weight: 650 !important; font-size: 16px !important; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.se-share svg { width: 18px; height: 18px; }
.se-share:disabled { opacity: 0.7; }

/* writing */
.se-te { position: absolute; inset: 0; z-index: 3; background: rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(70px + env(safe-area-inset-top, 0px)) 18px 0; touch-action: auto; }
html.kb-open .se-te { justify-content: flex-start; padding-top: calc(130px + env(safe-area-inset-top, 0px)); }
.se-te-top { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; right: 14px; display: flex; align-items: center; gap: 10px; }
.se .se-pill { height: 36px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.92) !important; color: #17120d !important; font-weight: 650 !important; font-size: 14px !important; }
.se .se-done { margin-left: auto; height: 36px; padding: 0 6px; font-weight: 700 !important; font-size: 17px !important; }
.se .se-ta { font-size: 28px !important; color: var(--c) !important; width: 100%; max-width: 360px; resize: none; border: 0; outline: 0; background: transparent; color: var(--c); font-size: 28px; line-height: 1.22; text-align: center; caret-color: #f2c46b; padding: 4px 12px; -webkit-user-select: text; user-select: text; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); overflow: hidden; }
.se .se-ta.has-box { text-shadow: none; background: var(--bc); border-radius: 10px; }
.se-colors { position: absolute; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 12px; }
html.kb-open .se-colors { bottom: auto; top: calc(66px + env(safe-area-inset-top, 0px)); }
.se .se-colors button { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.9) !important; transition: transform 0.15s; }
.se-colors button.is-on { transform: scale(1.22); }

/* choosing a song */
.se-mp { position: absolute; inset: 0; z-index: 4; background: rgba(0, 0, 0, 0.4); display: flex; align-items: flex-end; touch-action: auto; }
.se-mp-sheet { width: 100%; height: 72dvh; background: #1c1712; border-radius: 22px 22px 0 0; padding: 10px 16px 0; display: flex; flex-direction: column; animation: se-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
html.kb-open .se-mp-sheet { height: 88dvh; }
@keyframes se-up { from { transform: translateY(100%); } }
.se-mp-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 10px; }
.se-mp-head b { font-size: 17px; }
.se-mp-head .se-ic { width: 34px; height: 34px; background: rgba(255, 255, 255, 0.1); }
.se-mp-head .se-ic svg { width: 18px; height: 18px; }
.se-msearch { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.1); }
.se-msearch svg { width: 18px; height: 18px; opacity: 0.6; }
.se-msearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 16px; -webkit-appearance: none; appearance: none; }
.se-mlist { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px)); }
.se-mlist.is-looking { opacity: 0.5; }
.se-mrow { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.se .se-mpick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 9px 0; text-align: left; }
.se-mpick img, .se-mpick .se-mart { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); }
.se-mpick span:last-child { display: grid; min-width: 0; }
.se-mpick b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se-mpick small { font-size: 13px; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.se .se-mplay { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1) !important; flex: none; }
.se-mplay svg { width: 16px; height: 16px; }
.se-mplay svg + svg, .se-mplay.is-on svg:first-child { display: none; }
.se-mplay.is-on svg + svg { display: block; }
.se-mnone { text-align: center; opacity: 0.6; padding: 30px 0; font-size: 14px; }

/* the viewer keeps the 9 by 16 picture covering the screen, and the song where it was put */
.sv-frame { position: absolute; left: 50%; top: env(safe-area-inset-top, 0px); width: min(100vw, (100dvh - env(safe-area-inset-top, 0px)) * 9 / 16); aspect-ratio: 9 / 16; transform: translateX(-50%); border-radius: 0 0 18px 18px; overflow: hidden; }
.sv-over { overflow: visible; }
.sv-frame .sv-pic { position: absolute; inset: 0; }
.sv-frame .se-music { font-size: 16px; }
.sv-over { z-index: 3; pointer-events: none; }
.sv-music { pointer-events: auto; position: absolute; font: inherit; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sv .se-music { font-family: -apple-system, "Hanken Grotesk", Helvetica, sans-serif; }

.se-stage:has(~ .se-te) .se-top, .se-stage:has(~ .se-te) .se-bottom, .se-stage:has(~ .se-mp) .se-top { display: none; }

/* sheets leave the way they came */
.sheet-back.is-leaving { animation: sh-fade-out 0.18s ease both; }
.sheet-back.is-leaving .sheet { transition: transform 0.18s ease; transform: translateY(60px); }
@keyframes sh-fade-out { to { opacity: 0; } }
.sheet-back, .rm-veil, .se-mp { cursor: pointer; }
.sheet, .rm-sheet, .se-mp-sheet { cursor: auto; }
.sheet.is-pulled, .rm-sheet.is-pulled { transition: none !important; animation: none !important; }

/* arriving from a sideways slide between the four places */
html[data-slide="left"] #main { animation: tab-from-right 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
html[data-slide="right"] #main { animation: tab-from-left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes tab-from-right { from { transform: translateX(36%); opacity: 0; } }
@keyframes tab-from-left { from { transform: translateX(-36%); opacity: 0; } }

/* holding your own story circle */
.k-pop { position: fixed; z-index: 150; display: grid; min-width: 220px; padding: 6px; border-radius: 16px; background: rgba(251, 247, 240, 0.88); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); box-shadow: 0 18px 50px -10px rgba(20, 12, 4, 0.45), 0 0 0 0.5px rgba(31, 25, 18, 0.12); color: #1f1912; animation: k-pop-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; transform-origin: 30px top; }
:root:not([data-theme="light"]) .k-pop { background: rgba(40, 33, 27, 0.88); color: #f4eee2; }
.k-pop button { display: flex; align-items: center; gap: 10px; padding: 12px; border: 0; border-radius: 11px; background: none; color: inherit; font: inherit; font-size: 15.5px; font-weight: 550; text-align: left; cursor: pointer; }
.k-pop button + button { border-top: 0.5px solid color-mix(in srgb, currentColor 14%, transparent); border-radius: 0 0 11px 11px; }
.k-pop svg { width: 19px; height: 19px; }
@keyframes k-pop-in { from { opacity: 0; transform: scale(0.85); } }
.sto { -webkit-touch-callout: none; }
.se-top, .se-bottom { pointer-events: none; }
.se-top button, .se-bottom button { pointer-events: auto; }

/* the story: your photos first, the camera in the corner */
.se-gal { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0d0b09; padding-top: env(safe-area-inset-top, 0px); }
.se-gal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px; }
.se-gal-head b { font-size: 17px; font-weight: 650; }
.se .se-flat { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.se-gal-sub { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; }
.se-gal-sub span { font-size: 16px; font-weight: 650; }
.se .se-gal-sub button { height: 32px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-size: 14px; font-weight: 600; }
.se-grid { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: min-content; gap: 2px; padding-bottom: env(safe-area-inset-bottom, 0px); align-content: start; }
.se .se-tile, .se .se-cam { position: relative; aspect-ratio: 9 / 15; overflow: hidden; background: #1d1915; display: block; }
.se-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-touch-callout: none; }
.se-tile:active img { opacity: 0.75; }
.se-tile.is-wait { animation: se-wait 1.2s ease-in-out infinite alternate; }
@keyframes se-wait { to { background: #2a241e; } }
.se .se-cam { display: grid; place-content: center; justify-items: center; gap: 8px; background: radial-gradient(120% 90% at 30% 10%, #4a3524, #1a130d); }
.se-cam span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, #ffd56b, #f2545b); color: #fff; box-shadow: 0 6px 20px rgba(242, 84, 91, 0.4); }
.se-cam span svg { width: 26px; height: 26px; }
.se-cam b, .se-more b { font-size: 13px; font-weight: 600; }
.se .se-more { display: grid; place-content: center; justify-items: center; gap: 8px; color: rgba(255, 255, 255, 0.85); }
.se-gal-note { margin: 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 13.5px; color: rgba(255, 255, 255, 0.65); }
.se-gal-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); }
.se-gal-busy i { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: se-spin 0.8s linear infinite; }
@keyframes se-spin { to { transform: rotate(1turn); } }
