@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg: #fff5f2;
  --bg-deep: #ffe8e1;
  --ink: #2a1814;
  --muted: #8a6a62;
  --card: #ffffff;
  --line: #f0d7d0;
  --rose: #c45c6a;
  --rose-deep: #a23d4c;
  --coral: #e07a5f;
  --terracotta: #c46b4a;
  --blush: #ffd6cc;
  --cream: #fffaf7;
  --accent: #c45c6a;
  --accent-2: #e07a5f;
  --accent-soft: #fce8e4;
  --ok: #2f7d57;
  --warn: #b7791f;
  --danger: #b33a3a;
  --admin: #3b1d22;
  --admin-accent: #c45c6a;
  --admin-surface: #fffaf8;
  --admin-panel: #ffffff;
  --admin-line: #f0d7d0;
  --admin-ink: #2a1814;
  --admin-muted: #8a6a62;
  --shadow: 0 18px 50px rgba(164, 74, 74, 0.10);
  --shadow-sm: 0 8px 24px rgba(164, 74, 74, 0.08);
  --radius: 1.25rem;
  --radius-sm: 0.85rem;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --app-topbar-h: 58px;
  --sidebar-w: 260px;
  --chat-rail-w: 300px;
  --mobile-bottom-nav-h: 0px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -5%, #ffd4c8 0%, transparent 55%),
    radial-gradient(800px 380px at 100% 0%, #ffc9d4 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--cream) 100%);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--rose-deep); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--coral); }

.wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - var(--app-topbar-h));
  box-sizing: border-box;
}
.sidebar {
  width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  background: linear-gradient(185deg, #4a2328 0%, #2c1518 100%);
  color: #ffe9e4;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 8px 0 30px rgba(60, 20, 30, 0.12);
  position: sticky;
  top: var(--app-topbar-h);
  height: calc(100vh - var(--app-topbar-h));
  max-height: calc(100vh - var(--app-topbar-h));
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
}
.sidebar-head {
  flex-shrink: 0;
  padding: 1.25rem 1.1rem .65rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar--menu-only .sidebar-nav {
  padding-top: .55rem;
}
/* Must beat `.sidebar a { display:block }` so the avatar stays centered */
.sidebar a.sidebar-user,
.sidebar-user {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 1.15rem auto 0.55rem;
  padding: 0.45rem 0.5rem 0.65rem;
  width: calc(100% - 1.5rem);
  max-width: 100%;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #fff7f4;
  text-decoration: none;
  text-align: center;
  transition: color .2s ease, opacity .2s ease;
}
.sidebar a.sidebar-user:hover,
.sidebar-user:hover {
  background: transparent;
  border-color: transparent;
  color: #fff;
  transform: none;
  opacity: .92;
}
.sidebar-user-avatar {
  display: block;
  width: 128px;
  height: 128px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid rgba(255, 232, 226, .65);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}
.sidebar-user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--rose), var(--coral));
  color: #fff;
  font-weight: 700;
  font-family: var(--display);
  font-size: 2.75rem;
  line-height: 1;
}
.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
  text-align: center;
}
.sidebar-user--agent {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.85rem;
}
.sidebar-user--agent .sidebar-user-avatar {
  width: 128px;
  height: 128px;
  border-width: 3px;
}
.sidebar-user--agent .sidebar-user-avatar-fallback {
  font-size: 2.75rem;
}
.sidebar-user--agent .sidebar-user-meta {
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  flex: 0 1 auto;
  gap: 0.4rem;
  text-align: center;
}
.sidebar-user--agent .sidebar-user-name {
  font-size: 1.05rem;
  text-align: center;
}
.sidebar-user--agent .sidebar-agent-level {
  justify-content: center;
}
.sidebar-agent-level {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 100%;
}
.sidebar-agent-level__badge {
  font-size: 0.62rem;
  padding: 0.15rem 0.45rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-agent-level__tier {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 232, 226, 0.78);
  white-space: nowrap;
}
.sidebar-user-name {
  display: block;
  width: 100%;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .65rem 1.1rem 1.25rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}
.sidebar--menu-only .sidebar-nav > .muted:first-child {
  margin-top: .35rem;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22);
  border-radius: 999px;
}
.sidebar-logout { margin-top: 1.25rem; padding-bottom: .25rem; }
.sidebar h1 {
  font-family: var(--display);
  font-size: 1.45rem;
  margin: 0 0 .35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sidebar .brand-tag {
  color: #f0b8b0;
  font-size: .78rem;
  margin: 0 0 .35rem .15rem;
}
.sidebar a {
  display: block;
  color: #ffe8e2;
  padding: .65rem .85rem;
  border-radius: .75rem;
  margin-bottom: .2rem;
  font-weight: 500;
  transition: background .2s ease, transform .15s ease;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
}
.sidebar a:hover { background: rgba(255,255,255,.1); transform: translateX(3px); color: #fff; }
.sidebar a.active {
  background: linear-gradient(135deg, var(--rose), var(--coral));
  color: #fff;
  box-shadow: 0 8px 20px rgba(196, 92, 106, 0.35);
}
/* Wallet card must not inherit generic sidebar link padding / slide hover */
.sidebar a.sidebar-wallet-card,
.sidebar-wallet-card {
  display: flex;
  flex-direction: column;
  margin: 0 .85rem .95rem;
  padding: .75rem .8rem .7rem;
  border-radius: 14px;
  font-weight: 500;
  transform: none;
}
.sidebar a.sidebar-wallet-card:hover,
.sidebar-wallet-card:hover {
  background:
    linear-gradient(155deg, rgba(255,255,255,.18), rgba(255,255,255,.07) 42%, rgba(0,0,0,.1)),
    rgba(255, 255, 255, .08);
  transform: none;
  color: #fff;
}
.sidebar-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd0c8, #f0a3a0);
  color: #5c1f28;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.sidebar-nav a.active .sidebar-nav-badge {
  background: #fff;
  color: var(--rose-deep, #9b3d4a);
}
.sidebar .muted {
  color: #d4a39a;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 1.15rem .85rem .45rem;
  font-weight: 600;
}
.sidebar-head .muted { margin-top: .65rem; }
.main {
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  padding: 1.5rem 1.5rem 2.25rem;
  min-height: calc(100vh - var(--app-topbar-h));
  overflow-x: auto;
}

/* Persistent right chat rail (user layout) */
.chat-rail {
  width: var(--chat-rail-w);
  max-width: var(--chat-rail-w);
  flex: 0 0 var(--chat-rail-w);
  position: sticky;
  top: var(--app-topbar-h);
  height: calc(100vh - var(--app-topbar-h));
  max-height: calc(100vh - var(--app-topbar-h));
  align-self: flex-start;
  background: #fff;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 25;
  box-shadow: -8px 0 24px rgba(80, 30, 40, .06);
}
.chat-rail-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .9rem 1rem;
  background: linear-gradient(180deg, #fff7f4, #fff);
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
}
.chat-rail-expand {
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: #f3e6e1; color: #4a2328; cursor: pointer; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.chat-rail-expand:hover { background: #ead7d0; color: #4a2328; }
.chat-rail-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.chat-rail-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  gap: .7rem;
  padding: .75rem .9rem;
  cursor: pointer;
  border-bottom: 1px solid #f3e8e4;
  color: inherit;
  font: inherit;
  text-decoration: none;
}
a.chat-rail-item:hover { color: inherit; }
.chat-rail-item:hover,
.chat-rail-item.active { background: #fff7f4; }
.chat-rail-item.has-unread .chat-rail-top strong { font-weight: 700; }
.chat-rail-item.has-unread .chat-rail-preview { color: var(--ink); font-weight: 600; }
.chat-rail-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: linear-gradient(145deg, #e08a7a, #c45c6a);
}
.chat-rail-avatar-fallback,
.chat-rail-avatar.dock-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-family: var(--display);
}
.chat-rail-copy { flex: 1; min-width: 0; }
.chat-rail-top {
  display: flex; justify-content: space-between; gap: .4rem; align-items: baseline;
}
.chat-rail-top strong {
  font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-rail-time { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.chat-rail-item.has-unread .chat-rail-time { color: var(--rose); font-weight: 700; }
.chat-rail-bottom { display: flex; align-items: center; gap: .45rem; margin-top: .12rem; }
.chat-rail-preview {
  flex: 1; min-width: 0; color: var(--muted); font-size: .82rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-rail-unread {
  flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--rose); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}
.chat-rail-empty {
  padding: 1.25rem 1rem; color: var(--muted); font-size: .88rem; line-height: 1.45;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card-link { display: block; color: inherit; }
.card-link:hover { transform: translateY(-2px); color: inherit; }

.grid { display: grid; gap: 1.15rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { font-family: var(--display); font-size: 1.75rem; font-weight: 700; color: var(--rose-deep); }

label { display: block; font-size: .82rem; margin: .65rem 0 .3rem; color: var(--muted); font-weight: 600; }
input, select, textarea {
  font: inherit;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  padding: .7rem .85rem;
  width: 100%;
  background: var(--cream);
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(196, 92, 106, 0.15);
  background: #fff;
}
button, .btn {
  font: inherit;
  font-weight: 600;
  background: linear-gradient(135deg, var(--rose) 0%, var(--coral) 100%);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: auto;
  padding: .7rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(196, 92, 106, 0.28);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(196, 92, 106, 0.35);
  filter: brightness(1.03);
  color: #fff;
}
.btn.secondary {
  background: linear-gradient(135deg, #d4694f, #e08a55);
}
.btn.ghost {
  background: transparent;
  color: var(--rose-deep);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--rose); color: var(--rose-deep); }
.btn.small { padding: .4rem .85rem; font-size: .85rem; }
.btn.like { background: linear-gradient(135deg, #e0567a, #c45c6a); }
.btn.pass { background: #fff; color: var(--muted); border: 1.5px solid var(--line); box-shadow: none; }
.btn.super { background: linear-gradient(135deg, #5b8def, #7aa2f7); }

.flash {
  background: linear-gradient(135deg, #e8f7ef, #f3fcf7);
  border: 1px solid #b7e0c7;
  color: var(--ok);
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
}
.errors {
  background: #fdecec;
  border: 1px solid #f2c2c2;
  color: var(--danger);
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
}
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: .7rem .45rem; text-align: left; vertical-align: top; }
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--rose-deep);
  font-size: .72rem;
  font-weight: 600;
}
.badge.ok { background: #d8f3e4; color: var(--ok); }
.badge.warn { background: #fff3cd; color: var(--warn); }

.auth-shell {
  max-width: 440px;
  margin: 3.5rem auto;
  padding: 0 1rem 2rem;
}
.auth-shell .card {
  padding: 1.75rem 1.6rem 1.5rem;
  border-radius: 1.5rem;
}
.auth-brand {
  font-family: var(--display);
  font-size: 1.8rem;
  margin: 0 0 .25rem;
  color: var(--rose-deep);
}
.auth-sub { color: var(--muted); margin: 0 0 1.25rem; }
.otp-page {
  text-align: center;
}
.otp-icon {
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto .85rem;
  display: grid;
  place-items: center;
  border-radius: 1.15rem;
  color: var(--rose-deep);
  background: linear-gradient(160deg, #fff1ed, #ffe3dc);
  box-shadow: inset 0 0 0 1px rgba(196, 92, 106, .12);
}
.otp-title {
  margin: 0 0 .35rem;
  font-size: 1.45rem;
}
.otp-copy {
  margin: 0 auto .85rem;
  color: var(--muted);
  max-width: 22rem;
  line-height: 1.45;
}
.otp-copy strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.otp-hint {
  margin: 0 auto 1rem;
  padding: .55rem .8rem;
  width: fit-content;
  max-width: 100%;
  border-radius: .75rem;
  background: var(--accent-soft);
  color: var(--rose-deep);
  font-size: .88rem;
}
.otp-form {
  margin-top: .35rem;
}
.otp-digits {
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin: .35rem 0 0;
}
.otp-digit {
  width: 2.65rem !important;
  height: 3.1rem;
  padding: 0 !important;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: .8rem !important;
  background: #fff !important;
}
.otp-digit:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(196, 92, 106, 0.15);
}
.otp-error {
  margin: .75rem 0 0;
  color: var(--danger);
  font-size: .9rem;
  font-weight: 600;
}
.otp-actions {
  margin-top: 1.15rem;
  justify-content: center;
}
.otp-submit {
  width: 100%;
}
.otp-resend {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.otp-resend-copy {
  margin: 0 0 .65rem;
  color: var(--muted);
  font-size: .9rem;
}
.otp-resend-btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}
@media (max-width: 420px) {
  .otp-digit {
    width: 2.35rem !important;
    height: 2.85rem;
    font-size: 1.1rem;
  }
  .otp-digits { gap: .35rem; }
}
.phone-field {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.phone-field:focus-within {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(196, 92, 106, 0.15);
  background: #fff;
}
.phone-field__divider {
  width: 1px;
  align-self: stretch;
  margin: .55rem 0;
  background: var(--line);
  flex: 0 0 1px;
}
.phone-field__number {
  flex: 1 1 auto;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  margin: 0 !important;
  min-width: 0;
  padding: .7rem .85rem .7rem .7rem !important;
  color: var(--ink);
}
.country-picker {
  position: relative;
  flex: 0 0 auto;
}
.country-picker__trigger {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: .4rem;
  height: 100%;
  width: auto;
  margin: 0;
  padding: .65rem .55rem .65rem .75rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}
.country-picker__trigger:hover,
.country-picker__trigger:focus-visible {
  background: rgba(255, 255, 255, .72) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  color: var(--ink) !important;
}
.country-picker__flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(42, 24, 20, .12);
  flex-shrink: 0;
  background: #f3e4df;
  display: block;
}
.country-picker__dial {
  font-variant-numeric: tabular-nums;
  min-width: 2.1rem;
}
.country-picker__chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .15s ease;
}
.country-picker.is-open .country-picker__chevron {
  transform: rotate(180deg);
}
.country-picker__panel {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  z-index: 40;
  width: min(20rem, calc(100vw - 2.5rem));
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: .95rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.country-picker__search-wrap {
  padding: .65rem .65rem .45rem;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.country-picker__search {
  width: 100%;
  margin: 0;
  border: 1.5px solid var(--line) !important;
  border-radius: .7rem !important;
  background: #fff !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  padding: .55rem .7rem !important;
  font-size: .9rem;
}
.country-picker__list {
  list-style: none;
  margin: 0;
  padding: .35rem;
  max-height: 14rem;
  overflow: auto;
}
.country-picker__list li[hidden] {
  display: none;
}
.country-picker__option {
  display: grid !important;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  justify-content: stretch;
  gap: .65rem;
  width: 100%;
  margin: 0;
  padding: .55rem .6rem !important;
  border: 0 !important;
  border-radius: .65rem !important;
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  text-align: left;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.country-picker__option:hover,
.country-picker__option:focus-visible {
  background: var(--accent-soft) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  color: var(--ink) !important;
}
.country-picker__option.is-selected {
  background: #fff1ed !important;
  color: var(--rose-deep) !important;
}
.country-picker__option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.country-picker__option-dial {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.country-picker__empty {
  margin: 0;
  padding: .85rem 1rem 1rem;
  color: var(--muted);
  font-size: .9rem;
}
.password-field {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1.5px solid var(--line, #e7cfc7);
  border-radius: var(--radius-sm, .85rem);
  background: var(--cream, #fffaf8);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.password-field:focus-within {
  border-color: var(--rose, #c45c6a);
  box-shadow: 0 0 0 4px rgba(196, 92, 106, 0.15);
  background: #fff;
}
.password-field__input {
  flex: 1 1 auto;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  margin: 0 !important;
  min-width: 0;
  padding-right: .35rem !important;
}
.password-field__toggle {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted, #8a6a62);
  box-shadow: none;
  cursor: pointer;
}
.password-field__toggle:hover,
.password-field__toggle:focus-visible {
  color: var(--rose-deep, #a23d4c);
  background: transparent;
  box-shadow: none;
}
.password-field__icon[hidden] {
  display: none;
}
.auth-check {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .35rem 0;
  font-weight: 500;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-photo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 1rem;
  background: linear-gradient(145deg, var(--blush), #f5c4b8);
  box-shadow: var(--shadow-sm);
}
.profile-photo-lg {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1rem 1rem 0 0;
  background: linear-gradient(145deg, #f0b8ae, #e89aa0);
  display: block;
}
.photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 1rem 1rem 0 0;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  color: #fff;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(160deg, #e08a7a 0%, #c45c6a 55%, #8f3d55 100%);
}

.dating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.person-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.person-card-heart {
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 3;
}
.favorite-form { margin: 0; }
.favorite-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.favorite-btn.is-double {
  color: var(--rose-deep, #9b3d4a);
}
.favorite-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, .92);
  color: var(--rose);
  box-shadow: 0 6px 16px rgba(120, 40, 50, .18);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.favorite-btn:hover { transform: scale(1.06); color: var(--rose-deep); }
.favorite-btn.is-on {
  background: var(--rose);
  color: #fff;
}
.people-detail-heart {
  position: absolute;
  top: .7rem;
  right: .7rem;
  z-index: 2;
}
.person-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(164, 74, 74, 0.14);
}
.person-card-media {
  position: relative;
  background: #fff5f2;
}
.person-card-score {
  position: absolute;
  left: .65rem;
  bottom: .65rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: rgba(42, 24, 20, .72);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.person-card-body {
  padding: .85rem .9rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-height: 0;
}
.person-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
}
.person-card h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  min-width: 0;
}
.person-meta {
  color: var(--muted);
  font-size: .82rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-bio {
  color: var(--ink);
  font-size: .86rem;
  margin: .15rem 0 .35rem;
  line-height: 1.35;
  opacity: .88;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.person-card .actions,
.person-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.person-card-actions .btn,
.person-card-actions form { margin: 0; }
.person-card-actions form { display: inline-flex; }

.deck-stack {
  display: grid;
  gap: 1rem;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-items: start;
}
.discover-empty { grid-column: 1 / -1; }
.person-card.discover-card {
  margin: 0;
  height: auto;
  max-width: 100%;
}

.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .85rem; }
.chat-bubble {
  max-width: 72%;
  padding: .75rem .95rem;
  border-radius: 1.1rem;
  margin: .4rem 0;
  background: #ffe9e4;
  box-shadow: 0 2px 8px rgba(164,74,74,.06);
}
.chat-bubble.mine {
  margin-left: auto;
  background: linear-gradient(135deg, #ffe0d6, #ffd0c4);
  border-bottom-right-radius: .35rem;
}
.chat-list-item {
  display: flex;
  gap: .9rem;
  align-items: center;
}
.chat-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(145deg, var(--blush), #e89aa0);
  flex-shrink: 0;
}

/* Admin shell uses rose-aligned system below */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
h2 {
  margin: 0 0 .9rem;
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h3 { font-family: var(--display); }

.mobile-nav { display: none; }
.mobile-bottom-nav { display: none; }
.mobile-drawer-scrim { display: none; }
.sidebar-mobile-head { display: none; }
.app-topbar-burger { display: none; }
.chat-rail-head-actions { display: inline-flex; align-items: center; gap: .35rem; }
.sidebar-wallet-card {
  position: relative;
  gap: .55rem;
  overflow: hidden;
  text-decoration: none;
  color: #fff8f5;
  background:
    linear-gradient(160deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.06) 45%, rgba(0,0,0,.14) 100%);
  border: 1px solid rgba(255, 232, 226, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 10px 22px rgba(0,0,0,.16);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.sidebar-wallet-card:hover {
  border-color: rgba(255, 232, 226, .38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 26px rgba(0,0,0,.2);
}
.sidebar-wallet-card__glow {
  position: absolute;
  top: -2.5rem;
  right: -1.5rem;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 160, .32), transparent 70%);
  pointer-events: none;
}
.sidebar-wallet-card__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: .65rem;
  z-index: 1;
  width: 100%;
  min-width: 0;
}
.sidebar-wallet-card__ico {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .92rem;
  font-weight: 800;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.2);
  color: #ffe8e0;
  flex: 0 0 auto;
}
.sidebar-wallet-card__ico--pts {
  font-size: .82rem;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.14);
  color: rgba(255, 232, 226, .88);
}
.sidebar-wallet-card__copy {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
  flex: 1 1 auto;
}
.sidebar-wallet-card__label {
  display: block;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 244, 240, .78);
  line-height: 1;
}
.sidebar-wallet-card__label--muted {
  color: rgba(255, 232, 226, .58);
  font-weight: 650;
}
.sidebar-wallet-card__value {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: .01em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-wallet-card__points {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 236, 230, .78);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-wallet-card__divider {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 1px;
  margin: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.28), rgba(255,255,255,.06));
}
.person-card.is-live-in,
.dock-msg.is-live-in,
.chat-rail-item.is-live-in,
.wa-list-item.is-live-in {
  animation: liveCardIn .55s ease;
}
@keyframes liveCardIn {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.mobile-drawer-close {
  display: none;
  width: 32px; height: 32px; border: 0; border-radius: 9px;
  background: rgba(255,255,255,.14); color: #fff;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  align-items: center; justify-content: center;
}
.chat-rail .mobile-drawer-close,
.wa-sidebar-head .mobile-drawer-close {
  background: #ead7d0;
  color: #4a2328;
}
.mode-bar {
  display: flex;
  gap: .75rem;
  align-items: end;
  flex-wrap: wrap;
}
.mode-bar > div { flex: 1; min-width: 160px; }

/* —— Marketing homepage —— */
.marketing-page { padding-bottom: 3rem; }
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  max-width: 1120px;
  margin: 0 auto;
}
.site-header .logo {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rose-deep);
}
.site-header nav { display: flex; gap: .65rem; align-items: center; }

.hero {
  max-width: 1120px;
  margin: 0.5rem auto 2.5rem;
  padding: 2.5rem 1.5rem 2.75rem;
  border-radius: 2rem;
  background:
    linear-gradient(125deg, rgba(255,255,255,.55), rgba(255,240,236,.75)),
    radial-gradient(600px 300px at 85% 20%, rgba(224,122,95,.25), transparent 60%),
    linear-gradient(160deg, #ffe3dc 0%, #ffd0d8 45%, #fff5f2 100%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,92,106,.2), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.7);
  color: var(--rose-deep);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 .85rem;
  max-width: 14ch;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero p.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 36ch;
  margin: 0 0 1.5rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-note { margin-top: 1.25rem; font-size: .88rem; color: var(--muted); }

.section {
  max-width: 1120px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.section-head p { color: var(--muted); margin: .25rem 0 0; max-width: 40ch; }
.home-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin: 0 0 1.35rem;
  padding: .7rem;
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 28px rgba(80, 30, 40, .06);
}
.home-search input[type="search"] {
  flex: 1 1 16rem;
  min-width: 0;
  margin: 0;
  border: 1.5px solid var(--line);
  border-radius: .85rem;
  background: #fff;
  padding: .7rem .9rem;
  font: inherit;
  color: var(--ink);
}
.home-search input[type="search"]:focus {
  outline: none;
  border-color: #e08a7a;
  box-shadow: 0 0 0 3px rgba(224, 122, 95, .18);
}
.home-search .btn { margin: 0; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.feature-pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-sm);
}
.feature-pill strong {
  display: block;
  font-family: var(--display);
  margin-bottom: .25rem;
  color: var(--rose-deep);
}

.site-footer {
  max-width: 1120px;
  margin: 2rem auto 0;
  padding: 1.5rem;
  color: var(--muted);
  font-size: .9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.profile-hero-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
  align-items: center;
}
@media (max-width: 600px) {
  .profile-hero-card { grid-template-columns: 1fr; }
}
.profile-completeness { display: flex; flex-wrap: wrap; gap: .4rem; }
.profile-avatar-upload {
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  width: 150px;
}
.photo-dropzone {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.photo-dropzone--avatar {
  width: 150px; height: 150px; border-radius: 1.35rem;
  border: 1.5px dashed #d4b8b1;
  background: linear-gradient(145deg, #f7ebe7, #efe0db);
}
.photo-dropzone--avatar.has-photo { border-style: solid; border-color: #e8d5cf; }
.photo-dropzone:hover,
.photo-dropzone:focus-visible {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(196, 92, 106, .14);
  outline: none;
}
.photo-dropzone.is-dragover {
  border-color: var(--rose-deep, #9b3d4a);
  box-shadow: 0 0 0 4px rgba(196, 92, 106, .2);
  transform: scale(1.02);
}
.photo-dropzone-input {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important; border: 0 !important;
  opacity: 0 !important;
}
.profile-avatar-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.profile-avatar-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 2.4rem; font-weight: 700;
  color: #fff; background: linear-gradient(145deg, #e08a7a, #c45c6a);
}
.photo-dropzone-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; padding: .75rem; text-align: center;
  color: #fff; background: rgba(42, 18, 22, .55);
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
  z-index: 2;
}
.photo-dropzone--avatar:not(.has-photo) .photo-dropzone-overlay,
.photo-dropzone--avatar:hover .photo-dropzone-overlay,
.photo-dropzone--avatar:focus-visible .photo-dropzone-overlay,
.photo-dropzone--avatar.is-dragover .photo-dropzone-overlay {
  opacity: 1;
}
.photo-dropzone-badge {
  position: absolute;
  right: .55rem;
  bottom: .55rem;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0567a, #c45c6a);
  color: #fff;
  box-shadow: 0 6px 16px rgba(80, 30, 40, .28);
  pointer-events: none;
}
.profile-avatar-upload-btn {
  margin: 0;
  padding: .4rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 92, 106, .28);
  background: #fff;
  color: var(--rose-deep);
  font-weight: 700;
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(80, 30, 40, .06);
  filter: none;
}
.profile-avatar-upload-btn:hover {
  background: #fff7f4;
  border-color: var(--rose);
  color: var(--rose-deep);
  filter: none;
  transform: translateY(-1px);
}
.photo-dropzone-overlay strong { font-size: .88rem; line-height: 1.2; }
.photo-dropzone-overlay span { font-size: .72rem; opacity: .9; }
.photo-dropzone-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18); color: #fff; margin-bottom: .15rem;
}
.photo-dropzone-preview {
  position: absolute; inset: 0; z-index: 1;
  background-size: cover; background-position: center;
}
.photo-dropzone.has-file .profile-avatar-img,
.photo-dropzone.has-file .profile-avatar-fallback { opacity: 0; }
.photo-dropzone-content {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  text-align: center; color: var(--muted); pointer-events: none;
}
.photo-dropzone-content strong { color: var(--ink); font-size: .98rem; }
.photo-dropzone-content span { font-size: .82rem; }
.photo-dropzone-family {
  display: inline-flex; align-items: center; gap: .35rem;
  margin: 0; color: var(--muted); font-size: .78rem; justify-content: center;
}
.profile-mode-bar { margin-bottom: 1rem; }
.profile-mode-toggles {
  display: flex; flex-wrap: wrap; gap: .65rem; align-items: center;
}
.mode-toggle {
  display: inline-flex; align-items: center; gap: .45rem;
  margin: 0; padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-weight: 600; color: var(--muted);
}
.mode-toggle input { width: auto; margin: 0; }
.mode-toggle.is-on {
  color: var(--ink); border-color: #e2b4ad;
  background: linear-gradient(180deg, #fff7f4, #fff);
}
.profile-tabs {
  display: flex; gap: .35rem; margin: 0 0 1rem;
  border-bottom: 1px solid var(--line); padding-bottom: .15rem;
}
.profile-tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 120px; padding: .7rem 1.1rem; border-radius: 12px 12px 0 0;
  text-decoration: none; color: var(--muted); font-weight: 700;
  border: 1px solid transparent; border-bottom: 0;
}
.profile-tab:hover { color: var(--ink); background: #fff7f4; }
.profile-tab.is-active {
  color: var(--ink); background: #fff;
  border-color: var(--line); box-shadow: 0 -1px 0 #fff;
}
.profile-tab.is-disabled { opacity: .55; }
.profile-tab-panel { border-top-left-radius: 0; }
.profile-form-section {
  margin: 0 0 1.25rem;
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(180deg, #fff, #fffaf8);
}
.profile-form-section--prefs {
  background: linear-gradient(180deg, #fff8f4, #fff3ee);
  border-color: #f0cfc4;
}
.profile-form-section__head {
  margin-bottom: .9rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}
.profile-form-section__head h4 {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
}
.profile-form-section__head p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.field-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: .35rem;
}
.field-label label {
  margin: 0;
}
.field-info {
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  cursor: help;
}
.field-info:hover,
.field-info:focus-visible,
.field-info.is-open {
  color: var(--rose-deep);
  background: var(--accent-soft);
  box-shadow: none;
  transform: none;
  filter: none;
}
.field-info__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .45rem);
  transform: translateX(-50%);
  width: min(16rem, 70vw);
  padding: .55rem .7rem;
  border-radius: .7rem;
  background: #2a1814;
  color: #fff7f4;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 20;
  box-shadow: 0 10px 24px rgba(42, 24, 20, .22);
}
.field-info:hover .field-info__tip,
.field-info:focus-visible .field-info__tip,
.field-info.is-open .field-info__tip {
  opacity: 1;
}
.field-hint {
  margin: .35rem 0 0;
  font-size: .8rem;
}
.profile-check {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .55rem 0 0;
}

/* Layout breakpoints */
@media (max-width: 1200px) {
  :root {
    --sidebar-w: 230px;
    --chat-rail-w: 260px;
  }
  .main { padding: 1.25rem 1.15rem 2rem; }
}
@media (max-width: 980px) {
  :root {
    --sidebar-w: 210px;
    --chat-rail-w: 240px;
  }
}
@media (max-width: 860px) {
  :root {
    --mobile-bottom-nav-h: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  body.app-shell {
    padding-bottom: var(--mobile-bottom-nav-h);
  }

  .wrap {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  /* Left menu as off-canvas drawer */
  body.app-shell .sidebar,
  body.app-shell #app-sidebar {
    position: fixed;
    top: var(--app-topbar-h);
    left: 0;
    bottom: 0;
    width: min(86vw, 300px);
    max-width: min(86vw, 300px);
    height: auto;
    max-height: none;
    z-index: 120;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 18px 0 40px rgba(40, 18, 22, .28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.app-shell.mobile-drawer-left-open .sidebar,
  body.app-shell.mobile-drawer-left-open #app-sidebar {
    transform: translateX(0);
  }
  body.app-shell .sidebar-nav {
    overflow: auto;
    max-height: none;
    flex: 1;
    padding-bottom: 1.25rem;
    -webkit-overflow-scrolling: touch;
  }
  body.app-shell .mobile-drawer-close {
    display: inline-flex;
  }
  body.app-shell .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem .35rem;
    color: #ffe8e2;
    flex-shrink: 0;
  }
  body.app-shell .sidebar-mobile-head strong {
    font-family: var(--display);
    font-size: 1.05rem;
  }

  /* Right chats as full-height off-canvas drawer (above bottom nav) */
  body.app-shell .chat-rail,
  body.app-shell #chat-rail {
    position: fixed !important;
    top: var(--app-topbar-h) !important;
    right: 0 !important;
    left: auto !important;
    bottom: var(--mobile-bottom-nav-h) !important;
    width: min(92vw, 360px) !important;
    max-width: min(92vw, 360px) !important;
    flex: none !important;
    align-self: stretch !important;
    height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h)) !important;
    max-height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h)) !important;
    min-height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h)) !important;
    border-left: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 !important;
    order: initial;
    z-index: 120;
    transform: translate3d(105%, 0, 0);
    transition: transform .22s ease;
    box-shadow: -18px 0 40px rgba(40, 18, 22, .22);
    background: #fffaf8;
    padding-bottom: 0;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  body.app-shell.mobile-drawer-right-open .chat-rail,
  body.app-shell.mobile-drawer-right-open #chat-rail {
    transform: translate3d(0, 0, 0);
  }
  body.app-shell .chat-rail-list {
    max-height: none !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.app-shell .chat-rail-head {
    flex-shrink: 0;
  }

  .mobile-drawer-scrim {
    display: block;
    position: fixed;
    inset: var(--app-topbar-h) 0 0;
    background: rgba(42, 24, 20, .42);
    z-index: 110;
    border: 0;
  }
  .mobile-drawer-scrim[hidden] { display: none !important; }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    height: var(--mobile-bottom-nav-h);
    padding: .35rem .35rem calc(.35rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 250, 247, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
    box-shadow: 0 -10px 28px rgba(40, 18, 22, .08);
  }
  .mobile-bottom-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .12rem;
    min-width: 0;
    padding: .2rem .15rem;
    color: var(--muted);
    text-decoration: none;
    font-size: .68rem;
    font-weight: 600;
    border-radius: 12px;
  }
  .mobile-bottom-nav__item svg { display: block; }
  .mobile-bottom-nav__item span:not(.mobile-bottom-nav__badge) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-bottom-nav__item.is-active {
    color: var(--rose-deep);
    background: color-mix(in srgb, var(--blush) 55%, white);
  }
  .mobile-bottom-nav__badge {
    position: absolute;
    top: .05rem;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--rose);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
  }

  .chat-dock {
    right: 10px;
    left: auto;
    max-width: calc(100vw - 20px);
    bottom: var(--mobile-bottom-nav-h);
  }
  .chat-dock-panel {
    max-width: min(360px, calc(100vw - 20px));
    max-height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h) - 12px);
  }

  .main {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    padding: 1rem .85rem calc(1.25rem + 8px);
    min-height: 0;
  }
  .hero { margin: 0.75rem .5rem 1.25rem; padding: 1.5rem 1.1rem; border-radius: 1.25rem; }
  .page-hero {
    padding: 1.05rem 1.05rem;
    border-radius: 1.15rem;
  }
  .page-hero-actions {
    flex-wrap: wrap;
    gap: .45rem;
  }
  .page-hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  /* Bottom nav already covers primary destinations */
  body.app-shell .page-hero-actions,
  body.app-shell .agent-hero__actions {
    display: none;
  }
  body.app-shell .page-hero .actions a[href*="/chats"],
  body.app-shell .page-hero .actions a[href*="/connections"],
  body.app-shell .page-hero .actions a[href*="/discover"],
  body.app-shell .page-hero .actions a[href*="/matches"] {
    display: none;
  }
  body.app-shell .page-hero.topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
  }
  body.app-shell .page-hero.topbar .actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
  }
  body.app-shell .profile-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .15rem;
  }
  body.app-shell .profile-tab {
    flex: 0 0 auto;
  }
  body.app-shell .connection-tabs,
  body.app-shell .match-tabs {
    overflow-x: auto;
  }
  body.app-shell .person-card,
  body.app-shell .match-profile-card,
  body.app-shell .connection-card {
    border-radius: 1rem;
  }
  body.app-shell .people-detail-hero,
  body.app-shell .profile-hero-card {
    grid-template-columns: 1fr;
  }
  body.app-shell .agent-balances,
  body.app-shell .agent-stats-grid {
    grid-template-columns: 1fr;
  }

  .deck-stack {
    grid-template-columns: 1fr;
    gap: .85rem;
  }
  .discover-actions,
  .discover-actions-primary {
    grid-template-columns: 1fr;
  }
  .discover-actions-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }
  .discover-filters-grid {
    grid-template-columns: 1fr;
  }

  .table-scroll,
  .agent-payroll-table-wrap,
  .card table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Advanced post-login shell */
body.app-shell,
body.admin-shell {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
body.app-shell,
body.admin-shell {
  background:
    radial-gradient(1000px 500px at -10% -20%, #ffcbbf 0%, transparent 50%),
    radial-gradient(900px 480px at 110% 0%, #ffb8c8 0%, transparent 45%),
    linear-gradient(165deg, #fff7f4 0%, #ffe9e4 40%, #fffaf8 100%);
}
.app-shell .sidebar {
  backdrop-filter: blur(8px);
  border-right: 1px solid rgba(255,255,255,.06);
}
.app-shell .main,
.admin-shell .main {
  max-width: none;
  opacity: 1;
  animation: fadeUp .3s ease both;
}
.admin-shell .admin-main {
  padding: 1.35rem 1.5rem 2.25rem;
}
@keyframes fadeUp {
  from { opacity: .2; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-hero {
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,232,226,.85));
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow-sm);
}
.page-hero h2 { margin: 0; }
.page-hero p { margin: .4rem 0 0; color: var(--muted); }
.page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  background: linear-gradient(180deg, #fff 0%, #fff8f6 100%);
  border-radius: 1.4rem;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-panel-header {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.85);
}
.chat-panel-body {
  flex: 1;
  padding: 1.1rem 1.15rem;
  overflow-y: auto;
  max-height: 480px;
}
.chat-panel-composer {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.composer-row { display: flex; gap: .65rem; align-items: flex-end; }
.composer-row textarea { flex: 1; min-height: 48px; resize: vertical; }
.match-tile {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: 1.15rem;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: .75rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.match-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399; display: inline-block;
  box-shadow: 0 0 0 4px rgba(52,211,153,.2);
  margin-right: .35rem;
}

/* ?? Matches page + connections ?? */
.matches-section { margin-bottom: 2rem; }
.matches-section-title {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 0 0 1rem;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: .55rem;
}
.matches-count {
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 700;
  color: var(--rose-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: .15rem .55rem;
}
.matches-subcopy {
  margin: -.35rem 0 1rem;
  color: var(--muted);
  font-size: .92rem;
  max-width: 52rem;
}
.matches-tabs { margin-bottom: 1.25rem; }
.matches-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 1.15rem;
}
.matches-subtab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.matches-subtab span {
  font-size: .78rem;
  font-weight: 700;
  color: var(--rose-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: .1rem .45rem;
}
.matches-subtab:hover { color: var(--ink); border-color: #e2b4ad; }
.matches-subtab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  border-color: transparent;
}
.matches-subtab.is-active span {
  background: rgba(255,255,255,.22);
  color: #fff;
}
.matches-card-grid,
.connection-list.deck-stack {
  margin-bottom: .25rem;
}
.match-profile-card,
.connection-card--compact {
  margin: 0;
  height: auto;
  max-width: 100%;
}
.match-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  margin: .15rem 0 .15rem;
}
.match-card-muted { opacity: .82; }
.match-card-muted:hover { opacity: 1; }
.match-card-actions { margin-top: 0; }
.match-card-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  width: 100%;
}
.match-card-actions-row .btn,
.match-card-actions-row form,
.match-card-actions-row form .btn {
  width: 100%;
  margin: 0;
  justify-content: center;
}
.match-card-actions-row form { display: block; }
.match-card-actions-secondary {
  margin-top: .4rem;
}
.match-card-actions-secondary .btn {
  width: 100%;
  justify-content: center;
}
.connection-status.pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: .45rem .55rem;
  border-radius: .75rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--rose-deep);
  background: color-mix(in srgb, var(--rose) 12%, white);
  border: 1px solid #f0d7d0;
  text-align: center;
}
.connection-card--compact .person-card-body { padding-bottom: .35rem; }
.connect-compose {
  margin-top: .35rem;
  padding: .7rem;
  border-radius: 12px;
  background: #fffaf8;
  border: 1px solid #f0d7d0;
}
.connect-compose-label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #9a7a74;
  margin-bottom: .3rem;
}
.connect-compose textarea {
  width: 100%;
  min-height: 52px;
  max-height: 88px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid #e8d5cf;
  background: #fff;
  padding: .5rem .65rem;
  font: inherit;
  font-size: .86rem;
  line-height: 1.35;
}
.discover-actions {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: .65rem;
}
.discover-actions-primary,
.discover-actions-secondary {
  display: grid;
  gap: .4rem;
}
.discover-actions-primary {
  grid-template-columns: 1.2fr .9fr;
}
.discover-actions-secondary {
  grid-template-columns: 1fr auto auto;
}
.discover-actions .btn {
  width: 100%;
  justify-content: center;
  margin: 0;
  padding: .55rem .65rem;
  font-size: .88rem;
}
.discover-actions-secondary .btn.ghost {
  padding: .45rem .55rem;
  font-size: .8rem;
}
.connect-compose-actions { margin: 0; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* �� Bottom chat dock (Messenger-style) �� */
/* Sit left of the persistent right users rail so the list stays fully visible */
.chat-dock {
  position: fixed;
  right: calc(var(--chat-rail-w, 300px) + 12px);
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  max-width: calc(100vw - var(--chat-rail-w, 300px) - 24px);
  pointer-events: none;
}
.chat-dock-panel {
  --dock-accent: var(--rose);
  --dock-accent-2: var(--rose-deep);
  --dock-tint: var(--accent-soft);
  width: 400px;
  max-width: min(400px, calc(100vw - var(--chat-rail-w, 300px) - 28px));
  height: min(72vh, 680px);
  max-height: calc(100vh - var(--app-topbar-h, 58px) - 12px);
  background: #fff;
  border: 1px solid #eadfd9;
  border-bottom: 0;
  border-top: 3px solid var(--dock-accent);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 34px rgba(40, 18, 22, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  transition: height .2s ease, transform .2s ease, box-shadow .2s ease;
}
.chat-dock-panel.is-minimized { height: 52px; max-height: 52px; }
.chat-dock-panel.is-focused {
  box-shadow: 0 -12px 40px color-mix(in srgb, var(--rose) 35%, transparent);
  outline: 2px solid color-mix(in srgb, var(--rose) 55%, white);
  outline-offset: 0;
}
.dock-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem .7rem;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose) 55%, var(--coral));
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.dock-accent {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: rgba(255,255,255,.35);
}
.dock-avatar, .wa-list-avatar, .wa-thread-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: linear-gradient(145deg, #e08a7a, #c45c6a);
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
}
.dock-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-family: var(--display);
}
.dock-title { flex: 1; min-width: 0; line-height: 1.2; }
.dock-title strong { display: block; font-size: .95rem; letter-spacing: .01em; }
.dock-title span { display: block; font-size: .72rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-unread {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--rose-deep, #c45c6a);
  font-size: .68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(40, 18, 22, .2);
}
.chat-dock-panel:not(.is-minimized) .dock-unread { display: none; }
.dock-actions { display: inline-flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.dock-btn {
  width: 30px; height: 30px; border: 0; border-radius: 9px;
  background: rgba(255,255,255,.18); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 600; line-height: 1;
  transition: background .15s ease, transform .12s ease;
}
.dock-btn svg {
  display: block;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}
.dock-btn:hover { background: rgba(255,255,255,.28); }
.dock-btn:active { transform: scale(.94); }
.dock-btn--close:hover { background: rgba(0,0,0,.22); }
.dock-btn--eye {
  background: #f5c518;
  color: #5c4500;
}
.dock-btn--eye:hover {
  background: #ffd84d;
  color: #3d2e00;
}
/* Light surfaces: beat global `button { color:#fff }` so icons stay visible */
.chat-gift-panel .dock-btn,
.wa-thread-head .dock-btn,
.wa-thread-head a.dock-btn,
.agent-modal__panel .dock-btn,
.chat-attach-menu .dock-btn {
  background: #ead7d0 !important;
  color: #3b1c20 !important;
  box-shadow: inset 0 0 0 1px rgba(74, 35, 40, 0.1);
  filter: none !important;
  transform: none;
}
.chat-gift-panel .dock-btn:hover,
.wa-thread-head .dock-btn:hover,
.wa-thread-head a.dock-btn:hover,
.agent-modal__panel .dock-btn:hover {
  background: #d9bbb0 !important;
  color: #1f1012 !important;
  filter: none !important;
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(74, 35, 40, 0.14);
}
.chat-gift-panel .dock-btn--close,
.wa-thread-head .dock-btn--close,
.wa-thread-head .wa-back-inline,
.wa-thread-head .wa-close-inline {
  background: #e4cec5 !important;
  color: #2a1418 !important;
  font-weight: 700;
}
.chat-gift-panel .dock-btn--close:hover,
.wa-thread-head .dock-btn--close:hover,
.wa-thread-head .wa-back-inline:hover,
.wa-thread-head .wa-close-inline:hover {
  background: #d0b3a8 !important;
  color: #140a0c !important;
}
.wa-thread-head .dock-btn--eye {
  background: #f5c518 !important;
  color: #5c4500 !important;
}
.wa-thread-head .dock-btn--eye:hover {
  background: #ffd84d !important;
  color: #3d2e00 !important;
}
.agent-modal__panel header .btn.ghost.small[aria-label="Close"] {
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 9px;
  background: #ead7d0 !important;
  border: 1px solid #d9c0b6 !important;
  color: #2a1418 !important;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}
.agent-modal__panel header .btn.ghost.small[aria-label="Close"]:hover {
  background: #d0b3a8 !important;
  color: #140a0c !important;
  border-color: #c9a89c !important;
}
.wa-thread-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.chat-gift-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.chat-gift-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 12, 10, 0.28);
  backdrop-filter: blur(2px);
}
.chat-gift-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(78vh, 640px);
  overflow: auto;
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 250, 248, 0.88);
  box-shadow: 0 24px 60px rgba(42, 24, 20, 0.28);
  padding: 0.95rem 1rem 1.1rem;
}
.chat-gift-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.chat-gift-panel__head strong {
  display: block;
  font-size: 1.05rem;
}
.chat-gift-panel__wallet {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted, #8a6a62);
  font-weight: 600;
}
.chat-gift-panel__wallet.is-low,
.chat-gift-panel__wallet.is-low strong {
  color: #8a2e28;
}
.chat-gift-panel__wallet a {
  color: var(--rose-deep, #a23d4c);
  font-weight: 700;
  text-decoration: none;
}
.chat-gift-panel__wallet a:hover { text-decoration: underline; }
.wallet-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.wallet-hero__balances {
  display: flex;
  gap: .75rem;
}
.wallet-stat {
  min-width: 140px;
  padding: .65rem .85rem;
  border-radius: 14px;
  background: #fff7f4;
  border: 1px solid #f0d7d0;
}
.wallet-stat span {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.wallet-stat strong {
  display: block;
  font-size: 1.25rem;
  font-family: var(--display);
  line-height: 1.15;
}
.wallet-stat__points {
  display: block;
  margin-top: .2rem;
  font-size: .78rem;
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  opacity: .85;
  font-variant-numeric: tabular-nums;
}
.wallet-add-card {
  max-width: 720px;
}
.wallet-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.wallet-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .85rem;
}
.wallet-preset {
  border: 1.5px solid #f0d7d0 !important;
  background: #fff !important;
  border-radius: 999px !important;
  padding: .45rem .9rem !important;
  font: inherit !important;
  font-weight: 650 !important;
  cursor: pointer;
  color: var(--ink) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  width: auto !important;
}
.wallet-preset:hover,
.wallet-preset.is-active {
  border-color: var(--rose) !important;
  color: var(--rose-deep) !important;
  background: #fff7f4 !important;
}
.wallet-amount-label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: .85rem;
  max-width: 240px;
  font-weight: 650;
}
.wallet-amount-label input {
  font: inherit;
  padding: .65rem .75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.wallet-pos { color: var(--ok); font-weight: 700; }
.wallet-neg { color: var(--danger); font-weight: 700; }
.wallet-cat {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: #f3e8e4;
  color: #6b4a44;
}
.gift-inbox__hero { margin-bottom: 1rem; }
.gift-inbox__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1.1rem;
}
.gift-inbox__stat {
  padding: .85rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.gift-inbox__stat span {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.gift-inbox__stat strong {
  font-family: var(--display);
  font-size: 1.35rem;
}
.gift-inbox__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.gift-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gift-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.gift-card.is-redeemed { opacity: .88; }
.gift-card__media {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 214, 204, .9), transparent 55%),
    linear-gradient(145deg, #fff7f4, #ffe8e1);
  font-size: 3.2rem;
}
.gift-card__media img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 16px;
}
.gift-card__body { padding: 1rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.gift-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.gift-card__top h3 { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.gift-card__badge {
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .2rem .45rem;
  border-radius: 999px;
  background: #ffe8e2;
  color: #a23d4c;
}
.gift-card.is-redeemed .gift-card__badge {
  background: #e8efe9;
  color: #2f7d57;
}
.gift-card__from { margin: 0; color: var(--muted); font-size: .86rem; }
.gift-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .15rem;
}
.gift-card__points {
  font-weight: 800;
  color: var(--rose-deep);
  font-size: .92rem;
}
.gift-card__note {
  margin: .25rem 0 0;
  font-size: .84rem;
  color: #6b4a44;
  font-style: italic;
}
.gift-card__actions { margin-top: auto; padding-top: .65rem; }
.gift-card__actions .btn { width: 100%; justify-content: center; }
.gift-card__done {
  margin: auto 0 0;
  padding-top: .55rem;
  font-size: .8rem;
  font-weight: 700;
  color: #2f7d57;
}
.gift-inbox__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.25rem 1.25rem;
}
.gift-inbox__empty-ico { font-size: 2.5rem; margin-bottom: .35rem; }
.gift-inbox__empty h3 { margin: 0 0 .35rem; }
@media (max-width: 640px) {
  .gift-inbox__stats { grid-template-columns: 1fr; }
}
.wallet-cat--gift_send { background: #ffe8e2; color: #a23d4c; }
.wallet-cat--subscription { background: #e8f0ff; color: #2f4f8a; }
.wallet-cat--purchase,
.wallet-cat--debit { background: #fff3e0; color: #9a5b12; }
.wallet-methods-label {
  margin: .35rem 0 .55rem;
  font-weight: 700;
}
.wallet-methods {
  display: grid;
  gap: .75rem;
  margin-bottom: 1.1rem;
}
.wallet-method {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 1.5px solid #eadfd8;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.wallet-method input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.wallet-method__radio {
  position: absolute;
  top: 0.95rem;
  right: 0.95rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid #d4b8b0;
  background: #fff;
  box-shadow: inset 0 0 0 0 #c45c6a;
  z-index: 2;
}
.wallet-method.is-selected,
.wallet-method:has(input:checked) {
  border-color: #c45c6a;
  background: #fff8f5;
  box-shadow: 0 0 0 3px rgba(196, 92, 106, 0.12);
}
.wallet-method.is-selected .wallet-method__radio,
.wallet-method:has(input:checked) .wallet-method__radio {
  border-color: #c45c6a;
  box-shadow: inset 0 0 0 4px #c45c6a;
}
.wallet-method__body {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.95rem 1rem;
  min-width: 0;
}
.wallet-method:not(.has-qr) .wallet-method__body {
  grid-template-columns: 1fr;
  padding-right: 2.4rem;
}
.wallet-method__qr-wrap {
  display: block;
  width: 132px;
  height: 132px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #f0d7d0;
  flex-shrink: 0;
}
.wallet-method__qr {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.wallet-method__copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  padding-right: 1.6rem;
  font-size: 0.9rem;
  color: #4a3230;
  line-height: 1.35;
}
.wallet-method__copy strong {
  font-size: 1.05rem;
  color: var(--ink, #2a1814);
  line-height: 1.25;
}
.wallet-method__copy em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #9a7a74;
}
.wallet-method__help {
  margin-top: 0.2rem;
  color: var(--muted, #8a6a62);
  white-space: pre-wrap;
  font-size: 0.84rem;
}
.wallet-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: .85rem;
  max-width: 100%;
  font-weight: 650;
}
.wallet-field input,
.wallet-field textarea {
  font: inherit;
  font-weight: 500;
  padding: .65rem .75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.wallet-upload-box {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.wallet-upload-box__label {
  font-weight: 650;
  font-size: 0.9rem;
}
.wallet-upload-box__label em {
  color: #c45c6a;
  font-style: normal;
}
.wallet-upload-box__drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 168px;
  border: 1.5px dashed #e0b8ae;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdfc, #fff6f2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.wallet-upload-box.is-drag .wallet-upload-box__drop,
.wallet-upload-box__drop:hover {
  border-color: #c45c6a;
  background: #fff1ec;
  box-shadow: 0 0 0 3px rgba(196, 92, 106, 0.12);
}
.wallet-upload-box__placeholder {
  display: grid;
  gap: 0.22rem;
  justify-items: center;
  text-align: center;
  padding: 1rem;
  color: #7a5c55;
}
.wallet-upload-box__placeholder strong {
  color: #4a2328;
  font-size: 0.92rem;
}
.wallet-upload-box__placeholder small {
  font-size: 0.75rem;
  color: #9a7a74;
}
.wallet-upload-box__icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ffe4dc;
  color: #a23d4c;
  margin-bottom: 0.15rem;
}
.wallet-upload-box__preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #1a1010;
}
.wallet-upload-box__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.wallet-upload-box__change {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  z-index: 2;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(42, 24, 20, 0.88);
  color: #fffaf7;
  font-size: 0.75rem;
  font-weight: 700;
}
.wallet-upload-box__preview[hidden],
.wallet-upload-box__placeholder[hidden],
.wallet-upload-box__change[hidden] {
  display: none !important;
}
.wallet-upload-box[data-has-image="1"] .wallet-upload-box__drop {
  border-style: solid;
}
.wallet-add-submit {
  align-self: flex-start;
  min-width: 10rem;
}
@media (max-width: 640px) {
  .wallet-method__body {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .wallet-method__qr-wrap {
    width: min(100%, 200px);
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
  }
  .wallet-method__copy {
    padding-right: 1.8rem;
  }
}
.wallet-topup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.wallet-topup-list li {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .75rem;
  align-items: center;
}
.wallet-topup-status {
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: #fff4df;
  color: #9a6b12;
}
.wallet-topup-status.is-approved { background: #e7f7ee; color: #1f6b45; }
.wallet-topup-status.is-rejected { background: #fde2e2; color: #a11d1d; }
.chat-gift-redeem.is-redeemed {
  opacity: .7;
  background: #e8efe9;
  color: #2f7d57;
}
.chat-gift-panel__error {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.75rem;
  background: #fff1f0;
  border: 1px solid #f0c2bc;
  color: #8a2e28;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}
.chat-gift-panel__error[hidden] { display: none !important; }
.chat-gift-panel__error strong {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chat-gift-panel__error.is-pulse {
  animation: giftWalletPulse 0.7s ease;
}
.chat-gift-notice__link {
  display: inline-block;
  margin-top: 0.25rem;
  color: #a23d4c;
  font-weight: 750;
  text-decoration: underline;
}
.chat-gift-toast {
  position: sticky;
  left: 0;
  right: 0;
  bottom: 0.35rem;
  z-index: 5;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(42, 24, 20, 0.94);
  color: #fffaf7;
  box-shadow: 0 16px 36px rgba(42, 24, 20, 0.28);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.chat-gift-toast[hidden] { display: none !important; }
.chat-gift-toast.is-on {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.chat-gift-toast strong {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd6cc;
}
.chat-gift-toast .chat-gift-notice__link {
  color: #ffd6cc;
}
.chat-gift-pick.is-unaffordable {
  opacity: 0.72;
  border-color: #f0c2bc;
  background: #fff7f5;
}
.chat-gift-pick.is-unaffordable .chat-gift-pick__meta {
  color: #8a2e28;
}
@keyframes giftWalletPulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 92, 106, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(196, 92, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 92, 106, 0); }
}
.chat-gift-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.65rem;
}
.chat-gift-panel__loading,
.chat-gift-panel__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.25rem 0.5rem;
  text-align: center;
  color: var(--muted, #8a6a62);
}
.chat-gift-pick {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.65rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(232, 207, 200, 0.9);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.chat-gift-pick:hover {
  transform: translateY(-1px);
  border-color: #e0a090;
  box-shadow: 0 8px 20px rgba(196, 92, 106, 0.14);
}
.chat-gift-pick:disabled {
  opacity: 0.6;
  cursor: wait;
}
.chat-gift-pick__media {
  display: grid;
  place-items: center;
  height: 72px;
  border-radius: 0.75rem;
  background: #fff7f4;
  font-size: 1.6rem;
  overflow: hidden;
}
.chat-gift-pick__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-gift-pick__name {
  font-size: 0.86rem;
  font-weight: 750;
  color: var(--ink, #2a1814);
  line-height: 1.2;
}
.chat-gift-pick__meta {
  font-size: 0.72rem;
  color: var(--muted, #8a6a62);
  font-weight: 650;
}
.dock-msg .dock-bubble.type-gift,
.dock-bubble.type-gift,
.wa-thread-body .dock-bubble.type-gift,
.wa-thread-body .dock-bubble.type-gift.mine,
.wa-thread-body .dock-bubble.type-gift:not(.mine) {
  width: min(244px, 88%);
  max-width: 244px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  overflow: visible;
}
.dock-bubble.type-gift .dock-time {
  padding: 0 0.25rem 0.05rem;
}
.chat-gift-bubble {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
  padding: 0.72rem 0.75rem 0.75rem;
  border-radius: 1.05rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(165deg, #fffdfb 0%, #fff1ec 58%, #ffe3da 100%);
  border: 1px solid rgba(224, 122, 95, 0.48);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 22px rgba(162, 61, 76, 0.13);
  overflow: hidden;
}
.chat-gift-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(225deg, rgba(255, 250, 247, 0.98) 49%, rgba(224, 122, 95, 0.42) 50%);
  pointer-events: none;
}
.chat-gift-bubble.is-sent {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 30%),
    linear-gradient(165deg, #fffaf8 0%, #ffe8e0 100%);
}
.chat-gift-bubble.is-received {
  border-color: rgba(196, 92, 106, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 26px rgba(162, 61, 76, 0.18);
}
.chat-gift-bubble.is-redeemed {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 30%),
    linear-gradient(165deg, #f7fbf8 0%, #e7f4ec 100%);
  border-color: rgba(47, 125, 87, 0.35);
}
.chat-gift-bubble.is-settling {
  animation: giftCardSettle 0.48s cubic-bezier(.2, .8, .2, 1);
}
.chat-gift-bubble__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding-right: 0.85rem;
}
.chat-gift-bubble__label {
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--rose-deep);
}
.chat-gift-bubble.is-sent .chat-gift-bubble__label { color: var(--terracotta); }
.chat-gift-bubble.is-redeemed .chat-gift-bubble__label { color: var(--ok); }
.chat-gift-bubble__seal {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px rgba(255, 214, 204, 0.85);
  flex-shrink: 0;
}
.chat-gift-bubble.is-redeemed::before {
  background: linear-gradient(225deg, rgba(255, 250, 247, 0.98) 49%, rgba(47, 125, 87, 0.38) 50%);
}
.chat-gift-bubble.is-redeemed .chat-gift-bubble__seal {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(47, 125, 87, 0.15);
}
.chat-gift-bubble__row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.chat-gift-bubble__ico {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(240, 215, 208, 0.95);
  box-shadow: 0 6px 14px rgba(196, 92, 106, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1.55rem;
}
.chat-gift-bubble__ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-gift-bubble__copy {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}
.chat-gift-bubble__name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.chat-gift-bubble__value {
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.3;
  color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
}
.chat-gift-bubble.is-redeemed .chat-gift-bubble__value { color: var(--ok); }
.chat-gift-redeem {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0.8rem;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(196, 92, 106, 0.28);
}
.chat-gift-redeem:hover:not(:disabled) { filter: brightness(1.06); }
.chat-gift-redeem:disabled,
.chat-gift-redeem.is-redeemed {
  cursor: default;
  opacity: 1;
  background: #e7f4ec;
  color: #1f6b45;
  box-shadow: none;
}
.gift-icon {
  transform-origin: center center;
  transform-style: preserve-3d;
}
.gift-icon--bloom { animation: giftBloom 2.6s ease-in-out infinite; }
.gift-icon--pulse { animation: giftPulse 1.8s ease-in-out infinite; }
.gift-icon--bounce { animation: giftBounce 1.6s ease-in-out infinite; }
.gift-icon--wiggle { animation: giftWiggle 1.9s ease-in-out infinite; }
.gift-icon--sparkle { animation: giftSparkle 2.1s ease-in-out infinite; }
.gift-icon--pop { animation: giftPop 1.9s ease-in-out infinite; }
.gift-icon--float { animation: giftFloat 2.4s ease-in-out infinite; }
.gift-icon--shine { animation: giftShine 2.2s ease-in-out infinite; }
.gift-icon--twinkle { animation: giftTwinkle 1.7s ease-in-out infinite; }
.gift-icon--toast { animation: giftToast 2.1s ease-in-out infinite; }
.gift-icon--flame { animation: giftFlame 1.8s ease-in-out infinite; }
.gift-icon--kiss { animation: giftKiss 2s ease-in-out infinite; }
.gift-icon--letter { animation: giftLetter 2.4s ease-in-out infinite; }
.gift-icon--balloon { animation: giftBalloon 2.7s ease-in-out infinite; }
.gift-icon--forever { animation: giftForever 2.3s ease-in-out infinite; }
.gift-icon--moon { animation: giftMoon 2.9s ease-in-out infinite; }
.gift-icon--band { animation: giftBand 2.1s ease-in-out infinite; }
.gift-icon--hug { animation: giftHug 2.3s ease-in-out infinite; }
.gift-icon--bouquet { animation: giftBouquet 2.5s ease-in-out infinite; }
.gift-icon--clover { animation: giftClover 2.2s ease-in-out infinite; }
.gift-icon--sun { animation: giftSun 2.8s ease-in-out infinite; }
.gift-icon--latte { animation: giftLatte 2.2s ease-in-out infinite; }
@keyframes giftBloom {
  0%, 100% { transform: perspective(240px) rotateY(-12deg) translateY(0) scale(1); filter: drop-shadow(0 6px 8px rgba(162, 61, 76, 0.16)); }
  50% { transform: perspective(240px) rotateY(14deg) translateY(-5px) scale(1.06); filter: drop-shadow(0 12px 14px rgba(224, 122, 95, 0.38)) brightness(1.06); }
}
@keyframes giftPulse {
  0%, 100% { transform: perspective(240px) rotateY(-8deg) translateY(0) scale(1); filter: drop-shadow(0 4px 6px rgba(162, 61, 76, 0.14)); }
  50% { transform: perspective(240px) rotateY(10deg) translateY(-2px) scale(1.08); filter: drop-shadow(0 8px 12px rgba(196, 92, 106, 0.32)) brightness(1.05); }
}
@keyframes giftBounce {
  0%, 100% { transform: perspective(240px) rotateX(8deg) rotateY(-6deg) translateY(0); filter: drop-shadow(0 5px 7px rgba(162, 61, 76, 0.16)); }
  50% { transform: perspective(240px) rotateX(-10deg) rotateY(8deg) translateY(-7px); filter: drop-shadow(0 12px 12px rgba(224, 122, 95, 0.3)); }
}
@keyframes giftWiggle {
  0%, 100% { transform: perspective(240px) rotateY(-14deg) rotateZ(0) translateY(0); }
  35% { transform: perspective(240px) rotateY(12deg) rotateZ(-7deg) translateY(-3px); filter: drop-shadow(0 8px 10px rgba(224, 122, 95, 0.28)); }
  70% { transform: perspective(240px) rotateY(-8deg) rotateZ(7deg) translateY(-1px); }
}
@keyframes giftSparkle {
  0%, 100% { transform: perspective(240px) rotateY(-10deg) translateY(0); filter: brightness(1) drop-shadow(0 4px 6px rgba(162, 61, 76, 0.12)); }
  50% { transform: perspective(240px) rotateY(16deg) translateY(-4px); filter: brightness(1.16) drop-shadow(0 0 10px rgba(224, 122, 95, 0.7)); }
}
@keyframes giftPop {
  0%, 100% { transform: perspective(240px) rotateY(-8deg) translateY(0) scale(1); filter: drop-shadow(0 5px 8px rgba(162, 61, 76, 0.16)); }
  42% { transform: perspective(240px) rotateY(14deg) translateY(-5px) scale(1.1); filter: drop-shadow(0 12px 14px rgba(224, 122, 95, 0.36)) brightness(1.08); }
  62% { transform: perspective(240px) rotateY(-4deg) translateY(-1px) scale(0.98); }
}
@keyframes giftFloat {
  0%, 100% { transform: perspective(240px) rotateY(-12deg) translateY(0); filter: drop-shadow(0 6px 8px rgba(162, 61, 76, 0.14)); }
  50% { transform: perspective(240px) rotateY(14deg) translateY(-8px); filter: drop-shadow(0 14px 12px rgba(224, 122, 95, 0.28)); }
}
@keyframes giftShine {
  0%, 100% { transform: perspective(240px) rotateY(-16deg) translateY(0); filter: brightness(1) drop-shadow(0 4px 6px rgba(162, 61, 76, 0.12)); }
  50% { transform: perspective(240px) rotateY(18deg) translateY(-3px); filter: brightness(1.18) saturate(1.08) drop-shadow(0 0 12px rgba(255, 214, 180, 0.85)); }
}
@keyframes giftTwinkle {
  0%, 100% { opacity: 1; transform: perspective(240px) rotateY(-12deg) translateY(0) scale(1); filter: drop-shadow(0 4px 6px rgba(162, 61, 76, 0.12)); }
  50% { opacity: 0.82; transform: perspective(240px) rotateY(14deg) translateY(-4px) scale(1.06); filter: drop-shadow(0 0 10px rgba(255, 220, 190, 0.8)); }
}
@keyframes giftToast {
  0%, 100% { transform: perspective(240px) rotateY(0) rotateZ(0) translateY(0); filter: drop-shadow(0 5px 7px rgba(162, 61, 76, 0.14)); }
  32% { transform: perspective(240px) rotateY(-16deg) rotateZ(-8deg) translateY(-4px); }
  64% { transform: perspective(240px) rotateY(14deg) rotateZ(8deg) translateY(-2px); filter: drop-shadow(0 8px 10px rgba(224, 122, 95, 0.32)); }
}
@keyframes giftFlame {
  0%, 100% { transform: perspective(240px) rotateY(-8deg) translateY(0) scale(1); filter: brightness(1) drop-shadow(0 4px 6px rgba(162, 61, 76, 0.12)); }
  40% { transform: perspective(240px) rotateY(12deg) rotateZ(-4deg) translateY(-6px) scale(1.06); filter: brightness(1.16) drop-shadow(0 0 12px rgba(224, 100, 48, 0.62)); }
  70% { transform: perspective(240px) rotateY(-6deg) rotateZ(3deg) translateY(-2px) scale(1.03); filter: brightness(1.08) drop-shadow(0 0 8px rgba(196, 80, 40, 0.4)); }
}
@keyframes giftKiss {
  0%, 100% { transform: perspective(240px) rotateY(-8deg) rotateZ(0) scale(1); filter: drop-shadow(0 5px 7px rgba(196, 92, 106, 0.16)); }
  40% { transform: perspective(240px) rotateY(16deg) rotateZ(-8deg) translateY(-3px) scale(1.12); filter: drop-shadow(0 0 10px rgba(224, 122, 140, 0.55)); }
  58% { transform: perspective(240px) rotateY(-6deg) rotateZ(5deg) scale(0.96); }
  74% { transform: perspective(240px) rotateY(6deg) rotateZ(-2deg) scale(1.05); }
}
@keyframes giftLetter {
  0%, 100% { transform: perspective(240px) rotateY(-14deg) rotateZ(0) translateY(0); filter: drop-shadow(0 6px 8px rgba(162, 61, 76, 0.14)); }
  50% { transform: perspective(240px) rotateY(12deg) rotateZ(-5deg) translateY(-7px); filter: drop-shadow(0 12px 14px rgba(196, 92, 106, 0.28)); }
}
@keyframes giftBalloon {
  0%, 100% { transform: perspective(240px) rotateY(-10deg) rotateZ(-3deg) translateY(0); filter: drop-shadow(0 8px 10px rgba(162, 61, 76, 0.14)); }
  50% { transform: perspective(240px) rotateY(14deg) rotateZ(4deg) translateY(-11px); filter: drop-shadow(0 16px 14px rgba(224, 122, 95, 0.26)); }
}
@keyframes giftForever {
  0%, 100% { transform: perspective(240px) rotateY(-12deg) translateY(0) scale(1); filter: brightness(1) drop-shadow(0 4px 6px rgba(162, 61, 76, 0.12)); }
  50% { transform: perspective(240px) rotateY(16deg) translateY(-4px) scale(1.07); filter: brightness(1.14) drop-shadow(0 0 12px rgba(226, 177, 90, 0.72)); }
}
@keyframes giftMoon {
  0%, 100% { transform: perspective(240px) rotateY(-14deg) translateY(0) scale(1); filter: brightness(1) drop-shadow(0 4px 8px rgba(162, 61, 76, 0.12)); }
  50% { transform: perspective(240px) rotateY(12deg) translateY(-6px) scale(1.05); filter: brightness(1.1) drop-shadow(0 0 12px rgba(255, 220, 200, 0.72)); }
}
@keyframes giftBand {
  0%, 100% { transform: perspective(240px) rotateY(-16deg) rotateZ(0) scale(1); filter: drop-shadow(0 4px 6px rgba(162, 61, 76, 0.14)); }
  30% { transform: perspective(240px) rotateY(8deg) rotateZ(-8deg) translateY(-2px) scale(1.04); }
  70% { transform: perspective(240px) rotateY(16deg) rotateZ(8deg) translateY(-2px) scale(1.04); filter: drop-shadow(0 0 8px rgba(226, 177, 90, 0.45)); }
}
@keyframes giftHug {
  0%, 100% { transform: perspective(240px) rotateY(-8deg) scale(1); filter: drop-shadow(0 5px 7px rgba(196, 92, 106, 0.14)); }
  50% { transform: perspective(240px) rotateY(12deg) translateY(-3px) scale(1.1); filter: drop-shadow(0 0 12px rgba(224, 122, 140, 0.5)); }
}
@keyframes giftBouquet {
  0%, 100% { transform: perspective(240px) rotateY(-12deg) rotateZ(0) translateY(0); filter: drop-shadow(0 6px 8px rgba(162, 61, 76, 0.14)); }
  36% { transform: perspective(240px) rotateY(8deg) rotateZ(-6deg) translateY(-5px); }
  68% { transform: perspective(240px) rotateY(14deg) rotateZ(6deg) translateY(-3px); filter: drop-shadow(0 10px 12px rgba(224, 122, 95, 0.3)); }
}
@keyframes giftClover {
  0%, 100% { transform: perspective(240px) rotateY(-10deg) rotateZ(0) scale(1); filter: brightness(1); }
  50% { transform: perspective(240px) rotateY(16deg) rotateZ(14deg) translateY(-3px) scale(1.06); filter: brightness(1.08) drop-shadow(0 0 8px rgba(196, 120, 90, 0.4)); }
}
@keyframes giftSun {
  0%, 100% { transform: perspective(240px) rotateY(-16deg) rotateZ(-4deg) translateY(0); filter: brightness(1) drop-shadow(0 4px 6px rgba(162, 61, 76, 0.12)); }
  50% { transform: perspective(240px) rotateY(18deg) rotateZ(8deg) translateY(-4px); filter: brightness(1.14) drop-shadow(0 0 12px rgba(224, 162, 74, 0.62)); }
}
@keyframes giftLatte {
  0%, 100% { transform: perspective(240px) rotateY(-8deg) rotateZ(0) translateY(0); filter: drop-shadow(0 5px 7px rgba(162, 61, 76, 0.14)); }
  40% { transform: perspective(240px) rotateY(12deg) rotateZ(-5deg) translateY(-4px); filter: drop-shadow(0 8px 10px rgba(196, 120, 74, 0.28)); }
  72% { transform: perspective(240px) rotateY(-4deg) rotateZ(3deg) translateY(-1px); }
}
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --pop { syntax: "<number>"; inherits: false; initial-value: 0.4; }
@property --lift { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --yaw { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --pitch { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --roll { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --ty { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --tz { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --sc { syntax: "<number>"; inherits: false; initial-value: 1; }
.chat-gift-fly,
.chat-gift-arrive,
.chat-gift-celebrate {
  --gift-card: 128px;
  --ring-lag: 0.34s;
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  transition: opacity 0.42s ease;
}
.chat-gift-arrive { z-index: 12940; --ring-lag: 0.62s; }
.chat-gift-celebrate { z-index: 13200; --ring-lag: 0.28s; }
.chat-gift-fly.is-out,
.chat-gift-arrive.is-out,
.chat-gift-celebrate.is-out { opacity: 0; }
.chat-gift-fx__veil {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 246, 240, 0.2) 0%, rgba(72, 32, 28, 0.2) 42%, rgba(32, 14, 12, 0.58) 100%);
}
.chat-gift-fly.is-on .chat-gift-fx__veil,
.chat-gift-arrive.is-on .chat-gift-fx__veil,
.chat-gift-celebrate.is-on .chat-gift-fx__veil {
  animation: giftVeilIn 0.55s ease both;
}
.chat-gift-arrive .chat-gift-fx__veil {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 250, 247, 0.94) 0%, rgba(255, 214, 204, 0.66) 32%, rgba(255, 245, 242, 0) 70%);
}
.chat-gift-celebrate .chat-gift-fx__veil {
  background:
    radial-gradient(ellipse at 50% 34%, rgba(255, 220, 208, 0.55), transparent 46%),
    linear-gradient(180deg, rgba(62, 28, 26, 0.34), rgba(162, 61, 76, 0.52));
}
.chat-gift-fx__stage {
  --gift-card: 128px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: min(440px, calc(100vw - 1.5rem));
  transform-style: preserve-3d;
  perspective: 900px;
  perspective-origin: 50% 28%;
}
.chat-gift-fx__stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(var(--gift-card) / 2);
  width: 250px;
  height: 250px;
  margin: -125px 0 0 -125px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 248, 244, 0.96) 0%, rgba(255, 196, 176, 0.55) 28%, rgba(224, 122, 95, 0.16) 52%, transparent 72%);
}
.chat-gift-fly.is-on .chat-gift-fx__stage::before { animation: giftCreateBloom 2.15s ease-out both; }
.chat-gift-arrive.is-on .chat-gift-fx__stage::before { animation: giftArriveBloom 1.7s ease-out both; }
.chat-gift-celebrate.is-on .chat-gift-fx__stage::before { animation: giftCreateBloom 1.9s ease-out both; }
.chat-gift-arrive .chat-gift-fx__stage::before {
  background: radial-gradient(circle, rgba(255, 250, 247, 0.98) 0%, rgba(255, 214, 204, 0.78) 30%, rgba(224, 122, 95, 0.2) 54%, transparent 72%);
}
.chat-gift-fx__orbit,
.chat-gift-fx__rings {
  position: absolute;
  left: 50%;
  top: calc(var(--gift-card) / 2);
  width: 0;
  height: 0;
  pointer-events: none;
}
.chat-gift-fx__orbit {
  transform-style: preserve-3d;
  transform: rotateX(62deg) rotateZ(-8deg) translateZ(0);
}
.chat-gift-fx__orbit span {
  --spin: 0deg;
  --pop: 0.35;
  --lift: 0px;
  position: absolute;
  left: 0;
  top: 0;
  width: var(--size, 10px);
  height: var(--size, 10px);
  margin: calc(var(--size, 10px) * -0.5) 0 0 calc(var(--size, 10px) * -0.5);
  border-radius: 50%;
  background: #fff4ee;
  box-shadow: 0 0 12px rgba(224, 122, 95, 0.85);
  opacity: 0;
  transform-style: preserve-3d;
  transform-origin: center center;
  /* Reliable elliptical orbit: rotate around center then push out on X */
  transform:
    rotate(calc(var(--a) + var(--spin)))
    translate3d(var(--r), var(--lift), var(--z, 0px))
    rotateX(-62deg)
    scale(var(--pop));
}
.chat-gift-fly.is-on .chat-gift-fx__orbit span {
  animation: giftOrbitBit var(--dur, 1.75s) cubic-bezier(.2, .7, .2, 1) var(--delay, 0s) both;
}
.chat-gift-arrive.is-on .chat-gift-fx__orbit span {
  animation: giftArriveBit var(--dur, 1.35s) ease-out calc(0.5s + var(--delay, 0s) * 0.35) both;
}
.chat-gift-celebrate .chat-gift-fx__orbit { transform: none; }
.chat-gift-celebrate.is-on .chat-gift-fx__orbit span {
  animation: giftConfettiBit var(--dur, 1.55s) cubic-bezier(.15, .7, .2, 1) calc(var(--delay, 0s) * 0.45) both;
}
.chat-gift-fx__orbit span.is-heart {
  border-radius: 0;
  background: #c45c6a;
  clip-path: polygon(50% 86%, 14% 50%, 10% 32%, 24% 16%, 42% 20%, 50% 34%, 58% 20%, 76% 16%, 90% 32%, 86% 50%);
  filter: drop-shadow(0 0 4px rgba(196, 92, 106, 0.85));
}
.chat-gift-fx__orbit span.is-star {
  border-radius: 0;
  background: #f0d48a;
  clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 70% 56%, 80% 92%, 50% 72%, 20% 92%, 30% 56%, 2% 35%, 38% 34%);
  filter: drop-shadow(0 0 4px rgba(224, 176, 80, 0.9));
}
.chat-gift-fx__orbit span.is-ember {
  border-radius: 46% 46% 46% 46%;
  background: radial-gradient(circle at 40% 32%, #fff3d4, #e07a5f 48%, #a23d4c);
  box-shadow: 0 0 8px rgba(224, 96, 48, 0.8);
}
.chat-gift-fx__orbit span.is-petal {
  border-radius: 80% 12% 80% 12%;
  background: linear-gradient(160deg, #fffaf7, #ffd6cc 58%, #e07a5f);
  box-shadow: 0 0 8px rgba(224, 122, 95, 0.5);
}
.chat-gift-fx__rings i {
  position: absolute;
  left: 0;
  top: 0;
  width: 148px;
  height: 148px;
  margin: -74px 0 0 -74px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 238, 0.92);
  box-shadow: 0 0 22px rgba(224, 122, 95, 0.38);
  opacity: 0;
}
.chat-gift-fx__rings i:nth-child(2) {
  width: 118px;
  height: 118px;
  margin: -59px 0 0 -59px;
  border-width: 1.5px;
  border-color: rgba(196, 92, 106, 0.72);
}
.chat-gift-fx__rings i:nth-child(3) { border-width: 1px; }
.chat-gift-fly.is-on .chat-gift-fx__rings i,
.chat-gift-arrive.is-on .chat-gift-fx__rings i,
.chat-gift-celebrate.is-on .chat-gift-fx__rings i {
  animation: giftShock 1.15s cubic-bezier(.16, .72, .2, 1) var(--ring-lag) both;
}
.chat-gift-fly.is-on .chat-gift-fx__rings i:nth-child(2),
.chat-gift-arrive.is-on .chat-gift-fx__rings i:nth-child(2),
.chat-gift-celebrate.is-on .chat-gift-fx__rings i:nth-child(2) {
  animation-duration: 1.28s;
  animation-delay: calc(var(--ring-lag) + 0.18s);
}
.chat-gift-fly.is-on .chat-gift-fx__rings i:nth-child(3),
.chat-gift-arrive.is-on .chat-gift-fx__rings i:nth-child(3),
.chat-gift-celebrate.is-on .chat-gift-fx__rings i:nth-child(3) {
  animation-duration: 1.42s;
  animation-delay: calc(var(--ring-lag) + 0.4s);
}
.chat-gift-fx__card {
  --yaw: 0deg;
  --pitch: 0deg;
  --roll: 0deg;
  --ty: 0px;
  --tz: 0px;
  --sc: 1;
  position: relative;
  width: var(--gift-card);
  height: var(--gift-card);
  flex: 0 0 auto;
  transform-style: preserve-3d;
  transform-origin: center center;
  transform: translateY(var(--ty)) rotateZ(var(--roll)) rotateX(var(--pitch)) rotateY(var(--yaw)) translateZ(var(--tz)) scale(var(--sc));
}
.chat-gift-fly .chat-gift-fx__card {
  opacity: 0;
  --yaw: 108deg;
  --pitch: 22deg;
  --tz: -70px;
  --sc: 0.22;
}
.chat-gift-arrive .chat-gift-fx__card {
  opacity: 0;
  --ty: -200px;
  --pitch: -58deg;
  --yaw: 42deg;
  --roll: -16deg;
  --sc: 0.78;
}
.chat-gift-celebrate .chat-gift-fx__card {
  opacity: 0;
  --ty: 30px;
  --pitch: 16deg;
  --yaw: -36deg;
  --sc: 0.74;
}
.chat-gift-fly.is-on .chat-gift-fx__card { animation: giftCreate 2.15s cubic-bezier(.16, .8, .18, 1) both; }
.chat-gift-arrive.is-on .chat-gift-fx__card { animation: giftArriveDrop 1.52s cubic-bezier(.18, .82, .2, 1) both; }
.chat-gift-celebrate.is-on .chat-gift-fx__card { animation: giftRedeemFlip 1.85s cubic-bezier(.16, .84, .22, 1) both; }
.chat-gift-fx__card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background:
    linear-gradient(90deg, transparent 46.5%, rgba(196, 92, 106, 0.9) 46.5% 53.5%, transparent 53.5%),
    linear-gradient(180deg, transparent 46.5%, rgba(162, 61, 76, 0.78) 46.5% 53.5%, transparent 53.5%),
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.8), transparent 30%),
    linear-gradient(155deg, #fff8f4 0%, #f4c4b6 50%, #e07a5f 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), inset 0 0 0 7px rgba(255, 236, 228, 0.72);
  transform: rotateY(180deg) translateZ(1px);
  backface-visibility: hidden;
}
.chat-gift-fx__card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.55), transparent 42%),
    linear-gradient(165deg, #fff 0%, #fff1ea 100%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65),
    0 0 28px rgba(255, 214, 196, 0.45),
    0 22px 40px rgba(162, 61, 76, 0.3);
  font-size: 3.35rem;
  line-height: 1;
  transform: translateZ(2px);
  backface-visibility: hidden;
}
.chat-gift-fx__card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.chat-gift-fx__card-face span {
  line-height: 1;
}
.chat-gift-fx__card-face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.78) 48%, transparent 66%);
  transform: translateX(-90%);
  opacity: 0;
  pointer-events: none;
}
.chat-gift-fly.is-on .chat-gift-fx__card-face::after { animation: giftGloss 0.85s ease 0.5s both; }
.chat-gift-arrive.is-on .chat-gift-fx__card-face::after { animation: giftGloss 0.75s ease 0.68s both; }
.chat-gift-celebrate.is-on .chat-gift-fx__card-face::after { animation: giftGloss 0.7s ease 0.72s both; }
.chat-gift-fx__label,
.chat-gift-arrive__name,
.chat-gift-celebrate__kicker,
.chat-gift-celebrate__title,
.chat-gift-celebrate__points,
.chat-gift-celebrate__total {
  position: relative;
  z-index: 2;
  max-width: calc(100vw - 2rem);
  text-align: center;
  opacity: 0;
}
.chat-gift-fx__label,
.chat-gift-arrive__name,
.chat-gift-celebrate__kicker,
.chat-gift-celebrate__points,
.chat-gift-celebrate__total {
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
}
.chat-gift-fx__label {
  background: rgba(255, 250, 247, 0.94);
  color: var(--rose-deep);
  font-weight: 750;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(42, 24, 20, 0.16);
}
.chat-gift-fly.is-on .chat-gift-fx__label { animation: giftLabelIn 0.55s cubic-bezier(.16, .84, .22, 1) 0.82s both; }
.chat-gift-arrive.is-on .chat-gift-fx__label { animation: giftLabelIn 0.5s cubic-bezier(.16, .84, .22, 1) 0.7s both; }
.chat-gift-arrive__name {
  margin-top: -0.35rem;
  background: rgba(255, 250, 247, 0.96);
  border: 1px solid rgba(240, 215, 208, 0.95);
  box-shadow: 0 10px 24px rgba(42, 24, 20, 0.12);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.chat-gift-arrive.is-on .chat-gift-arrive__name { animation: giftLabelIn 0.5s cubic-bezier(.16, .84, .22, 1) 0.84s both; }
.chat-gift-celebrate__kicker {
  background: rgba(255, 250, 247, 0.94);
  color: var(--rose-deep);
  font-weight: 750;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.chat-gift-celebrate.is-on .chat-gift-celebrate__kicker { animation: giftLabelIn 0.45s ease 0.42s both; }
.chat-gift-celebrate__title {
  margin-top: -0.2rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.15;
  color: #fffaf7;
  text-shadow: 0 2px 14px rgba(42, 24, 20, 0.35);
  overflow-wrap: anywhere;
}
.chat-gift-celebrate.is-on .chat-gift-celebrate__title { animation: giftTitleIn 0.55s cubic-bezier(.16, .84, .22, 1) 0.52s both; }
.chat-gift-celebrate__points {
  font-weight: 750;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  box-shadow: 0 12px 26px rgba(162, 61, 76, 0.32);
}
.chat-gift-celebrate.is-on .chat-gift-celebrate__points {
  animation: giftPointsPop 0.7s cubic-bezier(.16, 1.2, .28, 1) 0.64s both;
}
.chat-gift-celebrate__total {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--rose-deep);
  background: rgba(255, 250, 247, 0.94);
}
.chat-gift-celebrate.is-on .chat-gift-celebrate__total { animation: giftLabelIn 0.45s ease 0.84s both; }
.chat-gift-fly--flame .chat-gift-fx__veil {
  background:
    radial-gradient(ellipse at 50% 78%, rgba(224, 96, 40, 0.34), transparent 42%),
    radial-gradient(ellipse at 50% 40%, rgba(255, 196, 140, 0.16), rgba(42, 16, 10, 0.66) 76%);
}
.chat-gift-fly--flame .chat-gift-fx__stage::before {
  background: radial-gradient(circle, rgba(255, 220, 170, 0.96), rgba(224, 90, 40, 0.48) 36%, transparent 70%);
}
.chat-gift-fly--flame .chat-gift-fx__orbit { transform: translateZ(0); }
.chat-gift-fly--flame.is-on .chat-gift-fx__orbit span { animation-name: giftEmberBit; }
.chat-gift-fly--flame .chat-gift-fx__orbit span.is-ember {
  background: radial-gradient(circle at 40% 30%, #fff6df, #ff9a4a 42%, #c2412d);
}
.chat-gift-fly--flame .chat-gift-fx__rings i {
  border-color: rgba(255, 156, 80, 0.9);
  box-shadow: 0 0 18px rgba(224, 90, 40, 0.48);
}
.chat-gift-fly--kiss .chat-gift-fx__veil {
  background: radial-gradient(ellipse at 50% 44%, rgba(255, 220, 226, 0.28), rgba(90, 28, 40, 0.58) 74%);
}
.chat-gift-fly--kiss .chat-gift-fx__stage::before {
  background: radial-gradient(circle, rgba(255, 240, 242, 0.96), rgba(196, 92, 106, 0.4) 40%, transparent 72%);
}
.chat-gift-fly--kiss .chat-gift-fx__rings i {
  border-color: rgba(255, 196, 206, 0.95);
  box-shadow: 0 0 16px rgba(196, 92, 106, 0.42);
}
.chat-gift-fly--balloon .chat-gift-fx__veil {
  background:
    radial-gradient(ellipse at 50% 28%, rgba(255, 250, 247, 0.34), transparent 36%),
    radial-gradient(ellipse at 50% 46%, rgba(255, 214, 204, 0.2), rgba(42, 24, 20, 0.48) 78%);
}
.chat-gift-fly--balloon .chat-gift-fx__stage::before {
  background: radial-gradient(circle, rgba(255, 250, 247, 0.96), rgba(255, 196, 186, 0.45) 36%, transparent 70%);
}
.chat-gift-fly--balloon .chat-gift-fx__orbit { transform: translateY(-22px) translateZ(0); }
.chat-gift-fly--balloon.is-on .chat-gift-fx__orbit span {
  animation-name: giftFloatBit;
  animation-timing-function: ease-out;
}
.chat-gift-fly--balloon .chat-gift-fx__rings i {
  border-color: rgba(255, 232, 226, 0.95);
  box-shadow: 0 0 16px rgba(224, 122, 95, 0.28);
}
.chat-gift-fly--forever .chat-gift-fx__veil {
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 236, 196, 0.3), rgba(92, 48, 28, 0.56) 72%);
}
.chat-gift-fly--forever .chat-gift-fx__stage::before {
  background: radial-gradient(circle, rgba(255, 248, 226, 0.97), rgba(226, 177, 90, 0.42) 38%, transparent 70%);
}
.chat-gift-fly--forever .chat-gift-fx__orbit span.is-star,
.chat-gift-fly--forever .chat-gift-fx__orbit span.is-ember {
  background: linear-gradient(180deg, #fff8e4, #e2b15a);
  filter: drop-shadow(0 0 5px rgba(226, 177, 90, 0.9));
}
.chat-gift-fly--forever .chat-gift-fx__rings i {
  border-color: rgba(242, 206, 120, 0.92);
  box-shadow: 0 0 18px rgba(210, 160, 60, 0.48);
}
.chat-gift-fly--sun .chat-gift-fx__veil {
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 228, 170, 0.4), rgba(120, 52, 28, 0.5) 70%);
}
.chat-gift-fly--sun .chat-gift-fx__stage::before {
  background:
    radial-gradient(circle, rgba(255, 248, 230, 0.95) 0%, rgba(255, 210, 140, 0.28) 34%, transparent 58%),
    repeating-conic-gradient(from 0deg, rgba(255, 214, 140, 0) 0deg 11deg, rgba(255, 196, 96, 0.72) 11deg 13deg);
}
.chat-gift-fly--sun.is-on .chat-gift-fx__stage::before { animation: giftSunRays 2.2s ease-out both; }
.chat-gift-fly--sun .chat-gift-fx__orbit { transform: translateZ(0); }
.chat-gift-fly--sun .chat-gift-fx__orbit span.is-star {
  width: 3px;
  height: calc(var(--size) * 3.6);
  margin-left: -1.5px;
  margin-top: calc(var(--size) * -1.8);
  border-radius: 99px;
  clip-path: none;
  background: linear-gradient(180deg, rgba(255, 248, 230, 0.15), #ffe3a4 38%, #e0a24a);
  filter: drop-shadow(0 0 4px rgba(224, 162, 74, 0.85));
  transform: translate3d(
    calc(sin(var(--spin)) * var(--r)),
    calc(cos(var(--spin)) * var(--r) * 0.42 + var(--lift)),
    calc(cos(var(--spin)) * 64px)
  ) rotate(var(--spin)) scale(var(--pop));
}
.chat-gift-fly--sun .chat-gift-fx__rings i {
  border-color: rgba(255, 220, 150, 0.95);
  box-shadow: 0 0 20px rgba(224, 160, 60, 0.5);
}
@keyframes giftVeilIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes giftCreateBloom {
  0% { opacity: 0; transform: scale(0.25); }
  16% { opacity: 0.35; transform: scale(0.55); }
  38% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 0.22; transform: scale(1.22); }
}
@keyframes giftArriveBloom {
  0%, 28% { opacity: 0; transform: scale(0.45); }
  48% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.4; transform: scale(1.28); }
}
@keyframes giftSunRays {
  0% { opacity: 0; transform: rotate(0deg) scale(0.35); }
  32% { opacity: 0.95; transform: rotate(16deg) scale(1); }
  100% { opacity: 0.28; transform: rotate(42deg) scale(1.08); }
}
@keyframes giftShock {
  0% { opacity: 0.9; transform: scale(0.18); }
  100% { opacity: 0; transform: scale(2.55); }
}
@keyframes giftOrbitBit {
  0% { opacity: 0; --spin: 0deg; --pop: 0.15; --lift: 0px; }
  12% { opacity: 1; --pop: 1.05; }
  100% { opacity: 0; --spin: 280deg; --pop: 0.65; --lift: calc(var(--z) * 0.35); }
}
@keyframes giftEmberBit {
  0% { opacity: 0; --spin: 0deg; --pop: 0.3; --lift: 20px; }
  12% { opacity: 1; --pop: 1.1; }
  100% { opacity: 0; --spin: 90deg; --pop: 0.25; --lift: -140px; }
}
@keyframes giftFloatBit {
  0% { opacity: 0; --spin: 0deg; --pop: 0.35; --lift: 22px; }
  14% { opacity: 1; --pop: 1; }
  100% { opacity: 0; --spin: 60deg; --pop: 0.85; --lift: -130px; }
}
@keyframes giftArriveBit {
  0% { opacity: 0; --spin: 0deg; --pop: 0.12; --lift: 6px; }
  18% { opacity: 1; --pop: 1; }
  100% { opacity: 0; --spin: 160deg; --pop: 0.5; --lift: calc(var(--z) * 0.4); }
}
@keyframes giftConfettiBit {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translate3d(12px, 10px, 0) rotateX(-62deg) scale(0.2);
  }
  18% {
    opacity: 1;
    transform: rotate(calc(var(--a) + 40deg)) translate3d(calc(var(--r) * 0.55), -20px, var(--z)) rotateX(-62deg) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--a) + 160deg)) translate3d(var(--r), 120px, calc(var(--z) * 0.3)) rotateX(-62deg) scale(0.75);
  }
}
@keyframes giftCreate {
  0% { opacity: 0; --yaw: 92deg; --pitch: 28deg; --tz: -120px; --ty: 18px; --sc: 0.08; }
  8% { opacity: 1; --yaw: 88deg; --pitch: 18deg; --tz: -40px; --ty: 8px; --sc: 0.28; }
  18% { --yaw: 55deg; --pitch: 6deg; --tz: 20px; --ty: -4px; --sc: 0.72; }
  32% { --yaw: -32deg; --pitch: -18deg; --tz: 96px; --ty: -12px; --sc: 1.16; }
  48% { --yaw: 16deg; --pitch: 12deg; --tz: 48px; --ty: 4px; --sc: 0.96; }
  64% { --yaw: -10deg; --pitch: -6deg; --tz: 36px; --ty: -6px; --sc: 1.04; }
  82% { --yaw: -14deg; --pitch: 8deg; --ty: -3px; --tz: 30px; --sc: 1; }
  100% { opacity: 1; --yaw: -12deg; --pitch: 6deg; --ty: -2px; --tz: 26px; --sc: 1; }
}
@keyframes giftArriveDrop {
  0% { opacity: 0; --ty: -210px; --pitch: -58deg; --yaw: 44deg; --roll: -18deg; --sc: 0.76; }
  14% { opacity: 1; }
  46% { --ty: 16px; --pitch: 22deg; --yaw: -26deg; --roll: 9deg; --sc: 1.05; }
  64% { --ty: -12px; --pitch: -8deg; --yaw: 8deg; --roll: -4deg; --sc: 0.99; }
  82% { --ty: 4px; --pitch: 3deg; --yaw: -3deg; --roll: 1deg; --sc: 1; }
  100% { opacity: 1; --ty: 0px; --pitch: 1deg; --yaw: 0deg; --roll: 0deg; --sc: 1; }
}
@keyframes giftRedeemFlip {
  0% { opacity: 0; --ty: 30px; --pitch: 14deg; --yaw: -28deg; --sc: 0.74; }
  14% { opacity: 1; --ty: -2px; --pitch: 2deg; --yaw: 0deg; --sc: 1.03; }
  30% { --ty: -16px; --pitch: 6deg; --yaw: 90deg; --sc: 1; }
  48% { --ty: -20px; --pitch: 0deg; --yaw: 180deg; --sc: 1.04; }
  66% { --ty: -8px; --pitch: -4deg; --yaw: 270deg; --sc: 1; }
  82% { --ty: 2px; --pitch: 2deg; --yaw: 360deg; --sc: 1.04; }
  100% { opacity: 1; --ty: 0px; --pitch: 0deg; --yaw: 360deg; --sc: 1; }
}
@keyframes giftGloss {
  0% { opacity: 0; transform: translateX(-90%); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translateX(90%); }
}
@keyframes giftLabelIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes giftTitleIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes giftPointsPop {
  0% { opacity: 0; transform: translateY(16px) scale(0.35); }
  58% { opacity: 1; transform: translateY(-6px) scale(1.14); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes giftCardSettle {
  0% { transform: translateY(-4px) scale(1.035); }
  100% { transform: none; }
}
@media (max-width: 640px) {
  .chat-gift-fly,
  .chat-gift-arrive,
  .chat-gift-celebrate,
  .chat-gift-fx__stage { --gift-card: 104px; }
  .chat-gift-fx__card::before,
  .chat-gift-fx__card-face { border-radius: 22px; }
  .chat-gift-fx__card-face { font-size: 2.5rem; }
  .chat-gift-fx__stage { gap: 1rem; }
  .chat-gift-fx__stage::before {
    width: 190px;
    height: 190px;
    margin: -95px 0 0 -95px;
  }
  .chat-gift-fx__orbit { scale: 0.78; }
  .chat-gift-fx__rings i {
    width: 112px;
    height: 112px;
    margin: -56px 0 0 -56px;
  }
  .chat-gift-fx__rings i:nth-child(2) {
    width: 92px;
    height: 92px;
    margin: -46px 0 0 -46px;
  }
  .chat-gift-fx__label { font-size: 0.82rem; }
  .chat-gift-celebrate__title { font-size: 1.35rem; }
  .chat-gift-arrive__name { font-size: 1.02rem; }
  .chat-gift-celebrate__points { font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gift-icon--bloom,
  .gift-icon--pulse,
  .gift-icon--bounce,
  .gift-icon--wiggle,
  .gift-icon--sparkle,
  .gift-icon--pop,
  .gift-icon--float,
  .gift-icon--shine,
  .gift-icon--twinkle,
  .gift-icon--toast,
  .gift-icon--flame,
  .gift-icon--kiss,
  .gift-icon--letter,
  .gift-icon--balloon,
  .gift-icon--forever,
  .gift-icon--moon,
  .gift-icon--band,
  .gift-icon--hug,
  .gift-icon--bouquet,
  .gift-icon--clover,
  .gift-icon--sun,
  .gift-icon--latte,
  .chat-gift-fx__veil,
  .chat-gift-fx__stage::before,
  .chat-gift-fx__orbit span,
  .chat-gift-fx__rings i,
  .chat-gift-fx__card,
  .chat-gift-fx__card-face::after,
  .chat-gift-fx__label,
  .chat-gift-arrive__name,
  .chat-gift-celebrate__kicker,
  .chat-gift-celebrate__title,
  .chat-gift-celebrate__points,
  .chat-gift-celebrate__total,
  .chat-gift-bubble.is-settling {
    animation: none !important;
  }
  .chat-gift-fly,
  .chat-gift-arrive,
  .chat-gift-celebrate {
    transition: none;
  }
  .chat-gift-fx__veil,
  .chat-gift-fx__card,
  .chat-gift-fx__label,
  .chat-gift-arrive__name,
  .chat-gift-celebrate__kicker,
  .chat-gift-celebrate__title,
  .chat-gift-celebrate__points,
  .chat-gift-celebrate__total {
    opacity: 1 !important;
  }
  .chat-gift-fx__card { transform: none !important; }
}
.dock-body,
.wa-thread-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: .85rem .8rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .15rem;
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--dock-accent) 10%, transparent), transparent 42%),
    linear-gradient(180deg, #fff, var(--dock-tint));
}
.wa-thread-body {
  background: #efeae6;
}
.dock-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(84%, 360px);
  margin: .35rem 0;
  align-self: flex-start;
  flex-shrink: 0;
  position: relative;
}
.dock-msg.mine {
  align-self: flex-end;
  align-items: flex-end;
}
.dock-msg.is-flash .dock-bubble {
  outline: 2px solid color-mix(in srgb, #c45c26 55%, transparent);
  outline-offset: 2px;
}
.dock-bubble {
  display: block;
  position: relative;
  max-width: 100%;
  width: fit-content;
  padding: .55rem .7rem;
  border-radius: 1rem 1rem 1rem .3rem;
  margin: 0;
  background: #f3f4f6;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  font-size: .9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.dock-bubble-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  margin-top: .28rem;
  min-height: 1.35rem;
}
.dock-bubble.mine .dock-bubble-foot {
  flex-direction: row;
}
.chat-bubble-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  opacity: 0.4;
  pointer-events: auto;
  transition: opacity .15s ease;
  z-index: 2;
  margin-right: auto;
}
.dock-bubble.mine .chat-bubble-actions {
  margin-right: 0;
  margin-left: 0;
  order: -1;
}
.dock-bubble:hover .chat-bubble-actions,
.chat-bubble-actions.is-picking {
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  .chat-bubble-actions {
    opacity: 0;
    pointer-events: none;
  }
  .dock-bubble:hover .chat-bubble-actions,
  .chat-bubble-actions.is-picking {
    opacity: 1;
    pointer-events: auto;
  }
}
.chat-bubble-act {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, .22);
  background: rgba(248, 250, 252, .92);
  color: rgba(100, 116, 139, .72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.chat-bubble-act:hover {
  color: rgba(71, 85, 105, .95);
  border-color: rgba(100, 116, 139, .4);
}
.chat-bubble-act--react {
  color: rgba(148, 163, 184, .85);
}
.chat-rx-picker,
.chat-rx-picker--portal {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.15rem;
  padding: 0.45rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(148, 163, 184, .32);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
  z-index: 5000;
  max-width: min(292px, calc(100vw - 16px));
}
.chat-rx-picker--portal {
  position: fixed;
  left: 0;
  top: 0;
}
.chat-rx-picker[hidden],
.chat-rx-picker--portal[hidden] {
  display: none !important;
}
.chat-rx-pick {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  opacity: 0.9;
  filter: saturate(0.9);
}
@media (max-width: 420px) {
  .chat-rx-picker,
  .chat-rx-picker--portal {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.chat-rx-pick:hover {
  opacity: 1;
  filter: none;
  background: rgba(241, 245, 249, .9);
}
.chat-rx-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.22rem;
  padding: 0 0.15rem;
  max-width: 100%;
}
.dock-msg.mine .chat-rx-row {
  justify-content: flex-end;
}
.chat-rx-chip {
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(255, 255, 255, .92);
  color: #334155;
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  font-size: 0.78rem;
  line-height: 1.3;
  cursor: pointer;
  opacity: 0.95;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.chat-rx-chip span {
  font-size: 0.68rem;
  opacity: 0.75;
}
.chat-rx-chip.is-mine {
  opacity: 1;
  border-color: rgba(196, 92, 38, .35);
  background: rgba(255, 237, 230, .9);
}
.chat-reply-quote {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid rgba(196, 92, 38, .55);
  background: rgba(15, 23, 42, .04);
  border-radius: 0.35rem;
  padding: 0.28rem 0.45rem;
  margin: 0 0 0.35rem;
  cursor: pointer;
  color: inherit;
}
.dock-bubble.mine .chat-reply-quote {
  background: rgba(59, 29, 34, .06);
  border-left-color: rgba(196, 92, 38, .7);
}
.chat-reply-quote__who {
  display: block;
  font-size: 0.68rem;
  font-weight: 650;
  opacity: 0.75;
  margin-bottom: 0.05rem;
}
.chat-reply-quote__body {
  display: block;
  font-size: 0.78rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}
.chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  margin: 0 0.35rem 0.2rem;
  border-radius: 0.65rem;
  background: rgba(248, 250, 252, .95);
  border: 1px solid rgba(148, 163, 184, .28);
  border-left: 3px solid rgba(196, 92, 38, .65);
}
.chat-reply-bar[hidden] { display: none !important; }
.chat-reply-bar__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.chat-reply-bar__copy strong {
  font-size: 0.72rem;
  color: #c45c26;
}
.chat-reply-bar__copy span {
  font-size: 0.8rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-reply-bar__close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
}
.chat-reply-bar__close:hover { color: #64748b; }
.dock-bubble.mine {
  border-radius: 1rem 1rem .3rem 1rem;
  background: #fde2d9;
  color: #3b1d22;
  border-color: #f0c4b6;
}
.dock-bubble:not(.mine) {
  background: #eef2f7;
  border-color: #d8e0ea;
  color: #1e293b;
}
.dock-bubble.type-image {
  padding: .35rem;
  overflow: hidden;
  max-width: 100%;
}
.dock-bubble.type-image .chat-media-img {
  display: block;
  line-height: 0;
  width: auto;
  max-width: 280px;
}
.dock-bubble.type-image .chat-media-img img {
  display: block;
  width: auto;
  height: auto;
  max-width: 280px;
  max-height: 320px;
  object-fit: contain;
  border-radius: 10px;
}
.dock-bubble.mine .dock-time { color: rgba(59, 29, 34, .62); }
.dock-bubble:not(.mine) .dock-time { color: rgba(30, 41, 59, .55); }
.dock-time { font-size: .68rem; opacity: .75; margin-top: 0; text-align: right; flex: 0 0 auto; }
.wa-thread-body .dock-bubble:not(.mine) {
  background: #ffffff;
  border: 1px solid #eadfd8;
}
.wa-thread-body .dock-bubble.mine {
  background: #ffe8df;
  border-color: #f0c8ba;
  color: #3b1d22;
}
.dock-empty { text-align: center; color: var(--muted); padding: 1.6rem .75rem; font-size: .92rem; }
.dock-composer {
  display: flex; gap: .4rem; padding: .55rem .6rem .65rem;
  border-top: 1px solid color-mix(in srgb, var(--dock-accent) 18%, #e8d8d2);
  background: color-mix(in srgb, var(--dock-tint) 70%, #fff);
  align-items: flex-end;
  flex-shrink: 0;
}
.dock-composer .chat-input-shell {
  flex: 1; min-width: 0; margin: 0;
  display: flex; align-items: center; gap: .1rem;
  background: #fff; border: 1px solid #e4d8d0;
  border-radius: 22px;
  padding: .15rem .55rem .15rem .2rem; position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.dock-composer .chat-tools { display: none !important; }
.chat-tools { display: none !important; }
.dock-composer .chat-more-btn {
  width: 34px; height: 34px; color: #6b7c85; flex-shrink: 0;
}
.dock-composer .chat-more-btn svg { width: 18px; height: 18px; }
.dock-composer textarea[name="body"] {
  flex: 1; min-width: 0; margin: 0;
  min-height: 36px; max-height: 140px; resize: none;
  border: 0; background: transparent; box-shadow: none;
  border-radius: 0; padding: .5rem .35rem .5rem .15rem; line-height: 1.35;
  font: inherit; outline: none;
}
.dock-composer .chat-send-btn {
  padding: 0;
  background: var(--rose, #c45c6a) !important;
  box-shadow: 0 2px 8px rgba(196, 92, 106, .28);
}
.dock-composer .chat-send-btn:hover { background: var(--rose-deep, #9b3d4a) !important; color: #fff; }
.dock-composer .chat-icon-btn svg,
.dock-composer .chat-more-btn svg { display: block; color: inherit; fill: currentColor; }
.dock-composer .chat-mic-btn:hover { color: var(--dock-accent-2); background: color-mix(in srgb, var(--dock-accent) 14%, transparent); }
.dock-composer .chat-more-btn:hover,
.dock-composer .chat-attach.is-open .chat-more-btn {
  color: var(--dock-accent-2);
  background: color-mix(in srgb, var(--dock-accent) 12%, transparent);
}
.chat-text, .chat-caption { white-space: pre-wrap; word-break: break-word; }

/* �� WhatsApp-style fullscreen overlay �� */
.chat-fullscreen {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 12, 16, .45);
  display: none; align-items: stretch; justify-content: center;
  padding: 8px;
  backdrop-filter: blur(2px);
}
.chat-fullscreen.is-open { display: flex; }
body.chat-fs-open { overflow: hidden; }
/* Full-page chat workspace: menu | users list | conversation | partner details */
html:has(body.chat-app-body),
body.chat-app-body {
  overflow-x: hidden;
  max-width: 100%;
}
.chat-app-body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
.wrap.chat-app-frame {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  min-height: calc(100vh - var(--app-topbar-h, 58px));
  height: calc(100vh - var(--app-topbar-h, 58px));
  max-height: calc(100dvh - var(--app-topbar-h, 58px));
}
.chat-app-frame > .sidebar,
.chat-app-frame > #app-sidebar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 0 var(--sidebar-w) !important;
  width: var(--sidebar-w) !important;
  min-width: var(--sidebar-w) !important;
  max-width: var(--sidebar-w) !important;
  height: 100% !important;
  max-height: 100% !important;
  position: sticky;
  top: var(--app-topbar-h);
  align-self: flex-start;
  z-index: 35;
}
.chat-app-frame > .wa-sidebar--left {
  flex: 0 1 270px;
  width: min(270px, 28vw);
  min-width: 0;
  max-width: 300px;
  height: 100%;
  max-height: 100%;
  position: relative;
  top: auto;
  align-self: stretch;
  background: #fff;
  border-right: 1px solid #e4d8d0;
}
.chat-app-frame > .wa-main {
  flex: 1 1 0;
  min-width: 0; /* allow shrink — prevents horizontal page scroll */
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: #efeae2;
  overflow: hidden;
}
.chat-app-frame > .wa-sidebar--right {
  flex: 0 1 240px;
  width: min(240px, 22vw);
  min-width: 0;
  max-width: 280px;
  height: 100%;
  max-height: 100%;
  position: relative;
  align-self: stretch;
  background: #fff;
  border-left: 1px solid #e4d8d0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-app-shell,
.wa-shell {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 100%;
  max-height: 100%;
  background: #efeae2;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  box-shadow: none;
  border-radius: 0;
}
.wa-sidebar {
  background: #fff;
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
}
.wa-sidebar--left {
  border-right: 1px solid #e4d8d0;
}
.wa-sidebar--right {
  border-left: 1px solid #e4d8d0;
  border-right: 0;
}
.wa-peer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.15rem 1rem 1.4rem;
}
.wa-peer-empty {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
  padding: .5rem .15rem;
}
.wa-peer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .55rem;
}
.wa-peer-photo,
.wa-peer-photo-fallback {
  width: 112px;
  height: 112px;
  border-radius: 1.15rem;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(80, 30, 40, .12);
}
.wa-peer-photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #e08a7a, #c45c6a);
}
.wa-peer-card h3 {
  margin: .35rem 0 0;
  font-size: 1.2rem;
  line-height: 1.25;
}
.wa-peer-sub {
  color: var(--muted);
  font-size: .88rem;
}
.wa-peer-bio {
  margin: .55rem 0 0;
  font-size: .92rem;
  line-height: 1.45;
  color: #3b1d22;
  text-align: left;
  width: 100%;
}
.wa-peer-meta {
  width: 100%;
  margin-top: .85rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  text-align: left;
}
.wa-peer-row {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .55rem .65rem;
  border-radius: 12px;
  background: #faf6f4;
  border: 1px solid #efe4df;
}
.wa-peer-row span {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #9a7a74;
}
.wa-peer-row strong {
  font-size: .92rem;
  color: #2c1518;
  font-weight: 600;
}
/* Legacy modal styles kept inert (overlay removed from layout) */
.chat-fullscreen { display: none !important; }
.wa-sidebar-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1rem .85rem; background: #f0e7e2; border-bottom: 1px solid #e4d8d0;
  flex-shrink: 0;
}
.wa-sidebar-head .dock-btn,
.wa-sidebar-head .mobile-drawer-close,
.chat-rail-head .mobile-drawer-close,
.chat-rail-head .chat-rail-expand {
  background: #ead7d0 !important;
  color: #3b1c20 !important;
  filter: none !important;
}
.wa-sidebar-head .dock-btn:hover,
.wa-sidebar-head .mobile-drawer-close:hover,
.chat-rail-head .mobile-drawer-close:hover,
.chat-rail-head .chat-rail-expand:hover {
  background: #d0b3a8 !important;
  color: #140a0c !important;
}
.wa-list { overflow-y: auto; flex: 1; min-height: 0; }
.wa-list-loading { padding: 1.25rem; color: var(--muted); font-size: .92rem; }
.wa-list-item {
  width: 100%; border: 0; background: transparent; text-align: left;
  display: flex; gap: .75rem; padding: .8rem 1rem; cursor: pointer;
  border-bottom: 1px solid #f1e8e3;
}
.wa-list-item:hover, .wa-list-item.active { background: #f7efeb; }
.wa-list-item.has-unread .wa-list-top strong,
.wa-list-item.has-unread .wa-list-preview { color: var(--ink); font-weight: 700; }
.wa-list-item.has-unread .wa-list-preview { font-weight: 600; }
.wa-list-avatar { width: 48px; height: 48px; }
.chat-presence-avatar {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
}
.chat-presence-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #c4b0aa;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
.chat-presence-avatar.is-online .chat-presence-dot {
  background: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .35);
}
.chat-online-tag {
  display: inline-flex;
  align-items: center;
  margin-left: .35rem;
  padding: .08rem .4rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
  line-height: 1.15;
}
.chat-online-tag.is-online {
  color: #166534;
  background: #dcfce7;
}
.chat-online-tag.is-offline {
  color: #7a5c55;
  background: #f3e8e4;
}
.agent-online-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .82rem;
}
.agent-online-pill.is-online {
  color: #166534;
  background: #dcfce7;
}
.agent-client-card__id strong .chat-online-tag {
  font-weight: 700;
}
.wa-list-copy { flex: 1; min-width: 0; }
.wa-list-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.wa-list-time { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.wa-list-item.has-unread .wa-list-time { color: var(--rose); font-weight: 700; }
.wa-list-bottom {
  display: flex; align-items: center; gap: .5rem; margin-top: .15rem;
}
.wa-list-preview {
  flex: 1; min-width: 0;
  color: var(--muted); font-size: .85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wa-unread-badge {
  flex-shrink: 0;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--rose); color: #fff;
  font-size: .7rem; font-weight: 700; line-height: 20px; text-align: center;
}
.wa-main { display: flex; flex-direction: column; min-height: 0; background: #efeae2; }
.wa-thread-head {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; background: #f0e7e2; border-bottom: 1px solid #e4d8d0;
  flex-shrink: 0;
}
.wa-thread-meta { flex: 1; min-width: 0; }
.wa-close-inline {
  margin-left: auto;
  background: #ead7d0 !important;
  color: #3b1c20 !important;
  font-weight: 700;
}
.wa-close-inline:hover {
  background: #d9bbb0 !important;
  color: #1f1012 !important;
}
.wa-thread-avatar { width: 42px; height: 42px; }
.wa-thread-sub { font-size: .8rem; color: var(--muted); }
.wa-thread-placeholder { color: var(--muted); }
.wa-thread-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background:
    radial-gradient(circle at 20% 20%, rgba(196,92,106,.05), transparent 40%),
    #efeae2;
}
.wa-thread-body .dock-bubble { box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.wa-composer,
#wa-composer-wrap {
  flex-shrink: 0;
}
.wa-composer {
  display: flex; gap: .5rem; padding: .75rem; background: #f0e7e2; border-top: 1px solid #e4d8d0;
}
.wa-composer input,
.wa-composer textarea[name="body"] { flex: 1; border-radius: 18px; background: #fff; }
.wa-composer button { border-radius: 999px; }
@media (max-width: 1100px) {
  .chat-app-frame > .wa-sidebar--left {
    flex-basis: 260px;
    width: 260px;
  }
}
@media (max-width: 860px) {
  /* Mobile topbar: left burger · center logo · right burger */
  .app-topbar--user {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
  }
  .app-topbar--user .app-topbar-burger {
    display: inline-flex;
  }
  .app-topbar--user .app-topbar-brand {
    justify-self: center;
    grid-column: 2;
  }
  .app-topbar--user .app-topbar-actions {
    display: none;
  }
  .app-topbar--user .app-topbar-wordmark {
    font-size: 1.05rem;
  }

  /* Chat workspace: flex shell so composer stays visible above bottom nav
     (also works with impersonation banner — no brittle 100dvh math). */
  body.chat-app-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100dvh;
    max-height: 100dvh;
    padding-bottom: var(--mobile-bottom-nav-h) !important;
  }
  body.chat-app-body > .app-topbar,
  body.chat-app-body > .impersonation-banner {
    flex-shrink: 0;
  }
  .wrap.chat-app-frame,
  body.chat-app-body .wrap.chat-app-frame {
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: hidden;
  }
  .chat-app-frame > .wa-sidebar--left,
  .chat-app-frame > #wa-chat-list {
    position: fixed !important;
    top: var(--app-topbar-h) !important;
    right: 0 !important;
    left: auto !important;
    bottom: var(--mobile-bottom-nav-h) !important;
    width: min(92vw, 360px) !important;
    max-width: min(92vw, 360px) !important;
    flex: none !important;
    height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h)) !important;
    max-height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h)) !important;
    min-height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h)) !important;
    border-right: 0;
    border-bottom: 0;
    border-left: 1px solid #e4d8d0;
    border-radius: 0 !important;
    z-index: 120;
    background: #fffaf8;
    transform: translate3d(105%, 0, 0);
    transition: transform .22s ease;
    box-shadow: -18px 0 40px rgba(40, 18, 22, .22);
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin: 0 !important;
  }
  body.mobile-drawer-right-open .chat-app-frame > .wa-sidebar--left,
  body.mobile-drawer-right-open .chat-app-frame > #wa-chat-list {
    transform: translate3d(0, 0, 0);
  }
  /* WhatsApp-style: chat users list fills the screen first */
  body.chat-mobile-list .chat-app-frame > .wa-sidebar--left,
  body.chat-mobile-list .chat-app-frame > #wa-chat-list {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    transform: none !important;
    box-shadow: none !important;
    border-left: 0 !important;
    z-index: 1;
  }
  body.chat-mobile-list .chat-app-frame > .wa-main {
    display: none !important;
  }
  body.chat-mobile-list .chat-app-frame > .wa-sidebar--right {
    display: none !important;
  }
  body.chat-mobile-list .app-topbar-burger--right {
    visibility: hidden;
    pointer-events: none;
  }
  body.chat-mobile-list #wa-chat-list .mobile-drawer-close {
    display: none !important;
  }
  body.chat-mobile-thread .chat-app-frame > .wa-sidebar--left,
  body.chat-mobile-thread .chat-app-frame > #wa-chat-list {
    /* keep as off-canvas drawer while a thread is open */
    transform: translate3d(105%, 0, 0);
  }
  body.chat-mobile-thread.mobile-drawer-right-open .chat-app-frame > .wa-sidebar--left,
  body.chat-mobile-thread.mobile-drawer-right-open .chat-app-frame > #wa-chat-list {
    transform: translate3d(0, 0, 0);
  }
  .chat-app-frame > .wa-main,
  body.chat-app-body .chat-app-frame > .wa-main {
    width: 100%;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .wa-back-inline {
    flex-shrink: 0;
    margin-right: .15rem;
    font-size: 1.2rem;
    line-height: 1;
    background: #ead7d0 !important;
    color: #3b1c20 !important;
  }
  .wa-back-inline:hover {
    background: #d9bbb0 !important;
    color: #1f1012 !important;
  }
  .chat-app-frame > .wa-sidebar--right {
    position: fixed !important;
    top: var(--app-topbar-h);
    right: 0;
    bottom: var(--mobile-bottom-nav-h);
    width: min(92vw, 360px);
    max-width: min(92vw, 360px);
    flex: none;
    height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h));
    max-height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h));
    border-left: 1px solid #e4d8d0;
    border-top: 0;
    border-radius: 0;
    z-index: 119;
    background: #fff;
    transform: translate3d(105%, 0, 0);
    transition: transform .22s ease;
    overflow: auto;
  }
  body.mobile-peer-open .chat-app-frame > .wa-sidebar--right {
    transform: translate3d(0, 0, 0);
  }
  .chat-app-shell,
  .wa-shell {
    grid-template-columns: 1fr;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .wa-sidebar--left {
    border-right: 0;
  }
  .wa-sidebar--right {
    border-left: 1px solid #e4d8d0;
    max-height: none;
  }
  .wa-thread-head,
  body.chat-app-body .wa-thread-head {
    padding: .55rem .7rem;
    flex: 0 0 auto;
    flex-shrink: 0;
  }
  body.chat-app-body .wa-thread-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: .55rem .65rem .75rem;
    gap: .08rem;
  }
  body.chat-app-body #wa-composer-wrap {
    flex: 0 0 auto;
    flex-shrink: 0;
    position: relative;
    z-index: 6;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #f0e7e2;
    border-top: 1px solid #e4d8d0;
    box-shadow: 0 -6px 18px rgba(40, 18, 22, .06);
  }
  body.chat-app-body #wa-composer-wrap .chat-composer,
  body.chat-app-body #wa-composer-wrap .dock-composer {
    padding: .42rem .5rem .48rem;
    gap: .3rem;
    background: transparent;
    border-top: 0;
  }
  body.chat-app-body #wa-composer-wrap .chat-input-shell {
    border-radius: 22px;
    padding: .1rem .4rem .1rem .15rem;
  }
  body.chat-app-body #wa-composer-wrap textarea[name="body"] {
    min-height: 34px;
    max-height: 110px;
    padding: .42rem .3rem;
    font-size: 16px; /* prevent iOS zoom */
  }
  body.chat-app-body .dock-msg {
    margin: 0;
    padding: .12rem 0;
  }
  body.chat-app-body .dock-bubble {
    max-width: min(88%, 320px);
    padding: .45rem .65rem .35rem;
    border-radius: 12px;
  }
  body.chat-app-body .dock-msg,
  body.chat-app-body .wa-thread-body,
  body.chat-app-body #wa-composer-wrap,
  body.chat-app-body .wa-thread-head {
    max-width: 100%;
  }
  body.chat-app-body .chat-voice-card {
    max-width: min(220px, calc(100vw - 5.5rem));
  }
  body.chat-app-body .dock-bubble-foot {
    margin-top: .15rem;
    gap: .25rem;
  }
  body.chat-app-body .chat-bubble-actions {
    opacity: 1;
  }
  body.chat-app-body .wa-list-item {
    padding: .7rem .85rem;
  }
}
@media (max-width: 820px) {
  .chat-app-shell,
  .wa-shell {
    grid-template-columns: 1fr;
  }
  body.app-shell .chat-dock {
    right: 10px;
    left: auto;
    max-width: calc(100vw - 20px);
    bottom: var(--mobile-bottom-nav-h);
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  body.app-shell .chat-dock-panel {
    width: min(100%, 400px);
    max-width: calc(100vw - 20px);
    height: min(70dvh, 640px);
    max-height: calc(100dvh - var(--app-topbar-h) - var(--mobile-bottom-nav-h) - 12px);
  }
}

/* ?? Chat media (voice / image / file) ?? */
.chat-composer { flex-wrap: nowrap; align-items: flex-end; gap: .35rem; }
.chat-input-shell { flex: 1; min-width: 0; }
.chat-attach { position: relative; flex-shrink: 0; }
.chat-emoji {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.chat-emoji-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7c85;
}
.chat-emoji-toggle:hover,
.chat-emoji.is-open .chat-emoji-toggle {
  background: rgba(196, 92, 106, .1);
}
.chat-emoji-panel {
  position: fixed;
  width: min(320px, calc(100vw - 24px));
  height: 320px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eadfd8;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(40, 18, 22, .22);
  z-index: 4000;
  overflow: hidden;
}
.chat-emoji-panel[hidden] { display: none !important; }
.chat-emoji-search-wrap {
  padding: .55rem .65rem .35rem;
  border-bottom: 1px solid #f0e4de;
}
.chat-emoji-search {
  width: 100%;
  border: 1px solid #eadfd8;
  border-radius: 999px;
  padding: .45rem .75rem;
  font: inherit;
  font-size: .86rem;
  background: #fffaf8;
  outline: none;
}
.chat-emoji-search:focus {
  border-color: #e0b4aa;
  box-shadow: 0 0 0 3px rgba(196, 92, 106, .12);
}
.chat-emoji-tabs {
  display: flex;
  gap: .15rem;
  padding: .35rem .4rem;
  overflow-x: auto;
  border-bottom: 1px solid #f0e4de;
  -webkit-overflow-scrolling: touch;
}
.chat-emoji-tab {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.chat-emoji-tab:hover { background: #fff4f0; }
.chat-emoji-tab.is-active {
  background: color-mix(in srgb, var(--blush, #ffd6cc) 70%, white);
  box-shadow: inset 0 -2px 0 var(--rose, #c45c6a);
}
.chat-emoji-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: .45rem;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: .15rem;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}
.chat-emoji-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.chat-emoji-btn:hover {
  background: #fff4f0;
  transform: scale(1.08);
}
.chat-emoji-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted, #8a6a62);
  font-size: .86rem;
  padding: 1.25rem .5rem;
}
@media (max-width: 420px) {
  .chat-emoji-list { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.chat-more-btn {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #6b7c85; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-more-btn:hover,
.chat-attach.is-open .chat-more-btn {
  background: rgba(0, 0, 0, .06); color: #54656f;
}
.chat-attach-menu {
  position: absolute; left: 0; bottom: calc(100% + 10px);
  min-width: 196px; padding: .4rem;
  background: #fff; border: 1px solid #e8ddd7; border-radius: 14px;
  box-shadow: 0 10px 28px rgba(40, 18, 22, .16);
  z-index: 40; display: flex; flex-direction: column; gap: .1rem;
}
.chat-attach-menu[hidden] { display: none !important; }
.chat-attach-menu-title {
  padding: .25rem .55rem .35rem;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8a6a62;
}
.chat-attach-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  column-gap: .7rem;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: .48rem .55rem;
  border-radius: 10px;
  color: #3b4a54;
  font: inherit;
  font-size: .9rem;
  text-align: left;
}
.chat-attach-item:hover { background: #f5f0ed; }
.chat-attach-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  line-height: 0;
}
.chat-attach-ico svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.chat-attach-copy {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  min-width: 0;
  line-height: 1.15;
}
.chat-attach-copy strong {
  font-size: .9rem;
  font-weight: 700;
}
.chat-attach-copy small {
  font-size: .72rem;
  color: #8a6a62;
}
.chat-attach-ico--photo { background: #007bfc; }
.chat-attach-ico--file { background: #5157c3; }
.chat-attach-ico--pin { background: #bf59cf; }
.chat-attach-ico--gift { background: #ff5474; }
.chat-icon-btn,
.chat-tool-btn {
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #6b7c85; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 0; transition: background .15s ease, color .15s ease;
}
.chat-icon-btn svg,
.chat-tool-btn svg { display: block; pointer-events: none; }
.chat-icon-btn:hover,
.chat-tool-btn:hover { background: rgba(0, 0, 0, .06); color: #54656f; }
.chat-icon-btn:active,
.chat-tool-btn:active { background: rgba(0, 0, 0, .1); }
.chat-icon-btn:focus-visible,
.chat-tool-btn:focus-visible {
  outline: 2px solid rgba(196, 92, 106, .45); outline-offset: 2px;
}
.chat-send-cluster {
  display: inline-flex; align-items: center; gap: 0; flex-shrink: 0;
  width: 40px; height: 40px; position: relative;
}
.chat-mic-btn,
.chat-send-btn {
  position: absolute; inset: 0;
}
.chat-mic-btn { color: #6b7c85; }
.chat-mic-btn:hover { color: var(--rose-deep); background: rgba(196, 92, 106, .1); }
.chat-mic-btn.is-recording {
  background: #c45c6a; color: #fff;
  box-shadow: 0 0 0 3px rgba(196, 92, 106, .25);
  animation: chat-pulse 1s ease infinite;
}
.chat-send-btn {
  background: #00a884; color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(.86);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease, background .15s ease;
}
.chat-send-btn:hover { background: #029979; color: #fff; }
.chat-send-btn svg { margin-left: 1px; }
/* Empty ? mic only; typed text ? send replaces mic */
.chat-composer .chat-mic-btn {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: scale(1);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.chat-composer.has-text .chat-mic-btn {
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(.86);
}
.chat-composer.has-text .chat-send-btn {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: scale(1);
}
.chat-rec-bar {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  padding: .45rem .55rem; background: #fff3f0; border-top: 1px solid var(--line);
  font-size: .85rem;
}
.chat-rec-bar[hidden] { display: none !important; }
.chat-rec-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #c45c6a;
  animation: chat-pulse 1s ease infinite;
}
@keyframes chat-pulse { 50% { opacity: .35; } }
.chat-rec-timer { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.chat-rec-cancel, .chat-rec-send {
  border: 0; border-radius: 999px; padding: .35rem .7rem; cursor: pointer; font: inherit;
}
.chat-rec-cancel { background: transparent; color: var(--muted); }
.chat-rec-send { background: var(--rose); color: #fff; }
.dock-bubble.type-file { max-width: min(84%, 320px); }
.dock-bubble.type-voice {
  max-width: fit-content;
  width: fit-content;
  padding: .35rem .4rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.dock-bubble.type-voice.mine { background: transparent; border: 0; }
.dock-bubble.type-voice:not(.mine) { background: transparent; border: 0; }
.chat-media-img { display: block; border-radius: 12px; overflow: hidden; line-height: 0; }
.chat-media-img img {
  display: block;
  width: auto;
  height: auto;
  max-width: 220px;
  max-height: 280px;
  object-fit: contain;
}
.chat-caption { margin-top: .35rem; font-size: .88rem; }
.chat-voice { display: flex; align-items: center; gap: .45rem; }
.chat-voice-card {
  display: inline-flex; align-items: center; gap: .4rem;
  width: 220px; max-width: min(220px, 78vw); min-width: 180px;
  padding: .28rem .45rem .28rem .28rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e7ddd7;
  box-shadow: 0 1px 2px rgba(40, 18, 22, .06);
  position: relative;
}
.dock-bubble.mine .chat-voice-card {
  background: #ffe9e1;
  border-color: #f0c8ba;
}
.dock-bubble:not(.mine) .chat-voice-card {
  background: #f4f6f8;
  border-color: #dde3ea;
}
.chat-voice-play {
  width: 36px; height: 36px; border: 0; border-radius: 50%; flex-shrink: 0;
  background: #c45c6a; color: #fff !important; cursor: pointer;
  display: inline-flex !important; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(196, 92, 106, .28);
  font-size: 13px; line-height: 1; padding: 0;
}
.chat-voice-play .chat-voice-ico {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff !important; line-height: 0;
}
.chat-voice-play .chat-voice-ico-play { transform: translateX(1px); }
.chat-voice-play .chat-voice-ico[hidden] {
  display: none !important;
}
.chat-voice-play:hover { background: #9b3d4a; }
.chat-voice-card.is-playing .chat-voice-play { background: #9b3d4a; }
.chat-voice-wave {
  --voice-progress: 0%;
  position: relative;
  display: flex; align-items: center; gap: 1.5px; height: 28px;
  flex: 1; min-width: 0; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  touch-action: none; /* allow horizontal scrub without page scroll */
  -webkit-user-select: none;
  user-select: none;
}
.chat-voice-wave i {
  display: block; width: 2.5px; border-radius: 99px;
  background: #c45c6a;
  opacity: .92;
  height: var(--bh, 50%);
  min-height: 18%;
  transition: opacity .12s ease, background-color .12s ease;
}
/* Heard / played portion — muted like WhatsApp */
.chat-voice-wave i.is-heard {
  opacity: .28;
}
.dock-bubble:not(.mine) .chat-voice-wave i { background: #64748b; }
.dock-bubble:not(.mine) .chat-voice-wave i.is-heard {
  opacity: .3;
  background: #94a3b8;
}
.chat-voice-wave::after {
  content: '';
  position: absolute;
  left: var(--voice-progress, 0%);
  top: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #c45c6a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .75);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.chat-voice-card.is-playing .chat-voice-wave::after,
.chat-voice-card.is-scrubbed .chat-voice-wave::after {
  opacity: 1;
}
.dock-bubble:not(.mine) .chat-voice-wave::after { background: #475569; }
.chat-voice-meta {
  display: flex; flex-direction: column; justify-content: center;
  flex-shrink: 0; min-width: 2.4rem;
}
.chat-voice-dur {
  font-size: .72rem; font-weight: 650; color: #7c6a66;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.dock-bubble:not(.mine) .chat-voice-dur { color: #64748b; }
/* Keep audio in DOM for playback — display:none can block play() in some browsers */
.chat-audio--voice {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  border: 0 !important; opacity: 0 !important;
  pointer-events: none;
}
.chat-audio { width: min(220px, 100%); height: 36px; }
.chat-composer.is-recording .chat-mic-btn {
  opacity: 1 !important; visibility: visible !important; pointer-events: auto !important;
  transform: scale(1) !important;
  background: #c45c6a; color: #fff;
}
.chat-composer.is-recording .chat-send-btn {
  opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
}
.chat-send-btn {
  background: var(--rose, #c45c6a) !important; color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.chat-send-btn:hover { background: var(--rose-deep, #9b3d4a) !important; color: #fff; }
.chat-file {
  display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem;
  border-radius: 12px; background: rgba(255,255,255,.7); color: inherit; text-decoration: none;
}
.chat-file-icon { font-size: 1.2rem; }
.chat-file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-file-meta strong { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-file-meta small { color: var(--muted); font-size: .72rem; }
.chat-file-dl { font-size: .75rem; color: var(--rose-deep); font-weight: 600; }
.wa-composer-wrap .chat-composer { background: #f0e7e2; border-top: 1px solid #e4d8d0; padding: .55rem .75rem; }

/* ?? App top bar (user + admin) ?? */
.app-topbar {
  position: sticky; top: 0; z-index: 130;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .65rem 1.25rem;
  min-height: var(--app-topbar-h);
  background: rgba(255, 250, 247, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.app-topbar-burger {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff7f4;
  border: 1px solid #f0d7d0;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.app-topbar-burger__lines,
.app-topbar-burger__lines::before,
.app-topbar-burger__lines::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
}
.app-topbar-burger__lines::before,
.app-topbar-burger__lines::after {
  content: "";
  position: absolute;
  left: 0;
}
.app-topbar-burger__lines::before { top: -6px; }
.app-topbar-burger__lines::after { top: 6px; }
.app-topbar-burger__count {
  top: -4px;
  right: -4px;
}
.app-topbar--admin {
  background: rgba(59, 29, 34, .96);
  border-bottom-color: rgba(255,255,255,.08);
  color: #ffe8e2;
}
.app-topbar-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: inherit; text-decoration: none; font-weight: 700;
}
.app-topbar-brand:hover { color: inherit; }
.app-topbar-logo {
  width: 34px; height: 34px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--rose), var(--coral));
  color: #fff; font-size: 1rem;
}
.app-topbar--admin .app-topbar-logo { background: linear-gradient(145deg, var(--rose), var(--coral)); }
.app-topbar-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.app-topbar-online {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.15rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff7f4;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}
.app-topbar-online:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.app-topbar-online__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ecf8e;
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.22);
  flex-shrink: 0;
}
.app-topbar-online__label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  opacity: 0.86;
}
.app-topbar-online strong {
  font-size: 0.92rem;
  font-weight: 800;
}
.app-topbar-wordmark {
  font-family: var(--display); font-size: 1.15rem; letter-spacing: -.02em; color: var(--ink);
}
.app-topbar--admin .app-topbar-wordmark { color: #fff7f4; }
.app-topbar-badge-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  padding: .2rem .45rem; border-radius: 999px; background: rgba(196,92,106,.28); color: #ffd6cc;
}
.app-topbar--admin .app-topbar-badge-label {
  background: rgba(196,92,106,.35); color: #ffe8e2;
}
.app-topbar-actions { display: flex; align-items: center; gap: .35rem; }
.app-topbar-presence {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .55rem;
  border-radius: 999px;
  border: 1px solid #e8cfc8;
  background: #fffaf8;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #8a6a62;
  line-height: 1;
  user-select: none;
}
.app-topbar-presence__dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #b0a09c;
  flex-shrink: 0;
}
.app-topbar-presence.is-online {
  border-color: #b7dfc4;
  background: #f2fbf5;
  color: #1f6b3a;
}
.app-topbar-presence.is-online .app-topbar-presence__dot {
  background: #22a45a;
  box-shadow: 0 0 0 3px rgba(34, 164, 90, .18);
}
.app-topbar-presence.is-offline {
  border-color: #e4d2cd;
  background: #faf6f5;
  color: #8a6a62;
}
.app-topbar-presence.is-offline .app-topbar-presence__dot {
  background: #b0a09c;
}
.app-topbar-balance {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05rem;
  min-height: 42px;
  padding: 0.3rem 0.65rem;
  border-radius: 12px;
  background: #fff7f4;
  border: 1px solid #f0d7d0;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}
.app-topbar-balance:hover { border-color: #e0b4aa; color: inherit; }
.app-topbar-balance__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8a6a62);
}
.app-topbar-balance strong {
  font-size: 0.86rem;
  font-weight: 750;
}
.app-topbar-balance--wallet {
  background: #f4faf6;
  border-color: #cfe3d6;
}
.app-topbar-menu { position: relative; }
.app-topbar-icon-btn {
  position: relative;
  width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; box-shadow: none; flex-shrink: 0;
}
.app-topbar-icon-btn svg {
  width: 22px; height: 22px; flex-shrink: 0; display: block;
  stroke: currentColor; fill: none;
}
.app-topbar-heart-btn svg path {
  fill: none;
  stroke: currentColor;
}
.app-topbar-heart-btn.has-hearts {
  color: var(--rose-deep);
}
.app-topbar-heart-btn.has-hearts svg path {
  fill: currentColor;
}
.app-topbar-heart-btn .app-topbar-count {
  display: inline-block;
}
.hearts-page-count {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--rose-deep);
  font-weight: 700;
  font-size: .9rem;
}
.hearts-page-count svg { display: block; }
.app-topbar-icon-btn:hover {
  background: rgba(196, 92, 106, .1); color: var(--rose-deep);
  transform: none; box-shadow: none; filter: none;
}
.app-topbar--admin .app-topbar-icon-btn { color: #f3d2cb; box-shadow: none; }
.app-topbar--admin .app-topbar-icon-btn:hover {
  background: rgba(196,92,106,.22); color: #fff;
  transform: none; box-shadow: none; filter: none;
}
.app-topbar-count {
  position: absolute; top: 2px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--rose); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}
.app-topbar--admin .app-topbar-count { background: var(--rose); color: #fff; }
.app-topbar-profile-btn { width: auto; padding: 0; }
.app-topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
}
.app-topbar-avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #e08a7a, #c45c6a); color: #fff;
  font-weight: 700; font-family: var(--display);
}
.app-topbar--admin .app-topbar-avatar-fallback { background: linear-gradient(145deg, var(--rose), var(--coral)); }
.app-topbar-panel, .app-topbar-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: min(340px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(80, 30, 40, .16); overflow: hidden; z-index: 90;
}
.app-topbar--admin .app-topbar-panel,
.app-topbar--admin .app-topbar-dropdown {
  background: #3b1d22; border-color: rgba(255,255,255,.1); color: #ffe8e2;
  box-shadow: 0 18px 50px rgba(59, 29, 34, .45);
}
.app-topbar-dropdown { width: 220px; padding: .4rem; }
.app-topbar-dropdown-label {
  padding: .55rem .75rem .35rem; font-size: .75rem; color: var(--muted); font-weight: 600;
}
.app-topbar--admin .app-topbar-dropdown-label { color: #e8b4ac; }
.app-topbar-dropdown a,
.app-topbar-dropdown button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: .7rem .75rem; border-radius: 10px; color: inherit; font: inherit; cursor: pointer;
  text-decoration: none;
}
.app-topbar-dropdown a:hover,
.app-topbar-dropdown button:hover { background: var(--accent-soft); color: var(--rose-deep); }
.app-topbar--admin .app-topbar-dropdown a:hover,
.app-topbar--admin .app-topbar-dropdown button:hover { background: rgba(196,92,106,.22); color: #fff; }
.app-topbar-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line);
}
.app-topbar--admin .app-topbar-panel-head { border-bottom-color: rgba(255,255,255,.1); }
.app-topbar-panel-head a { font-size: .82rem; font-weight: 600; }
.app-topbar-panel-list { max-height: 360px; overflow-y: auto; }
.app-topbar-panel-item {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .8rem 1rem; border-bottom: 1px solid #f3e8e4;
  color: inherit; text-decoration: none;
}
.app-topbar--admin .app-topbar-panel-item { border-bottom-color: rgba(255,255,255,.08); }
.app-topbar-panel-item:hover { background: #fff7f4; }
.app-topbar--admin .app-topbar-panel-item:hover { background: rgba(196,92,106,.18); }
.app-topbar-panel-item.is-unread { background: #fff4f0; }
.app-topbar--admin .app-topbar-panel-item.is-unread { background: rgba(196,92,106,.22); }
.app-topbar-panel-title { font-weight: 600; font-size: .92rem; }
.app-topbar-panel-body { color: var(--muted); font-size: .82rem; }
.app-topbar--admin .app-topbar-panel-body { color: #e8b4ac; }
.app-topbar-panel-time { font-size: .72rem; color: var(--muted); }
.app-topbar-panel-empty { padding: 1.25rem 1rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 820px) {
  .app-topbar { padding: .55rem .75rem; }
  .app-topbar-wordmark { font-size: 1rem; }
}

/* Discover tabs + filters */
.discover-tabs { margin-bottom: .85rem; }
.discover-filters {
  margin-bottom: 1rem;
  padding: 0;
  overflow: hidden;
}
.discover-filters-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem;
  font-weight: 700;
  color: var(--rose-deep);
}
.discover-filters-summary::-webkit-details-marker { display: none; }
.discover-filters-hint {
  font-weight: 600;
  font-size: .8rem;
  color: var(--muted);
}
.discover-filters-form {
  padding: 0 1rem 1rem;
  border-top: 1px solid #f0e2de;
  padding-top: .9rem;
}
.discover-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: .85rem;
}
.discover-filters-span { grid-column: 1 / -1; }
.discover-filter-set {
  border: 1px solid #f0e2de;
  border-radius: .85rem;
  padding: .7rem .8rem .85rem;
  margin: 0 0 .75rem;
}
.discover-filter-set legend {
  padding: 0 .35rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--rose-deep);
}
.discover-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .7rem;
}
.discover-check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .84rem;
  margin: 0;
  font-weight: 500;
}
.discover-check input { width: auto; margin: 0; }
.discover-check--solo { margin: .25rem 0 .85rem; }
.discover-filters-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .35rem;
}
.person-card-hit {
  display: block;
  color: inherit;
  text-decoration: none;
}
.person-card-hit:hover h3 { color: var(--rose-deep); }
.person-card-body--preview { padding-bottom: .55rem; }
.person-card-footer {
  padding: .75rem .9rem 1rem;
  border-top: 1px solid #f3e4e0;
}
.person-card-view {
  display: inline-block;
  margin-top: .35rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--rose-deep);
}

/* Peer profile detail */
.people-back {
  display: inline-block;
  margin-bottom: .35rem;
  font-size: .86rem;
  font-weight: 600;
  color: var(--rose-deep);
}
.people-detail { display: grid; gap: 1rem; }
.people-detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 1.25rem;
  align-items: start;
  overflow: hidden;
}
.people-detail-photo {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(160deg, #fff1ec, #ffe0d8);
  aspect-ratio: 1 / 1;
}
.people-detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.people-detail-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 4rem;
  font-weight: 700;
  color: var(--rose-deep);
}
.people-detail-badges {
  position: absolute;
  left: .7rem;
  bottom: .7rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.people-mode-badge {
  background: rgba(255,255,255,.92);
  color: var(--rose-deep);
}
.people-detail-intro h3 {
  margin: 0 0 .35rem;
  font-family: var(--display);
  font-size: 1.85rem;
}
.people-detail-sub {
  margin: 0 0 .75rem;
  color: var(--muted);
  font-size: .95rem;
}
.people-detail-bio {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  line-height: 1.55;
}
.people-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .65rem;
}
.people-chip {
  padding: .28rem .65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rose) 14%, white);
  color: var(--rose-deep);
  font-size: .78rem;
  font-weight: 600;
}
.people-chip.soft {
  background: #fff4f0;
  color: #7a4450;
}
.people-detail-actions {
  display: grid;
  gap: .85rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid #f0e2de;
}
.people-connect-form { display: grid; gap: .45rem; }
.people-connect-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.people-safety-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.people-report-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  margin: 0;
  padding: 0;
  border: 1px solid #ead7d1;
  border-radius: 999px;
  background: #fff;
  color: var(--rose-deep, #9b3d4a);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.people-report-icon-btn:hover {
  border-color: rgba(196, 92, 106, 0.45);
  background: #fff6f3;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(80, 30, 40, 0.08);
}
.people-report-icon-btn:focus-visible {
  outline: 2px solid rgba(196, 92, 106, 0.45);
  outline-offset: 2px;
}
body.people-report-modal-open {
  overflow: hidden;
}
.people-report-modal {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.people-report-modal[hidden] {
  display: none !important;
}
.people-report-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 24, 20, 0.42);
  backdrop-filter: blur(3px);
}
.people-report-modal__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, #fffefc, #fff8f5);
  box-shadow: 0 24px 50px rgba(42, 24, 20, 0.28);
  padding: 1.1rem 1.15rem 1.2rem;
}
.people-report-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
}
.people-report-modal__head h3 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
}
.people-report-modal__head p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
}
.people-report-modal__close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: #fff1ec;
  color: var(--rose-deep);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.people-report-modal__close:hover {
  background: #ffe4dc;
}
.people-report-reasons {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.45rem;
}
.people-report-reasons legend {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
.people-report-reason {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #ead7d1;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.people-report-reason:hover {
  border-color: rgba(196, 92, 106, 0.4);
  background: #fff8f6;
}
.people-report-reason:has(input:checked) {
  border-color: rgba(196, 92, 106, 0.55);
  background: linear-gradient(135deg, #fff4f0, #ffe8e2);
  box-shadow: 0 0 0 3px rgba(196, 92, 106, 0.1);
}
.people-report-reason input {
  width: auto;
  margin: 0;
  accent-color: var(--rose, #c45c6a);
}
.people-report-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.05rem;
  padding-top: 0.95rem;
  border-top: 1px solid #f0e2de;
}
.people-report-modal__actions .btn {
  min-width: 7rem;
  border-radius: 999px;
}
.people-photo-strip h4,
.people-section h4 {
  margin: 0 0 .75rem;
  font-family: var(--display);
  color: var(--rose-deep);
}
.people-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .55rem;
}
.people-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: .75rem;
}
.people-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.people-dl {
  display: grid;
  gap: .55rem;
  margin: 0;
}
.people-dl > div {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: .5rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid #f5ebe8;
}
.people-dl dt {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
}
.people-dl dd {
  margin: 0;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
}
@media (max-width: 820px) {
  .people-detail-hero { grid-template-columns: 1fr; }
  .people-detail-photo { max-width: 360px; }
}

/* Albums + admin media */
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .65rem 1rem;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  color: #fff;
  font-size: .9rem;
}
.impersonation-banner .btn { background: #fff; color: var(--rose-deep); border: 0; }
.albums-panel-head { margin-bottom: .35rem; }
.albums-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .75rem 0;
}
.albums-picker-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .7rem;
  border-radius: 999px;
  border: 1px solid #f0d7d0;
  background: #fffaf8;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
}
.albums-picker-item span {
  background: color-mix(in srgb, var(--rose) 14%, white);
  color: var(--rose-deep);
  border-radius: 999px;
  padding: .1rem .4rem;
  font-size: .72rem;
}
.albums-picker-item.is-active {
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  border-color: transparent;
  color: #fff;
}
.albums-picker-item.is-active span { background: rgba(255,255,255,.22); color: #fff; }
.albums-album-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: .5rem 0 .75rem;
}
.albums-upload {
  display: grid;
  gap: .45rem;
  margin: .85rem 0 1rem;
  padding: .85rem;
  border: 1px dashed #e8c9c2;
  border-radius: .9rem;
  background: #fffaf8;
}
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.albums-item {
  margin: 0;
  border: 1px solid #f0e2de;
  border-radius: .85rem;
  overflow: hidden;
  background: #fff;
}
.albums-item img,
.albums-item video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #fff5f2;
}
.albums-item figcaption {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .45rem .5rem .55rem;
}
.albums-privacy select {
  width: 100%;
  margin: 0;
  padding: .35rem .45rem;
  font-size: .8rem;
}
.admin-usage-bar {
  height: 6px;
  border-radius: 999px;
  background: #f3e4e0;
  overflow: hidden;
  margin-top: .35rem;
}
.admin-usage-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--coral));
}
.admin-usage-bar--lg { height: 10px; }
.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.admin-media-card {
  margin: 0;
  border: 1px solid #f0e2de;
  border-radius: .85rem;
  overflow: hidden;
  background: #fff;
}
.admin-media-card img,
.admin-media-card video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.admin-media-card figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  padding: .45rem .55rem;
  font-size: .78rem;
}
.admin-albums-filters { margin-bottom: 0; }
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}

