/* ==========================================================================
   Misyan — components
   A single centred mobile-app frame, whatever the screen size.
   ========================================================================== */

/* --------------------------------------------------------------------------
   App frame and chrome
   -------------------------------------------------------------------------- */

.app-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
}

@media (min-width: 560px) {
  .app-frame {
    min-height: calc(100dvh - (var(--gap) * 2));
    border: 1px solid var(--line);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-frame);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(60px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

@media (min-width: 560px) {
  .topbar {
    top: var(--gap);
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  }
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
}

.topbar-brand img {
  display: block;
  width: 86px;
  height: 27px;
  object-fit: contain;
}

.topbar {
  background: color-mix(in srgb, var(--feature) 94%, transparent);
}

html[data-theme="dark"] .topbar {
  background: color-mix(in srgb, #111111 94%, transparent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar-avatar {
  margin-left: 6px;
  border-radius: 50%;
}

#main-outlet {
  min-width: 0;
  padding: 4px 18px 128px;
}

#main-outlet:focus {
  outline: none;
}

.page {
  min-height: 60dvh;
}

.page > *:not(.fab):not(script) {
  animation: rise-in 0.4s var(--ease-out) both;
}

/* Bottom dock */

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(var(--gap) + 12px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100vw - 24px), 428px);
  padding: 6px;
  border: 1px solid var(--dock-border);
  border-radius: var(--r-pill);
  background: var(--dock);
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.22);
  transform: translateX(-50%);
}

.dock-link {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 50px;
  border-radius: var(--r-pill);
  color: color-mix(in srgb, var(--dock-ink) 48%, transparent);
  transition: color 0.18s ease, background 0.18s ease, transform 0.14s ease;
}

.dock-link span {
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
}

.dock-link .icon {
  width: 20px;
  height: 20px;
}

.dock-link.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.dock-link:active {
  transform: scale(0.96);
}

.fab {
  position: fixed;
  right: max(18px, calc((100vw - 460px) / 2 + 18px));
  bottom: calc(var(--gap) + 88px + env(safe-area-inset-bottom));
  z-index: 55;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px rgba(255, 201, 60, 0.28);
  transition: transform 0.14s var(--ease), opacity 0.18s ease;
}

.fab .icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.9;
}

.fab:active {
  transform: scale(0.94);
}

/* --------------------------------------------------------------------------
   Wordmark
   -------------------------------------------------------------------------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  align-items: baseline;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.055em;
}

.wordmark img {
  display: block;
  width: 86px;
  height: 27px;
  object-fit: contain;
}

.wordmark .dot {
  margin-left: 1px;
  color: var(--accent);
}

.wordmark.on-dark {
  color: var(--on-dark);
}

.wordmark-sm {
  font-size: 19px;
}

/* --------------------------------------------------------------------------
   Avatars
   -------------------------------------------------------------------------- */

.avatar {
  --size: 40px;
  display: inline-grid;
  flex: none;
  width: var(--size);
  height: var(--size);
  place-items: center;
  border-radius: 50%;
  background: var(--av-bg);
  color: var(--av-ink);
  font-size: calc(var(--size) * 0.37);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  user-select: none;
}

.avatar.tone-0 {
  --av-bg: #ede7db;
  --av-ink: #3b352b;
}

.avatar.tone-1 {
  --av-bg: #e3dccd;
  --av-ink: #3b352b;
}

.avatar.tone-2 {
  --av-bg: #d9d1c1;
  --av-ink: #38322a;
}

.avatar.tone-3 {
  --av-bg: #f1e6ca;
  --av-ink: #3e341e;
}

.avatar.tone-4 {
  --av-bg: #e9e4d9;
  --av-ink: #3b352b;
}

.avatar.tone-5 {
  --av-bg: #ffc93c;
  --av-ink: #111111;
}

html[data-theme="dark"] .avatar.tone-0,
html[data-theme="dark"] .avatar.tone-1,
html[data-theme="dark"] .avatar.tone-2,
html[data-theme="dark"] .avatar.tone-4 {
  --av-bg: #2c2a25;
  --av-ink: #efe9dd;
}

html[data-theme="dark"] .avatar.tone-3 {
  --av-bg: #3b3427;
  --av-ink: #f4ead4;
}

.av-24 {
  --size: 24px;
}

