/* ============================================================
   Aitai — identidade propria (dark premium romantico, JP vibe)
   ============================================================ */
:root {
  --night: #0c0e13;
  --night2: #151820;
  --ink: #f1f2f4;
  --muted: #989ca7;
  --faint: #666b77;
  --rose: #d96f83;
  --coral: #d7897b;
  --violet: #9a9eaa;
  --teal: #a3a7b1;
  --gold: #c4a477;
  --grad: linear-gradient(135deg, #d88978 0%, #d96f83 100%);
  --grad-soft: rgba(217,111,131,.12);
  --grad-teal: linear-gradient(135deg, #8f949f, #b2b5bd);
  --glass: rgba(255,255,255,0.045);
  --glass-2: rgba(255,255,255,0.075);
  --line: rgba(255,255,255,0.09);
  --ok: #76b99d;
  --shadow: 0 24px 64px rgba(0,0,0,.42);
  --radius: 26px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Manrope", "Noto Sans JP", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--night);
  color: var(--ink);
  overflow: hidden;
}
h1, h2, h3, .brand, .display { font-family: "Quicksand", "Noto Sans JP", sans-serif; }
.hidden { display: none !important; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- aurora background ---- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: radial-gradient(1000px 700px at 86% -8%, rgba(74,82,104,.22) 0%, transparent 62%),
              radial-gradient(900px 700px at 0% 100%, rgba(92,66,72,.16) 0%, transparent 58%),
              var(--night); }
.blob { display: none; }
.b1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: radial-gradient(circle, #ff7a5c, transparent 70%); }
.b2 { width: 40vmax; height: 40vmax; right: -14vmax; top: 18vmax; background: radial-gradient(circle, #22d3be, transparent 70%); animation-delay: -7s; }
.b3 { width: 38vmax; height: 38vmax; left: 20vmax; bottom: -18vmax; background: radial-gradient(circle, #ffb14e, transparent 70%); animation-delay: -13s; }
@keyframes drift { 0%,100%{transform:translate(0,0) scale(1);} 33%{transform:translate(4vmax,3vmax) scale(1.08);} 66%{transform:translate(-3vmax,2vmax) scale(.95);} }

/* ---- app shell (device frame no desktop, full no mobile) ---- */
#app {
  position: relative; z-index: 1;
  width: 100%; max-width: 430px; height: 100dvh; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(18,20,27,.92), rgba(12,14,19,.96));
  backdrop-filter: blur(20px);
}
/* ===== DESKTOP: layout de app web (rail lateral + area principal) ===== */


/* ---- topbar ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; }
.brand-wrap { display: flex; align-items: center; gap: 9px; }
.brand { font-size: 25px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.brand .jp { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 2px; display: block; }
.heartlogo { width: 30px; height: 30px; flex: none; }
.langsel { background: var(--glass); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 12px; font-weight: 600; }
.slotpill { display: inline-flex; align-items: center; gap: 6px; background: var(--glass); border: 1px solid var(--line);
  padding: 6px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--muted); }
.slotpill b { color: var(--rose); }
.slotpill .ui-icon { color: var(--rose); }
.ui-icon { display: block; flex: none; }

/* ---- views ---- */
.view { flex: 1; overflow-y: auto; padding: 8px 18px 20px; }
.view::-webkit-scrollbar { width: 0; }

/* ---- buttons / inputs ---- */
.btn { background: var(--grad); color: #fff; border: none; border-radius: 16px; padding: 15px; font-size: 16px;
  font-weight: 700; cursor: pointer; width: 100%; box-shadow: 0 10px 24px rgba(0,0,0,.22); transition: transform .12s; font-family: "Quicksand",sans-serif; }
.btn:active { transform: scale(.97); }
.btn:has(.ui-icon) { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn.ghost { background: var(--glass); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: linear-gradient(135deg,#ff5b6b,#c0293f); box-shadow: 0 12px 30px rgba(200,41,63,.3); }
.btn.sm { padding: 10px 14px; font-size: 14px; width: auto; border-radius: 12px; }
input, select, textarea { width: 100%; background: var(--glass); border: 1px solid var(--line); color: var(--ink);
  border-radius: 14px; padding: 14px; font-size: 15px; outline: none; font-family: inherit; transition: border-color .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { border-color: var(--rose); background: var(--glass-2); }
label { font-size: 12px; color: var(--muted); margin: 14px 3px 6px; display: block; font-weight: 600; letter-spacing: .3px; }
.link { color: var(--rose); text-align: center; cursor: pointer; font-size: 14px; padding: 8px; font-weight: 600; }
.err { color: #ff89a3; font-size: 13px; text-align: center; min-height: 18px; margin: 6px 0; }
.hint { font-size: 12px; color: var(--faint); }

/* ---- auth / onboarding ---- */
.center-wrap { display: flex; flex-direction: column; justify-content: center; min-height: 100%; padding: 6px 6px 20px; }
.hero { text-align: center; margin-bottom: 22px; }
.hero .heartlogo { width: 66px; height: 66px; margin: 0 auto 14px; display: block; filter: drop-shadow(0 10px 24px rgba(255,93,143,.45)); }
.hero h1 { font-size: 46px; line-height: 1; }
.hero .jp { color: var(--muted); letter-spacing: 6px; font-size: 13px; margin-top: 6px; }
.hero p { color: var(--muted); margin-top: 12px; font-size: 15px; }
.glass-card { background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 20px; backdrop-filter: blur(8px); }
.socials { display: flex; flex-direction: column; gap: 10px; }
.btn.social { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; padding: 13px; }
.btn.social svg { flex: none; }
.btn.social.google { background: #fff; color: #1f2430; box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.btn.social.fb { background: #1877f2; color: #fff; box-shadow: 0 8px 22px rgba(24,119,242,.32); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.disclosure { font-size: 11px; color: var(--faint); text-align: center; margin-top: 14px; line-height: 1.5; }
.topright { text-align: right; margin-bottom: 4px; }

/* step dots */
.steps { display: flex; gap: 7px; justify-content: center; margin: 4px 0 20px; }
.steps i { width: 26px; height: 5px; border-radius: 3px; background: var(--line); transition: background .2s; }
.steps i.on { background: var(--grad); }

/* chips (interesses / opcoes) */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
.chip-sel { padding: 10px 15px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass);
  color: var(--muted); font-size: 14px; cursor: pointer; font-weight: 600; transition: all .15s; user-select: none; }
.chip-sel.on { background: var(--grad-soft); border-color: var(--rose); color: var(--ink); }

/* ---- swipe deck ---- */
.deck { position: relative; height: 62vh; max-height: 620px; margin: 8px 0 4px; }
.swipe-card { position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), opacity .35s, filter .35s; cursor: grab;
  isolation: isolate; background: var(--night2); will-change: transform, opacity; touch-action: pan-y; }
.swipe-card[data-top] { z-index: 3; }
.swipe-card[data-depth="1"] { z-index: 2; transform: scale(.972) translateY(9px); opacity: .92; pointer-events: none; }
.swipe-card[data-depth="2"] { z-index: 1; transform: scale(.944) translateY(18px); opacity: .7; pointer-events: none; }
.swipe-card.is-leaving { cursor: default; }
.swipe-card.is-leaving[data-decision="nope"] { filter: saturate(.62) brightness(.86); }
.swipe-card.is-leaving[data-decision="reject"] { filter: grayscale(.42) saturate(.55) brightness(.82); }
.swipe-card.is-leaving .stamp { transition: opacity .12s ease; }
.swipe-card:active { cursor: grabbing; }
.portrait { position: absolute; inset: 0; z-index: 0; }
.portrait::after { content: ""; position: absolute; inset: 0;
  z-index: 1; background: radial-gradient(120% 80% at 50% 15%, transparent 30%, rgba(15,8,24,.15) 55%, rgba(15,8,24,.92) 100%); }
.persona-photo { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.portrait > .persona-photo { position: absolute; inset: 0; z-index: 0; }
.portrait .motif { position: absolute; top: 44%; left: 50%; transform: translate(-50%,-50%); font-size: 130px;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,.4)); }
.swipe-card .info { position: relative; z-index: 2; padding: 22px; }
.swipe-card h2 { font-size: 30px; font-weight: 700; }
.swipe-card h2 small { font-size: 16px; color: var(--muted); font-weight: 600; }
.swipe-card .nat { color: rgba(255,255,255,.82); font-size: 13px; margin: 3px 0 10px; }
.swipe-card .tag { font-size: 15.5px; line-height: 1.4; color: #fff; }
.traits { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.16); border-radius: 20px;
  padding: 5px 11px; font-size: 11px; color: #fff; font-weight: 600; backdrop-filter: blur(4px); }
.stamp { position: absolute; top: 34px; z-index: 3; font-size: 30px; font-weight: 900; font-family: "Quicksand",sans-serif;
  padding: 6px 18px; border-radius: 14px; border: 4px solid; opacity: 0; }
.stamp.like { left: 22px; color: var(--ok); border-color: var(--ok); transform: rotate(-14deg); }
.stamp.nope { right: 22px; color: var(--rose); border-color: var(--rose); transform: rotate(14deg); }

.deck-actions { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 18px; }
.round { width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass);
  font-size: 26px; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px);
  transition: transform .12s; }
.round:active { transform: scale(.9); }
.round:disabled { cursor: wait; opacity: .52; transform: scale(.96); }
.round.like { color: var(--ok); border-color: rgba(78,224,166,.5); }
.round.nope { color: var(--rose); border-color: rgba(255,93,143,.5); }
.round.big { width: 72px; height: 72px; font-size: 32px; }
.empty { text-align: center; color: var(--muted); margin-top: 60px; padding: 0 20px; line-height: 1.6; }
.empty .big { font-size: 46px; display: block; margin-bottom: 12px; }

/* discover: coluna (mobile) / 2 colunas (desktop) */
.discover { display: flex; flex-direction: column; }
.deck-col { display: flex; flex-direction: column; }
.round.info { width: 54px; height: 54px; font-size: 22px; color: var(--violet); border-color: rgba(180,107,255,.5); }

/* painel de perfil */
.persona-panel { display: none; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } }
.pp-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.pp-av { width: 76px; height: 76px; border-radius: 22px; flex: none; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.pp-av .motif { font-size: 40px; }
.pp-id h2 { font-size: 26px; } .pp-id h2 small { color: var(--muted); font-size: 15px; }
.pp-id .nat { color: var(--muted); font-size: 13px; margin: 2px 0 4px; }
.pp-id .tag { font-size: 14px; color: var(--ink); }
.pp-sec { margin-top: 20px; }
.pp-sec h4 { font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--rose); margin-bottom: 10px; }
.pp-sec p { font-size: 14.5px; line-height: 1.6; color: var(--ink); opacity: .92; }
.trait { margin-bottom: 11px; }
.trait-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 5px; text-transform: capitalize; }
.trait-top b { color: var(--ink); }
.bar > i { transform-origin: left; animation: growbar .9s cubic-bezier(.2,.8,.2,1); }
@keyframes growbar { from { transform: scaleX(0); } }

/* sheet mobile (ver perfil) */
.sheet { position: absolute; inset: 0; z-index: 70; background: rgba(15,8,24,.72); backdrop-filter: blur(10px); display: flex; align-items: flex-end; animation: fade .25s; }
.persona-panel.in-sheet { display: block; background: var(--night2); border: 1px solid var(--line); border-radius: 26px 26px 0 0; width: 100%; max-height: 90%; overflow-y: auto; padding: 22px 20px 30px; animation: slideup .32s cubic-bezier(.2,.8,.2,1); }
@keyframes slideup { from { transform: translateY(100%); } }
.sheet-close { display: block; margin: 0 0 14px auto; background: var(--glass); border: 1px solid var(--line); color: var(--ink); padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* efeitos gerais */
.swipe-card[data-top] { animation: cardin .42s cubic-bezier(.2,.8,.2,1); }
.swipe-card[data-top].is-promoted { animation: none; }
@keyframes cardin { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@media (prefers-reduced-motion: reduce) {
  .swipe-card, .swipe-card[data-top], .particle { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.portrait .motif { animation: floaty 4.5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translate(-50%,-50%); } 50% { transform: translate(-50%,-56%); } }
.rel-item { transition: transform .14s, background .15s; }
.rel-item:hover { transform: translateY(-1px); }
.chip-sel { transition: transform .12s, background .15s, border-color .15s; }
.chip-sel:active { transform: scale(.95); }

/* ---- match popup ---- */
.match-pop { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; text-align: center; padding: 34px; background: rgba(15,8,24,.9); backdrop-filter: blur(14px);
  animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.match-pop .big { font-size: 38px; font-weight: 700; font-family: "Quicksand",sans-serif; }
.match-pop .av { width: 132px; height: 132px; border-radius: 50%; overflow: hidden; border: 3px solid var(--rose);
  box-shadow: 0 0 44px rgba(255,93,143,.5); display: flex; align-items: center; justify-content: center; position: relative; }
.match-pop .av .motif { font-size: 74px; position: relative; z-index: 2; }

/* ---- roster (minhas garotas) ---- */
.section-title { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .5px; margin: 18px 4px 10px; text-transform: uppercase; }
.section-title.sm { margin-top: 8px; }
.rel-item { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 18px; background: var(--glass);
  border: 1px solid var(--line); margin-bottom: 10px; cursor: pointer; transition: background .15s; }
.rel-item:active { background: var(--glass-2); }
.rel-item.arch { opacity: .62; }
.avatar { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; flex: none; position: relative;
  display: flex; align-items: center; justify-content: center; }
.avatar .motif { font-size: 30px; position: relative; z-index: 2; }
.avatar.ring { border: 2px solid var(--rose); }
.rel-item .meta { flex: 1; min-width: 0; }
.rel-item .meta h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.rel-item .meta .stage-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--grad-soft); color: var(--ink); }
.rel-item .meta p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.rel-actions { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--glass);
  color: var(--muted); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.slotbar { display: flex; align-items: center; gap: 10px; margin: 6px 4px 4px; }
.slotbar .track { flex: 1; height: 8px; border-radius: 5px; background: var(--glass); overflow: hidden; display: flex; gap: 3px; padding: 0; }
.slotbar .track i { flex: 1; background: var(--line); border-radius: 3px; }
.slotbar .track i.on { background: var(--grad); }

/* ---- chat ---- */
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: rgba(15,8,24,.5); backdrop-filter: blur(10px); }
.chat-head .bk { background: none; border: none; color: var(--ink); font-size: 26px; cursor: pointer; line-height: 1; padding: 0 4px 0 0; }
.chat-head .who h3 { font-size: 16px; font-weight: 700; }
.chat-head .who p { font-size: 11px; color: var(--ok); display: flex; align-items: center; gap: 5px; }
.chat-head .who .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 9px; }
.chat-scroll::-webkit-scrollbar { width: 0; }
.msg { max-width: 80%; min-width: 96px; padding: 10px 13px 7px; border-radius: 18px; font-size: 14px; line-height: 1.48; word-wrap: break-word; animation: pop .2s; }
.msg-copy { white-space: pre-wrap; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; min-height: 13px; margin-top: 4px; font-size: 9.5px; line-height: 1; color: var(--faint); }
.msg.user .msg-meta { color: rgba(255,255,255,.7); }
.msg-receipt { font-size: 10px; letter-spacing: -2px; padding-right: 2px; }
.msg.read .msg-receipt { color: #d9f4ea; }
.msg-day { align-self: center; color: var(--faint); background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 10px; margin: 6px 0 10px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.msg.assistant { align-self: flex-start; background: var(--glass-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 6px 18px rgba(255,93,143,.28); }
.typing { align-self: flex-start; color: var(--muted); font-size: 13px; padding: 4px 10px; }
.chat-input { display: flex; gap: 9px; padding: 12px 14px; border-top: 1px solid var(--line); background: rgba(15,8,24,.5); }
.chat-input input { border-radius: 22px; }
.chat-input button { width: 50px; min-width: 50px; height: 50px; border-radius: 50%; border: none; background: var(--grad);
  color: #fff; font-size: 20px; cursor: pointer; box-shadow: 0 8px 20px rgba(255,93,143,.35); }

/* ---- bottom nav ---- */
.nav { display: flex; border-top: 1px solid var(--line); background: rgba(15,8,24,.7); backdrop-filter: blur(14px); }
.nav button, .nav > a { flex: 1; background: none; border: none; color: var(--faint); padding: 12px 4px 16px; font-size: 10.5px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; transition: color .15s; }
.nav button .ic, .nav > a .ic { font-size: 21px; }
.nav button.active, .nav > a.active { color: var(--rose); }
.nav button.active .ic, .nav > a.active .ic { filter: none; }
.rail-conversations { display: none; }

/* ---- profile / admin ---- */
.card { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 12px; }
.card h3 { margin-bottom: 10px; font-size: 17px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; gap: 10px; }
.kv:last-child { border-bottom: none; }
.kv span:last-child { color: var(--muted); text-align: right; }
.seg { display: flex; gap: 6px; margin-bottom: 14px; background: var(--glass); padding: 5px; border-radius: 14px; border: 1px solid var(--line); }
.seg button { flex: 1; padding: 10px; border-radius: 10px; border: none; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; font-weight: 600; }
.seg button.active { background: var(--grad); color: #fff; }
.row { padding: 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); font-size: 14px; cursor: pointer; margin-bottom: 8px; }
.row small { color: var(--muted); }
.avatar-lg { width: 82px; height: 82px; border-radius: 22px; margin: 0 auto 8px; }
.bar { height: 7px; background: var(--glass); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: var(--grad); }
.toast { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); background: rgba(20,12,34,.96);
  border: 1px solid var(--line); color: var(--ink); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  z-index: 80; box-shadow: var(--shadow); animation: fade .25s; max-width: 88%; text-align: center; }

/* ---- modais ---- */
.modal-back { position: absolute; inset: 0; z-index: 75; background: rgba(10,6,18,.72); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s; }
.modal { width: 100%; max-width: 440px; max-height: 88%; overflow-y: auto; background: var(--night2); border: 1px solid var(--line);
  border-radius: 22px; padding: 20px; box-shadow: var(--shadow); animation: modalin .25s cubic-bezier(.2,.8,.2,1); }
.modal.wide { max-width: 560px; }
.modal::-webkit-scrollbar { width: 0; }
@keyframes modalin { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-h h3 { font-size: 19px; }
.modal-x { background: var(--glass); border: 1px solid var(--line); color: var(--ink); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.modal-a { display: flex; gap: 10px; margin-top: 18px; }
.modal-a .btn { margin: 0; }
.modal.persona-editor-modal {
  width: min(1180px, calc(100vw - 48px)); max-width: 1180px; height: min(860px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px); padding: 0; overflow: hidden; display: flex; flex-direction: column;
}
.persona-editor-modal .modal-h { flex: none; margin: 0; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.persona-editor-modal .modal-b { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.persona-editor-modal .modal-a { flex: none; justify-content: flex-end; margin: 0; padding: 15px 24px; border-top: 1px solid var(--line); background: rgba(21,24,32,.98); }
.persona-editor-modal .modal-a .btn { width: auto; min-width: 150px; padding: 12px 20px; }
.persona-editor { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(350px,.9fr); gap: 28px; }
.persona-editor-column { min-width: 0; }
.editor-section-title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.editor-section-title b { font-family: "Quicksand",sans-serif; font-size: 16px; }
.editor-section-title span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.editor-section-title.compact { margin: 24px 0 12px; }
.editor-field { min-width: 0; }
.editor-field label { margin-top: 12px; }
.editor-grid { display: grid; gap: 10px; }
.editor-grid.three { grid-template-columns: 100px minmax(150px,1fr) minmax(150px,1fr); }
.persona-editor textarea { resize: vertical; min-height: 82px; }
.persona-editor-photo { display: flex; align-items: center; gap: 16px; padding: 14px; margin-bottom: 4px; border: 1px dashed rgba(255,255,255,.16); border-radius: 17px; background: rgba(255,255,255,.025); }
.persona-editor-preview { width: 92px; height: 92px; flex: none; border-radius: 22px; overflow: hidden; display: grid; place-items: center; }
.persona-editor-preview .motif { font-size: 42px; }
.persona-editor-photo > div:nth-child(2) { min-width: 0; }
.persona-editor-photo p { color: var(--muted); font-size: 11px; margin: 3px 0 10px; }
.persona-editor-photo .btn { margin: 0; }
.persona-traits { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.025); }
.persona-traits .trait { margin: 0; }
.slider { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 4px; background: var(--glass); outline: none; margin-top: 6px; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--rose); cursor: pointer; box-shadow: 0 2px 8px rgba(255,93,143,.5); }

/* ---- filterbar ---- */
.filterbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filterbar input { flex: 1; min-width: 140px; padding: 11px 12px; }
.filterbar select { width: auto; padding: 11px 12px; }

/* ---- perfil ---- */
.profile-head { text-align: center; }
.avatar-lg { width: 88px; height: 88px; border-radius: 26px; overflow: hidden; }
.profile-photo { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.profile-photo .avatar-lg { width: 104px !important; height: 104px !important; border-radius: 30px; box-shadow: 0 14px 32px rgba(0,0,0,.28); }
.photo-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  border-radius: 12px; padding: 8px 12px; font: 700 12px "Manrope",sans-serif; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.photo-action:hover { background: var(--glass-2); border-color: rgba(255,111,139,.5); transform: translateY(-1px); }
.photo-action.busy { opacity: .55; cursor: wait; }
.photo-action .camera { font-size: 15px; }
.photo-editor {
  display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 18px;
  border: 1px dashed rgba(255,255,255,.18); background: rgba(255,255,255,.035); border-radius: 18px;
}
.photo-editor-preview { flex: none; cursor: pointer; }
.photo-editor-preview .avatar-lg { width: 96px !important; height: 96px !important; border-radius: 26px; }
.photo-editor-copy { flex: 1; min-width: 0; text-align: left; }
.photo-editor-copy h3 { margin: 0 0 4px; }
.photo-editor-copy p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 11px; }
.photo-upload-btn { margin: 0; }
.profile-edit-actions { display: flex; gap: 10px; }
.profile-edit-actions .btn { margin: 0; }
.profile-identity { margin-top: 25px; }
.profile-identity h3 { margin: 0; }
.field-group, .form-fields { display: block; }
.identity-card {
  display: grid; grid-template-columns: 1fr; gap: 18px; margin: 22px 0 6px; padding: 18px;
  border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025);
}
.identity-card-head { padding-bottom: 2px; }
.identity-card-head h3 { margin: 0 0 4px; font-size: 17px; }
.identity-card-head p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.identity-choice { min-width: 0; border: 0; }
.identity-choice legend {
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .25px; margin-bottom: 9px;
}
.choice-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-card {
  min-height: 40px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.035); color: var(--muted); font: 650 13px "Manrope",sans-serif;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.choice-card:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.choice-card:active { transform: scale(.97); }
.choice-card.on {
  color: var(--ink); border-color: rgba(217,111,131,.72); background: rgba(217,111,131,.13);
  box-shadow: inset 0 0 0 1px rgba(217,111,131,.1);
}
.choice-card:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.choice-custom { flex-basis: 100%; margin-top: 2px; }
.choice-custom input { min-height: 44px; padding: 11px 13px; }
.planpill { display: inline-block; margin-top: 10px; background: var(--grad-soft); border: 1px solid var(--line); color: var(--ink); padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pref-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: flex-start; }
.pref-row:last-child { border-bottom: none; }
.pref-row.col { flex-direction: column; gap: 6px; }
.pref-row .pref-k { color: var(--muted); font-weight: 600; flex: none; }
.pref-row p { color: var(--ink); opacity: .92; line-height: 1.5; }
.chip.on-soft { background: var(--grad-soft); border: 1px solid var(--line); color: var(--ink); display: inline-block; margin: 2px; }

/* ---- planos ---- */
.plans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.plan-card.feat { border-color: var(--rose); box-shadow: 0 12px 30px rgba(255,93,143,.18); }
.plan-card.cur { outline: 2px solid var(--violet); }
.plan-name { font-family: "Quicksand",sans-serif; font-weight: 700; font-size: 18px; }
.plan-price { font-size: 26px; font-weight: 800; } .plan-price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.plan-slots { color: var(--rose); font-weight: 700; font-size: 14px; }
.plan-card .btn { margin-top: auto; }

/* ---- badges ---- */
.navbadge { background: var(--rose); color: #fff; font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; position: absolute; top: 8px; right: 28%; }
.navbadge[hidden] { display: none; }
.nav button, .nav > a { position: relative; text-decoration: none; }
.avatar .unread { position: absolute; top: -5px; right: -5px; background: var(--rose); color: #fff; font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--night2); }
.chat-head .view-prof { margin-left: auto; background: var(--glass); border: 1px solid var(--line); color: var(--teal); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

/* ---- efeitos (match / like / dislike) ---- */
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 66; overflow: hidden; }
.particle { position: absolute; font-size: 24px; will-change: transform, opacity; animation: pburst .95s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes pburst { 0% { transform: translate(-50%,-50%) scale(.4) rotate(0); opacity: 0; } 12% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.05) rotate(var(--r)); opacity: 0; } }
.round { transition: transform .12s cubic-bezier(.3,1.6,.5,1), box-shadow .2s, background .2s; }
.round.like { color: var(--ok); border-color: rgba(47,224,168,.55); }
.round.like:hover { box-shadow: 0 0 26px rgba(47,224,168,.4); background: rgba(47,224,168,.1); }
.round.nope:hover { box-shadow: 0 0 26px rgba(255,111,139,.35); background: rgba(255,111,139,.09); }
.round:active { transform: scale(.82); }
.btn { transition: transform .12s cubic-bezier(.3,1.6,.5,1), box-shadow .2s, filter .2s; }
.btn:hover { filter: brightness(1.05); }
.match-pop .av { animation: heartbeat 1.1s ease-in-out infinite; }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
.match-pop .big { animation: pop-in .5s cubic-bezier(.2,1.5,.4,1); }
@keyframes pop-in { from { transform: scale(.5); opacity: 0; } }
.nav button.active .ic, .nav > a.active .ic { animation: bounce .4s; }
@keyframes bounce { 40% { transform: translateY(-4px); } 70% { transform: translateY(0); } }

/* seletor de idioma refinado */
.langsel { appearance: none; -webkit-appearance: none; background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2393a1c2' d='M6 8L2 4h8z'/%3E%3C/svg%3E") no-repeat right 10px center; background-size: 10px; padding-right: 26px; cursor: pointer; }
.langsel option { background: #14203a; color: var(--ink); }
.help-btn { width: 34px; height: 34px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line); color: var(--teal); font-weight: 800; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.help-btn svg, .chat-head .view-prof svg { display: block; }

/* seletor de idioma segmentado (substitui o select feio) */
.langseg { display: inline-flex; gap: 3px; background: var(--glass); border: 1px solid var(--line); border-radius: 13px; padding: 3px; }
.langseg button { border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .5px; padding: 7px 12px; border-radius: 10px; cursor: pointer; transition: all .15s; font-family: "Quicksand", sans-serif; }
.langseg button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(255,122,92,.3); }
.langseg button:not(.on):hover { color: var(--ink); }

/* autofill do Chrome nao branqueia mais os campos */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 40px #17203a inset; box-shadow: 0 0 0 40px #17203a inset;
  transition: background-color 9999s ease-in-out 0s; }

/* pagina de entrada / onboarding: card mais elegante e centrado */
.center-wrap { max-width: 420px; margin: 0 auto; width: 100%; }
.glass-card { box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.hero .heartlogo { animation: heartbeat 2.4s ease-in-out infinite; }
.guide .g-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.guide .g-row:last-child { border-bottom: none; }
.guide .g-ic { font-size: 26px; flex: none; }
.guide .g-row b { font-size: 15px; } .guide .g-row p { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin-top: 2px; }
.headline { color: var(--teal); font-style: italic; font-size: 14px; margin: 4px 0; }
.auth-story, .rail-user, .page-head { display: none; }
.relationship-grid { display: grid; grid-template-columns: 1fr; }
.profile-actions { display: flex; flex-direction: column; gap: 10px; }
.profile-actions.admin-only .btn { width: 100%; }

/* ============================================================
   Desktop — produto web de verdade, sem alterar a experiencia mobile
   ============================================================ */
@media (min-width: 900px) {
  body { background: var(--night); }
  #app {
    max-width: none; width: 100%; height: 100dvh; margin: 0;
    display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto 1fr;
    background: transparent; backdrop-filter: none;
  }

  /* rail */
  .topbar {
    grid-column: 1; grid-row: 1; flex-direction: column; align-items: stretch; gap: 22px;
    padding: 34px 26px 22px; border-right: 1px solid rgba(255,255,255,.08);
    background: #101218;
  }
  .brand-wrap { gap: 12px; }
  .topbar .brand { font-size: 30px; letter-spacing: -.8px; }
  .topbar .brand .jp { margin-top: 4px; }
  .topbar-tools { display: grid !important; grid-template-columns: 1fr 38px; gap: 9px !important; }
  .topbar-tools .slotpill { justify-content: center; min-height: 38px; background: rgba(255,255,255,.055); }
  .topbar-tools .langseg { grid-column: 1 / -1; width: 100%; }
  .topbar-tools .langseg button { flex: 1; }
  .rail-user {
    display: flex; align-items: center; gap: 11px; padding: 11px;
    border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.075);
    cursor: pointer; transition: background .15s, border-color .15s; color: inherit; text-decoration: none;
  }
  .rail-user:hover, .rail-user.active { background: rgba(255,255,255,.065); border-color: rgba(255,255,255,.13); }
  .rail-user .avatar { width: 40px !important; height: 40px !important; border-radius: 12px; }
  .rail-user > div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
  .rail-user > .ui-icon { margin-left: auto; color: var(--faint); }
  .rail-user b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-user span { color: var(--muted); font-size: 11px; margin-top: 2px; }
  .nav {
    grid-column: 1; grid-row: 2; flex-direction: column; justify-content: flex-start; gap: 7px;
    border-top: none; border-right: 1px solid rgba(255,255,255,.08);
    background: #101218;
    padding: 10px 16px 28px; backdrop-filter: none;
  }
  .nav::before { display: none; }
  .nav button, .nav > a {
    flex: none; min-height: 50px; flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 13px 16px; border-radius: 15px; font-size: 14px;
    transition: background .16s, color .16s, transform .16s;
  }
  .nav button .ic, .nav > a .ic {
    width: 25px; height: 25px; display: grid; place-items: center;
  }
  .nav button:hover, .nav > a:hover { color: var(--ink); background: rgba(255,255,255,.055); transform: translateX(2px); }
  .nav button.active, .nav > a.active {
    color: #fff; background: rgba(255,255,255,.08); box-shadow: inset 2px 0 0 var(--rose);
  }
  .nav button[data-k="profile"], .nav > a[data-k="profile"] { display: none; }
  .nav button[data-k="admin"], .nav > a[data-k="admin"] { margin-top: auto; }
  .rail-conversations {
    display: flex; flex-direction: column; min-height: 0; margin: 8px 0 4px;
  }
  .rail-label {
    color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: 1.35px;
    text-transform: uppercase; padding: 8px 14px 9px;
  }
  .rail-chat-list { display: flex; flex-direction: column; gap: 3px; }
  .rail-chat {
    width: 100%; min-height: 54px !important; display: flex !important; align-items: center;
    gap: 10px !important; padding: 8px 10px !important; border-radius: 12px !important;
    color: var(--muted) !important; background: transparent !important; border: 0;
  }
  .rail-chat:hover { color: var(--ink) !important; background: rgba(255,255,255,.05) !important; transform: none !important; }
  .rail-chat.current { color: var(--ink) !important; background: rgba(255,255,255,.065) !important; }
  .rail-chat-avatar {
    width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
    font-size: 17px; overflow: hidden;
  }
  .rail-chat-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
  .rail-chat-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
  .rail-chat-copy b { min-width: 0; color: var(--ink); font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-presence { flex: none; display: inline-flex; align-items: center; gap: 3px; color: var(--ok); font-size: 8px; font-weight: 700; }
  .rail-presence i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px color-mix(in srgb, var(--ok) 65%, transparent); }
  .rail-chat-copy small { color: var(--faint); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
  .rail-chat.is-typing .rail-chat-copy small { color: var(--rose); font-weight: 700; }
  .rail-unread {
    min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center;
    border-radius: 9px; background: var(--rose); color: #fff; font-size: 9px; font-style: normal;
    font-weight: 800; box-shadow: 0 0 0 2px rgba(12,14,18,.8), 0 4px 12px rgba(223,123,140,.32);
  }
  .rail-empty {
    min-height: 40px !important; padding: 9px 12px !important; color: var(--muted) !important;
    border: 1px dashed var(--line) !important; border-radius: 11px !important; font-size: 11px !important;
  }
  .rail-loading { color: var(--faint); font-size: 11px; padding: 6px 14px; }

  /* conteudo */
  .view {
    grid-column: 2; grid-row: 1 / span 2; overflow-y: auto; padding: 44px clamp(34px,5vw,76px) 56px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
  }
  .view > * { width: 100%; max-width: 1120px; margin-left: auto; margin-right: auto; }
  .page-head { display: block; margin-bottom: 26px; }
  .page-head span {
    display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.8px;
    text-transform: uppercase; margin-bottom: 8px;
  }
  .page-head h1 { font-size: clamp(29px,3vw,40px); letter-spacing: -1.3px; line-height: 1.08; }
  .page-head p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 8px; max-width: 600px; }
  .card, .rel-item, .row, .plan-card, .seg, .filterbar input, .filterbar select {
    border-color: rgba(255,255,255,.095);
  }
  .card { background: rgba(255,255,255,.035); box-shadow: 0 18px 50px rgba(0,0,0,.10); }

  /* descobrir */
  .view.v-discover { display: flex; justify-content: center; padding-top: 34px; }
  .view.v-discover > .discover { max-width: 1180px; margin: auto; }
  .discover { flex-direction: row; gap: clamp(42px,5vw,76px); align-items: center; width: 100%; }
  .deck-col { width: min(390px, 36vw); flex: none; }
  .deck { width: 100%; height: min(66vh, 650px); max-height: 650px; margin: 0; }
  .swipe-card { border-radius: 30px; box-shadow: 0 32px 80px rgba(0,0,0,.48); }
  .persona-panel {
    display: block; flex: 1; align-self: center; max-height: 78vh; overflow-y: auto;
    padding: 24px 4px 24px 0;
  }
  .persona-panel::-webkit-scrollbar { width: 0; }
  .pp-head { gap: 18px; margin-bottom: 16px; }
  .pp-av { width: 88px; height: 88px; border-radius: 25px; }
  .pp-id h2 { font-size: 30px; }
  .pp-sec { margin-top: 24px; }
  .round.info { display: none; }
  .round:hover { transform: translateY(-3px) scale(1.05); }

  /* conversas */
  .v-matches .slotbar {
    padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08); margin-bottom: 24px;
  }
  .relationship-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .relationship-grid .rel-item { margin: 0; min-height: 92px; padding: 16px; background: rgba(255,255,255,.05); }
  .relationship-grid .rel-item:hover { background: rgba(255,255,255,.075); transform: translateY(-2px); }
  .relationship-grid .avatar { width: 60px; height: 60px; border-radius: 18px; }
  .v-matches .section-title { margin-top: 24px; }

  /* perfil */
  .view.v-profile {
    max-width: none; display: grid; grid-template-columns: minmax(250px,.72fr) minmax(430px,1.55fr);
    gap: 16px 22px; align-content: start;
  }
  .v-profile > * { max-width: none; margin: 0; }
  .v-profile .page-head { grid-column: 1 / -1; }
  .profile-overview { grid-column: 1; grid-row: 2; padding: 26px 20px; }
  .profile-overview .profile-photo { position: relative; }
  .profile-overview .photo-action {
    position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
    width: max-content; background: rgba(18,25,43,.95); box-shadow: 0 8px 22px rgba(0,0,0,.3);
  }
  .profile-overview .photo-action:hover { transform: translateX(-50%) translateY(-1px); }
  .profile-overview .profile-photo + h3 { margin-top: 25px !important; }
  .profile-preferences { grid-column: 2; grid-row: 2 / span 3; padding: 24px; }
  .profile-connections { grid-column: 1; grid-row: 3; }
  .profile-actions { grid-column: 1; grid-row: 4; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .profile-actions .btn:first-child { grid-column: 1 / -1; }
  .profile-actions.admin-only .btn { grid-column: 1 / -1; }
  .pref-row { padding: 13px 0; }
  .view.v-profile.editing { display: flex; flex-direction: column; max-width: none; }
  .v-profile.editing > * { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }
  .v-profile.editing .profile-edit-card { padding: 26px; }
  .v-profile.editing .profile-edit-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .v-profile.editing .identity-card { grid-template-columns: 1fr 1fr; padding: 20px; gap: 20px 24px; }
  .v-profile.editing .identity-card-head, .v-profile.editing .identity-country { grid-column: 1 / -1; }

  /* planos */
  .plans-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
  .plan-card { min-height: 260px; padding: 24px 18px; border-radius: 22px; }
  .plan-card.feat { transform: translateY(-8px); }
  .plan-price { font-size: 32px; margin: 8px 0; }

  /* admin */
  .v-admin .seg { padding: 6px; border-radius: 16px; margin-bottom: 16px; }
  .v-admin .seg button { padding: 12px; }
  .v-admin .row { padding: 16px; border-radius: 17px; background: rgba(255,255,255,.05); }

  /* chat */
  .topbar.hidden, .nav.hidden { display: flex !important; }
  .view.v-chat { padding: 24px clamp(24px,3.2vw,56px) !important; }
  .chat-head, .chat-scroll, .chat-input { max-width: 1180px; margin-left: auto; margin-right: auto; width: 100%; }
  .chat-head { padding: 15px 20px; border-radius: 20px 20px 0 0; border: 1px solid var(--line); background: rgba(21,24,32,.94); }
  .chat-scroll { border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding: clamp(28px,4vw,52px); background: rgba(7,11,21,.26); }
  .chat-input { border: 1px solid var(--line); border-radius: 0 0 20px 20px; padding: 15px 20px; background: rgba(21,24,32,.94); }
  .msg { max-width: min(62%, 680px); }

  .match-pop { justify-content: center; }
  .match-pop .big, .match-pop h2 { text-align: center; }
  .match-pop .btn { max-width: 360px; }

  /* login e onboarding */
  #app.noshell { display: block; max-width: none; overflow-y: auto; }
  #app.noshell .view {
    display: flex; min-height: 100dvh; padding: 44px clamp(50px,7vw,110px); overflow: visible;
  }
  #app.noshell .center-wrap {
    max-width: 1180px; min-height: min(760px, calc(100dvh - 88px)); margin: auto;
    display: grid; grid-template-columns: minmax(0,1.06fr) minmax(390px,.78fr);
    grid-template-rows: auto 1fr auto; column-gap: clamp(64px,8vw,118px); align-items: center;
    position: relative; padding: 42px 0 18px;
  }
  #app.noshell .topright { position: absolute; top: 0; right: 0; z-index: 2; }
  #app.noshell .hero { grid-column: 1; grid-row: 1; align-self: end; text-align: left; margin: 0 0 30px; }
  #app.noshell .hero .heartlogo { width: 78px; height: 78px; margin: 0 0 20px; }
  #app.noshell .hero h1 { font-size: clamp(62px,6vw,86px); letter-spacing: -3px; }
  #app.noshell .hero .jp { font-size: 15px; margin-top: 10px; letter-spacing: 9px; }
  #app.noshell .hero p { font-size: 18px; margin-top: 20px; max-width: 430px; line-height: 1.55; }
  #app.noshell .auth-story { display: block; grid-column: 1; grid-row: 2; align-self: start; max-width: 560px; }
  .auth-kicker {
    color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: 1.7px;
    text-transform: uppercase; margin-bottom: 13px;
  }
  .auth-story h2 { font-size: clamp(31px,3vw,44px); line-height: 1.12; letter-spacing: -1.4px; max-width: 520px; }
  .auth-story > p { color: var(--muted); font-size: 16px; line-height: 1.7; margin-top: 16px; max-width: 510px; }
  .auth-points { display: grid; gap: 12px; margin-top: 26px; }
  .auth-points span { display: flex; align-items: center; gap: 11px; color: #cbd5e8; font-size: 13px; font-weight: 600; }
  .auth-points i { color: var(--teal); font-style: normal; }
  #app.noshell .glass-card {
    grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 100%; padding: 28px;
    border-radius: 26px; background: linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.035));
    box-shadow: 0 32px 90px rgba(0,0,0,.46); border-color: rgba(255,255,255,.13);
  }
  #app.noshell .disclosure { grid-column: 2; grid-row: 3; align-self: start; margin-top: 18px; }
  #app.noshell .glass-card .btn { min-height: 50px; }
  #app.noshell .glass-card input { min-height: 52px; }
  #app.noshell .steps { grid-column: 2; grid-row: 1; align-self: start; margin: 0 0 18px; }
  #app.noshell .steps + .glass-card { grid-row: 2; }
  #app.noshell .steps ~ div[style*="display:flex"] { grid-column: 2; grid-row: 3; }
}

@media (max-width: 520px) {
  .photo-editor { align-items: flex-start; }
  .photo-editor-preview .avatar-lg { width: 78px !important; height: 78px !important; border-radius: 22px; }
  .persona-editor-photo { align-items: flex-start; }
  .persona-editor-preview { width: 76px; height: 76px; border-radius: 19px; }
  .persona-editor-modal .modal-a .btn { min-width: 0; flex: 1; }
}

@media (max-width: 899px) {
  .persona-editor-modal { width: 100%; height: min(94dvh, 900px); max-height: 94dvh; border-radius: 20px; }
  .persona-editor-modal .modal-h { padding: 16px 18px; }
  .persona-editor-modal .modal-b { padding: 16px 18px; }
  .persona-editor-modal .modal-a { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .persona-editor { grid-template-columns: 1fr; gap: 26px; }
  .editor-grid.three { grid-template-columns: 88px minmax(0,1fr); }
  .editor-grid.three .editor-field:last-child { grid-column: 1 / -1; }
  .persona-traits { grid-template-columns: 1fr; }
}

@media (min-width: 900px) and (max-width: 1120px) {
  #app { grid-template-columns: 238px minmax(0,1fr); }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .nav { padding-left: 12px; padding-right: 12px; }
  .discover { gap: 34px; }
  .deck-col { width: 340px; }
  .relationship-grid { grid-template-columns: 1fr; }
  .view.v-profile { grid-template-columns: 1fr; }
  .v-profile .page-head, .profile-overview, .profile-preferences, .profile-connections, .profile-actions {
    grid-column: 1; grid-row: auto;
  }
  #app.noshell .center-wrap { column-gap: 56px; grid-template-columns: minmax(0,1fr) minmax(370px,.85fr); }
}