/* Hobby chip picker (profile) */
.hobby-picker { margin: .85rem 0 1rem; }
.hobby-picker-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem .75rem;
  margin-bottom: .55rem;
}
.hobby-picker-label label { margin: 0; }
.hobby-picker-label .muted { font-size: .78rem; }
.hobby-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.hobby-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.hobby-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.hobby-chip span {
  display: inline-flex;
  align-items: center;
  padding: .55rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffaf8;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.hobby-chip:hover span {
  border-color: rgba(196, 92, 106, .45);
  background: #fff4f0;
  color: var(--rose-deep);
}
.hobby-chip.is-selected span,
.hobby-chip:has(input:checked) span {
  background: linear-gradient(135deg, var(--rose), var(--coral));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(196, 92, 106, .28);
}
.hobby-chip:focus-within span {
  outline: 2px solid rgba(196, 92, 106, .45);
  outline-offset: 2px;
}
.pref-chip-group,
.age-range {
  margin: .15rem 0 .35rem;
  padding: .85rem 1rem 1rem;
  border: 1px solid var(--line, #eadad4);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf8 0%, #fff 100%);
}
.age-range__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem .85rem;
  margin-bottom: .85rem;
}
.age-range__values {
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
  font-weight: 700;
  color: var(--rose-deep, #9b3d4a);
  font-size: 1.05rem;
}
.age-range__sep { opacity: .7; }
.age-range__track-wrap {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
}
.age-range__track {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: 999px;
  background: #efe0db;
  pointer-events: none;
}
.age-range__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #e08a7a, #c45c6a);
}
.age-range__input {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none;
  height: 36px;
}
.age-range__input:focus {
  outline: none;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.age-range__input::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
  border: none;
}
.age-range__input::-moz-range-track {
  height: 8px;
  background: transparent;
  border: none;
}
.age-range__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--rose-deep, #9b3d4a);
  box-shadow: 0 2px 8px rgba(80, 30, 40, .28);
  cursor: grab;
  margin-top: -7px;
}
.age-range__input::-moz-range-thumb {
  pointer-events: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--rose-deep, #9b3d4a);
  box-shadow: 0 2px 8px rgba(80, 30, 40, .28);
  cursor: grab;
}
.age-range__input:active::-webkit-slider-thumb,
.age-range__input:active::-moz-range-thumb {
  cursor: grabbing;
}
.age-range__input--min { z-index: 3; }
.age-range__input--max { z-index: 4; }
.age-range__bounds {
  display: flex;
  justify-content: space-between;
  margin-top: .35rem;
  font-size: .78rem;
}