.av-28 {
  --size: 28px;
}

.av-32 {
  --size: 32px;
}

.av-34 {
  --size: 34px;
}

.av-36 {
  --size: 36px;
}

.av-40 {
  --size: 40px;
}

.av-42 {
  --size: 42px;
}

.av-44 {
  --size: 44px;
}

.av-52 {
  --size: 52px;
}

.av-56 {
  --size: 56px;
}

.av-64 {
  --size: 64px;
}

.av-76 {
  --size: 76px;
}

.av-96 {
  --size: 96px;
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--paper);
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.avatar-stack.on-dark .avatar {
  box-shadow: 0 0 0 2px var(--feature);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.14s var(--ease), background 0.18s ease,
    color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-2);
}

.btn-dark {
  background: var(--ink);
  color: var(--paper);
}

.btn-dark:hover {
  background: #2a2a2a;
}

html[data-theme="dark"] .btn-dark {
  background: var(--ink);
  color: var(--paper);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.btn-soft {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.btn-quiet {
  color: var(--ink-2);
}

.btn-quiet:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
}

.btn-sm .icon {
  width: 15px;
  height: 15px;
}

.btn-lg {
  height: 50px;
  padding: 0 22px;
  font-size: 14.5px;
}

.btn-block {
  width: 100%;
}

.link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.link:hover {
  text-decoration-color: var(--accent);
}

.link-muted {
  color: var(--ink-3);
  font-weight: 500;
}

.link-muted:hover {
  color: var(--ink);
}

.icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease, transform 0.14s var(--ease);
}

.icon-btn:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn.solid {
  border-color: var(--line);
  background: transparent;
}

.icon-btn.sm {
  width: 32px;
  height: 32px;
}

.icon-btn .icon {
  width: 19px;
  height: 19px;
}

/* --------------------------------------------------------------------------
   Chips
   -------------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.chip .icon {
  width: 12px;
  height: 12px;
  color: var(--accent-2);
}

.chip-accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.chip-dark {
  background: var(--ink);
  color: var(--paper);
}

.chip-outline {
  border: 1px solid var(--line);
  background: transparent;
}

.chip-live {
  gap: 5px;
  background: color-mix(in srgb, var(--live) 11%, transparent);
  color: var(--live);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip-live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-soft 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Cards and page furniture
   -------------------------------------------------------------------------- */

.card {
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.page-head-copy {
  min-width: 0;
}

.page-head h1 {
  margin-top: 5px;
  font-size: clamp(2rem, 8vw, 2.35rem);
}

.page-head .lede {
  max-width: 40ch;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}

.page-head-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 12px;
}

.section-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-head .link-muted {
  font-size: 12px;
}

.section-head .count {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
}

