    .browse-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
    }
    .browse-header-text { flex: 1; }
    .browse-title {
      margin: 0;
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.3px;
    }
    .browse-subtitle {
      margin: 2px 0 0;
      font-size: 13px;
      color: var(--text-muted);
    }

    /* Category chips */
    .category-chips {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
      padding: 4px 0 10px;
      margin-bottom: 4px;
      flex-shrink: 0;
    }
    .category-chips::-webkit-scrollbar { display: none; }
    .category-chip {
      flex-shrink: 0;
      padding: 7px 16px;
      border-radius: 999px;
      border: 1px solid var(--outline-color);
      background: var(--surface-3);
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
    }
    .category-chip.active {
      background: var(--accent);
      color: var(--text-primary);
      border-color: var(--accent);
    }
    .category-chip:active:not(.active) {
      background: #555;
    }

    /* Continue Chats row */
    .continue-section {
      margin-bottom: 14px;
    }
    .section-label {
      font-size: 13px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin: 0 0 8px;
      font-weight: 600;
    }
    .continue-row {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 4px;
    }
    .continue-row::-webkit-scrollbar { display: none; }
    .continue-card {
      flex-shrink: 0;
      width: 130px;
      border-radius: 14px;
      overflow: hidden;
      position: relative;
      aspect-ratio: 3/4;
      background: var(--surface-3);
      cursor: pointer;
    }
    .continue-card img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .continue-card-overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.05) 40%, transparent 100%);
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 10px;
    }
    .continue-card-name {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.2;
    }
    .continue-card-meta {
      font-size: 11px;
      color: rgba(255,255,255,0.75);
      margin-top: 2px;
    }

    /* Browse search */
    .browse-search {
      display: flex;
      gap: 6px;
      margin-bottom: 12px;
    }
    .browse-search input {
      flex: 1;
      padding: 9px 12px;
    }
    .browse-search button {
      background: none;
      border: 1px solid var(--outline-bright);
      border-radius: 10px;
      padding: 8px 14px;
      font-size: 12px;
      color: var(--text-secondary);
      cursor: pointer;
      flex-shrink: 0;
    }

    /* 2-column grid */
    .browse-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
    }
    @media (min-width: 701px) {
      .browse-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
      }
      .continue-card {
        width: 150px;
      }
    }

    /* Character card */
    .character-card {
      position: relative;
      border-radius: 14px;
      overflow: hidden;
      background: var(--surface-3);
      cursor: pointer;
      transition: transform 0.15s ease;
      content-visibility: auto;
      contain-intrinsic-size: auto 280px;
    }
    .character-card:active {
      transform: scale(0.97);
    }
    .character-card.selected {
      outline: 2px solid var(--accent);
      outline-offset: -2px;
    }
    .character-card .char-select-checkbox {
      position: absolute;
      top: 8px;
      right: 8px;
      z-index: 5;
      width: 22px;
      height: 22px;
      border-radius: 6px;
      border: 2px solid rgba(255,255,255,0.75);
      background: rgba(0,0,0,0.35);
      display: none;
      align-items: center;
      justify-content: center;
      pointer-events: none;
    }
    .character-card.select-mode .char-select-checkbox {
      display: flex;
    }
    .character-card.selected .char-select-checkbox {
      background: var(--accent);
      border-color: var(--accent);
    }
    .character-card.selected .char-select-checkbox::after {
      content: "";
      width: 6px;
      height: 10px;
      border: solid #fff;
      border-width: 0 2px 2px 0;
      transform: rotate(45deg);
      margin-top: -2px;
    }
    .character-card-image-wrap {
      position: relative;
      aspect-ratio: 1/1;
      overflow: hidden;
      background: var(--surface-3);
    }
    .character-card-image-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .character-card-image-overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
      pointer-events: none;
    }

    /* Social signals on card image */
    .character-card-signals {
      position: absolute;
      bottom: 8px;
      left: 8px;
      right: 8px;
      display: flex;
      gap: 10px;
      font-size: 12px;
      color: var(--text-primary);
      font-weight: 600;
      pointer-events: none;
    }
    .character-card-signals span {
      display: flex;
      align-items: center;
      gap: 3px;
    }

    /* Heart button */
    .character-card-heart {
      position: absolute;
      top: 6px;
      right: 6px;
      z-index: 2;
      width: 30px;
      height: 30px;
      border-radius: 999px;
      background: rgba(0,0,0,0.35);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      line-height: 0;
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
    }

    /* Card body (below image) */
    .character-card-body {
      padding: 10px;
    }
    .character-card-name {
      font-size: 15px;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.2;
      margin-bottom: 2px;
    }
    .character-card-type {
      font-size: 12px;
      color: var(--accent);
      font-weight: 500;
      margin-bottom: 4px;
    }
    .character-card-preview {
      font-size: 12px;
      color: var(--text-secondary);
      line-height: 1.35;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    /* Tag chips on card */
    .character-card-tags {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      margin-top: 6px;
    }
    .character-card-tag {
      padding: 3px 8px;
      border-radius: 999px;
      background: var(--surface-3);
      border: 1px solid var(--outline-color);
      font-size: 10px;
      color: var(--text-muted);
      font-weight: 500;
    }

    .vis-radio {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      font-size: 13px;
      color: var(--text-muted);
      margin: 0;
      position: relative;
      padding-left: 24px;
    }

    .vis-radio input {
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
    }

    .vis-radio .radio-dot {
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 2px solid #555;
      background: transparent;
      transition: all 0.15s ease;
    }

    .vis-radio .radio-dot::after {
      content: '';
      display: block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: transparent;
      margin: 2px auto;
      transition: all 0.15s ease;
    }

    .vis-radio input:checked ~ .radio-dot {
      border-color: #4a9eff;
    }

    .vis-radio input:checked ~ .radio-dot::after {
      background: #4a9eff;
    }

    .vis-radio input:checked ~ .radio-label {
      color: var(--text-primary);
    }

    .mode-pill {
      display: inline-block;
      font-size: 12px;
      padding: 4px 8px;
      border: 1px solid var(--outline-bright);
      border-radius: 999px;
      color: var(--text-secondary);
      margin-bottom: 8px;
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: calc(82px + var(--safe-bottom) + var(--bottom-lift));
      transform: translateX(-50%);
      background: var(--surface-3);
      border: 1px solid var(--outline-bright);
      color: var(--text-primary);
      padding: 10px 14px;
      border-radius: 999px;
      font-size: 14px;
      z-index: 200;
      display: none;
    }

    .toast.show {
      display: block;
      animation: toastFade 1600ms ease forwards;
    }

    /* @keyframes toastFade is defined once in reset.css (de-duped, F3) — keyframes are document-global. */

    /* ── Long-press action sheet (bottom-sheet style) ── */

    /* The backdrop fade + sheet slide/drag-dismiss are Motion-owned (F2: AnimatePresence opacity +
       drag='y' translateY). These rules are layout-only now — adding opacity/transform/transition back
       would fight Motion's per-frame inline values (same reason the .active toggles were removed). */
    .action-sheet-backdrop {
      position: fixed;
      inset: 0;
      z-index: 300;
      background: rgba(0,0,0,0.35);
    }
    .action-sheet {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 301;
      background: var(--surface-3);
      border-top: 1px solid #2a2a2a;
      border-radius: 20px 20px 0 0;
      padding: 8px 16px calc(16px + var(--safe-bottom) + var(--bottom-lift));
      max-height: 50vh;
      overflow-y: auto;
    }
    .action-sheet-handle {
      width: 36px;
      height: 5px;
      border-radius: 999px;
      background: #555;
      margin: 6px auto 10px;
    }
    .action-sheet-title {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 1px;
      padding: 6px 0 4px;
    }
    .action-sheet-item {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 14px 6px;
      background: none;
      border: none;
      border-bottom: 1px solid #222;
      color: var(--text-primary);
      font-size: 15px;
      cursor: pointer;
      text-align: left;
      border-radius: 0;
      transition: background 120ms;
    }
    .action-sheet-item:last-child {
      border-bottom: none;
    }
    .action-sheet-item:active {
      background: var(--surface-3);
    }
    .action-sheet-item svg {
      width: 20px;
      height: 20px;
      flex-shrink: 0;
      opacity: 0.7;
    }
    .action-sheet-item.danger {
      color: #e55;
    }
    .msg.long-press-target {
      opacity: 0.72;
      transition: opacity 120ms ease;
    }

    .bubble.jump-highlight {
      animation: jumpGlow 2.6s ease-out forwards;
    }
    /* @keyframes jumpGlow is defined once in reset.css (de-duped, F3) — keyframes are document-global. */

    .saved-moment-card {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 14px;
      border-radius: 14px;
      background: var(--surface-3);
      border: 1px solid var(--outline-color);
      cursor: pointer;
      transition: background 120ms;
      margin-bottom: 8px;
    }
    .saved-moment-card:active { background: #242424; }
    .saved-moment-preview {
      font-size: 14px;
      color: var(--text-primary);
      line-height: 1.45;
      font-style: italic;
    }
    .saved-moment-preview.collapsed {
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .saved-moment-expand {
      font-size: 11px;
      color: var(--accent-soft);
      margin-top: 4px;
      cursor: pointer;
      font-weight: 600;
    }
    .saved-moment-meta {
      font-size: 11px;
      color: #777;
      display: flex;
      gap: 12px;
      align-items: center;
    }
    .saved-moment-char {
      color: var(--accent-soft);
      font-weight: 600;
    }

    .saved-char-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      border-radius: 14px;
      background: var(--surface-3);
      border: 1px solid var(--outline-color);
      cursor: pointer;
      transition: background 120ms;
      margin-bottom: 8px;
    }
    .saved-char-card:active { background: #242424; }
    .saved-char-avatar {
      width: 44px;
      height: 44px;
      border-radius: 999px;
      background: var(--surface-3);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      font-weight: 600;
      font-size: 17px;
      overflow: hidden;
    }
    .saved-char-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .saved-char-info {
      flex: 1;
      min-width: 0;
    }
    .saved-char-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--accent-soft);
    }
    .saved-char-count {
      font-size: 12px;
      color: #777;
      margin-top: 1px;
    }
    .saved-char-preview {
      font-size: 12px;
      color: var(--text-muted);
      font-style: italic;
      margin-top: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .saved-char-right {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      padding-right: 4px;
    }

    /* Custom confirm/alert/prompt modal */

    .modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 3000;
      background: rgba(0,0,0,0.7);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 200ms ease;
    }

    .modal-overlay.show {
      opacity: 1;
      pointer-events: auto;
    }

    .modal-card {
      background: var(--surface-3);
      border: 1px solid var(--outline-color);
      border-radius: 18px;
      padding: 24px 22px;
      max-width: 370px;
      width: 100%;
      transform: scale(0.92);
      transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .modal-overlay.show .modal-card {
      transform: scale(1);
    }

    .modal-message {
      font-size: 15px;
      line-height: 1.5;
      color: var(--text-primary);
      margin-bottom: 20px;
      white-space: pre-wrap;
    }

    .modal-input {
      width: 100%;
      border: 1px solid var(--outline-bright);
      border-radius: 10px;
      padding: 11px 13px;
      background: var(--surface-low);
      color: var(--text-primary);
      font-size: 14px;
      margin-bottom: 16px;
      box-sizing: border-box;
    }

    .modal-input:focus {
      outline: none;
      border-color: #4a9eff;
    }

    .modal-actions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
    }

    .modal-actions button {
      padding: 9px 20px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      border: 1px solid var(--outline-color);
      transition: background 0.15s ease;
    }

    .modal-btn-cancel {
      background: var(--surface-3);
      color: var(--text-secondary);
    }

    .modal-btn-cancel:hover {
      background: #555;
    }

    .modal-btn-confirm {
      background: #eee;
      color: #111;
      border-color: #eee !important;
    }

    .modal-btn-confirm:hover {
      background: #ddd;
    }

    .modal-btn-danger {
      background: #3a1515;
      color: #e55;
      border-color: #753030 !important;
    }

    .modal-btn-danger:hover {
      background: #4d1c1c;
    }

    .modal-btn-branch {
      background: #1a5fb4;
      color: var(--text-primary);
      border-color: #3584e4 !important;
    }

    .modal-btn-branch:hover {
      background: #2365c0;
    }

    .modal-btn-ok {
      background: #eee;
      color: #111;
      border-color: #eee !important;
      min-width: 72px;
    }

    .modal-btn-ok:hover {
      background: #ddd;
    }
    .bottom-tabs {
      height: var(--bottom-nav-height);
      border-top: 1px solid var(--outline-color);
      background: var(--surface-low);
      display: flex;
      justify-content: space-around;
      align-items: center;
      flex-shrink: 0;
      position: fixed;
      left: 0;
      right: 0;
      /* Mirrors reset.css .bottom-tabs - lifted clear of the iOS home indicator. */
      bottom: calc(12px + var(--safe-bottom));
      box-shadow: 0 calc(12px + var(--safe-bottom)) 0 var(--surface-low);
      z-index: 50;
      touch-action: none;
    }


    .tab-btn {
      border: 0;
      background: transparent;
      color: var(--text-muted);
      width: 54px;
      height: 48px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      padding: 0;
    }

    .tab-btn svg {
      width: 24px;
      height: 24px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .tab-btn.active {
      color: var(--text-primary);
      background: var(--surface-3);
    }

    .tab-btn:hover {
      color: var(--text-primary);
    }

    /* Profile Hero */

    .account-hero {
      position: relative;
      border-radius: 18px;
      overflow: hidden;
      margin-bottom: 14px;
    }
    .account-hero-bg {
      height: 120px;
      background: var(--hero-gradient, linear-gradient(135deg, var(--bg-base) 0%, color-mix(in srgb, var(--accent-deep) 35%, var(--bg-base)) 50%, #111 100%));
      position: relative;
    }
    .account-hero-bg::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at 30% 50%, color-mix(in srgb, var(--accent) 15%, transparent) 0%, transparent 70%);
    }
    .account-hero-header {
      position: absolute;
      top: 0;
      right: 0;
      display: flex;
      gap: 4px;
      padding: 8px 10px;
      z-index: 2;
    }
    .hero-icon-btn {
      background: rgba(0,0,0,0.4);
      border: none;
      border-radius: 8px;
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      color: rgba(255,255,255,0.8);
      cursor: pointer;
      padding: 0;
    }
    .hero-icon-btn:hover { background: rgba(0,0,0,0.6); }

    /* Notification badge — hero icon & tab buttons */
    .notif-badge {
      position: absolute;
      top: -2px;
      right: -2px;
      width: 18px;
      height: 18px;
      background: #e55;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 700;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      pointer-events: none;
      box-shadow: 0 0 0 2px #111;
    }
    .tab-notif-dot {
      position: absolute;
      top: 4px;
      right: 12px;
      width: 8px;
      height: 8px;
      background: #e55;
      border-radius: 999px;
      pointer-events: none;
      box-shadow: 0 0 0 2px #111;
    }

    .account-hero-body {
      padding: 0 14px 14px;
      margin-top: -36px;
      position: relative;
      z-index: 1;
    }
    .account-avatar-lg {
      width: 72px;
      height: 72px;
      border-radius: 999px;
      background: #333;
      display: grid;
      place-items: center;
      font-size: 28px;
      font-weight: 700;
      color: var(--text-muted);
      border: 3px solid #111;
      overflow: hidden;
      position: relative;
    }
    .account-avatar-lg img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 999px;
    }
    .level-badge {
      display: inline-block;
      padding: 3px 10px;
      border-radius: 999px;
      background: var(--hero-accent, var(--accent));
      color: var(--text-primary);
      font-size: 11px;
      font-weight: 700;
      margin-top: 8px;
    }
    .account-hero-name {
      margin: 6px 0 2px;
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .account-hero-username {
      margin: 0 0 8px;
      font-size: 13px;
      color: var(--text-muted);
    }
    .hero-edit-btn {
      background: rgba(255,255,255,0.1);
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 8px;
      padding: 6px 14px;
      font-size: 12px;
      color: var(--text-secondary);
      cursor: pointer;
    }

    /* Stats row */
    .stats-row {
      display: flex;
      gap: 6px;
      margin-bottom: 18px;
    }
    .stat-item {
      flex: 1;
      background: var(--surface-3);
      border: 1px solid var(--outline-color);
      border-radius: 12px;
      padding: 10px 6px;
      text-align: center;
    }
    .stat-value {
      display: block;
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .stat-label {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 500;
    }

    /* Shelves */
    .account-shelf {
      margin-bottom: 14px;
    }
    .shelf-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }
    .shelf-header h3 {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-primary);
      margin: 0;
    }
    .shelf-view-all {
      background: none;
      border: none;
      color: var(--accent);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      padding: 0;
    }
    .shelf-row {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 4px;
    }
    .shelf-row::-webkit-scrollbar { display: none; }

    /* Character shelf card */
    .shelf-char-card {
      flex-shrink: 0;
      width: 110px;
      border-radius: 12px;
      overflow: hidden;
      background: var(--surface-3);
      border: 1px solid var(--outline-color);
      cursor: pointer;
    }
    .shelf-char-card-img {
      width: 100%;
      aspect-ratio: 1;
      object-fit: cover;
      background: var(--surface-3);
    }
    .shelf-char-card-body {
      padding: 8px;
    }
    .shelf-char-card-name {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .shelf-char-card-stat {
      font-size: 10px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    /* Chat shelf card */

    /* Empty state for shelves */
    .shelf-empty {
      padding: 20px;
      text-align: center;
      color: var(--text-muted);
      font-size: 13px;
      background: var(--surface-3);
      border-radius: 12px;
      border: 1px dashed var(--outline-bright);
    }

    /* Create new card */
    .shelf-create-card {
      flex-shrink: 0;
      width: 110px;
      border-radius: 12px;
      border: 2px dashed var(--outline-bright);
      background: var(--surface-3);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      cursor: pointer;
      color: var(--accent);
      font-size: 12px;
      font-weight: 600;
      padding: 16px 8px;
    }
    .shelf-create-card svg { opacity: 0.6; }

    .account-email {
      font-size: 12px;
      color: var(--text-muted);
      margin: 4px 0 8px 0;
    }

    .field-hint {
      font-size: 12px;
      color: var(--text-muted);
      margin: -2px 0 4px 0;
    }

    .profile-image-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 8px 0 12px;
    }

    .profile-preview {
      width: 72px;
      height: 72px;
      border-radius: 999px;
      background: #2b2b2b;
      display: grid;
      place-items: center;
      font-weight: 700;
      flex-shrink: 0;
      position: relative;
      overflow: hidden;
    }

    .profile-preview img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 999px;
    }

    .avatar-icon {
      position: absolute;
      width: 27px;
      height: 27px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      z-index: 10;
    }

    .profile-preview .avatar-cam {
      bottom: -5px;
      right: -5px;
      background: #1a5fb4;
      color: var(--text-primary);
      cursor: pointer;
    }

    .profile-preview .avatar-remove {
      top: -5px;
      right: -5px;
      background: #753030;
      color: #e55;
      cursor: pointer;
    }

    /* Banner preview (edit profile) */
    .banner-preview {
      width: 100%;
      height: 100px;
      border-radius: 10px;
      background: var(--surface-3);
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      border: 1px dashed var(--outline-bright);
    }
    .banner-preview img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .banner-preview-label {
      color: var(--text-muted);
      font-size: 12px;
    }
    /* Profile hero banner (account tab + public profile) */

    .avatar-remove:hover {
      background: #8a3a3a;
    }
    .banner-upload-row {
      position: relative;
    }
    .banner-upload-row .avatar-remove {
      top: -5px;
      right: -5px;
      background: #753030;
      color: #e55;
      cursor: pointer;
    }

    .avatar-cam:hover {
      background: #2365c0;
    }

    /* Public Profile */
    .public-hero {
      position: relative;
      border-radius: 18px;
      overflow: hidden;
      margin-bottom: 12px;
    }
    .public-hero-bg {
      height: 100px;
      background: var(--hero-gradient, linear-gradient(135deg, var(--bg-base) 0%, color-mix(in srgb, var(--accent-deep) 35%, var(--bg-base)) 50%, #111 100%));
      position: relative;
    }
    .public-hero-bg::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at 30% 50%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 70%);
    }
    .public-hero-body {
      padding: 0 14px 14px;
      margin-top: -30px;
      position: relative;
      z-index: 1;
    }
    .public-hero-name {
      margin: 6px 0 2px;
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .public-hero-username {
      margin: 0;
      font-size: 13px;
      color: var(--text-muted);
    }
    .public-bio {
      margin: 8px 0 0;
      font-size: 13px;
      color: var(--text-secondary);
      line-height: 1.4;
    }
    .follow-btn {
      padding: 7px 18px;
      border-radius: 999px;
      border: none;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      background: var(--accent);
      color: var(--text-primary);
    }
    .follow-btn.following {
      background: #555;
      color: var(--text-secondary);
      border: 1px solid var(--outline-bright);
    }
    .follow-btn.self { display: none; }
    .creator-card {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px;
      background: var(--surface-3);
      border: 1px solid var(--outline-color);
      border-radius: 14px;
      cursor: pointer;
      margin-bottom: 8px;
    }
    .creator-card-avatar {
      width: 44px;
      height: 44px;
      border-radius: 999px;
      background: #333;
      overflow: hidden;
      flex-shrink: 0;
      display: grid;
      place-items: center;
      font-weight: 700;
      color: var(--text-muted);
      font-size: 18px;
    }
    .creator-card-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .creator-card-body {
      flex: 1;
      min-width: 0;
    }
    .creator-card-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
    }
    .creator-card-username {
      font-size: 12px;
      color: var(--text-muted);
    }
    .creator-card-bio {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .creator-card-stats {
      font-size: 11px;
      color: var(--text-muted);
      text-align: right;
    }

    /* ── Character group header in chat list ── */

    .chat-group-header {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 10px; border-radius: 12px; cursor: pointer;
      transition: background 120ms; margin: 0; user-select: none;
    }
    .chat-group-header:active { background: var(--surface-1); }
    .chat-group-avatar {
      width: 36px; height: 36px; border-radius: 999px;
      background: var(--surface-3); flex-shrink: 0; display: flex;
      align-items: center; justify-content: center;
      color: var(--text-muted); font-weight: 600; font-size: 14px; overflow: hidden;
    }
    .chat-group-avatar img { width: 100%; height: 100%; object-fit: cover; }
    .chat-group-info { flex: 1; min-width: 0; }
    .chat-group-name { font-size: 14px; font-weight: 600; color: var(--accent-soft); }
    .chat-group-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
    .chat-group-chevron {
      flex-shrink: 0; transition: transform 250ms ease; opacity: 0.5;
    }
    .chat-group-chevron.expanded { transform: rotate(90deg); }
    .chat-group-children {
      overflow: hidden; max-height: 0;
      transition: max-height 350ms ease; padding-left: 8px;
    }
    .chat-group-children.expanded { max-height: 2000px; }
    .chat-group-wrapper {
      border: 2px solid var(--outline-color);
      border-radius: 14px;
      overflow: hidden;
    }
    .chat-group-wrapper + .chat-group-wrapper {
      margin-top: 1px;
    }
    .chat-group-wrapper .chat-row {
      margin: 4px 8px;
    }
    .chat-group-wrapper .chat-row:last-child {
      margin-bottom: 6px;
    }
    .chat-group-wrapper .chat-row-avatar {
      width: 41px; height: 41px;
    }
    .chat-group-wrapper .chat-row-title {
      font-size: 12px;
    }
    .chat-group-wrapper .chat-row-preview {
      font-size: 10px;
    }
    .chat-group-wrapper .chat-row-time {
      font-size: 11px;
    }

    /* Home */

    .home-hero {
      position: relative;
      border-radius: 18px;
      overflow: hidden;
      margin-bottom: 16px;
    }
    .home-hero-bg {
      height: 100px;
      background: linear-gradient(135deg, color-mix(in srgb, var(--accent-deep) 35%, var(--bg-base)) 0%, var(--accent) 50%, var(--accent-soft) 100%);
      position: relative;
    }
    .home-hero-bg::after {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at 60% 40%, rgba(255,255,255,0.14) 0%, transparent 70%);
    }
    .home-hero-text {
      padding: 0 16px 14px;
      margin-top: -28px;
      position: relative;
      z-index: 1;
    }
    .home-hero-title {
      font-size: 24px;
      font-weight: 700;
      color: var(--text-primary);
      margin: 0;
    }
    .home-hero-subtitle {
      margin: 2px 0 0;
      font-size: 13px;
      color: rgba(255,255,255,0.85);
    }

    .home-composer {
      background: var(--surface-3);
      border: 1px solid var(--outline-color);
      border-radius: 14px;
      padding: 10px;
      margin-bottom: 12px;
    }
    .home-composer textarea {
      width: 100%;
      min-height: 44px;
      max-height: 120px;
      background: var(--surface-low);
      border: 1px solid var(--outline-color);
      border-radius: 10px;
      padding: 8px 10px;
      color: var(--text-primary);
      font-size: 13px;
      resize: none;
      line-height: 1.4;
    }
    /* Home feed items */

    /* The enter/exit slide + swipe-back is owned by the React <Screen> Motion primitive (F1); this rule
       is now layout-only. Do NOT re-add transform/transition here — a CSS transition fights Motion's
       per-frame inline transform (same reason the .dragging/.active toggle was removed). */
    .chat-screen {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: auto;
      z-index: 100;
      display: flex;
      height: 100dvh;
      flex-direction: column;
      background: var(--bg-base);
      overflow: hidden;
      overscroll-behavior: contain;
    }
    /* Layout only — slide is Motion-owned (push overlays via <Screen>; the in-chat Saved Moments
       overlay sets transform:none inline). */
    .overlay-screen {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: auto;
      z-index: 100;
      display: flex;
      height: 100dvh;
      flex-direction: column;
      background: var(--surface-low);
      touch-action: pan-y;
      overflow: hidden;
      overscroll-behavior: contain;
    }

    .overlay-screen-body {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      touch-action: pan-y;
      -webkit-overflow-scrolling: touch;
      padding: 14px;
    }

    .chat-header {
      height: 54px;
      border-bottom: 1px solid var(--outline-color);
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 12px;
      flex-shrink: 0;
      background: var(--surface-low);
      touch-action: none;
    }

    .back-btn {
      width: 42px;
      height: 42px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      padding: 0;
      background: transparent;
      border-color: transparent;
    }

    .back-btn svg {
      width: 24px;
      height: 24px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .avatar {
      width: 38px;
      height: 38px;
      border-radius: 999px;
      background: #2b2b2b;
      display: grid;
      place-items: center;
      font-weight: 700;
      overflow: hidden;
      flex-shrink: 0;
    }

    .avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .chat-row-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 999px;
    }

    .chat-title-wrap {
      min-width: 0;
    }

    .char-header-pill {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 5px 14px 5px 5px;
      border-radius: 999px;
      background: var(--surface-1);
      border: 1px solid var(--outline-color);
      cursor: pointer;
      min-width: 0;
      max-width: calc(100vw - 180px);
      flex-shrink: 1;
      transition: background 120ms;
    }
    .char-header-pill:hover, .char-header-pill:active { background: #555; }
    .header-pill-avatar {
      width: 32px;
      height: 32px;
      border-radius: 999px;
      flex-shrink: 0;
      overflow: hidden;
    }
    .header-pill-name {
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 14px;
      cursor: pointer;
    }

    .header-like-btn {
      background: none;
      border: none;
      cursor: pointer;
      padding: 6px;
      flex-shrink: 0;
      border-radius: 999px;
      transition: transform 120ms;
    }
    .header-like-btn:active { transform: scale(1.2); }

    /* ── Character Info Dropdown ── */

html,
body,
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
html,
body {
  overflow: hidden !important;
}

    input, textarea, select {
      font-size: 16px !important;
    }

    .field-badge {
      font-size: 11px;
      font-weight: 400;
      color: var(--text-muted);
      background: var(--surface-3);
      padding: 1px 7px;
      border-radius: 999px;
      margin-left: 6px;
      vertical-align: middle;
    }

    .field-badge.required {
      color: #e88;
      background: #2a1818;
    }

    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 44px;
      height: 24px;
      flex-shrink: 0;
    }

    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
      position: absolute;
    }

    .toggle-slider {
      position: absolute;
      inset: 0;
      background: #333;
      border-radius: 24px;
      transition: background 0.2s ease;
      cursor: pointer;
    }

    .toggle-slider::before {
      content: '';
      position: absolute;
      width: 18px;
      height: 18px;
      left: 3px;
      bottom: 3px;
      background: #888;
      border-radius: 50%;
      transition: transform 0.2s ease, background 0.2s ease;
    }

    .toggle-switch input:checked + .toggle-slider {
      background: #4a9eff;
    }

    .toggle-switch input:checked + .toggle-slider::before {
      transform: translateX(20px);
      background: #fff;
    }

    /* Persona cards */

    .persona-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      border-radius: 12px;
      background: var(--surface-3);
      cursor: pointer;
      margin-bottom: 8px;
    }
    .persona-card-avatar {
      width: 40px;
      height: 40px;
      border-radius: 999px;
      background: #555;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-secondary);
      font-weight: 600;
      font-size: 16px;
      overflow: hidden;
    }
    .persona-card-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .persona-card-info {
      flex: 1;
      min-width: 0;
    }
    .persona-card-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
    }
    .persona-card-pronouns {
      font-size: 12px;
      color: var(--text-muted);
    }
    .persona-card-badge {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 999px;
      background: color-mix(in srgb, var(--accent) 20%, transparent);
      color: var(--accent);
      font-weight: 600;
      margin-left: 6px;
    }
    .persona-card-actions {
      display: flex;
      gap: 4px;
      flex-shrink: 0;
    }
    .persona-card-actions button {
      background: none;
      border: 1px solid var(--outline-color);
      border-radius: 6px;
      padding: 4px 8px;
      font-size: 11px;
      color: var(--text-muted);
      cursor: pointer;
    }
    .persona-select-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px;
      border-radius: 10px;
      cursor: pointer;
      margin-bottom: 4px;
    }
    .persona-select-item:hover, .persona-select-item.active {
      background: #555;
    }
    .persona-select-item.active {
      border: 1px solid var(--accent);
    }
    .persona-select-avatar {
      width: 32px;
      height: 32px;
      border-radius: 999px;
      background: #555;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-secondary);
      font-size: 13px;
      overflow: hidden;
    }
    .persona-select-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .persona-none-circle {
      width: 32px;
      height: 32px;
      border-radius: 999px;
      border: 2px dashed var(--outline-bright);
      flex-shrink: 0;
    }
    /* Timeline marker */

    /* ── User badges (server-authoritative, never client-assigned) ── */
    .user-badge {
      display: inline-flex;
      align-items: center;
      padding: 1px 7px;
      border-radius: 999px;
      color: #0f0f1a;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.3px;
      vertical-align: middle;
      line-height: 1.5;
      user-select: none;
      flex-shrink: 0;
    }
    .user-badge-owner {
      background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    }

    /* ── Owner flair: gold border + subtle glow on post cards ── */
    .post-card-owner {
      border-color: #b8860b !important;
      box-shadow: 0 0 16px rgba(184, 134, 11, 0.18), inset 0 0 16px rgba(184, 134, 11, 0.04);
    }

    /* ── Owner name: gold text with subtle glow ── */
    .owner-name {
      color: #fbbf24 !important;
      text-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
    }

    /* ── Badge row: second line below post-card author name ── */
    .post-badge-row {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      margin-top: 3px;
      margin-bottom: 1px;
    }

    /* ── Post action bar ── */
    .post-actions {
      display: flex;
      align-items: center;
      gap: 2px;
    }

    .post-action-btn {
      background: transparent;
      border: none;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 4px 6px;
      border-radius: 8px;
      color: var(--text-muted);
      font-size: 12px;
      cursor: pointer;
      min-height: 32px;
      min-width: 32px;
      font-family: inherit;
    }

    .post-action-btn:hover {
      color: var(--text-muted);
      background: rgba(255, 255, 255, 0.05);
    }

    .post-action-btn svg {
      width: 15px;
      height: 15px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      flex-shrink: 0;
    }

    /* Liked state: inline color applied via JS; filled heart via fill */
    .post-action-btn[style*="color: rgb(238"] svg,
    .post-action-btn[style*="color: #e55"] svg {
      fill: currentColor;
    }

    .post-action-count {
      font-size: 12px;
      line-height: 1;
    }

    .post-translate-label {
      font-size: 11px;
      line-height: 1;
    }

    /* ── Reply cards ── */
    .reply-card {
      position: relative;
      background: #252538;
      border-radius: 10px;
      padding: 8px 36px 8px 12px; /* right pad leaves room for ✕ button */
      margin-bottom: 6px;
      border-left: 3px solid transparent;
      font-size: 12px;
      line-height: 1.4;
    }

    .reply-badge-caption {
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.3px;
      opacity: 0.8;
      margin-bottom: 2px;
      user-select: none;
    }

    .reply-card-body {
      color: var(--text-muted);
    }

    .reply-card-content {
      color: var(--text-muted);
    }

    /* ✕ delete — hidden until hover on desktop; dimly visible on touch devices */
    .reply-card-delete {
      position: absolute;
      top: 7px;
      right: 8px;
      width: 22px;
      height: 22px;
      background: transparent;
      border: none;
      color: #555;
      font-size: 13px;
      display: grid;
      place-items: center;
      border-radius: 4px;
      padding: 0;
      cursor: pointer;
      transition: opacity 120ms, color 120ms, background 120ms;
      font-family: inherit;
    }

    @media (hover: hover) {
      .reply-card-delete {
        opacity: 0;
      }
      .reply-card:hover .reply-card-delete {
        opacity: 1;
      }
      .reply-card-delete:hover {
        color: #ffb0b0;
        background: rgba(255, 80, 80, 0.12);
      }
    }

    @media (hover: none) {
      .reply-card-delete {
        opacity: 0.35;
      }
    }

    /* ── Reply composer ── */
    .reply-composer {
      display: flex;
      gap: 8px;
      margin-top: 10px;
      align-items: flex-end;
    }

    .reply-textarea {
      flex: 1;
      background: #252538;
      border: 1px solid #3a3a52;
      border-radius: 8px;
      padding: 7px 10px;
      color: var(--text-primary);
      font-size: 12px;
      font-family: inherit;
      resize: none;
      min-height: 32px;
      max-height: 100px;
      overflow-y: auto;
      outline: none;
      line-height: 1.4;
      display: block;
    }

    .reply-textarea:focus {
      border-color: color-mix(in srgb, var(--accent-soft) 50%, transparent);
    }

    /* Send button: 32px purple circle with SVG arrow */
    .reply-send-btn {
      width: 32px;
      height: 32px;
      border-radius: 999px;
      background: var(--accent-soft);
      border: none;
      display: grid;
      place-items: center;
      flex-shrink: 0;
      cursor: pointer;
      color: var(--text-primary);
      padding: 0;
      transition: background 120ms, opacity 120ms;
    }

    .reply-send-btn:disabled {
      opacity: 0.35;
      cursor: default;
    }

    .reply-send-btn:not(:disabled):hover {
      background: #9333ea;
    }

    .reply-send-btn svg {
      width: 13px;
      height: 13px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2.5;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    /* Polygon inside send SVG should be filled */
    .reply-send-btn svg polygon {
      fill: currentColor;
      stroke: none;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }