  /* Profile edit */
  .pe-photo-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px 16px 14px;
  }
  .pe-photo-preview {
    position: relative;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(14,165,233,.18), rgba(6,194,143,.16));
    box-shadow: 0 14px 30px rgba(14,165,233,.16);
  }
  .pe-photo-preview .avatar-wrap,
  .pe-photo-preview .avatar {
    width: 124px !important;
    height: 124px !important;
  }
  .pe-photo-preview .avatar {
    border: 4px solid #fff;
    box-shadow: 0 6px 18px rgba(39,32,57,.12);
  }
  .pe-photo-badge {
    position: absolute;
    right: -2px;
    bottom: 8px;
    background: linear-gradient(135deg, var(--coral-500) 0%, var(--mint-500) 100%);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 10px;
    font-weight: 900;
  }
  .pe-photo-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
  }
  .pe-photo-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    background: #F4F4F8;
    color: #5F6270;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
  }
  .pe-photo-btn.primary {
    background: linear-gradient(135deg, var(--coral-500) 0%, var(--mint-500) 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(14,165,233,.28);
  }
  .pe-photo-help {
    color: #9093A1;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
  }
  .pe-avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 12px;
    padding: 12px 20px;
    align-items: start;
  }
  .pe-avatar-toolbar {
    margin: 8px 20px 2px;
    display: grid;
    grid-template-columns: 74px 1fr 74px;
    align-items: center;
    gap: 10px;
  }
  .pe-avatar-toolbar span {
    text-align: center;
    font-size: 12px;
    font-weight: 900;
    color: #6B7280;
  }
  .pe-avatar-page-btn {
    min-height: 34px;
    border: 1px solid #E5E7EB;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
  }
  .pe-avatar-page-btn:disabled {
    opacity: .38;
    cursor: default;
  }
  .pe-avatar-tile {
    width: 100%;
    aspect-ratio: 1;
    min-width: 0;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 20px;
    background: #F4F4F8;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(17,24,39,.03);
    transition: transform 0.08s, border-color 0.15s, background 0.15s;
  }
  .pe-avatar-tile:active {
    transform: scale(0.96);
  }
  .pe-avatar-tile.selected {
    border-color: var(--coral-500);
    background: #E0F2FE;
  }
  .pe-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: contain;
    object-position: center;
    background: #fff;
  }
  .pe-input {
    margin: 8px 16px; padding: 12px 14px;
    border-radius: 12px; background: #F4F4F8; border: none;
    width: calc(100% - 32px); font-size: 14px; outline: none;
    font-family: inherit;
  }
  .pe-input:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--coral-500); }
  .pe-textarea {
    margin: 8px 16px; padding: 12px 14px;
    border-radius: 12px; background: #F4F4F8; border: none;
    width: calc(100% - 32px); font-size: 14px; outline: none;
    font-family: inherit; resize: none; height: 80px;
  }
  .pe-textarea:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--coral-500); }
  .pe-save {
    margin: 16px;
    width: calc(100% - 32px); padding: 14px;
    background: var(--coral-500); color: #fff; border: none;
    border-radius: 14px; font-size: 14px; font-weight: 800;
    cursor: pointer;
  }
  .pe-save:active { transform: scale(0.99); }

  .profile-crop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 13000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(20,22,32,.58);
    backdrop-filter: blur(8px);
  }
  .profile-crop-panel {
    width: min(100%, 360px);
    border-radius: 22px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(18,22,32,.28);
    color: var(--ink-900);
  }
  .profile-crop-title {
    font-size: 18px;
    font-weight: 900;
    text-align: center;
  }
  .profile-crop-sub {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-500);
    text-align: center;
  }
  .profile-crop-stage {
    width: 220px;
    height: 220px;
    position: relative;
    overflow: hidden;
    margin: 18px auto 16px;
    border-radius: 50%;
    background: #F4F4F8;
    touch-action: none;
    cursor: grab;
    user-select: none;
  }
  .profile-crop-stage:active { cursor: grabbing; }
  .profile-crop-img {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: none;
    max-height: none;
    transform-origin: center;
    user-select: none;
    -webkit-user-drag: none;
  }
  .profile-crop-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: inset 0 0 0 1px rgba(14,165,233,.55);
    pointer-events: none;
  }
  .profile-crop-mask {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 38px rgba(0,0,0,.16);
    pointer-events: none;
  }
  .profile-crop-controls {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    align-items: center;
    gap: 10px;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 900;
  }
  .profile-crop-controls input { width: 100%; accent-color: var(--coral-500); }
  .profile-crop-nudge {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
  }
  .profile-crop-nudge button {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #F1F5F9;
    color: #404352;
    font-weight: 900;
  }
  .profile-crop-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
  }
  .profile-crop-btn {
    flex: 1;
    border: none;
    border-radius: 14px;
    padding: 13px 10px;
    background: linear-gradient(135deg, var(--coral-500) 0%, var(--mint-500) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
  }
  .profile-crop-btn.ghost {
    background: #F1F2F6;
    color: #62677A;
  }

  /* Onboarding */
  .onb-screen {
    position: absolute; inset: 0;
    background: linear-gradient(160deg, var(--coral-500) 0%, var(--coral-500) 50%, #1A1340 100%);
    color: #fff;
    display: flex; flex-direction: column;
    padding: 60px 28px calc(22px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .onb-dots {
    display: flex; gap: 6px; justify-content: center;
    margin-bottom: 30px;
  }
  .onb-dot {
    width: 22px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.3);
    transition: background 0.2s;
  }
  .onb-dot.active { background: #fff; }
  .onb-emoji { font-size: 80px; text-align: center; margin: 20px 0 14px; }
  .onb-title {
    font-size: 26px; font-weight: 800;
    text-align: center; line-height: 1.3;
    margin-bottom: 12px;
  }
  .onb-sub {
    font-size: 14px; text-align: center;
    opacity: 0.85; line-height: 1.5;
    margin-bottom: 24px;
  }
  .onb-card {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 16px;
    margin: 8px 0;
    backdrop-filter: blur(8px);
  }
  .onb-card-title { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
  .onb-card-desc { font-size: 12px; opacity: 0.85; line-height: 1.5; }
  .onb-flex { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
  .onb-bottom {
    position: sticky;
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    z-index: 2;
    padding-top: 16px;
    padding-bottom: 2px;
    margin-top: auto;
    background: linear-gradient(180deg, rgba(26,19,64,0) 0%, rgba(26,19,64,.78) 34%, rgba(26,19,64,.96) 100%);
    border-radius: 18px 18px 0 0;
  }
  .onb-btn {
    width: 100%; min-height: 54px; padding: 14px;
    background: #fff; color: var(--coral-500);
    border: none; border-radius: 14px;
    font-size: 15px; font-weight: 800; cursor: pointer;
    touch-action: manipulation;
  }
  .onb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .onb-btn.outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.5); margin-bottom: 8px; }
  .onb-input {
    width: 100%; padding: 14px 16px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 14px;
    color: #fff; font-size: 16px; font-weight: 700;
    outline: none; box-sizing: border-box;
  }
  .onb-input::placeholder { color: rgba(255,255,255,0.5); }
  .onb-input:focus { border-color: #fff; background: rgba(255,255,255,0.25); }
  .onb-avatar-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px; margin: 14px 0;
  }
  .onb-avatar {
    width: 100%; aspect-ratio: 1; border-radius: 50%;
    object-fit: cover; cursor: pointer;
    border: 3px solid transparent;
  }
  .onb-avatar.selected { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }

  @media (max-width: 720px) {
    .onb-screen {
      padding: 42px 28px calc(92px + env(safe-area-inset-bottom, 0px));
      min-height: 100%;
      min-height: 100dvh;
    }
    .onb-dots { margin-bottom: 20px; }
    .onb-emoji { font-size: 64px; margin: 12px 0 12px; }
    .onb-title { font-size: 24px; }
    .onb-sub { margin-bottom: 18px; }
    .onb-flex {
      justify-content: flex-start;
      padding-bottom: 16px;
    }
    .onb-bottom {
      bottom: calc(72px + env(safe-area-inset-bottom, 0px));
      padding: 14px 0 calc(6px + env(safe-area-inset-bottom, 0px));
      margin-left: -2px;
      margin-right: -2px;
    }
  }

  /* Auth (sign-in) screen */
  .auth-status-msg {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin: 10px 16px 4px;
    min-height: 18px;
  }
  .auth-status-msg.err { color: #FFD0D7; }
  .auth-status-msg.ok { color: #C7F9CC; }
  .auth-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block; vertical-align: middle;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* Mate register wizard */
  .mr-progress {
    height: 4px; background: #F1F1F5;
    margin: 0 20px 16px;
    border-radius: 2px; overflow: hidden;
  }
  .mr-progress-bar {
    height: 100%; background: linear-gradient(90deg, var(--coral-500), var(--mint-500));
    transition: width 0.25s;
  }
  .mr-step-num { font-size: 12px; color: var(--ink-500); font-weight: 700; padding: 0 20px 4px; }
  .mr-title { font-size: 22px; font-weight: 800; padding: 0 20px 6px; line-height: 1.3; }
  .mr-sub { font-size: 13px; color: var(--ink-500); padding: 0 20px 16px; line-height: 1.5; }

  .mr-game-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; padding: 0 16px;
  }
  .mr-game-card {
    background: #F4F4F8; border: 1.5px solid transparent;
    border-radius: 14px; padding: 12px 8px;
    text-align: center; cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.08s;
  }
  .mr-game-card:active { transform: scale(0.95); }
  .mr-game-card.selected { background: #F0F9FF; border-color: var(--coral-500); }
  .mr-game-card .em { font-size: 28px; }
  .mr-game-card .nm { font-size: 12px; font-weight: 700; margin-top: 4px; }
  .mr-game-card .ix {
    font-size: 10px; color: var(--coral-500); font-weight: 800; margin-top: 2px;
  }

  .mr-game-detail {
    background: var(--surface-mute); margin: 8px 16px;
    padding: 14px; border-radius: 14px;
  }
  .mr-game-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .mr-tier-row { display: flex; gap: 6px; flex-wrap: wrap; }
  .mr-tier-chip {
    padding: 6px 10px; border-radius: 999px;
    background: #fff; border: 1.5px solid #E5E5EE;
    font-size: 11.5px; font-weight: 700; cursor: pointer;
    color: var(--ink-500);
  }
  .mr-tier-chip.selected { background: #F0F9FF; border-color: var(--coral-500); color: var(--coral-500); }
  .mr-price-row {
    display: flex; align-items: center; gap: 10px;
    margin-top: 10px;
  }
  .mr-price-input {
    flex: 1; padding: 9px 12px; border-radius: 10px;
    background: #fff; border: 1.5px solid #E5E5EE;
    font-size: 14px; font-weight: 800; outline: none;
    text-align: right;
  }
  .mr-price-input:focus { border-color: var(--coral-500); }
  .mr-price-unit { font-size: 12px; color: var(--ink-500); font-weight: 700; }

  .mr-avail-list { padding: 0 16px; }
  .mr-avail-card {
    background: #F4F4F8; border: 1.5px solid transparent;
    border-radius: 14px; padding: 14px;
    margin-bottom: 8px; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
  }
  .mr-avail-card.selected { background: #F0F9FF; border-color: var(--coral-500); }
  .mr-avail-card-title { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
  .mr-avail-card-sub { font-size: 12px; color: var(--ink-500); }

  .mr-preview {
    background: linear-gradient(135deg, #F0F9FF 0%, #DCFCE7 100%);
    margin: 0 16px;
    border-radius: 16px; padding: 20px;
    text-align: center;
  }
  .mr-preview-tag {
    display: inline-block; padding: 4px 12px;
    background: rgba(14, 165, 233,0.15); color: var(--coral-500);
    font-size: 11px; font-weight: 800;
    border-radius: 999px; margin-bottom: 8px;
  }
  .mr-preview-name { font-size: 18px; font-weight: 800; margin: 6px 0; }
  .mr-preview-bio { font-size: 12px; color: var(--ink-500); line-height: 1.5; margin-bottom: 10px; }
  .mr-preview-games {
    display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 10px;
  }
  .mr-preview-game {
    background: #fff; padding: 4px 10px;
    border-radius: 999px; font-size: 11px; font-weight: 700;
  }
  .mr-preview-avail {
    font-size: 11px; color: var(--ink-500);
  }

  .mr-bottom {
    padding: 14px 16px 16px;
    display: flex; gap: 8px;
    background: #fff; border-top: 1px solid #F1F1F5;
  }
  .mr-btn {
    flex: 1; padding: 14px; border: none;
    border-radius: 14px; font-size: 14px; font-weight: 800; cursor: pointer;
  }
  .mr-btn.primary { background: var(--coral-500); color: #fff; }
  .mr-btn.primary:disabled { background: #BAE6FD; cursor: not-allowed; }
  .mr-btn.ghost { background: #F4F4F8; color: var(--ink-500); }
  .quick-stats {
    background: #fff;
    margin: 0 20px 16px;
    padding: 12px 0;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
  }
  .stat-item { flex: 1; text-align: center; cursor: pointer; }
  .stat-num { font-size: 19px; font-weight: 800; }
  .stat-name { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
  .menu-section { margin-bottom: 12px; }
  .menu-section-title { font-size: 12px; font-weight: 700; color: var(--ink-500); padding: 0 20px; margin-bottom: 8px; }
  .menu-card {
    background: #fff;
    margin: 0 20px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
  }
  .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #F1F1F5;
    cursor: pointer;
  }
  .menu-item:last-child { border-bottom: none; }
  .menu-item > svg { width: 20px; height: 20px; flex-shrink: 0; stroke: var(--ink-500); fill: none; stroke-width: 1.8; }
  .menu-item > svg:last-of-type { stroke: var(--ink-500); } /* trailing chevron */
  .menu-item > span:first-child { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; }
  .menu-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-label { flex: 1; font-size: 14px; font-weight: 500; }
  .menu-badge {
    background: rgba(6, 194, 144,0.13);
    color: var(--mint-500);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
  }
  .chevron-r { width: 18px; height: 18px; stroke: var(--ink-500); }

  /* Order modal */
  .order-screen {
    z-index: 200;
    background: #fff;
  }
  .order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #F1F1F5;
  }
  .order-close { cursor: pointer; padding: 4px; }
  .order-title { font-size: 17px; font-weight: 700; }
  .order-mate {
    margin: 20px;
    padding: 16px;
    background: var(--surface-mute);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .order-section { padding: 0 20px; margin-bottom: 20px; }
  .order-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
  .option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 16px;
    border: 1.5px solid var(--border);
    margin-bottom: 8px;
    position: relative;
    cursor: pointer;
  }
  .option-card.selected {
    border-color: var(--coral-500);
    background: rgba(14, 165, 233,0.08);
  }
  .option-emoji { font-size: 26px; }
  .option-info { flex: 1; }
  .option-title { font-size: 14px; font-weight: 700; }
  .option-price { font-size: 15px; font-weight: 800; }
  .check-badge {
    position: absolute;
    top: 10px; right: 10px;
    width: 22px; height: 22px;
    border-radius: 11px;
    background: var(--coral-500);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }
  .counter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
  }
  .counter-btn {
    width: 44px; height: 44px;
    border-radius: 22px;
    background: var(--surface-mute);
    border: 1px solid var(--border);
    font-size: 22px;
    cursor: pointer;
  }
  .counter-btn:disabled { opacity: 0.4; }
  .counter-display { display: flex; align-items: baseline; gap: 4px; min-width: 80px; justify-content: center; }
  .counter-value { font-size: 32px; font-weight: 800; }
  .counter-unit { font-size: 16px; color: var(--ink-500); }
  .quick-row { display: flex; gap: 8px; justify-content: center; }
  .quick-chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-500);
    cursor: pointer;
  }
  .quick-chip.active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
  .summary-card {
    background: var(--surface-mute);
    border-radius: 16px;
    padding: 16px;
  }
  .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
  }
  .summary-label { color: var(--ink-500); }
  .summary-divider { height: 1px; background: var(--border); margin: 8px 0; }
  .summary-total {
    font-size: 20px;
    font-weight: 800;
    color: var(--coral-500);
  }
  .balance-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--ink-500);
  }
  .order-cta-wrap {
    padding: 12px 20px 20px;
    border-top: 1px solid #F1F1F5;
    background: #fff;
  }
  .order-cta {
    width: 100%;
    background: var(--coral-500);
    color: #fff;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 800;
    border: none;
    cursor: pointer;
  }

  /* Mini hint banner */
  .hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
  }
  .hint.show { opacity: 1; }

  .app-dialog-backdrop {
    position: absolute;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(18,18,28,0.45);
    backdrop-filter: blur(6px);
  }
  .app-dialog {
    width: min(100%, 330px);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(27,24,42,0.28);
    padding: 20px;
    color: #202033;
  }
  .app-dialog-title {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 10px;
  }
  .app-dialog-message {
    font-size: 14px;
    line-height: 1.55;
    color: #62677A;
    word-break: keep-all;
    white-space: normal;
  }
  .app-dialog-input {
    width: 100%;
    margin-top: 14px;
    border: 1px solid #E3E5EE;
    border-radius: 12px;
    padding: 12px;
    resize: vertical;
    min-height: 96px;
    font: inherit;
    outline: none;
  }
  .app-dialog-input:focus {
    border-color: var(--mint-500);
    box-shadow: 0 0 0 3px rgba(6,194,143,0.14);
  }
  .app-dialog-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
  }
  .app-dialog-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px 10px;
    background: #202033;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
  }
  .app-dialog-btn.ghost {
    background: #F1F2F6;
    color: #62677A;
  }