.pref-multi {
  margin: .85rem 0 0;
}
.pref-chip-group[hidden],
.pref-multi[hidden],
[data-cascade-personal][hidden] {
  display: none !important;
}
.pref-chip-group .hobby-picker-label,
.pref-multi__label {
  margin-bottom: .55rem;
}
.pref-multi__select {
  width: 100%;
  max-width: 100%;
}
.pref-multi__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .55rem;
  min-height: 0;
  visibility: visible;
  opacity: 1;
}
.pref-multi__tags:empty {
  display: none;
}
.pref-tag {
  display: inline-flex !important;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  padding: .28rem .35rem .28rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 92, 106, .28);
  background: #fff7f4;
  color: var(--rose-deep, #9b3d4a);
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.2;
  visibility: visible !important;
  opacity: 1 !important;
}
.pref-tag__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pref-tag__remove {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(42, 24, 20, .12);
  color: var(--ink, #2a1814);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pref-tag__remove:hover {
  background: rgba(196, 92, 106, .22);
  color: var(--rose-deep, #9b3d4a);
}
.pref-tag--open-all {
  background: #f3ebe7;
  border-color: rgba(80, 30, 40, .18);
  color: var(--ink, #2a1814);
}
.pref-multi.is-open-for-all .pref-multi__select {
  opacity: .72;
  cursor: not-allowed;
}
.grid-span-2 {
  grid-column: 1 / -1;
}

/* —— Read-only profile polish —— */
.profile-readonly-section {
  margin-top: 1.15rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid #eadad4;
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, #fffdfb 0%, #fff 42%);
  box-shadow: 0 10px 28px rgba(80, 30, 40, .05);
}
.profile-readonly-section__head,
.profile-section-head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .85rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #f0e4df;
}
.profile-readonly-section__intro h3,
.profile-readonly-section__intro h4 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.profile-readonly-section__intro p {
  margin: .28rem 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  max-width: 42rem;
}
.profile-section-head-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}
.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid rgba(196, 92, 106, .28);
  background: #fff;
  color: var(--rose-deep);
  font-weight: 700;
  font-size: .84rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(80, 30, 40, .06);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
  /* Beat the global gradient `button` styles so these stay readable. */
  filter: none;
}
.profile-edit-btn:hover {
  background: #fff7f4;
  border-color: var(--rose);
  transform: translateY(-1px);
  color: var(--rose-deep);
  filter: none;
  box-shadow: 0 6px 16px rgba(80, 30, 40, .1);
}
.profile-edit-btn--upload {
  background: linear-gradient(135deg, #e0567a, #c45c6a);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(196, 92, 106, .28);
}
.profile-edit-btn--upload:hover {
  background: linear-gradient(135deg, #e56b8a, #cd6a76);
  color: #fff;
  border-color: transparent;
  filter: brightness(1.03);
}
.profile-edit-btn svg { flex-shrink: 0; }
.profile-section-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.profile-readonly-block + .profile-readonly-block {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px dashed #efe3de;
}
.profile-readonly__subtitle {
  margin: 0 0 .7rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--rose-deep);
}
.profile-readonly {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem .95rem;
  margin: 0;
}
.profile-readonly__item {
  margin: 0;
  padding: .75rem .85rem;
  border-radius: 12px;
  background: #faf5f2;
  border: 1px solid transparent;
  min-width: 0;
}
.profile-readonly__item.is-wide { grid-column: 1 / -1; }
.profile-readonly__item.is-empty { background: #fcfaf9; }
.profile-readonly__item dt {
  margin: 0 0 .28rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-readonly__item dd {
  margin: 0;
  font-size: .98rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  word-break: break-word;
}
.profile-readonly__empty {
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}
.profile-readonly__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.profile-readonly__tag {
  display: inline-flex;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eadad4;
  color: var(--rose-deep);
  font-size: .82rem;
  font-weight: 650;
}
.profile-readonly-empty {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}
@media (max-width: 720px) {
  .profile-readonly { grid-template-columns: 1fr; }
  .profile-readonly-section__head { flex-wrap: wrap; }
}

/* Edit dialogs */
.profile-edit-dialog:not([open]) {
  display: none;
}
.profile-edit-dialog {
  border: 0;
  padding: 0;
  max-width: min(920px, calc(100vw - 1.5rem));
  width: 100%;
  background: transparent;
}
.profile-edit-dialog::backdrop {
  background: rgba(42, 18, 22, .55);
  backdrop-filter: blur(3px);
}
.profile-edit-dialog__panel {
  background: #fff;
  border-radius: 1.15rem;
  border: 1px solid #eadad4;
  box-shadow: 0 24px 60px rgba(42, 18, 22, .22);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.profile-edit-dialog__panel--wide { max-width: 100%; }
.profile-edit-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #f0e4df;
  background: #fffaf8;
}
.profile-edit-dialog__head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
}
.profile-edit-dialog__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(42, 24, 20, .08);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.profile-edit-dialog__body {
  padding: 1rem 1.15rem 1.15rem;
  overflow: auto;
}
.profile-edit-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid #f0e4df;
}
body.profile-modal-open { overflow: hidden; }

/* Media rails (album + reels) */
.media-rail {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .45rem;
}
.media-rail__track {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .15rem .1rem .35rem;
  scrollbar-width: thin;
}
.media-rail__card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: #fffaf8;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(80, 30, 40, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.media-rail__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(80, 30, 40, .1);
}
.media-rail__card--photo {
  width: 132px;
  aspect-ratio: 1;
}
.media-rail__card--reel {
  width: 128px;
  aspect-ratio: 9 / 16;
  position: relative;
  background: #1a1210;
}
.media-rail__card img,
.media-rail__card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.media-rail__play {
  position: absolute;
  inset: auto auto .55rem .55rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.92);
  color: var(--rose-deep);
  font-size: .7rem;
  font-weight: 700;
}
.media-rail__nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #eadad4;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(80, 30, 40, .08);
}
.media-rail__nav:disabled {
  opacity: .35;
  cursor: default;
}
.profile-media-lightbox:not([open]) {
  display: none;
}
.profile-media-lightbox {
  border: 0;
  padding: 0;
  max-width: min(980px, calc(100vw - 1rem));
  width: 100%;
  background: #140c0e;
  border-radius: 1.1rem;
  overflow: visible;
  color: #fff;
}
.profile-media-lightbox::backdrop {
  background: rgba(10, 4, 6, .88);
}
.profile-media-lightbox__panel {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .65rem;
  padding: 2.75rem 1rem 1.15rem;
  background: #140c0e;
  border-radius: 1.1rem;
}
.profile-media-lightbox__stage {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  background: #0b0708;
  border-radius: 14px;
  overflow: hidden;
}
.profile-media-lightbox__image,
.profile-media-lightbox__video {
  display: block;
  max-width: min(860px, 88vw);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 1;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.profile-media-lightbox__video {
  width: min(420px, 70vw);
  aspect-ratio: 9 / 16;
  object-fit: contain;
}
.profile-media-lightbox__close,
.profile-media-lightbox__nav {
  /* Override global gradient `button` styles so controls stay solid and circular. */
  margin: 0;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: #fff;
  color: #1a1210;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  filter: none;
  transform: none;
  line-height: 1;
}
.profile-media-lightbox__close:hover,
.profile-media-lightbox__nav:hover {
  background: #fff7f4;
  color: #1a1210;
  border-color: #fff;
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
}
.profile-media-lightbox__close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 3;
  font-size: 1.55rem;
  font-weight: 700;
}
.profile-media-lightbox__nav {
  position: relative;
  z-index: 2;
}
.profile-media-lightbox__nav svg {
  display: block;
  stroke: currentColor;
  flex-shrink: 0;
}
.profile-media-lightbox__caption {
  grid-column: 1 / -1;
  text-align: center;
  color: #fff;
  opacity: 1;
  margin: .45rem 0 0;
  font-size: .9rem;
  font-weight: 600;
}