.section-head.flush {
  margin-top: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 4px 0 24px;
  padding: 13px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric {
  padding: 0 14px;
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric dt {
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric dd {
  margin-top: 5px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 44px 20px;
  text-align: center;
}

.empty.compact {
  padding: 26px 10px;
}

.empty-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-3);
}

.empty h4 {
  font-size: 14px;
  font-weight: 600;
}

.empty p {
  max-width: 30ch;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.5;
}

.empty-line {
  padding: 12px 0;
  color: var(--ink-3);
  font-size: 12.5px;
}

.page-note {
  margin-top: 26px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-stack-spaced {
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label,
.field-head > label,
.field-label {
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-head button {
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.field-head button:hover {
  color: var(--ink);
}

.input,
.textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-3);
}

.input:focus,
.textarea:focus {
  border-color: var(--ink);
  box-shadow: var(--focus-ring);
}

.textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.password {
  position: relative;
}

.password .input {
  padding-right: 46px;
}

.password .icon-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
}

.form-error {
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.form-hint {
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.45;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 26px;
  flex: none;
  align-items: center;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: left 0.2s var(--ease), background 0.2s ease;
}

.switch[aria-checked="true"] {
  background: var(--accent);
}

.switch[aria-checked="true"]::after {
  left: 21px;
  background: var(--accent-ink);
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.segmented button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
}

.segmented button .icon {
  width: 15px;
  height: 15px;
}

.segmented button.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Filters
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 0 14px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  display: inline-flex;
  height: 34px;
  flex: none;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.filter:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Feed / yan cards
   -------------------------------------------------------------------------- */

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed > [data-list-key] {
  display: contents;
}

.yan {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s ease, transform 0.18s var(--ease);
}

@media (hover: hover) {
  .yan:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
  }
}

.yan-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.3;
}

.yan-author {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yan-time {
  white-space: nowrap;
}

.yan-dot {
  width: 3px;
  height: 3px;
  flex: none;
  border-radius: 50%;
  background: var(--line-strong);
}

.yan-bounty {
  margin-left: auto;
  height: 23px;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 600;
}

.yan-q {
  display: block;
  width: 100%;
  margin: 6px 0 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: -0.025em;
  text-align: left;
  overflow-wrap: anywhere;
}

.yan-q:hover {
  color: var(--ink-2);
}

/* Voice notes: no container background */
.yan-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 11px;
  padding: 0;
}

.play-btn {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  transition: background 0.18s ease, color 0.18s ease,
    transform 0.14s var(--ease);
}

.play-btn:hover {
  background: #2a2a2a;
}

.play-btn:active {
  transform: scale(0.94);
}

.play-btn .icon {
  width: 13px;
  height: 13px;
  margin-left: 1px;
  fill: currentColor;
  stroke: none;
}

.play-btn.is-playing {
  background: var(--accent);
  color: var(--accent-ink);
}

.wave {
  min-width: 0;
  flex: 1;
  height: 22px;
  color: var(--ink-3);
}

.wave svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yan-voice.is-playing .wave {
  color: var(--ink);
}

.yan-duration {
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.yan-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-left: -7px;
}

.yan-action {
  display: inline-flex;
  height: 29px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background 0.18s ease, color 0.18s ease;
}

.yan-action .icon {
  width: 16px;
  height: 16px;
}

.yan-action:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.yan-action.is-active {
  color: var(--ink);
}

.yan-action.is-active .icon {
  color: var(--accent-2);
}

.yan-action.push {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Live cards and room covers
   -------------------------------------------------------------------------- */

.room-cover {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  flex: none;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: var(--cover-bg);
  color: var(--cover-ink);
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.room-cover .live-dot {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live);
}

.cover-0 {
  --cover-bg: var(--feature);
  --cover-ink: var(--accent);
}

.cover-1 {
  --cover-bg: var(--accent);
  --cover-ink: var(--accent-ink);
}

.cover-2 {
  --cover-bg: #ece6d9;
  --cover-ink: var(--ink);
}

html[data-theme="dark"] .cover-2 {
  --cover-bg: #2a2620;
  --cover-ink: var(--ink);
}

.cover-3 {
  --cover-bg: #e3dccd;
  --cover-ink: var(--ink);
}

html[data-theme="dark"] .cover-3 {
  --cover-bg: #262626;
  --cover-ink: var(--ink);
}

.live-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -18px;
  padding: 1px 18px 3px;
  scrollbar-width: none;
}

.live-strip::-webkit-scrollbar {
  display: none;
}

.live-card {
  display: flex;
  width: 228px;
  flex: none;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s var(--ease);
}

.live-card:active {
  transform: scale(0.99);
}

.live-card .room-cover {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 17px;
}

.live-card-body {
  display: block;
  min-width: 0;
  flex: 1;
}

.live-card-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.live-card-meta .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live);
}

.room-list {
  display: flex;
  flex-direction: column;
}

.room-list > [data-list-key] {
  display: contents;
}

.room-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: opacity 0.18s ease;
}

.room-row:first-child {
  padding-top: 0;
}

.room-row:last-child {
  border-bottom: 0;
}

.room-row:active {
  opacity: 0.7;
}

.room-body {
  display: block;
  min-width: 0;
}

.room-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-desc {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.room-join {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-3);
  transition: background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.room-row:hover .room-join {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.room-join .icon {
  width: 14px;
  height: 14px;
}

/* Featured room */

.room-feature {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  margin-bottom: 8px;
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--feature);
  color: var(--on-dark);
  text-align: left;
  box-shadow: var(--shadow-card);
}

.room-feature::before {
  content: "";
  position: absolute;
  top: -66px;
  right: -48px;
  z-index: -1;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: var(--accent);
}

.room-feature::after {
  content: "";
  position: absolute;
  top: 36px;
  right: 42px;
  z-index: -1;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(17, 17, 17, 0.28);
  border-radius: 50%;
}

.room-feature-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.room-feature .chip-live {
  background: rgba(247, 244, 236, 0.1);
  color: #ffb7ab;
}

.room-feature-listeners {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--on-dark-2);
  font-size: 10.5px;
  font-weight: 500;
}

