/* Fame component primitives.
   One class block = one future component. Keep names in sync with the
   component that will replace them (.fame-card -> FameCard). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 520px at -10% -10%, rgba(87, 222, 123, 0.16), transparent 58%),
    radial-gradient(720px 480px at 110% -8%, rgba(87, 215, 222, 0.12), transparent 52%),
    var(--surface-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Icon ----------
   App SVGs are monochrome (black stroke/fill), so they are used as masks and
   painted with currentColor. Multi-color assets (social logos, coin) stay <img>. */

.icon {
  display: inline-block;
  flex: none;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.icon--home { mask-image: url("../img/home.svg"); }
.icon--chat { mask-image: url("../img/chat.svg"); }
.icon--star { mask-image: url("../img/star.svg"); }
.icon--menu { mask-image: url("../img/menu.svg"); }
.icon--search { mask-image: url("../img/search.svg"); }
.icon--clear { mask-image: url("../img/clear.svg"); }
.icon--cancel { mask-image: url("../img/cancel.svg"); }
.icon--message-new { mask-image: url("../img/messagenew.svg"); }
.icon--message-star { mask-image: url("../img/messagestar.svg"); }

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

/* ---------- Layout: AppShell ---------- */

.workspace {
  min-height: 100dvh;
}

.workspace__stage {
  min-width: 0;
}

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: var(--page-max);
  margin-inline: auto;
  background: transparent;
}

/* Pages in the app sit on fame_bgr.jpeg */
.app-shell--photo::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(165deg, rgba(10, 10, 10, 0.72), rgba(10, 10, 10, 0.92)),
    url("../img/fame_bgr.jpeg") center / cover no-repeat;
}

.app-shell--photo {
  background: transparent;
}

/* Pushed pages keep the tab bar, matching MAUI's Shell.TabBarIsVisible default, so there is
   deliberately no "--no-nav" variant here (the prototype had one). */

/* Pages with a bottom composer need the fab lifted above composer + tab bar.
   The shell is the viewport, the thread scrolls, and the composer stays under it. */
.app-shell--dock {
  --fab-bottom: calc(var(--nav-height) + 140px);
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: var(--nav-height);
}

.app-shell--dock .page-header,
.app-shell--dock .composer-dock {
  flex-shrink: 0;
}

.app-shell--dock .app-shell__body,
.app-shell--dock .app-shell__body--bottom {
  width: 100%;
  max-width: none;
}

.app-shell--dock .app-shell__body--bottom {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  justify-content: flex-start;
  padding-bottom: var(--space-3);
}

.app-shell--dock .chat-log {
  width: 100%;
  min-width: 0;
  margin-top: auto;
}

.app-shell--dock .composer-dock {
  position: static;
  bottom: auto;
}

/* Home: Discover, search and categories stay put. Only the Fame grid scrolls. */
.app-shell--browse {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: var(--nav-height);
}

.browse-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex-shrink: 0;
  width: min(100%, var(--page-max));
  margin-inline: auto;
  padding: var(--page-pad);
  padding-bottom: var(--space-3);
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(18px);
  z-index: 5;
}

.app-shell--browse .browse-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-top: 0;
  padding-bottom: var(--space-4);
}

.app-shell__body {
  flex: 1;
  width: min(100%, var(--page-max));
  margin-inline: auto;
  padding: var(--page-pad);
  padding-bottom: calc(var(--nav-height) + var(--space-8));
}

/* Chat keeps the newest messages against the composer */
.app-shell__body--bottom {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* ---------- PageHeader ---------- */

.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-height);
  padding-inline: var(--page-pad);
  background: rgba(10, 10, 10, 0.62);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-header__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-header__action {
  margin-left: auto;
}

/* ---------- Brand logo ----------
   Same MAUI asset as LoginPage.xaml Image Source="logo2026trans.png". */

.brand-logo {
  display: block;
  width: min(100%, 420px);
  height: auto;
  max-height: min(42vh, 360px);
  object-fit: contain;
  margin-bottom: 50px;
}