/* Profile photo slots (8) */
.profile-photos-card { overflow: visible; }
.profile-photos-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.profile-photos-count {
  flex-shrink: 0;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--rose-deep);
  font-weight: 700;
  font-size: .82rem;
}
.profile-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
/* Readable profile: only filled photos — empty slots have no aspect-ratio and
   collapsed into a thin dashed bar under the images. */
.profile-slots-grid--readonly .profile-slot.is-empty {
  display: none;
}
.profile-slots-grid--readonly .profile-slot {
  cursor: default;
}
.profile-slot {
  position: relative;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #fffaf8;
  overflow: hidden;
  min-height: 0;
  transition: box-shadow .2s ease, border-color .2s ease, transform .15s ease;
}
.profile-slot.is-filled { cursor: grab; }
.profile-slot.is-filled:active { cursor: grabbing; }
.profile-slot.is-dragging { opacity: .55; transform: scale(.98); }
.profile-slot.is-drop-target {
  border-color: var(--rose);
  box-shadow: 0 0 0 2px rgba(196, 92, 106, .25);
}
.profile-slot.is-default {
  border-color: rgba(196, 92, 106, .55);
  box-shadow: 0 10px 28px rgba(196, 92, 106, .16);
}
.profile-slot-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(145deg, #f0d7d0, #f7e6e1);
}
.profile-slot-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.profile-slot-default-badge {
  position: absolute;
  left: .5rem;
  top: .5rem;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: rgba(42, 24, 20, .72);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.profile-slot-default-badge:empty { display: none; }
.profile-slot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding: .45rem .5rem .55rem;
  background: #fff;
  border-top: 1px solid #f3e8e4;
}
.profile-slot-star {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #f8ebe7;
  color: var(--rose-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}
.profile-slot-star:hover,
.profile-slot-star.is-on {
  background: rgba(196, 92, 106, .16);
  color: var(--rose-deep);
  transform: none;
  filter: none;
  box-shadow: none;
}
.profile-slot-btn {
  border: 0;
  background: transparent;
  color: var(--rose-deep);
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  padding: .25rem .35rem;
  border-radius: 8px;
  box-shadow: none;
}
.profile-slot-btn:hover {
  background: #f8ebe7;
  transform: none;
  filter: none;
  box-shadow: none;
  color: var(--rose-deep);
}
.profile-slot-btn--danger { color: var(--danger); }
.profile-slot-drag-hint {
  display: block;
  text-align: center;
  font-size: .68rem;
  color: var(--muted);
  padding: 0 .5rem .45rem;
}
.profile-slot-upload { margin: 0; height: 100%; }
.profile-slot-dropzone {
  min-height: 180px;
  height: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-slot.is-empty {
  border-style: dashed;
  background:
    linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,250,247,.9)),
    repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(196,92,106,.04) 8px, rgba(196,92,106,.04) 16px);
}
.profile-slot-empty-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}
.profile-slot-empty-copy strong { color: var(--rose-deep); font-size: .9rem; }
.profile-slot-empty-copy span { font-size: .75rem; }
.profile-slot-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(196, 92, 106, .12);
  color: var(--rose-deep);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: .25rem;
}
@media (max-width: 900px) {
  .profile-slots-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .profile-slots-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Inline daily album (profile page, not a tab) */
.profile-daily-album { scroll-margin-top: calc(var(--app-topbar-h) + 12px); }
.daily-album-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .75rem;
  margin-top: .35rem;
}
.daily-album-upload--modal {
  flex-direction: column;
  align-items: stretch;
}
.daily-album-dropzone {
  position: relative;
  flex: 1 1 220px;
  min-height: 110px;
  border-radius: 14px;
  border: 1px dashed rgba(196, 92, 106, .45);
  background: #fff7f4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: pointer;
  overflow: hidden;
}
.daily-album-dropzone--modal {
  flex: 0 0 auto;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  min-height: 220px;
  height: auto;
  padding: 0;
  margin: 0 auto;
}
.daily-album-dropzone--modal.has-file,
.daily-album-dropzone--modal.has-photo {
  border-style: solid;
  border-color: #e8d5cf;
  background: #1a1210;
}
.daily-album-upload-copy {
  text-align: center;
  pointer-events: none;
  padding: 1rem;
}
.daily-album-upload-copy strong {
  display: block;
  color: var(--rose-deep);
  margin-bottom: .25rem;
}
.daily-album-upload--modal .daily-album-upload-btn {
  align-self: center;
  width: min(220px, 100%);
}
.photo-dropzone-preview--album {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1210;
}
.photo-dropzone-preview--album .photo-dropzone-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.daily-album-upload-btn {
  align-self: center;
  flex: 0 0 auto;
}
.daily-album-gallery { margin-top: 1.15rem; display: grid; gap: 1.15rem; }
.daily-album-day-title {
  margin: 0 0 .55rem;
  font-size: .92rem;
  color: var(--rose-deep);
  font-weight: 700;
}
.daily-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .65rem;
}
.daily-album-thumb {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f3e6e1;
}
.daily-album-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.daily-album-thumb-remove {
  position: absolute;
  top: .35rem;
  right: .35rem;
  margin: 0;
}
.daily-album-thumb-remove button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(42, 24, 20, .72);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}
.daily-album-thumb-remove button:hover {
  background: var(--danger);
  transform: none;
  filter: none;
  box-shadow: none;
}
.people-album-locked {
  border-style: dashed;
}