.room-feature-listeners .icon {
  width: 13px;
  height: 13px;
}

.room-feature h2 {
  position: relative;
  z-index: 1;
  max-width: 84%;
  margin: 22px 0 5px;
  color: var(--on-dark);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.room-feature-copy {
  position: relative;
  z-index: 1;
  max-width: 40ch;
  color: var(--on-dark-2);
  font-size: 12px;
  line-height: 1.5;
}

.room-feature-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.room-feature-people {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-feature-people .avatar {
  --size: 28px;
}

.room-feature-people > span:last-child {
  color: var(--on-dark-2);
  font-size: 10.5px;
}

.room-feature .btn {
  height: 36px;
  padding: 0 13px;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Poll card
   -------------------------------------------------------------------------- */

.poll-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.poll-list > [data-list-key] {
  display: contents;
}

.poll {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.poll-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.poll-head .avatar {
  --size: 26px;
}

.poll-by {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.poll-time {
  color: var(--ink-3);
  font-size: 11px;
}

.poll-q {
  margin: 11px 0 13px;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.03em;
}

.poll-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.poll-option {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.poll-option:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.poll-option span {
  position: relative;
  z-index: 1;
}

.poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  transform-origin: left center;
  background: var(--accent-soft);
  animation: grow-x 0.6s var(--ease-out) both;
}

.poll-option.is-selected {
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
}

.poll-option.is-selected .poll-bar {
  background: var(--accent);
  opacity: 0.5;
}

.poll-pct {
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.poll-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.poll-foot .icon {
  width: 13px;
  height: 13px;
}

.poll-voted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--success);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Wallet
   -------------------------------------------------------------------------- */

.wallet-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--feature);
  color: var(--on-dark);
  box-shadow: var(--shadow-card);
}

html[data-theme="dark"] .wallet-card {
  border: 1px solid var(--line);
}

.wallet-card::before {
  content: "";
  position: absolute;
  top: -58px;
  right: -46px;
  z-index: -1;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  background: var(--accent);
}

.wallet-card::after {
  content: "";
  position: absolute;
  top: 28px;
  right: 34px;
  z-index: -1;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(17, 17, 17, 0.25);
  border-radius: 50%;
}

.wallet-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wallet-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--on-dark-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wallet-brand .icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.wallet-eye {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(247, 244, 236, 0.2);
  border-radius: 50%;
  background: rgba(13, 27, 36, 0.32);
  color: var(--on-dark);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.wallet-eye:hover {
  background: rgba(13, 27, 36, 0.52);
}

.wallet-eye .icon {
  width: 16px;
  height: 16px;
}

.wallet-label {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  color: var(--on-dark-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.wallet-balance {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 5px;
  color: var(--on-dark);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.wallet-balance small {
  color: var(--on-dark-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.wallet-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.wallet-owner {
  color: var(--on-dark-2);
  font-size: 10.5px;
  line-height: 1.45;
}

.wallet-owner b {
  display: block;
  color: var(--on-dark);
  font-size: 11.5px;
  font-weight: 500;
}

.wallet-actions {
  display: flex;
  gap: 7px;
}

.wallet-actions .btn {
  height: 38px;
  flex: 1;
  padding: 0 12px;
  font-size: 12px;
}

.wallet-actions .btn-ghost {
  border-color: rgba(247, 244, 236, 0.22);
  color: var(--on-dark);
}

.wallet-actions .btn-ghost:hover {
  border-color: rgba(247, 244, 236, 0.4);
  background: rgba(247, 244, 236, 0.06);
}

.wallet-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 16px 0 24px;
}

.wallet-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 8px 2px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
}

.wallet-tool:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.wallet-tool-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
}

.wallet-tool:hover .wallet-tool-icon {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.wallet-tool-icon .icon {
  width: 17px;
  height: 17px;
}

.wallet-section {
  margin-top: 24px;
}

.wallet-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.wallet-section-head h3 {
  color: var(--ink-3);
}

.wallet-section-head .link-muted {
  font-size: 11px;
}

.wallet-methods,
.wallet-activity {
  overflow: hidden;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.method {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.method:last-child {
  border-bottom: 0;
}

.method-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
}

.method-icon .icon {
  width: 17px;
  height: 17px;
}

.method-body {
  display: block;
  min-width: 0;
  flex: 1;
}

.method-name {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.method-sub {
  display: block;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.4;
}

.method-radio {
  width: 17px;
  height: 17px;
  flex: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
}

.method.is-selected .method-radio {
  border-color: var(--ink);
  background: radial-gradient(circle, var(--ink) 42%, transparent 45%);
}

.method-chevron {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--ink-3);
}

.tx {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.tx:last-child {
  border-bottom: 0;
}

.tx-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
}

.tx-icon.in {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.tx-icon .icon {
  width: 16px;
  height: 16px;
}

.tx-body {
  display: block;
  min-width: 0;
}

.tx-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-time {
  display: block;
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.4;
}

.tx-amount {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tx-amount.plus {
  color: var(--success);
}

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row-btn {
  width: 100%;
  text-align: left;
}

.setting-copy {
  display: block;
  min-width: 0;
  flex: 1;
}

.setting-title {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.setting-sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.4;
}

.setting-chevron {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

.settings-section {
  margin-top: 22px;
}

.settings-section > h3 {
  margin-bottom: 8px;
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-profile-body {
  display: block;
  min-width: 0;
  flex: 1;
}

.settings-profile-name {
  display: block;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.settings-profile-handle {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 11px;
}

.settings-profile .icon {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

.settings-version {
  margin-top: 24px;
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Bottom sheet
   -------------------------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(17, 17, 17, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--gap);
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.32s;
}

.sheet.active {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  transform: translateY(102%);
  transition: transform 0.32s var(--ease-out);
}

.sheet.active .sheet-panel {
  transform: translateY(0);
}

@media (min-width: 560px) {
  .sheet-panel {
    border-radius: var(--r-2xl);
  }
}

.sheet-grabber {
  width: 34px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: var(--r-pill);
  background: var(--line-strong);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 62px 8px 18px;
}

.sheet-title {
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.sheet-sub {
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.45;
}

.sheet-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  margin: -3px -4px 0 0;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
}

.sheet-close:hover {
  background: var(--line);
  color: var(--ink);
}

.sheet-close .icon {
  width: 16px;
  height: 16px;
}

.sheet-close-static {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  margin: 0;
}

.sheet-body {
  padding: 6px 18px 4px;
}

.sheet-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.sheet-foot .btn {
  flex: 1;
}

.sheet-foot .btn-quiet {
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Install banner
   -------------------------------------------------------------------------- */

.install-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 18px 10px;
  padding: 9px 9px 9px 11px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.18);
}

.install-banner[hidden] {
  display: none;
}

.install-banner-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
}

.install-banner-icon .icon {
  width: 17px;
  height: 17px;
}

.install-banner-copy {
  display: block;
  min-width: 0;
  flex: 1;
}

.install-banner-copy b {
  display: block;
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
}

.install-banner-copy span {
  display: block;
  margin-top: 1px;
  color: color-mix(in srgb, var(--paper) 62%, transparent);
  font-size: 10.5px;
}

.install-banner .btn {
  height: 30px;
  padding: 0 11px;
  font-size: 11px;
}

.install-banner .icon-btn {
  width: 30px;
  height: 30px;
  color: color-mix(in srgb, var(--paper) 64%, transparent);
}

.install-banner .icon-btn:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.oja-toast-container {
  z-index: 120;
  font-family: var(--font);
}

.oja-toast {
  gap: 8px;
  padding: 11px 15px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.22);
}

.oja-toast.oja-toast-info,
.oja-toast.oja-toast-success,
.oja-toast.oja-toast-error,
.oja-toast.oja-toast-warn,
.oja-toast.oja-toast-custom {
  border: 0;
  background: var(--ink);
  color: var(--paper);
}

.oja-toast-icon {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
}

.oja-toast-success .oja-toast-icon {
  background: var(--accent);
  color: var(--accent-ink);
}

.oja-toast-error .oja-toast-icon {
  background: var(--danger);
  color: #fff;
}

.oja-toast-warn .oja-toast-icon {
  background: var(--accent);
  color: var(--accent-ink);
}

.oja-toast-info .oja-toast-icon {
  background: var(--surface);
  color: var(--ink);
}

.oja-toast-top-center {
  top: calc(var(--gap) + 68px + env(safe-area-inset-top));
}

.has-install-banner .oja-toast-top-center {
  top: calc(var(--gap) + 128px + env(safe-area-inset-top));
}

.oja-field-error {
  margin-top: 5px;
  color: var(--danger);
  font-size: 11.5px;
}

.oja-input-error {
  border-color: var(--danger) !important;
}

/* --------------------------------------------------------------------------
   Minor shared pieces
   -------------------------------------------------------------------------- */

.reply-bar {
  box-shadow: 0 -12px 24px -16px rgba(17, 17, 17, 0.24);
}

html[data-theme="dark"] .reply-bar {
  box-shadow: 0 -12px 24px -16px rgba(0, 0, 0, 0.8);
}

.topbar-actions .icon-btn {
  position: relative;
}

.bell-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: var(--live);
}

.method-chevron {
  color: var(--ink-3);
}

.room-feature-listeners {
  padding: 4px 8px;
  border-radius: var(--r-pill);
  background: rgba(13, 27, 36, 0.55);
  color: var(--on-dark);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Wide screens: desktop workspace with persistent left navigation. */
@media (min-width: 900px) {
  .app-frame:not(.auth-frame) {
    max-width: none;
    min-height: 100dvh;
    margin: 0;
    padding-left: 248px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    top: 0;
    height: 72px;
    padding: 0 40px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  #main-outlet {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 28px 40px 64px;
  }

  .dock {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    display: flex;
    width: 248px;
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 112px 18px 24px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    transform: none;
  }

  .dock-link {
    flex: none;
    height: 52px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 0 18px;
    border-radius: var(--r-md);
    color: var(--ink-2);
  }

  .dock-link.is-active,
  .dock-link[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--ink);
  }

  .install-banner {
    width: min(calc(100% - 80px), 1040px);
    margin: 16px auto 0;
  }

  .page {
    min-height: 0;
  }
}

@media (min-width: 1440px) {
  .app-frame:not(.auth-frame) {
    padding-left: 280px;
  }
  .dock {
    width: 280px;
    padding-right: 24px;
    padding-left: 24px;
  }
  #main-outlet {
    width: min(100%, 1240px);
    padding-right: 56px;
    padding-left: 56px;
  }
}

.desktop-rail { display: none; }

@media (min-width: 1200px) {
  .app-frame:not(.auth-frame) {
    padding-right: 344px;
  }
  .desktop-rail {
    position: fixed;
    top: 96px;
    right: max(32px, calc((100vw - 1440px) / 2 + 32px));
    display: flex;
    width: 296px;
    max-height: calc(100dvh - 120px);
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
  }
  .rail-search, .rail-card {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
  }
  .rail-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    color: var(--ink-3);
  }
  .rail-search .icon { width: 18px; height: 18px; }
  .rail-search input {
    width: 100%; border: 0; outline: 0; background: transparent;
    color: var(--ink); font: inherit; font-size: 13px;
  }
  .rail-card { padding: 18px; }
  .rail-card h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: -.02em; }
  .rail-card > a:not(.trend-link) {
    display: flex; align-items: center; gap: 12px; min-height: 42px;
    color: var(--ink-2); font-size: 13px; font-weight: 600;
  }
  .rail-card > a .icon { width: 18px; height: 18px; }
  .rail-card a:hover { color: var(--ink); }
  .trend-link { display: flex; flex-direction: column; gap: 4px; padding: 11px 0; border-top: 1px solid var(--line); }
  .trend-link span { color: var(--ink-3); font-size: 11px; }
  .trend-link b { color: var(--ink); font-size: 13px; line-height: 1.4; }
  .rail-note { padding: 0 4px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
}

@media (min-width: 1440px) {
  .app-frame:not(.auth-frame) { padding-right: 376px; }
  .desktop-rail { right: max(40px, calc((100vw - 1600px) / 2 + 40px)); width: 320px; }
}

.desktop-dock-brand { display: none; }
@media (min-width: 900px) {
  .topbar { position: fixed; top: 0; right: 0; left: 248px; z-index: 80; }
  #main-outlet { padding-top: 100px; }
  .desktop-rail { top: 0; right: 0; width: 344px; height: 100dvh; max-height: none; padding: 100px 24px 24px; border-left: 1px solid var(--line); background: var(--paper); }
  .desktop-dock-brand { position: absolute; top: 24px; left: 26px; display: block; }
  .desktop-dock-brand img { display: block; width: 112px; height: 36px; object-fit: contain; }
}
@media (min-width: 1200px) {
  .app-frame:not(.auth-frame) { padding-right: 344px; }
  .desktop-rail { right: 0; }
  #main-outlet { width: min(100%, 1000px); }
}
@media (min-width: 1440px) {
  .desktop-rail { width: 376px; }
  .app-frame:not(.auth-frame) { padding-right: 376px; }
}

@media (min-width: 900px) {
  .dock-link {
    min-height: 56px;
    height: 56px;
    gap: 16px;
    font-size: 15px;
    font-weight: 600;
  }
  .dock-link .icon {
    width: 21px;
    height: 21px;
  }
}

@media (min-width: 900px) {
  .topbar-brand { display: none; }
}

@media (min-width: 900px) {
  /* Keep the desktop header in the content area, clear of the left rail. */
  .topbar {
    left: 248px;
    right: 0;
    justify-content: flex-end;
    padding-right: 28px;
  }
  .topbar-actions { margin-left: auto; gap: 10px; }
  .topbar-actions .icon-btn,
  .topbar-avatar { width: 44px; height: 44px; }
  .topbar-actions .icon-btn .icon { width: 22px; height: 22px; }

  .dock-link {
    height: 62px;
    min-height: 62px;
    padding-left: 20px;
    font-size: 18px;
    font-weight: 650;
  }
  .dock-link .icon { width: 24px; height: 24px; }
}

@media (min-width: 1200px) {
  .topbar { right: 344px; }
}

@media (min-width: 1440px) {
  .topbar { left: 280px; right: 376px; }
}

@media (min-width: 1200px) {
  .desktop-rail { padding-top: 16px; }
  .rail-search { min-height: 52px; }
}
@media (min-width: 900px) {
  .dock-link { font-size: 20px; font-weight: 650; }
}

@media (min-width: 900px) {
  .dock-link span {
    font-size: 20px;
    line-height: 1.2;
  }
}


@media (min-width: 900px) {
  .dock-link span { font-size: 16px; }
}

.mobile-search-link { display: none; }
@media (max-width: 899px) {
  .mobile-search-link { display: inline-flex; align-items: center; justify-content: center; }
}

.account-menu { position: relative; margin-left: 6px; }
.account-menu > summary { display: block; cursor: pointer; list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu[open] > summary { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 100;
  display: grid; width: 208px; padding: 7px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-card);
}
.account-dropdown a, .account-dropdown button {
  display: flex; align-items: center; min-height: 42px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--ink-2); font: inherit;
  font-size: 13px; font-weight: 600; text-align: left;
}
.account-dropdown a:hover, .account-dropdown button:hover {
  background: var(--surface-2); color: var(--ink);
}
.account-dropdown button { width: 100%; }

.account-dropdown .icon { width: 18px; height: 18px; flex: none; margin-right: 11px; }

/* Route loading skeletons */
.page-skeleton { display: grid; gap: 14px; padding: 18px 0; }
.skeleton-block {
  display: block; overflow: hidden; position: relative;
  border-radius: var(--r-md); background: var(--surface-2);
}
.skeleton-block::after {
  position: absolute; inset: 0; content: "";
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 75%, transparent), transparent);
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}
.skeleton-heading { width: 48%; height: 34px; margin-bottom: 2px; }
.skeleton-copy { width: 72%; height: 14px; }
.skeleton-copy.short { width: 42%; }
.skeleton-card { height: 124px; }
@keyframes skeleton-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .skeleton-block::after { animation: none; transform: none; opacity: .3; }
}
.tx-amount.minus { color: var(--danger); }

.wallet-page .tx-amount.plus { color: #187348 !important; }
.wallet-page .tx-amount.minus { color: #c4322b !important; }

.home-page .fab {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}
.home-page .fab.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

#room-end[hidden] { display: none !important; }
.host-room-note { margin: 0 0 16px; }

#room-leave[hidden] { display: none !important; }