/* Parent gap is extra, so the visible space under the logo stays 50px. */
.stack > .brand-logo,
.empty-state > .brand-logo {
  margin-bottom: calc(50px - var(--space-3));
}

.brand-logo--compact {
  width: min(100%, 220px);
  max-height: 96px;
}

/* ---------- Button ----------
   One primary CTA for the whole app: dark fill, white label, green/cyan ring
   (the MAUI FrameWithGradientBackground). Primary actions are full-width so they
   line up with the fields. Icon / edit stay compact. Ghost and danger are secondary. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 45px;
  padding: 0 var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--transition), border-color var(--transition);
}

.btn:hover:not(:disabled):not(.btn--gradient):not(.btn--accent) {
  filter: brightness(1.15);
}

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

.btn--gradient,
.btn--accent {
  position: relative;
  isolation: isolate;
  color: #fff;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface-scrim), var(--surface-scrim)) padding-box,
    var(--gradient-brand) border-box;
  transition: background var(--transition), filter var(--transition), color var(--transition);
}

.btn--gradient:hover:not(:disabled),
.btn--gradient:focus-visible:not(:disabled),
.btn--accent:hover:not(:disabled),
.btn--accent:focus-visible:not(:disabled),
.fab[aria-pressed="true"] {
  background:
    var(--gradient-brand) padding-box,
    var(--gradient-brand) border-box;
  box-shadow: var(--shadow-glow);
}

.btn--gradient:active:not(:disabled),
.btn--accent:active:not(:disabled) {
  background:
    var(--gradient-brand) padding-box,
    var(--gradient-brand) border-box;
  filter: brightness(0.92);
}

.btn--gradient:not(.btn--icon):not(.btn--edit):not(.fab),
.btn--accent:not(.btn--icon):not(.btn--edit):not(.fab) {
  width: 100%;
}

.btn--solid {
  background: var(--accent);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
}

.btn--danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn--block {
  width: 100%;
}

.btn--icon {
  min-height: 40px;
  width: 40px;
  padding: 0;
  border-radius: var(--radius-pill);
}

.btn--edit {
  width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  border-radius: var(--radius-pill);
  font-size: var(--text-lg);
}

/* ---------- Field (label + input) ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.field__control {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field__control::placeholder {
  color: var(--text-muted);
}

.field__control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(87, 222, 123, 0.16);
}

textarea.field__control {
  min-height: 120px;
  resize: vertical;
  line-height: var(--leading-normal);
}

.field--line {
  gap: 0;
}

.field--line .field__label {
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.field--line .field__control {
  border: none;
  border-radius: 0;
  min-height: 40px;
  padding-inline: 0;
  background: transparent;
  box-shadow: none;
}

.field--line .field__control:disabled {
  opacity: 0.65;
}

.field--line .field__control:focus {
  box-shadow: none;
  border-bottom: 1px solid var(--accent);
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.field--invalid .field__control {
  border-color: var(--danger);
}

.field--invalid .field__hint {
  color: var(--danger);
}

/* ---------- SearchBar ---------- */

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 20, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.search-bar__input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
}

.search-bar__input:focus {
  outline: none;
}

/* ---------- Avatar ---------- */

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-weight: 600;
  overflow: hidden;
}

.avatar > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--lg {
  width: 96px;
  height: 96px;
  font-size: var(--text-2xl);
}

.avatar--sm {
  width: 36px;
  height: 36px;
  font-size: var(--text-sm);
}

/* Gold ring for creators */
.avatar--framed {
  padding: 2px;
  background: var(--gradient-gold);
}

.avatar--framed > img {
  border-radius: var(--radius-pill);
}

/* ---------- Chip (category) ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
}

.chip--active {
  border-color: var(--accent);
  color: var(--accent);
}

.chip-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

/* ---------- Card ---------- */

.card {
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(20, 20, 20, 0.72);
}

/* ---------- FameCard (search result / favorite row) ---------- */

.fame-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition);
}

.fame-card:hover {
  border-color: var(--accent);
}

.fame-card__body {
  flex: 1;
  min-width: 0;
}

.fame-card__name {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
}

.fame-card__meta {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fame-card__aside {
  flex: none;
  text-align: right;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ---------- Badge ---------- */

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ---------- ChatBubble ---------- */

.chat-log {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
}

/* A bubble plus anything that sits beside it (payment coin) */
.chat-line {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.chat-line--mine {
  justify-content: flex-end;
}

.chat-bubble {
  min-width: 0;
  max-width: min(78%, calc(100% - 36px));
  padding: var(--space-3) var(--space-4);
  border-radius: 18px;
  background: rgba(28, 28, 28, 0.92);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-sm);
}

.chat-bubble--mine {
  align-self: flex-end;
  background: linear-gradient(160deg, #146b48, var(--accent-deep));
  border-bottom-right-radius: 6px;
}

.chat-bubble--mine .chat-bubble__kind,
.chat-bubble--mine .chat-bubble__footer {
  color: rgba(255, 255, 255, 0.72);
}

.chat-bubble--theirs {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.chat-bubble__kind {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-bubble__kind--title {
  text-transform: none;
  font-weight: 600;
}

.chat-bubble__text {
  margin: 0;
  overflow-wrap: anywhere;
}

.audio-message {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 220px;
}

.audio-message__play {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.audio-message__play img,
.audio-message__play svg {
  display: block;
  width: 22px;
  height: 22px;
}

.audio-message__label {
  flex: 1;
  font-weight: 700;
}

.audio-message__time {
  flex: none;
  font-size: var(--text-xs);
  opacity: 0.85;
}

.audio-message__bar {
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.audio-message__bar > span {
  display: block;
  height: 100%;
  background: #3ddc84;
}

.chat-bubble__failed {
  margin: 6px 0 0;
  color: var(--danger, #ff5a6a);
  font-size: var(--text-xs);
}

.video-stage {
  max-width: min(960px, 100%);
  max-height: 80vh;
  background: #000;
}

.chat-bubble:has(.chat-bubble__photos) {
  box-sizing: border-box;
  width: calc(168px + 6px);
  max-width: min(78%, calc(100% - 36px));
  padding: 3px 3px 8px;
}

.chat-bubble__photos {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
}

.chat-bubble__photo-btn {
  display: block;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.chat-bubble__photo-btn,
.chat-bubble__photo {
  width: 100%;
}

.chat-bubble__photo {
  display: block;
  box-sizing: border-box;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 15px 15px 8px 8px;
}

.chat-bubble:has(.chat-bubble__photos) .chat-bubble__kind,
.chat-bubble:has(.chat-bubble__photos) .chat-bubble__text,
.chat-bubble:has(.chat-bubble__photos) .chat-bubble__footer,
.chat-bubble:has(.chat-bubble__photos) .chat-bubble__failed {
  box-sizing: border-box;
  width: 100%;
  padding-right: 5px;
  padding-left: 5px;
}

.chat-bubble:has(.chat-bubble__photos) .chat-bubble__text {
  margin-top: 8px;
}

.chat-bubble:has(.chat-bubble__photos) .chat-bubble__footer {
  margin-top: 4px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(0, 0, 0, 0.9);
}

.lightbox img {
  max-width: min(100%, 1100px);
  max-height: calc(100dvh - 80px);
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.chat-bubble__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---------- PaymentCoin (visible to recipient while status = New) ---------- */

.coin-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--gradient-gold);
  color: var(--text-on-accent);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}

/* Real coin asset, as used next to a received payment request */
.coin-btn--asset {
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
}

.coin-btn--asset > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- PriceRow (Fame service prices) ---------- */

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.price-row:last-child {
  border-bottom: none;
}

.price-row__amount {
  font-weight: 600;
  color: var(--accent);
}

/* ---------- TabBar ---------- */

.tab-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: auto;
  max-width: 520px;
  height: 64px;
  margin-inline: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(14, 14, 14, 0.78);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.tab-bar__brand {
  display: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.tab-bar__brand img {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: contain;
}

.tab-bar__nav {
  display: contents;
}

.tab-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.tab-bar__item--active {
  color: var(--accent);
  background: rgba(87, 222, 123, 0.12);
}

/* ---------- Fab ---------- */

.fab {
  position: fixed;
  right: max(var(--space-5), calc(50vw - var(--page-max) / 2 + var(--space-5)));
  bottom: var(--fab-bottom);
  z-index: 26;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  min-height: 70px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(var(--surface-scrim), var(--surface-scrim)) padding-box,
    var(--gradient-brand) border-box;
  box-shadow: none;
  cursor: pointer;
  transition: background var(--transition), filter var(--transition);
}

.fab:hover:not(:disabled),
.fab:focus-visible:not(:disabled),
.fab[aria-pressed="true"] {
  background:
    var(--gradient-brand) padding-box,
    var(--gradient-brand) border-box;
}

.fab:active:not(:disabled) {
  background:
    var(--gradient-brand) padding-box,
    var(--gradient-brand) border-box;
  filter: brightness(0.92);
}

.fab img {
  pointer-events: none;
}

@media (max-width: 959px) {
  .fab {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    user-select: none;
  }

  .fab--placed {
    right: auto;
    bottom: auto;
  }

  .fab[data-dragging="true"] {
    z-index: 70;
    touch-action: none;
    cursor: grabbing;
  }
}

/* ---------- EmptyState ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-secondary);
}

.empty-state__title {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: 600;
}

/* ---------- Spinner ---------- */

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: var(--radius-pill);
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40vh;
  padding: var(--space-8);
}

.app-shell__body--bottom > .page-loader {
  margin-top: auto;
  margin-bottom: auto;
}

/* ---------- FameTile (Home grid, 2 columns like GridItemsLayout Span=2) ---------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.fame-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: #141414;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  outline: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform var(--transition), outline-color var(--transition);
}

.fame-tile:hover {
  transform: translateY(-3px);
  outline-color: var(--accent);
}

.fame-tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  pointer-events: none;
}

.fame-tile__media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 0;
  background:
    radial-gradient(120% 80% at 15% 0%, rgba(87, 222, 123, 0.38), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(87, 215, 222, 0.3), transparent 52%),
    #141414;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: 0.04em;
  overflow: hidden;
}

.fame-tile__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fame-tile__name {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 34px;
  z-index: 1;
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fame-tile__role {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  display: block;
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--accent-alt);
}

/* ---------- ChatRow (My Chats / Favorites list item) ---------- */

.chat-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: var(--space-1) var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(20, 20, 20, 0.78);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.chat-row:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Favorites use the same row without the time / unread column */
.chat-row--profile {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.chat-row--profile .chat-row__name {
  align-self: end;
}

.chat-row--profile .chat-row__preview {
  align-self: start;
}

.chat-row__avatar {
  grid-row: span 2;
  align-self: center;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(87, 222, 123, 0.45), transparent 60%),
    #2a2a2a;
  font-size: var(--text-lg);
  font-weight: 700;
  overflow: hidden;
}

.chat-row__avatar > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-row__avatar--round {
  border-radius: var(--radius-pill);
}

.chat-row__name {
  align-self: end;
  font-size: var(--text-base);
  font-weight: 700;
}

.chat-row__time {
  align-self: end;
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.chat-row__preview {
  align-self: start;
  font-style: italic;
  font-size: var(--text-sm);
  color: #e1e1e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Unread counter: rounded except the bottom-right corner, as in XAML */
.chat-row__unread {
  align-self: start;
  justify-self: end;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: var(--space-1);
  border-radius: 10px 10px 10px 0;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- CategoryFilter (Home) ---------- */

.category-filter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
  display: none;
}

.category-filter__toggle {
  flex: none;
  height: 34px;
  padding-inline: var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(#141414, #141414) padding-box,
    var(--gradient-brand) border-box;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.category-filter__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  height: 34px;
  padding-inline: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 20, 0.8);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Sheet (category picker overlay, "Done" bar + list) ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  max-width: none;
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse 70% 36% at 50% -8%, rgba(87, 222, 123, 0.16), transparent 62%),
    #0a0a0a;
}

.sheet[data-open] {
  display: flex;
}

.sheet__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-shrink: 0;
  width: min(720px, 100%);
  margin-inline: auto;
  min-height: 64px;
  padding: var(--space-4) var(--page-pad);
  padding-top: calc(var(--space-4) + env(safe-area-inset-top));
  border: none;
  background: transparent;
}

.sheet__heading {
  min-width: 0;
}

.sheet__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sheet__hint {
  margin: var(--space-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.sheet .btn.btn--gradient.sheet__done {
  width: auto;
  flex: none;
  min-height: 40px;
  padding-inline: var(--space-5);
}

.sheet__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1 1 auto;
  width: min(720px, 100%);
  margin-inline: auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0 var(--page-pad) calc(var(--space-6) + env(safe-area-inset-bottom));
}

.sheet__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(20, 20, 20, 0.72);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.sheet__option:hover {
  border-color: rgba(87, 222, 123, 0.45);
}

.sheet__check {
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

.sheet__option[aria-selected="true"] {
  border-color: var(--accent);
  background: rgba(87, 222, 123, 0.12);
}

.sheet__option[aria-selected="true"] .sheet__check {
  border-color: var(--accent);
  background: var(--accent);
}

.sheet__option[aria-selected="true"] .sheet__check::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  margin: 3px auto 0;
  border: solid #0a0a0a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Composer (chat input row) ---------- */

/* Service bar + input + attachment tray stick to the bottom together, above the tab bar */
.composer-dock {
  position: sticky;
  bottom: var(--nav-height);
  z-index: 15;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  margin-inline: var(--page-pad);
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(12, 12, 12, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

.composer__attach {
  display: grid;
  place-items: center;
  flex: none;
  width: 35px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-xl);
  cursor: pointer;
}

.composer__input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font: inherit;
  resize: none;
}

.composer__input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.composer__send {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  background: #000;
  cursor: pointer;
}

.composer__send:disabled {
  opacity: 0.4;
  cursor: default;
}

.composer__mic {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.composer__mic svg {
  width: 22px;
  height: 22px;
}

.composer__mic[data-recording="true"] {
  color: #0a0a0a;
  background: var(--accent);
  border-color: var(--accent);
  animation: composer-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes composer-mic-pulse {
  50% { box-shadow: 0 0 0 6px rgba(87, 222, 123, 0.28); }
}

/* Attachment tray, revealed by the + button */
.composer-tray {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) var(--page-pad);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-scrim);
}

.composer-tray[data-open] {
  display: grid;
}

.composer-tray__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 72px;
  overflow: hidden;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-xs);
  cursor: pointer;
}

.composer-tray__item > img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  pointer-events: none;
}

/* Opacity stays above 0 and the input keeps a real size. display:none and a
   zero-size input never open the camera or Files on iOS. */
.composer-tray__pick {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0.02;
  font-size: 32px;
  cursor: pointer;
}

.composer-pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 var(--page-pad) var(--space-2);
}

.composer-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: var(--text-xs);
}

.composer-chip button {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.composer-chip__thumb {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.message-attachment {
  position: relative;
  display: flex;
  align-items: center;
  width: 200px;
  min-height: 50px;
  padding: 8px 28px 10px 10px;
  border: 1px solid #57de7b;
  border-radius: 10px 10px 0 10px;
  background: #000;
  color: #fff;
  font-style: italic;
  font-size: var(--text-xs);
}

.message-attachment__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment button {
  position: absolute;
  top: 4px;
  right: 8px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.message-attachment__bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.message-attachment__bar > span {
  display: block;
  height: 100%;
  background: #57de7b;
}

.camera-stage {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #000;
}

.camera-stage__video {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  background: #000;
}

.camera-stage__video[data-facing="user"] {
  transform: scaleX(-1);
}

.camera-stage__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
}

.camera-stage__text {
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.camera-stage__bar .camera-stage__text:last-child {
  justify-self: end;
}

.camera-stage__shutter {
  width: 68px;
  height: 68px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.composer-pending__live,
.composer-pending__error {
  margin: 0;
  font-size: var(--text-xs);
}

.composer-pending__live {
  color: var(--accent);
}

.composer-pending__error {
  flex-basis: 100%;
  color: var(--danger, #ff5a6a);
}

/* ---------- ServiceBar (selected service type / payment banner) ---------- */

.service-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 var(--page-pad) var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-scrim);
  font-style: italic;
  font-size: var(--text-sm);
}

.service-bar::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: var(--gradient-brand);
}

.service-bar--reply,
.service-bar--reply::before {
  background: #1f7a3a;
  color: #fff;
}

.charge-hint-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.55);
}

.charge-hint {
  position: fixed;
  z-index: 71;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: #141414;
  color: #fff;
  text-align: center;
}

.service-bar__close {
  border: none;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- FabMenu (service types) ---------- */

.fab-menu {
  position: fixed;
  top: 0;
  right: max(0px, calc(50vw - var(--page-max) / 2));
  bottom: var(--nav-height);
  z-index: 25;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-4);
  width: 220px;
  padding: var(--space-4) var(--space-3) calc(var(--fab-bottom) + 80px);
  background: #0a0a0a;
  overflow-y: auto;
}

.fab-menu[data-open] {
  display: flex;
}

.fab-menu .btn {
  width: 100%;
}

/* ---------- Hero (Fame detail header) ---------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  height: 340px;
  background:
    radial-gradient(90% 80% at 20% 0%, rgba(87, 222, 123, 0.28), transparent 55%),
    radial-gradient(70% 60% at 100% 100%, rgba(87, 215, 222, 0.22), transparent 50%),
    #161616;
  overflow: hidden;
}

/* Detail card pulls up over the photo. 10px less overlap on phones. */
.hero--detail {
  margin-bottom: 10px;
}

.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__initials {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(#2a2a2a, #2a2a2a) padding-box,
    var(--gradient-brand) border-box;
  font-family: var(--font-display);
  font-size: 52px;
  letter-spacing: 0.04em;
}

.hero__overlay {
  position: absolute;
  z-index: 1;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 90px;
  padding: var(--space-5);
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75));
}

.hero__name {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--leading-tight);
}

.hero__category {
  margin: 0;
  font-size: var(--text-xs);
}

/* Favourite toggle is the letter F in the display face, accent when active */
.fav-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1;
  color: var(--text-primary);
  cursor: pointer;
}

.fav-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(87, 222, 123, 0.14);
}

/* Profile photo sits above the field cards, with the edit control on the rim */
.profile-photo {
  position: relative;
  width: 148px;
  height: 148px;
  margin: var(--space-2) auto var(--space-6);
}

.profile-photo__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(#2a2a2a, #2a2a2a) padding-box,
    var(--gradient-brand) border-box;
}

.profile-photo .btn--edit {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.profile-photo .btn--edit input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Same idea as the mobile crop page: pan the photo under a circle, then save that square. */
.cropper {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 10, 0.96);
}

.cropper__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.cropper__stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  transform: translate(-50%, -50%);
  user-select: none;
  pointer-events: none;
}