/* My Reels (profile) */
.profile-reels-section { scroll-margin-top: calc(var(--app-topbar-h) + 12px); }
.reels-upload {
  flex-direction: column;
  align-items: center;
  gap: .85rem;
}
.reels-dropzone {
  min-height: 160px;
  position: relative;
}
.reels-dropzone--portrait {
  flex: 0 0 auto;
  width: min(220px, 70vw);
  aspect-ratio: 9 / 16;
  min-height: 0;
  height: auto;
  margin: 0 auto;
  padding: .85rem;
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,247,244,.92)),
    repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(196,92,106,.05) 8px, rgba(196,92,106,.05) 16px);
}
.reels-dropzone--portrait .daily-album-upload-copy {
  padding: .5rem;
}
.reels-dropzone--portrait .daily-album-upload-copy span {
  display: block;
  line-height: 1.35;
}
.reels-upload-hint {
  min-height: 1.2em;
  margin: 0;
  text-align: center;
  color: var(--danger, #b42318);
  font-size: .86rem;
}
.reels-upload-hint:empty { display: none; }
.reels-choose-btn {
  pointer-events: auto;
  margin-top: .65rem;
  position: relative;
  z-index: 2;
}
.reels-dropzone.has-file,
.reels-dropzone.has-video {
  border-style: solid;
  padding: 0;
  overflow: hidden;
  background: #1a1210;
}
.photo-dropzone-preview--video {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1210;
}
.photo-dropzone-preview--video video,
.reels-dropzone .photo-dropzone-preview video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #1a1210;
}
.reels-dropzone--portrait .photo-dropzone-preview video {
  object-fit: cover;
}
.reels-dropzone.has-file .daily-album-upload-copy,
.reels-dropzone.has-video .daily-album-upload-copy {
  display: none;
}
.daily-album-dropzone.has-file .photo-dropzone-preview:not([hidden]),
.reels-dropzone.has-file .photo-dropzone-preview:not([hidden]) {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.daily-album-dropzone--modal.has-file .daily-album-upload-copy,
.daily-album-dropzone--modal.has-photo .daily-album-upload-copy {
  display: none;
}
.reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 168px));
  justify-content: start;
  gap: .85rem;
  margin-top: 1.15rem;
}
.reel-card {
  margin: 0;
  width: 100%;
  max-width: 168px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fffaf8;
  box-shadow: var(--shadow-sm);
}
.reel-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16; /* standard vertical reel frame */
  background: #2a1814;
  overflow: hidden;
}
.reel-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #1a0f0d;
}
.reel-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .55rem .65rem;
  border-top: 1px solid #f3e8e4;
  background: #fff;
}
.reel-card-meta .muted { font-size: .72rem; }
.reel-card-meta form { margin: 0; }


