/* ==========================================================================
   Misyan — pages and layouts
   ========================================================================== */

/* --------------------------------------------------------------------------
   Auth — one mobile column, never a split desktop panel
   -------------------------------------------------------------------------- */

.auth-frame {
  min-height: 100dvh;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(20px + env(safe-area-inset-top)) 18px 0;
}

.auth-art {
  position: relative;
  width: 48px;
  height: 48px;
  flex: none;
}

.auth-ring {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  opacity: 0.55;
}

.auth-orb {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
}

.auth-hero {
  padding: 32px 18px 0;
}

.auth-hero h1 {
  max-width: 11ch;
  margin-top: 8px;
  font-size: clamp(2.3rem, 10vw, 2.8rem);
  font-weight: 700;
  line-height: 1.01;
  letter-spacing: -0.055em;
}

.auth-hero .auth-sub {
  max-width: 34ch;
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.auth-main {
  padding: 22px 18px calc(36px + env(safe-area-inset-bottom));
}

.auth-page {
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.auth-form-head h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.auth-form-head p {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.5;
}

.auth-form {
  margin-top: 20px;
}

.auth-form .btn-block {
  margin-top: 2px;
}

.auth-alt {
  margin-top: 16px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.auth-alt a,
.auth-alt button {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.auth-alt a:hover,
.auth-alt button:hover {
  text-decoration-color: var(--accent);
}

.auth-legal {
  margin-top: 13px;
  color: var(--ink-3);
  font-size: 9.5px;
  line-height: 1.5;
  text-align: center;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 15px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
}

.auth-back:hover {
  color: var(--ink);
}

.auth-back .icon {
  width: 14px;
  height: 14px;
}

.otp-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: 20px 0 14px;
}

.otp {
  width: 100%;
  height: 56px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.otp:focus {
  border-color: var(--ink);
  background: var(--surface);
}

.otp.filled {
  border-bottom-color: var(--accent);
}

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

.otp-meta b {
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.otp-meta button {
  color: var(--ink);
  font-weight: 600;
}

.otp-meta button:disabled {
  cursor: default;
  color: var(--ink-3);
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.home-hero {
  padding: 16px 0 20px;
}

.home-hero .date {
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 14ch;
  margin-top: 6px;
  font-size: clamp(2.1rem, 9vw, 2.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.home-hero .lede {
  max-width: 36ch;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.composer {
  margin: 2px 0 22px;
  padding: 13px 13px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s ease;
}

.composer:focus-within {
  border-color: var(--line-strong);
}

.composer-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
}

.composer textarea {
  width: 100%;
  min-height: 58px;
  padding: 6px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.025em;
  resize: none;
}

.composer textarea::placeholder {
  color: var(--ink-3);
  font-weight: 400;
}

.composer-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.composer-foot .spacer {
  flex: 1;
}

.composer-mic {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-2);
}

.composer-mic:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.composer-mic .icon {
  width: 16px;
  height: 16px;
}

.composer-anon {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 500;
}

.composer-anon:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.composer-anon .icon {
  width: 12px;
  height: 12px;
}

.composer-anon.is-on {
  color: var(--ink-2);
}

.composer-post {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
}

.live-card {
  width: 228px;
}

/* --------------------------------------------------------------------------
   Yans
   -------------------------------------------------------------------------- */

.yans-page .page-head {
  margin-bottom: 14px;
}

.yans-page .filters {
  padding-top: 1px;
}

.yans-page .section-head {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Rooms
   -------------------------------------------------------------------------- */

.rooms-page .room-list {
  margin-top: 4px;
}

.rooms-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.5;
}

.rooms-note .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex: none;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Polls
   -------------------------------------------------------------------------- */

.polls-page .page-head {
  margin-bottom: 14px;
}

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

.wallet-page .page-head {
  margin-bottom: 18px;
}

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

.settings-page .page-head {
  margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 22px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.avatar.profile-avatar {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 5px var(--surface), 0 0 0 6px var(--line);
}

.profile-name {
  margin-top: 17px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.profile-handle {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.profile-nick {
  margin-top: 10px;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
}

.profile-actions .icon-btn {
  width: 36px;
  height: 36px;
  border-color: var(--line);
  background: transparent;
}

.profile-stats {
  display: flex;
  width: 100%;
  max-width: 360px;
  margin-top: 22px;
}

.profile-stat {
  flex: 1;
  padding: 0 8px;
}

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

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

.profile-stat dd {
  margin-top: 4px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.profile-stat dd a {
  color: inherit;
  text-decoration: none;
}

.profile-stat dd a:hover {
  color: var(--ink-2);
}

.profile-my {
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Gifts
   -------------------------------------------------------------------------- */

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

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

.gift {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

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

.gift-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.gift-icon .icon {
  width: 18px;
  height: 18px;
}

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

.gift-name {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.gift-from {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 10.5px;
}

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

/* --------------------------------------------------------------------------
   Compose sheet
   -------------------------------------------------------------------------- */

.compose-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 14px;
  border-bottom: 1px solid var(--line);
}

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

.compose-author-name {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.compose-author-sub {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.compose-text {
  width: 100%;
  min-height: 110px;
  padding: 15px 0 6px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -0.03em;
  resize: none;
}

.compose-text::placeholder {
  color: var(--ink-3);
  font-weight: 400;
}

.compose-count {
  color: var(--ink-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.record {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  column-gap: 11px;
  align-items: center;
  margin: 14px 0 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.record.is-recording {
  border-color: var(--accent);
}

.record-btn {
  display: grid;
  width: 44px;
  height: 44px;
  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);
}

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

.record.is-recording .record-btn {
  background: var(--accent);
  color: var(--accent-ink);
  animation: mic-pulse 1.6s ease-out infinite;
}

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

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

.record-title {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.record-sub {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.record-time {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.record-wave {
  display: flex;
  height: 26px;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  gap: 4px;
  margin-top: 10px;
  color: var(--ink-3);
}

.record-wave i {
  width: 3px;
  min-height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.55;
  transition: height 0.08s linear, opacity 0.18s ease;
}

.record.is-recording .record-wave i {
  background: var(--ink);
  opacity: 0.8;
}

html[data-theme="dark"] .record.is-recording .record-wave i {
  background: var(--accent);
}

.voice-status {
  display: none;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 500;
}

.voice-status.show {
  display: flex;
}

.voice-status .icon {
  width: 14px;
  height: 14px;
}

.voice-status button {
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.voice-status .voice-preview {
  margin-left: auto;
  text-decoration: none;
}

.voice-status .voice-remove {
  color: inherit;
  opacity: 0.8;
}

.compose-options {
  margin-top: 14px;
}

.compose-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.compose-option:first-child {
  border-top: 0;
}

.compose-option-copy {
  min-width: 0;
}

.compose-option-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.compose-option-sub {
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.4;
}

.reward-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.reward {
  display: inline-flex;
  height: 29px;
  align-items: center;
  gap: 3px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.reward .icon {
  width: 11px;
  height: 11px;
}

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

@media (max-width: 420px) {
  .compose-option-rewards {
    display: block;
  }

  .compose-option-rewards .reward-row {
    justify-content: flex-start;
    margin-top: 9px;
  }
}

/* --------------------------------------------------------------------------
   Thread sheet
   -------------------------------------------------------------------------- */

.thread-origin {
  margin-bottom: 2px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.thread-origin .yan-head {
  gap: 6px;
}

.thread-origin .yan-q {
  margin: 6px 0 0;
  font-size: 15px;
}

.thread-origin .yan-voice {
  margin: 10px 0 0;
}

.thread-origin .yan-actions {
  margin-top: 8px;
}

.thread-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 1px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.thread-count.flush {
  margin-top: 0;
}

.comment {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.comment-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.comment-author {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
}

.comment-time {
  font-size: 10px;
}

.comment-text {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  margin: 4px 0 0 -7px;
}

.comment-action {
  display: inline-flex;
  height: 27px;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 500;
}

.comment-action .icon {
  width: 13px;
  height: 13px;
}

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

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

.comment-action.is-active .icon {
  fill: currentColor;
}

.comment-replies {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.comment-replies .comment {
  padding: 9px 0;
  border-bottom: 0;
}

.comment-replies .comment:first-child {
  padding-top: 0;
}

.comment-replies .comment:last-child {
  padding-bottom: 0;
}

.reply-target {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 10.5px;
}

.reply-target.show {
  display: flex;
}

.reply-target b {
  color: var(--ink-2);
  font-weight: 500;
}

.reply-target button {
  margin-left: auto;
  color: var(--ink);
  font-weight: 600;
}

.reply-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 2px;
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
}

.reply-field {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.reply-field:focus-within {
  border-color: var(--ink);
}

.reply-field textarea {
  width: 100%;
  max-height: 110px;
  min-height: 32px;
  padding: 7px 5px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}

.reply-field textarea::placeholder {
  color: var(--ink-3);
}

.reply-send {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
}

.reply-send:hover {
  background: #2a2a2a;
}

.reply-send .icon {
  width: 14px;
  height: 14px;
}

.reply-anon {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  padding: 0 3px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
}

.reply-anon button {
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 2px;
}

.reply-anon .icon {
  width: 11px;
  height: 11px;
}

/* --------------------------------------------------------------------------
   Room sheet
   -------------------------------------------------------------------------- */

.room-sheet-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 2px 0 16px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--feature);
  color: var(--on-dark);
}

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

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

.room-sheet-head h3 {
  margin-top: 10px;
  color: var(--on-dark);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: none;
}

.room-sheet-head p {
  margin-top: 3px;
  color: var(--on-dark-2);
  font-size: 11.5px;
}

.room-sheet-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--on-dark-2);
  font-size: 10.5px;
}

.speaker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 8px;
  padding: 4px 0;
  text-align: center;
}

.speaker {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
}

.speaker-wrap {
  position: relative;
  display: inline-flex;
}

.speaker-wrap .avatar {
  --size: 56px;
}

.speaker.is-speaking .avatar {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

.speaker-mic {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-3);
}

.speaker.is-speaking .speaker-mic {
  background: var(--accent);
  color: var(--accent-ink);
}

.speaker-mic .icon {
  width: 9px;
  height: 9px;
}

.speaker-name {
  display: block;
  overflow: hidden;
  width: 100%;
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-role {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 9px;
}

.room-listeners {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.room-listeners-copy {
  flex: 1;
  color: var(--ink-2);
  font-size: 11px;
}

.room-listeners .avatar {
  --size: 26px;
}

.room-sheet-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 2px;
}

.room-sheet-actions .btn {
  height: 40px;
}

.room-sheet-actions .icon-btn {
  width: 40px;
  height: 40px;
  border-color: var(--line);
  background: var(--surface);
}

.room-sheet-actions .icon-btn.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   Amounts, methods and transfers
   -------------------------------------------------------------------------- */

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0 12px;
}

.amount {
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

.amount.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.custom-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.custom-amount span {
  color: var(--ink-3);
  font-size: 12px;
}

.custom-amount input {
  width: 100%;
  height: 44px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.custom-amount input::placeholder {
  color: var(--ink-3);
  font-size: 14px;
}

.sheet-section-label {
  margin: 16px 0 3px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-balance {
  color: var(--ink-3);
  font-size: 10.5px;
  text-align: right;
}

.sheet-balance b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.topup-methods {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 12px;
  background: var(--surface);
}

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

.send-recents {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.send-recents > span {
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.send-recents button {
  display: inline-flex;
  height: 27px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
}

.send-recents button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.tip-recipient {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--line);
}

.tip-recipient-body {
  display: block;
}

.tip-recipient-name {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.tip-recipient-sub {
  display: block;
  color: var(--ink-3);
  font-size: 10.5px;
}

.amount-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.amount-control button {
  display: grid;
  height: 50px;
  place-items: center;
  color: var(--ink-2);
}

.amount-control button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.amount-control button .icon {
  width: 17px;
  height: 17px;
}

.amount-control:focus-within {
  border-color: var(--ink);
  box-shadow: var(--focus-ring);
}

.amount-control input {
  width: 100%;
  height: 50px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.amount-control input::placeholder {
  color: var(--ink-3);
}

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

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

/* --------------------------------------------------------------------------
   Poll / profile sheets
   -------------------------------------------------------------------------- */

.option-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}

.option-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.option-field .input {
  flex: 1;
}

.option-remove {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-3);
}

.option-remove:hover {
  background: var(--surface-2);
  color: var(--danger);
}

.option-remove .icon {
  width: 14px;
  height: 14px;
}

.add-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
}

.add-option .icon {
  width: 13px;
  height: 13px;
}

.profile-edit-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--line);
}

.profile-edit-preview .avatar {
  --size: 52px;
}

.profile-edit-preview .muted {
  font-size: 11px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Notifications
   -------------------------------------------------------------------------- */

.notif-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 10.5px;
}

.notif-top .link-muted {
  font-size: 10.5px;
  font-weight: 600;
}

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

.notif {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

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

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

.notif-icon .icon {
  width: 14px;
  height: 14px;
}

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

.notif-text {
  display: block;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.45;
}

.notif-text b {
  color: var(--ink);
  font-weight: 600;
}

.notif-time {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 9.5px;
}

.notif-dot {
  width: 6px;
  height: 6px;
  flex: none;
  margin-top: 13px;
  border-radius: 50%;
  background: transparent;
}

.notif.is-unread .notif-dot {
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.notfound {
  display: flex;
  min-height: 62dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.notfound .eyebrow {
  color: var(--ink-3);
}

.notfound h1 {
  margin-top: 10px;
  font-size: clamp(2.1rem, 9vw, 2.7rem);
}

.notfound p {
  max-width: 30ch;
  margin-top: 9px;
  color: var(--ink-3);
  font-size: 13px;
}

.notfound .btn {
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 360px) {
  #main-outlet {
    padding-right: 14px;
    padding-left: 14px;
  }

  .topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .auth-main,
  .auth-hero,
  .auth-top {
    padding-right: 14px;
    padding-left: 14px;
  }

  .auth-hero h1 {
    font-size: 2.15rem;
  }

  .wallet-balance {
    font-size: 38px;
  }
}

.auth-compact .auth-main {
  padding-top: 24px;
}

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

.yan-voice.is-playing .wave svg {
  animation: pulse-soft 2s ease-in-out infinite;
}

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

/* Auth pages use a split editorial layout on desktop; mobile remains stacked. */
@media (min-width: 900px) {
  .auth-frame {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(420px, 0.85fr);
    grid-template-rows: 88px 1fr;
    align-items: center;
    gap: 0 8vw;
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    padding: 0 clamp(48px, 9vw, 160px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--paper);
  }
  .auth-top {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: start;
    padding: 26px 0 0;
  }
  .auth-art { width: 72px; height: 72px; }
  .auth-ring { width: 58px; height: 58px; border-width: 2px; }
  .auth-orb { width: 42px; height: 42px; }
  .auth-hero {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    max-width: 620px;
    padding: 0;
  }
  .auth-hero h1 { max-width: 12ch; font-size: clamp(3.5rem, 5vw, 5.5rem); }
  .auth-hero .auth-sub { max-width: 42ch; font-size: 17px; }
  .auth-main {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    width: min(100%, 500px);
    justify-self: center;
    padding: 0;
  }
  .auth-page { padding: clamp(28px, 3vw, 44px); border-radius: var(--r-2xl); }
  .auth-form-head h2 { font-size: 32px; }
  .auth-form-head p { font-size: 14px; }
  .auth-alt { font-size: 14px; }
  .auth-legal { font-size: 11px; }
}

@media (min-width: 1200px) {
  .auth-frame { gap: 0 10vw; }
}

@media (min-width: 900px) {
  .auth-frame.auth-compact .auth-hero {
    display: block;
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    max-width: 620px;
    padding: 0;
  }
}

.search-page { padding-top: 16px; }
.search-field {
  display: flex; align-items: center; gap: 12px; min-height: 54px; margin: 8px 0 26px;
  padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink-3);
}
.search-field .icon { width: 20px; height: 20px; flex: none; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; }
.search-section-title { margin: 24px 0 12px; font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.search-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.search-shortcuts a { display: flex; min-height: 76px; flex-direction: column; justify-content: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; }
.search-shortcuts .icon { width: 21px; height: 21px; color: var(--ink-2); }
.search-trending { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.search-trending a, .search-result { display: flex; flex-direction: column; gap: 5px; padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.search-trending a:last-child, .search-result:last-child { border-bottom: 0; }
.search-trending span, .search-result span { color: var(--ink-3); font-size: 12px; }
.search-trending b, .search-result b { font-size: 14px; line-height: 1.4; }
.search-result { background: var(--surface); }
#search-empty { padding: 18px 0; color: var(--ink-3); font-size: 14px; }
@media (min-width: 900px) {
  .search-page { max-width: 760px; margin: 0 auto; }
  .search-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.notif { color: inherit; text-decoration: none; }
.notif:hover { background: var(--surface-2); }
.reply-record.is-recording { background: var(--live); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.comment-audio { display: block; width: min(100%, 320px); height: 38px; margin: 8px 0; }
#thread-voice-preview { width: min(100%, 280px); height: 36px; align-self: center; }

.listener-section { margin-top: 8px; }
.listener-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 240px;
  margin-top: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.listener-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 11px;
}
.listener-person .avatar { --size: 28px; }
.listener-person > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listener-person small { margin-left: auto; color: var(--ink-3); font-size: 9px; }
.room-reactions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.room-reactions > span { color: var(--ink-3); font-size: 11px; }
.room-reactions button {
  min-width: 46px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 14px;
}
.room-reactions button b { margin-left: 2px; color: var(--ink-3); font-size: 10px; }
.room-reactions button.is-active { border-color: var(--accent-2); background: var(--accent-soft); }
.rooms-host-fab { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); }
.rooms-host-fab.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
@media (min-width: 900px) {
  .rooms-host-fab { right: 28px; }
}
@media (min-width: 1200px) {
  .rooms-host-fab { right: 370px; }
}
@media (min-width: 1440px) {
  .rooms-host-fab { right: 402px; }
}

#room-hand[hidden], #room-tip[hidden] { display: none !important; }