.cropper__hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72vw, 320px);
  height: min(72vw, 320px);
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.cropper__bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
  background: #141414;
}

.cropper__hint {
  margin: 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.cropper__zoom {
  width: 100%;
  accent-color: var(--accent);
}

.cropper__actions {
  display: flex;
  gap: var(--space-3);
}

.cropper .cropper__actions .btn {
  flex: 1;
}

.cropper .cropper__actions .btn.btn--gradient {
  width: auto;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(20, 20, 20, 0.72);
}

.profile-card__name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-card .field__control:disabled {
  opacity: 0.72;
  cursor: default;
}

/* Detail body card overlaps the hero */
.detail-card {
  position: relative;
  margin-top: -28px;
  padding: var(--space-6) var(--space-5) var(--space-8);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: rgba(14, 14, 14, 0.96);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.28);
}

/* ---------- SettingRow (Settings sections) ---------- */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-3) 0;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-base);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.setting-row:hover {
  text-decoration: none;
  color: var(--accent);
}

.setting-row__chevron {
  flex: none;
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

/* ---------- Switch ---------- */

.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  transition: transform var(--transition);
}

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

.switch[aria-pressed="true"]::after {
  transform: translateX(20px);
}

/* Gradient hairline used between form rows (BoxViewHorisontalGradient) */
.hairline {
  height: 1px;
  margin-block: var(--space-4);
  background: var(--gradient-brand);
}