/* ── Profile wizard (no sidebar) ─────────────────────────────────────────── */
.wizard-shell {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(196, 92, 106, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(232, 149, 114, 0.16), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--cream, #fff8f5) 100%);
  color: var(--ink);
}
.wizard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  max-width: 56rem;
  margin: 0 auto;
}
.wizard-brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--rose-deep);
  letter-spacing: -0.02em;
}
.wizard-main {
  max-width: 54rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 3rem;
}
.wizard-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.65rem 1.5rem 1.85rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}
.wizard-card:has(.wizard-form--prefs) {
  padding-bottom: 1.5rem;
}
.wizard-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.15rem;
}
.wizard-avatar-dropzone {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  overflow: visible;
}
.wizard-avatar-dropzone .profile-avatar-img,
.wizard-avatar-dropzone .profile-avatar-fallback,
.wizard-avatar-dropzone .photo-dropzone-preview,
.wizard-avatar-dropzone .photo-dropzone-overlay {
  border-radius: 50%;
}
.wizard-avatar-dropzone .profile-avatar-img,
.wizard-avatar-dropzone .profile-avatar-fallback,
.wizard-avatar-dropzone .photo-dropzone-preview {
  overflow: hidden;
  border-radius: 50%;
}
.wizard-avatar-dropzone .photo-dropzone-overlay {
  inset: 0;
  overflow: hidden;
  gap: 0.35rem;
  padding: 1rem;
}
.wizard-avatar-dropzone .photo-dropzone-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.22);
}
.wizard-avatar-dropzone .photo-dropzone-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}
.wizard-avatar-dropzone .photo-dropzone-overlay strong {
  font-size: 0.82rem;
}
.wizard-avatar-dropzone .photo-dropzone-badge {
  right: 6px;
  bottom: 6px;
  width: 42px;
  height: 42px;
  box-shadow: 0 8px 18px rgba(80, 30, 40, 0.3);
}
.wizard-avatar-dropzone .photo-dropzone-badge svg {
  width: 18px;
  height: 18px;
  display: block;
}
.wizard-avatar-upload-btn {
  min-width: 9.5rem;
}
.wizard-card--waiting {
  text-align: center;
  padding: 2.25rem 1.5rem;
}
.wizard-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
  font-weight: 700;
}
.wizard-progress {
  margin-bottom: 1.25rem;
}
.wizard-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: #f3e4df;
  overflow: hidden;
}
.wizard-progress__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--coral, #e89572));
  transition: width 0.35s ease;
}
.wizard-progress__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.wizard-progress__meta strong { color: var(--ink); font-weight: 600; }
.wizard-title {
  font-family: var(--display);
  font-size: clamp(1.55rem, 4vw, 1.9rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.wizard-blurb {
  margin: 0 0 0.65rem;
  color: var(--muted);
  line-height: 1.45;
}
.wizard-autosave {
  margin: 0 0 1.15rem;
  font-size: 0.8rem;
}
.wizard-reject-notice {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #f0c2c2;
  background: #fff5f5;
  color: #7a2e2e;
}
.wizard-reject-notice strong { display: block; margin-bottom: 0.25rem; }
.wizard-reject-notice p { margin: 0; font-size: 0.9rem; line-height: 1.4; }
.wizard-form label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.wizard-form label:first-of-type { margin-top: 0; }
.wizard-form input[type="text"],
.wizard-form input[type="number"],
.wizard-form input:not([type]),
.wizard-form select,
.wizard-form textarea {
  width: 100%;
  box-sizing: border-box;
}
.wizard-form .wizard-field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
}
.wizard-form .age-range {
  margin: 0.85rem 0 1rem;
}
.wizard-form--prefs {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wizard-form--prefs .wizard-pref-group--solo {
  margin-bottom: 0.15rem;
}
.wizard-form--prefs .wizard-pref-group--solo .wizard-pref-group__body {
  gap: 1.25rem;
  padding-top: 1.35rem;
  padding-bottom: 1.55rem;
}
.wizard-form--prefs .wizard-pref-chips {
  min-height: 8rem;
}
.wizard-form--prefs .wizard-pref-field {
  padding: 1rem 1.05rem;
  border: 1px solid #f0e2de;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fffcfa);
}
.wizard-pref-open-all {
  display: inline-flex !important;
  align-items: center;
  gap: 0.55rem;
  width: auto;
  max-width: none;
  margin: 0 !important;
  padding: 0.55rem 0.85rem;
  border: 1px solid #ecd9d3;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #fff7f4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 4px 12px rgba(80, 30, 40, 0.05);
  font-size: 0.82rem;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  color: var(--rose-deep, #9b3d4a);
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.wizard-pref-open-all:hover {
  border-color: rgba(196, 92, 106, 0.45);
  box-shadow: 0 8px 18px rgba(80, 30, 40, 0.08);
  transform: translateY(-1px);
}
.wizard-pref-open-all:has(input:checked) {
  border-color: rgba(196, 92, 106, 0.5);
  background: linear-gradient(135deg, #fff4f0, #ffe8e2);
  box-shadow: 0 0 0 3px rgba(196, 92, 106, 0.1);
}
.wizard-pref-open-all input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem !important;
  height: 1.05rem;
  margin: 0;
  border: 1.5px solid #d8b8b0;
  border-radius: 0.35rem;
  background: #fff;
  display: grid;
  place-content: center;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wizard-pref-open-all input::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  transform: scale(0);
  transition: transform 0.12s ease;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
  background: #fff;
}
.wizard-pref-open-all input:checked {
  border-color: transparent;
  background: linear-gradient(135deg, var(--rose), var(--coral));
}
.wizard-pref-open-all input:checked::before {
  transform: scale(1);
}
.wizard-pref-open-all span {
  line-height: 1.2;
}
.wizard-pref-group {
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  margin: 0 0 0.35rem;
  padding: 0;
  border: 1px solid #ead7d1;
  border-radius: 20px;
  background:
    linear-gradient(165deg, #fffefc 0%, #fff 42%, #fff8f5 100%),
    radial-gradient(80% 60% at 100% 0%, rgba(224, 122, 95, 0.08), transparent 58%);
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  box-shadow: 0 12px 32px rgba(80, 30, 40, 0.07);
}
.wizard-pref-group.is-open-for-all {
  border-color: rgba(196, 92, 106, 0.42);
  box-shadow: 0 12px 32px rgba(80, 30, 40, 0.08), 0 0 0 3px rgba(196, 92, 106, 0.1);
}
.wizard-pref-group.is-open-for-all .wizard-pref-group__body {
  position: relative;
  pointer-events: none;
  user-select: none;
  opacity: 0.52;
  filter: grayscale(0.12);
}
.wizard-pref-group.is-open-for-all .wizard-pref-group__body::after {
  content: 'Open for all — custom picks are off';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(42, 24, 20, 0.86);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  width: max-content;
  max-width: calc(100% - 2rem);
  text-align: center;
  box-shadow: 0 10px 24px rgba(42, 24, 20, 0.22);
}
.wizard-pref-group.is-open-for-all .hobby-chip span {
  opacity: 0.72;
}
.wizard-pref-group.is-open-for-all .hobby-chip.is-locked {
  cursor: not-allowed;
}
.wizard-pref-group__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.1rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid #f1e3de;
  background: linear-gradient(180deg, #fffaf8, rgba(255, 255, 255, 0.92));
  border-radius: 20px 20px 0 0;
}
.wizard-pref-group__head-copy {
  min-width: min(100%, 14rem);
  flex: 1 1 14rem;
}
.wizard-pref-group__head h2 {
  margin: 0 0 0.28rem;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.6vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.wizard-pref-group__head p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 36rem;
}
.wizard-pref-group__body {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  padding: 1.15rem 1.25rem 1.4rem;
  display: grid;
  gap: 1.15rem;
}
.wizard-pref-group .age-range {
  margin: 0;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid #f0e2de;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fffaf8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.wizard-pref-group .wizard-check {
  margin: 0 !important;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  background: #fff7f4;
  border: 1px solid #f0e2de;
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
}
.wizard-pref-group .wizard-check input {
  width: auto !important;
  margin: 0;
  flex: 0 0 auto;
}
.wizard-pref-field {
  display: grid;
  gap: 0.4rem;
}
.wizard-pref-field > label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}
.wizard-pref-chips {
  margin: 0;
  padding: 0.95rem 1rem 1.05rem;
  border: 1px solid #f0e2de;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fffcfa);
}
.wizard-pref-chips__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.85rem;
  margin-bottom: 0.75rem;
}
.wizard-pref-chips__head label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}
.wizard-pref-chips__head .muted {
  font-size: 0.76rem;
  color: var(--muted);
}
.wizard-pref-chips .hobby-chip-grid {
  overflow: visible;
  max-height: none;
  gap: 0.55rem;
}
.wizard-pref-group .hobby-chip span {
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid #ead7d1;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.wizard-pref-group .hobby-chip:hover span {
  border-color: rgba(196, 92, 106, 0.42);
  background: #fff6f3;
  color: var(--rose-deep);
  transform: translateY(-1px);
}
.wizard-pref-group .hobby-chip.is-selected span,
.wizard-pref-group .hobby-chip:has(input:checked) span {
  background: linear-gradient(135deg, #e56d7d, #c45c6a);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 16px rgba(196, 92, 106, 0.24);
}
.wizard-pref-group select {
  border-radius: 12px;
  border-color: #ead7d1;
  background: #fff;
  min-height: 2.85rem;
  padding: 0.55rem 0.85rem;
}
@media (max-width: 640px) {
  .wizard-pref-group__head {
    padding: 1rem 1rem 0.9rem;
  }
  .wizard-pref-group__body {
    padding: 1rem 1rem 1.2rem;
    gap: 1rem;
  }
  .wizard-pref-open-all {
    width: 100%;
    justify-content: flex-start;
  }
}
.wizard-hobby-section {
  margin: 0.85rem 0 0;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fffaf8);
  overflow: hidden;
}
.wizard-hobby-section__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  user-select: none;
}
.wizard-hobby-section__summary::-webkit-details-marker { display: none; }
.wizard-hobby-section__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.wizard-hobby-section__meta {
  font-size: 0.78rem;
  white-space: nowrap;
}
.wizard-hobby-section__summary::after {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
  margin-left: 0.15rem;
}
.wizard-hobby-section[open] .wizard-hobby-section__summary::after {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}
.wizard-hobby-section__body {
  border-top: 1px solid var(--line);
  padding: 0.75rem 0.85rem 0.9rem;
}
.wizard-hobby-section__hint {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
}
.wizard-hobby-section__limit {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 9px;
  border: 1px solid #f0c2c2;
  background: #fff5f5;
  color: #7a2e2e;
  font-size: 0.82rem;
  font-weight: 600;
}
.wizard-hobby-section__scroll {
  margin: 0;
  max-height: 12.5rem;
  overflow: auto;
  padding-right: 0.15rem;
}
.wizard-hobby-section .hobby-chip input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
}
.wizard-check {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500 !important;
  margin-top: 1rem !important;
}
.wizard-check input { width: auto; }
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.65rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f0e2de;
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), #fff 38%);
  backdrop-filter: blur(8px);
  padding-bottom: 0.15rem;
}
.wizard-actions .btn {
  min-width: 8.25rem;
  min-height: 2.85rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(80, 30, 40, 0.08);
}
.wizard-actions .btn.secondary {
  background: #fff;
  border: 1px solid #ead7d1;
  color: var(--ink);
  box-shadow: none;
}
.wizard-actions .btn.secondary:hover {
  border-color: rgba(196, 92, 106, 0.4);
  background: #fff8f6;
}
.wizard-actions .btn.like {
  padding-inline: 1.35rem;
}
.wizard-review p { margin: 0 0 0.65rem; }
.wizard-review-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.wizard-review-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid #f5ebe7;
  font-size: 0.9rem;
}
.wizard-review-list li:last-child { border-bottom: 0; }
@media (max-width: 520px) {
  .wizard-card { padding: 1.2rem 1rem 1.35rem; border-radius: 16px; }
  .wizard-actions .btn { min-width: 0; flex: 1; }
}

/* ── Icon select (custom dropdown with in-list icons) ─────────────────────── */
.icon-select {
  position: relative;
  width: 100%;
}
.icon-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none;
}
.icon-select__trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
  min-height: 2.85rem;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fffaf8);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.icon-select__trigger:hover {
  border-color: #e2b7ae;
  background: #fff;
}
.icon-select.is-open .icon-select__trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 92, 106, 0.12);
  background: #fff;
}
.icon-select__trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}
.icon-select__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-select__icon[hidden] { display: none !important; }
.icon-select__icon svg { display: block; }
.icon-select__label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
  font-weight: 600;
}
.icon-select__label.is-placeholder {
  color: var(--muted);
  font-weight: 500;
}
.icon-select__chevron {
  display: inline-flex;
  color: var(--muted);
  transition: transform 0.18s ease;
}
.icon-select.is-open .icon-select__chevron { transform: rotate(180deg); }
.icon-select__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(42, 24, 20, 0.14);
  max-height: 17rem;
  overflow: auto;
  animation: icon-select-in 0.14s ease;
}
@keyframes icon-select-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.icon-select__option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.icon-select__option:hover,
.icon-select__option:focus-visible {
  background: var(--accent-soft);
  outline: none;
}
.icon-select__option.is-selected {
  background: color-mix(in srgb, var(--accent-soft) 85%, #fff);
  font-weight: 600;
}
.icon-select__option.is-selected .icon-select__icon {
  background: #fff;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(196, 92, 106, 0.18);
}
.icon-select__option-label { line-height: 1.3; }

/* ── Album crop (before save) ───────────────────────────────────────────── */
.album-crop {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff8f6;
}
.album-crop[hidden] { display: none !important; }
.album-crop__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.album-crop__toolbar strong {
  font-size: 0.92rem;
  color: var(--ink);
}
.album-crop__toolbar-actions {
  display: flex;
  gap: 0.35rem;
}
.album-crop__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 360px;
  overflow: hidden;
  border-radius: 12px;
  background: #1a1210;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.album-crop__viewport.is-dragging { cursor: grabbing; }
.album-crop__viewport img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  pointer-events: none;
  will-change: transform;
}
.album-crop__frame {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255,255,255,0.92);
  box-shadow: 0 0 0 999px rgba(0,0,0,0.35);
  border-radius: 10px;
  pointer-events: none;
}
.album-crop__zoom {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.album-crop__zoom span em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.25rem;
}
.album-crop__zoom input[type="range"] {
  width: 100%;
  accent-color: var(--rose);
}
.album-crop__hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
}
.daily-album-dropzone.is-cropping {
  min-height: 0;
  padding: 0.55rem 0.75rem;
  border-style: dashed;
}
.daily-album-dropzone.is-cropping .photo-dropzone-preview,
.daily-album-dropzone.is-cropping .daily-album-upload-copy {
  display: none !important;
}
.daily-album-dropzone.is-cropping::after {
  content: 'Photo selected — adjust the crop below';
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  padding: 0.35rem 0;
}
form.has-album-crop .daily-album-upload-btn {
  min-width: 9rem;
}

/* ── Agent desk ──────────────────────────────────────────────────────────── */
.agent-desk {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  min-width: 0;
}
.agent-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin: 0;
}
.agent-hero h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
}
.agent-hero__sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.agent-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-self: flex-start;
  justify-content: flex-end;
}
.agent-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
  font-weight: 700;
}
.agent-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.agent-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.agent-panel__head h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.agent-panel__head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.agent-balances {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.agent-balance-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}
.agent-balance-card--wallet {
  background: #f4faf6;
  border-color: #cfe3d6;
}
.agent-balance-card--payroll {
  background: #fffaf8;
}
.agent-balance-card__label {
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.agent-balance-card strong,
.agent-balance-card__title {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--ink);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.agent-balance-card__title {
  font-size: 1.05rem;
}
.agent-balance-card__hint,
.agent-balance-card__note {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.agent-balance-card__note {
  margin-top: 0.15rem;
}
.agent-balance-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.agent-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.agent-metric {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid #f0d7d0;
  border-radius: 12px;
  background: #fffaf8;
  box-sizing: border-box;
}
.agent-metric__label {
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.agent-metric strong {
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.agent-metric em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
}
.agent-metric-bar,
.agent-level-bar {
  width: 100%;
  max-width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #f3e8e4;
  overflow: hidden;
  box-sizing: border-box;
}
.agent-metric-bar > span,
.agent-level-bar > span,
.agent-level-bar__fill {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c45c4a, #e08a6b);
  min-width: 0;
  box-sizing: border-box;
  transition: width 0.35s ease;
}
.agent-metric-bar--response > span {
  background: linear-gradient(90deg, #1d4ed8, #60a5fa);
}
.agent-metric-bar--tier > span,
.agent-level-bar > span,
.agent-level-bar__fill {
  background: linear-gradient(90deg, #b87333, #c0c0c0 35%, #d4af37 70%, #7ec8e3);
}
.agent-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}
.agent-split > * {
  min-width: 0;
}
.agent-empty {
  margin: 0;
}
.agent-event-time {
  font-size: 0.8rem;
}
.agent-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.agent-stat-grid--tight {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.agent-stat-grid--activity {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.agent-stat-card {
  background: #fffaf8;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem 0.95rem;
  box-shadow: none;
  min-width: 0;
  box-sizing: border-box;
}
.agent-stat-card span {
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.agent-stat-card strong {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.15;
}
.agent-panel--activity {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.agent-panel--activity > .agent-panel__head {
  margin-bottom: 0;
}
.agent-activity-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #e4d2cd;
  background: #faf6f5;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a6a62;
  white-space: nowrap;
}
.agent-activity-live__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #b0a09c;
  flex-shrink: 0;
}
.agent-activity-live.is-online {
  border-color: #b7dfc4;
  background: #f2fbf5;
  color: #1f6b3a;
}
.agent-activity-live.is-online .agent-activity-live__dot {
  background: #22a45a;
  box-shadow: 0 0 0 3px rgba(34, 164, 90, 0.16);
}
.agent-activity-live.is-offline {
  border-color: #e4d2cd;
  background: #faf6f5;
  color: #8a6a62;
}
.agent-activity-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.agent-activity-block__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.agent-online-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.agent-online-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}
.agent-online-card--today {
  background: #f4faf6;
  border-color: #cfe3d6;
}
.agent-online-card--month {
  background: #fffaf8;
  border-color: #ead7d1;
}
.agent-online-card__label {
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.agent-online-card__value {
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--ink);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.agent-online-card__hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
@media (max-width: 960px) {
  .agent-balances,
  .agent-metric-row,
  .agent-split,
  .agent-online-grid,
  .agent-stat-grid--activity {
    grid-template-columns: 1fr;
  }
  .agent-hero {
    flex-direction: column;
  }
  .agent-hero__actions {
    justify-content: flex-start;
  }
}
@media (min-width: 641px) and (max-width: 960px) {
  .agent-online-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .agent-stat-grid--activity {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.agent-client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f3e8e4;
}
.agent-client-row:last-child { border-bottom: 0; }
.agent-rules {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.55;
}
.agent-stat-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}
.agent-glossary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.agent-glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem 1.1rem;
  margin: 0;
}
.agent-glossary-grid dt {
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0 0 0.2rem;
  color: var(--ink);
}
.agent-glossary-grid dd {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.agent-next-hint {
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
}
.agent-next-hint a {
  margin-left: 0.35rem;
  font-weight: 600;
}
.agent-progress-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 720px) {
  .agent-progress-row { grid-template-columns: 1fr; }
}
.agent-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #f3e8e4;
  overflow: hidden;
  margin-top: 0.35rem;
}
.agent-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c45c4a, #e08a6b);
  border-radius: 999px;
}
.agent-level-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.agent-level-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.agent-level-row.is-current {
  border-color: #c45c4a;
  box-shadow: 0 0 0 1px rgba(196, 92, 74, 0.25);
}
.agent-level-row.is-next {
  border-style: dashed;
}
.agent-level-row.is-locked {
  opacity: 0.72;
}
.agent-level-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.agent-level-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rose);
}
.agent-level-reqs {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
}
.agent-level-benefits {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink);
}
.agent-response-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}
.agent-response-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
}
.agent-response-chip.is-current {
  border-color: #c45c4a;
  background: #fff8f5;
}
.agent-response-chip strong {
  font-size: 0.85rem;
}

/* Named ladder + packages */
.agent-level-progress__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.agent-level-progress__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}
.agent-level-progress__meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  white-space: nowrap;
}
.agent-level-progress__foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.agent-level-progress {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.agent-level-bar {
  width: 100%;
  max-width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #f3e8e4;
  overflow: hidden;
  box-sizing: border-box;
}
.agent-level-bar > span,
.agent-level-bar__fill {
  display: block;
  height: 100%;
  max-width: 100%;
  background: linear-gradient(90deg, #b87333, #c0c0c0 35%, #d4af37 70%, #7ec8e3);
  border-radius: 999px;
  min-width: 0;
  box-sizing: border-box;
  transition: width 0.35s ease;
}
.agent-level-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f3e8e4;
  color: var(--ink);
}
.agent-level-pill--bronze { background: #cd7f32; color: #fff; }
.agent-level-pill--silver { background: #a8a8a8; color: #fff; }
.agent-level-pill--gold { background: #d4af37; color: #1a1a1a; }
.agent-level-pill--pearl { background: #f0e6d8; color: #4a3f35; }
.agent-level-pill--ruby { background: #9b1b30; color: #fff; }
.agent-level-pill--sapphire { background: #0f52ba; color: #fff; }
.agent-level-pill--emerald { background: #046307; color: #fff; }
.agent-level-pill--platinum { background: #e5e4e2; color: #333; }
.agent-level-pill--diamond { background: #b9f2ff; color: #0a3d62; }
.agent-level-pill--crown { background: linear-gradient(135deg, #1a1a2e, #d4af37); color: #fff; }
.agent-level-flag {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rose);
}
.agent-level-flag--next { color: #0f52ba; }
.agent-level-flag--locked { color: var(--muted); }
.agent-level-ladder {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.agent-level-point-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  width: 100%;
  min-width: 0;
}
.agent-level-point-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  padding: 1.1rem 1.15rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: #fff;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}
.agent-level-point-card.is-current {
  border-color: #c45c4a;
  box-shadow: 0 0 0 1px rgba(196, 92, 74, 0.2), var(--shadow-sm);
}
.agent-level-point-card.is-next {
  border-style: dashed;
}
.agent-level-point-card.is-locked {
  opacity: 0.78;
}
.agent-level-point-card__head h3 {
  margin: 0.45rem 0 0.15rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.agent-level-point-card__head .muted {
  margin: 0;
  font-size: 0.8rem;
}
.agent-level-point-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0;
}
.agent-level-point-card__stats > div {
  min-width: 0;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: #fffaf8;
  border: 1px solid #f0d7d0;
  box-sizing: border-box;
}
.agent-level-point-card__stats dt {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.agent-level-point-card__stats dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.agent-level-point-card__detail {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.agent-level-card {
  border: 1px solid var(--line);
}
.agent-level-card.is-current {
  border-color: #c45c4a;
  box-shadow: 0 0 0 1px rgba(196, 92, 74, 0.2);
}
.agent-level-card.is-next {
  border-style: dashed;
}
.agent-level-card.is-locked {
  opacity: 0.78;
}
.agent-level-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
  padding: 1.1rem 1.2rem 0;
}
.agent-level-card__req {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  white-space: nowrap;
}
.agent-package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 0 1.2rem 1.15rem;
}
.agent-package {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fffaf8;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.agent-package.is-locked {
  background: #faf7f5;
  opacity: 0.85;
}
.agent-package.is-unlocked {
  border-color: rgba(4, 99, 7, 0.35);
}
.agent-package__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.82rem;
}
.agent-package__top span {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.agent-package__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.agent-package__block ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink);
}
.agent-package__status {
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.agent-package.is-unlocked .agent-package__status {
  color: #046307;
}
.agent-response-ladder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}
@media (max-width: 720px) {
  .agent-level-card__head,
  .agent-level-progress__head,
  .agent-level-progress__intro {
    flex-direction: column;
  }
  .agent-level-card__req,
  .agent-level-progress__meta {
    text-align: left;
  }
}

/* Agent desk polish */
.agent-desk {
  --ad-ink: #1f2937;
  --ad-muted: #6b7280;
  --ad-line: #e5e7eb;
  --ad-accent: #b45309;
  --ad-surface: #ffffff;
  --ad-soft: #f8fafc;
}
.agent-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 0;
  width: 100%;
  min-width: 0;
}
.agent-chart {
  background: var(--ad-surface);
  border: 1px solid var(--ad-line);
  border-radius: 14px;
  padding: 0.85rem 1rem 0.7rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  color: #334155;
}
.agent-chart--earnings { color: #0f766e; }
.agent-chart--points { color: #b45309; }
.agent-chart--response { color: #1d4ed8; }
.agent-chart--score { color: #7c3aed; }
.agent-chart__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.45rem;
}
.agent-chart__head h3 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ad-ink);
}
.agent-chart__head p {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--ad-muted);
}
.agent-chart__badge {
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  color: inherit;
}
.agent-chart__canvas {
  position: relative;
  height: 96px;
}
.agent-chart__canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}
.agent-chart__line {
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.agent-chart__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--ad-muted);
}
.agent-chart__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--ad-muted);
}

.agent-client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
}
.agent-client-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.agent-client-card.is-inactive {
  opacity: 0.82;
  background: #fafafa;
}
.agent-client-card.is-focused {
  border-color: #c45c4a;
  box-shadow: 0 0 0 1px rgba(196, 92, 74, 0.25), var(--shadow-sm);
}
.agent-client-picker {
  position: relative;
  margin: 0 0 1rem;
  max-width: 420px;
}
.agent-client-picker__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.agent-client-picker__trigger:hover {
  border-color: #e0b4aa;
}
.agent-client-picker__label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.agent-client-picker__label strong {
  font-size: 0.92rem;
}
.agent-client-picker__label .muted {
  font-size: 0.75rem;
}
.agent-client-picker__chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-right: 0.25rem;
  flex-shrink: 0;
}
.agent-client-picker__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(42, 24, 20, 0.12);
  padding: 0.35rem;
}
.agent-client-picker__option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.agent-client-picker__option:hover,
.agent-client-picker__option.is-active {
  background: #fff8f5;
}
.agent-client-picker__option span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.agent-client-picker__option strong {
  font-size: 0.88rem;
}
.agent-client-picker__option .muted {
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-client-picker__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.agent-client-picker__avatar--fallback,
.agent-client-picker__avatar--all {
  display: grid;
  place-items: center;
  background: #f3e8e4;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.78rem;
}
.agent-client-picker__actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.agent-client-card__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: start;
}
.agent-client-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}
.agent-client-card__avatar--fallback {
  display: grid;
  place-items: center;
  background: #f3e8e4;
  font-weight: 700;
  color: var(--ink);
}
.agent-client-card__id {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.agent-client-card__id strong {
  font-size: 0.95rem;
}
.agent-client-card__id .muted {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-client-status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
}
.agent-client-status--inactive {
  background: #f3f4f6;
  color: #6b7280;
}
.agent-client-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0;
}
.agent-client-stats dt {
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0;
}
.agent-client-stats dd {
  margin: 0.1rem 0 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.agent-client-meta {
  margin: 0;
  font-size: 0.75rem;
}
.agent-client-card__actions {
  display: flex;
  gap: 0.45rem;
  margin-top: auto;
}

.agent-modal[hidden] { display: none !important; }
.agent-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.agent-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.agent-modal__panel {
  position: relative;
  width: min(440px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}
.agent-modal__panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.agent-modal__panel h3 { margin: 0; }
.agent-modal__panel textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  resize: vertical;
  min-height: 110px;
}
.agent-modal__error { color: var(--danger); margin: 0.4rem 0 0; }

.agent-balance-card--action {
  appearance: none;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.agent-balance-card--action:hover,
.agent-balance-card--action:focus-visible {
  border-color: #e0b4aa;
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 92, 106, 0.12);
}
.agent-payroll-card--wallet-click {
  cursor: pointer;
}
.agent-payroll-card--wallet-click:hover {
  border-color: #e0b4aa;
}
.agent-payout-modal__panel {
  width: min(520px, 100%);
}
.agent-payout-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.agent-payout-modal__form label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.82rem;
  font-weight: 650;
}
.agent-payout-modal__form label em {
  font-weight: 500;
}
.agent-payout-modal__form input {
  font: inherit;
  font-weight: 500;
  padding: 0.55rem 0.7rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
.agent-payout-modal__row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 520px) {
  .agent-payout-modal__row { grid-template-columns: 1fr; }
}
.agent-payout-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.agent-redeem-modal__summary {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #fff7f4;
  border: 1px solid #f0d7d0;
}
.agent-redeem-modal__summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.agent-redeem-modal__summary dt {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted, #8a6a62);
  font-weight: 650;
}
.agent-redeem-modal__summary dd {
  margin: 0;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.admin-agent-payout-dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}
.admin-agent-payout-dl dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-muted, #8a6a62);
  margin: 0 0 0.2rem;
}
.admin-agent-payout-dl dd {
  margin: 0;
  font-weight: 650;
}

.agent-payroll-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.agent-payroll-page .agent-payroll-card {
  padding: 1.1rem 1.2rem;
  margin: 0;
}
.agent-payroll-kicker {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}
.agent-payroll-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}
.agent-payroll-meta--hint {
  font-size: 0.8rem;
}
.agent-payroll-balance__action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}
.agent-payroll-balance__action form {
  margin: 0;
  width: 100%;
}
.agent-payroll-cta {
  white-space: nowrap;
}
.agent-payroll-section {
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.agent-payroll-section:last-child {
  margin-bottom: 0;
}
.agent-payroll-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.agent-payroll-section__head h3 {
  margin: 0;
}
.agent-payroll-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.agent-payroll-filter input[type="date"] {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.55rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 0;
  max-width: 100%;
}
.agent-payroll-cards {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
}
.agent-payroll-empty {
  margin: 0;
  padding: 0.35rem 0;
}
.agent-payroll-slip-card,
.agent-payroll-event-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf8;
  padding: 0.85rem 0.95rem;
}
.agent-payroll-slip-card__top,
.agent-payroll-event-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
}
.agent-payroll-slip-card__slip {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.agent-payroll-slip-card__top strong,
.agent-payroll-event-card__top strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.3;
}
.agent-payroll-slip-card__meta,
.agent-payroll-event-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.7rem;
  font-size: 0.82rem;
}
.agent-payroll-slip-card__meta span,
.agent-payroll-event-card__meta span {
  min-width: 0;
}
.agent-payroll-slip-card__meta em {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.12rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.agent-payroll-slip-card__meta small {
  display: block;
  margin-top: 0.1rem;
}
.agent-payroll-slip-card__actions {
  margin-top: 0.75rem;
}
.agent-payroll-slip-card__actions .btn {
  width: 100%;
  justify-content: center;
}
.agent-payroll-event-card__value {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.88rem;
}
.agent-payroll-event-card__type {
  text-align: right;
  color: var(--muted);
  text-transform: capitalize;
}
.agent-payroll-status {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  background: #f3e8e4;
  color: #7a5c55;
  flex-shrink: 0;
}
.agent-payroll-status--paid,
.agent-payroll-status--approved {
  background: #dcfce7;
  color: #166534;
}
.agent-payroll-status--pending,
.agent-payroll-status--requested {
  background: #fef3c7;
  color: #92400e;
}
.agent-payroll-status--rejected {
  background: #fee2e2;
  color: #991b1b;
}
.agent-payroll-status--adjusted {
  background: #e0e7ff;
  color: #3730a3;
}
.agent-payroll-pager {
  margin-top: 0.75rem;
}
.agent-payroll-modal-note {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
}
.flash--error {
  background: #fff1f0;
  border: 1px solid #f0c2bc;
  color: #8a2f28;
}
.agent-points-leaderboard__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.agent-points-leaderboard__live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e8f6ee;
  color: #1f6b45;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.agent-points-leaderboard__live::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 0 0 rgba(34, 160, 107, 0.55);
}
.agent-points-leaderboard__live.is-pulse::before {
  animation: agent-lb-pulse 0.7s ease-out;
}
@keyframes agent-lb-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 160, 107, 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(34, 160, 107, 0); }
}
.agent-points-leaderboard__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.agent-points-leaderboard__row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 0.85rem;
  background: #fffaf8;
  border: 1px solid var(--line);
}
.agent-points-leaderboard__row.is-you {
  background: #fff1ec;
  border-color: #efc4b8;
}
.agent-points-leaderboard__rank {
  font-weight: 750;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.agent-points-leaderboard__name {
  min-width: 0;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-points-leaderboard__name em {
  font-style: normal;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.agent-points-leaderboard__points {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.agent-points-leaderboard__empty {
  padding: 0.65rem 0.2rem;
}
.agent-payroll-card .agent-payroll-balance {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.agent-payroll-balance__copy {
  min-width: 0;
  flex: 1 1 12rem;
}
.agent-payroll-card--points {
  background: #f7fafc;
  border-color: #d5e3ef;
}
.agent-payroll-balance strong {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  color: var(--ink);
  margin-top: 0.15rem;
  word-break: break-word;
}
.agent-payroll-redeem input {
  font: inherit;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
}
.agent-payroll-table th,
.agent-payroll-table td {
  font-size: 0.86rem;
}
.table-wrap { overflow-x: auto; }

@media (max-width: 720px) {
  .agent-payroll-page {
    gap: 0.85rem;
    padding-bottom: 0.35rem;
  }
  .agent-payroll-page .agent-hero {
    flex-direction: column;
    gap: 0.65rem;
  }
  .agent-payroll-page .agent-hero h2 {
    font-size: 1.35rem;
    line-height: 1.2;
  }
  .agent-payroll-page .agent-hero__sub {
    font-size: 0.84rem;
  }
  .agent-payroll-page .agent-hero__actions {
    width: 100%;
  }
  .agent-payroll-page .agent-hero__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .agent-payroll-summary {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .agent-payroll-page .agent-payroll-card,
  .agent-payroll-section {
    padding: 0.95rem 0.95rem;
    border-radius: 1rem;
  }
  .agent-payroll-card .agent-payroll-balance {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .agent-payroll-balance__action {
    align-items: stretch;
    width: 100%;
  }
  .agent-payroll-cta,
  .agent-payroll-balance__action .btn {
    width: 100%;
    justify-content: center;
  }
  .agent-payroll-balance strong {
    font-size: 1.45rem;
  }
  .agent-points-leaderboard__head {
    flex-wrap: wrap;
  }
  .agent-payroll-section__head {
    flex-direction: column;
    align-items: stretch;
  }
  .agent-payroll-filter {
    width: 100%;
  }
  .agent-payroll-filter input[type="date"] {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 0;
  }
  .agent-payroll-filter .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
  .agent-payroll-table-wrap {
    display: none;
  }
  .agent-payroll-cards {
    display: flex;
  }
  .agent-payroll-slip-card__meta {
    grid-template-columns: 1fr;
  }
  .agent-payroll-event-card__top {
    flex-direction: column;
    align-items: flex-start;
  }
  .agent-payroll-event-card__value {
    white-space: normal;
  }
  .agent-payroll-event-card__meta {
    grid-template-columns: 1fr auto;
  }
  .agent-modal {
    place-items: end stretch;
    padding: 0;
  }
  .agent-modal__panel,
  .agent-payout-modal__panel {
    width: 100%;
    max-width: none;
    border-radius: 18px 18px 0 0;
    max-height: min(92dvh, 100%);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .agent-payout-modal__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .agent-payout-modal__actions .btn {
    width: 100%;
    justify-content: center;
  }
  .agent-payroll-pager nav,
  .agent-payroll-pager .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }
}

@media (min-width: 721px) {
  .agent-payroll-cards {
    display: none !important;
  }
}

/* Agent dashboard assigned-client cards */
.agent-dash-client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.agent-dash-client-card {
  border: 1px solid var(--line, #eadfd8);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.agent-dash-client-card__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.agent-dash-client-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.agent-dash-client-card__avatar--fallback {
  display: grid;
  place-items: center;
  background: #f3e8e4;
  color: var(--ink, #2a1814);
  font-weight: 700;
}
.agent-dash-client-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.agent-dash-client-card__meta strong {
  font-size: 0.95rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-dash-client-card__meta .muted {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-dash-client-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 0;
}
.agent-dash-client-card__stats dt {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #8a6a62);
}
.agent-dash-client-card__stats dd {
  margin: 0.1rem 0 0;
  font-size: 0.86rem;
  font-weight: 700;
}
.agent-dash-client-card__last {
  margin: 0;
  font-size: 0.75rem;
}
.agent-dash-client-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

/* New client assignment modal */
.agent-assign-modal__panel {
  width: min(420px, 100%);
}
.agent-assign-modal__client {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0.85rem 0 1rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: #fff7f4;
  border: 1px solid var(--line, #eadfd8);
}
.agent-assign-modal__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.agent-assign-modal__avatar--fallback {
  display: grid;
  place-items: center;
  background: #f3e8e4;
  color: var(--ink, #2a1814);
  font-weight: 700;
  font-size: 1.4rem;
}
.agent-assign-modal__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.agent-assign-modal__meta strong {
  font-size: 1.1rem;
}
.agent-assign-modal__meta .muted {
  font-size: 0.82rem;
}
.agent-assign-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

/* Searchable select (wizard long lists) */
.search-select {
  position: relative;
  width: 100%;
}
.search-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.search-select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 2.85rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--line, #eadfd8);
  border-radius: 12px;
  background: #fff;
  color: var(--ink, #2a1814);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}
.search-select__trigger:hover {
  border-color: #ddc8bf;
}
.search-select.is-open .search-select__trigger {
  border-color: var(--rose, #c45c5c);
  box-shadow: 0 0 0 3px rgba(196, 92, 92, 0.12);
}
.search-select__trigger:focus-visible {
  outline: 2px solid var(--rose, #c45c5c);
  outline-offset: 2px;
}
.search-select__label {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-select__label.is-placeholder {
  color: #9a857c;
  font-weight: 500;
}
.search-select__chevron {
  flex-shrink: 0;
  color: #9a857c;
  transition: transform 0.15s ease;
}
.search-select.is-open .search-select__chevron {
  transform: rotate(180deg);
}
.search-select__panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  border: 1.5px solid var(--line, #eadfd8);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(42, 24, 20, 0.14);
  overflow: hidden;
  animation: search-select-in 0.14s ease;
}
@keyframes search-select-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.search-select__search-wrap {
  padding: 0.65rem 0.65rem 0.45rem;
  border-bottom: 1px solid var(--line, #eadfd8);
  background: #fff7f4;
}
.search-select__search {
  width: 100%;
  margin: 0 !important;
  border: 1.5px solid var(--line, #eadfd8) !important;
  border-radius: 0.7rem !important;
  background: #fff !important;
  color: var(--ink, #2a1814) !important;
  box-shadow: none !important;
  padding: 0.55rem 0.7rem !important;
  font-size: 0.9rem !important;
}
.search-select__list {
  max-height: 15rem;
  overflow: auto;
  padding: 0.35rem;
}
.search-select__option {
  width: 100%;
  display: block;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink, #2a1814);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
  line-height: 1.35;
  cursor: pointer;
}
.search-select__option:hover,
.search-select__option:focus-visible {
  background: #fff1ec;
  outline: none;
}
.search-select__option.is-selected {
  background: #f8e4de;
  font-weight: 600;
}
.search-select__option[hidden] {
  display: none !important;
}
.search-select__empty {
  margin: 0;
  padding: 0.85rem 0.9rem 1rem;
  font-size: 0.86rem;
  color: #9a857c;
  text-align: center;
}
.wizard-form .search-select {
  margin: 0;
}