/* ---------- Price cards (Fame sets prices) ---------- */

.price-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.price-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(20, 20, 20, 0.72);
  cursor: text;
}

.price-card__name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.price-card__amount {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.price-card__input {
  flex: 1;
  min-width: 0;
}

.price-card__code {
  flex: none;
  min-width: 3.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(87, 222, 123, 0.14);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: center;
}

/* ---------- CardRow (saved Stripe cards) ---------- */

.card-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  text-align: left;
}

.card-row__brand {
  flex: none;
  width: 42px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
}

.card-row__number {
  flex: 1;
  letter-spacing: 0.04em;
}

.pan-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.pan-row .field__control {
  text-align: center;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.payment-mark {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin-inline: auto;
}

/* ---------- MenuList (More tab) — rows split by gradient hairlines ---------- */

/* Hero stays full-bleed. Bottom padding clears the fixed tab bar so the last action can scroll into view. */
.page-bleed {
  padding: 0 0 calc(var(--nav-height) + var(--space-8));
}

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

.menu-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-list__item::after {
  content: "›";
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.menu-list__item:hover {
  color: var(--accent);
  text-decoration: none;
}

.menu-list__sep {
  height: 1px;
  background: var(--gradient-brand);
}

.network-row {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  padding-block: var(--space-2) var(--space-5);
}

.network-row a {
  display: grid;
  place-items: center;
  line-height: 0;
}

.network-row img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.network-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.network-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(20, 20, 20, 0.72);
}

.network-card__icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.network-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.network-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.network-card__name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (min-width: 960px) {
  .price-list,
  .network-list,
  .profile-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Utilities (deliberately few) ---------- */

/* Text buttons that look like MAUI tappable Labels (not underlined hyperlinks). */
.link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

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

.link--plain {
  color: var(--text-primary);
}

.link:hover {
  text-decoration: underline;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-center {
  text-align: center;
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.phone-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.phone-row__code {
  flex: none;
  min-width: 92px;
  min-height: 48px;
  padding: 0 var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}

.phone-row .field__control {
  flex: 1;
  min-width: 0;
}

.category-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.category-pick[data-empty] {
  color: var(--text-muted);
}

.category-pick__chevron {
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.7;
}

.network-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.network-field__icon {
  width: 36px;
  height: 36px;
  flex: none;
  object-fit: contain;
}

.network-field .field__control {
  flex: 1;
  min-width: 0;
}

.network-field__state {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
}

.network-field__state .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.network-field__ok,
.network-field__bad {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.network-field__ok {
  position: relative;
  background: var(--accent);
}

.network-field__ok::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 4px;
  height: 8px;
  border: solid #0a0a0a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.network-field__bad {
  background: var(--danger);
  color: #0a0a0a;
  font-size: 0;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.network-field__bad::before {
  content: "×";
  font-size: 16px;
  line-height: 18px;
}

.row--between {
  justify-content: space-between;
}

.section-title {
  margin: var(--space-6) 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent-alt);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---------- Statistics (Fame history for the current month) ---------- */

.stat-streak {
  display: grid;
  place-items: center;
  padding: var(--space-8) var(--space-4);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--surface-scrim), var(--surface-scrim)) padding-box,
    var(--gradient-brand) border-box;
  text-align: center;
}

.stat-streak__value {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-streak__label {
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
}

.stat-sold {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.stat-sold__item {
  display: grid;
  place-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-2);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background:
    linear-gradient(var(--surface-scrim), var(--surface-scrim)) padding-box,
    var(--gradient-brand) border-box;
  text-align: center;
}

.stat-sold__count {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-sold__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-1);
}

.month-grid__dow {
  padding-block: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.month-grid__day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

span.month-grid__day {
  cursor: default;
}

button.month-grid__day:hover {
  color: var(--text-primary);
}

.month-grid__day--sold {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface-scrim), var(--surface-scrim)) padding-box,
    var(--gradient-brand) border-box;
  color: var(--text-primary);
  font-weight: 600;
}

.month-grid__day--today {
  color: var(--accent);
}

.month-grid__day--selected {
  background:
    var(--gradient-brand) padding-box,
    var(--gradient-brand) border-box;
  color: #fff;
  font-weight: 600;
}

/* ---------- Auth stage ---------- */

#app:has(.app-shell--auth) {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8) var(--space-4);
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(87, 222, 123, 0.2), transparent 60%),
    radial-gradient(ellipse 40% 35% at 100% 100%, rgba(87, 215, 222, 0.14), transparent 55%),
    #0a0a0a;
}

.app-shell--auth {
  width: min(460px, 100%);
  max-width: 460px;
  min-height: 0;
  margin-block: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background: rgba(16, 16, 16, 0.8);
  box-shadow: var(--shadow-lg), 0 0 80px rgba(87, 222, 123, 0.06);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.app-shell--auth .page-header {
  background: transparent;
}

/* Auth pages with a bar: PageHeader is a sibling of the card and spans the window. The card stays inset. */
#app:has(> .page-header) {
  padding: 0;
}

#app > .page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  align-self: stretch;
  flex-shrink: 0;
  width: 100%;
  background: rgba(10, 10, 10, 0.92);
}

#app:has(> .page-header) > .app-shell--auth {
  width: min(460px, calc(100% - 2 * var(--space-4)));
  margin-inline: auto;
}

/* Auth pages with a bar: pull the card up so its top edge is 20px under the bar. */
#app:has(> .page-header) > .app-shell--raised {
  margin-top: 20px;
  margin-bottom: auto;
}

.app-shell--auth .app-shell__body {
  width: 100%;
  padding-bottom: var(--space-8);
}

.app-shell--auth .brand-logo {
  width: min(100%, 260px);
  max-height: 148px;
  margin-inline: auto;
}

.screen-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: var(--leading-tight);
}

.screen-title__kicker {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.empty-state .btn {
  max-width: 280px;
}

/* ---------- Wide layout ---------- */

@media (min-width: 720px) {
  .tile-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (min-width: 960px) {
  :root {
    --nav-height: 0px;
    --fab-bottom: var(--space-8);
  }

  .workspace {
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
  }

  .tab-bar {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-5);
    width: var(--rail-width);
    max-width: none;
    height: 100dvh;
    margin: 0;
    padding: var(--space-6) var(--space-4);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: rgba(10, 10, 10, 0.9);
    box-shadow: none;
  }

  .tab-bar__brand {
    display: block;
  }

  .tab-bar__nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .tab-bar__item {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-3);
    min-height: 46px;
    padding-inline: var(--space-4);
    font-size: var(--text-sm);
  }

  .app-shell__body {
    padding-bottom: var(--space-10);
  }

  .hero {
    height: 420px;
  }

  .hero--detail {
    margin-bottom: 0;
    padding-bottom: 48px;
  }

  .hero--detail .hero__overlay {
    bottom: 48px;
  }

  .fab {
    right: calc((100vw - var(--rail-width) - min(var(--page-max), 100vw - var(--rail-width))) / 2 + var(--space-6));
    bottom: var(--space-6);
  }

  .fab-menu {
    top: 0;
    bottom: 0;
    right: calc((100vw - var(--rail-width) - min(var(--page-max), 100vw - var(--rail-width))) / 2);
  }

  .sheet {
    left: 0;
    padding-bottom: 0;
  }

  .app-shell__body:has(.month-grid) {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    align-items: start;
    column-gap: var(--space-8);
  }

  .app-shell__body:has(.month-grid) > .section-title {
    grid-column: 1 / -1;
  }

  .app-shell__body:has(.month-grid) > div:has(.month-grid) {
    grid-column: 1 / -1;
    max-width: 560px;
  }

  .app-shell--narrow {
    max-width: 720px;
  }

  .app-shell__body:has(.search-bar):not(:has(.tile-grid)),
  .app-shell__body:has(> .stack > .chat-row) {
    width: min(100%, 720px);
  }
}
