/* Simos Camp — accounts UI: login screen (lg-), avatar creator (cr-), profile panel (pf-), dev fallbacks (acct-fb-).
 * Builds on the tokens & primitives in css/base.css. Mobile-first (≥ 360 px), 44 px touch targets, safe-area aware.
 */

/* =====================================================================================================
 * LOGIN — a beach-themed overlay over the live camp
 * ===================================================================================================== */
.lg-host { position: absolute; inset: 0; pointer-events: none; }
.lg-root {
  position: absolute; inset: 0; pointer-events: auto; overflow: hidden; color: var(--ink); font-family: var(--font);
  animation: lg-in .7s var(--ease-soft) both;
}
.lg-root.lg-out { animation: lg-out .45s var(--ease-soft) forwards; pointer-events: none; }
@keyframes lg-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lg-out { to { opacity: 0; transform: scale(1.03); } }

.lg-tint {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 42%, rgba(255, 250, 235, 0) 40%, rgba(20, 70, 110, .28) 100%),
    linear-gradient(180deg, rgba(134, 230, 220, .72) 0%, rgba(160, 236, 240, .28) 26%, rgba(46, 196, 198, 0) 48%, rgba(37, 150, 194, .12) 72%, rgba(28, 106, 156, .55) 100%);
}
/* drifting clouds & gulls (pure CSS, cheap) */
.lg-cloud {
  position: absolute; left: -30%; width: 120px; height: 34px; border-radius: 999px; background: rgba(255, 255, 255, .88); pointer-events: none;
  box-shadow: 26px -14px 0 4px rgba(255, 255, 255, .88), 58px -4px 0 0 rgba(255, 255, 255, .88);
  animation: lg-drift 70s linear infinite; filter: drop-shadow(0 6px 8px rgba(30, 90, 120, .12));
}
.lg-cloud.c1 { top: 7%; animation-duration: 80s; animation-delay: -12s; }
.lg-cloud.c2 { top: 19%; transform: scale(.7); animation-duration: 105s; animation-delay: -60s; opacity: .8; }
.lg-cloud.c3 { top: 3%; transform: scale(.55); animation-duration: 120s; animation-delay: -95s; opacity: .7; }
@keyframes lg-drift { from { left: -30%; } to { left: 115%; } }
.lg-gulls { position: absolute; top: 13%; left: -10%; width: 90px; height: 40px; pointer-events: none; animation: lg-gulls 38s linear infinite; animation-delay: -8s; }
.lg-gulls i { position: absolute; width: 16px; height: 7px; border: 2.5px solid rgba(74, 59, 51, .55); border-color: rgba(74, 59, 51, .55) transparent transparent transparent; border-radius: 50% 50% 0 0; animation: lg-flap .6s ease-in-out infinite alternate; }
.lg-gulls i:nth-child(1) { left: 0; top: 12px; }
.lg-gulls i:nth-child(2) { left: 26px; top: 0; transform: scale(.8); animation-delay: -.2s; }
.lg-gulls i:nth-child(3) { left: 50px; top: 18px; transform: scale(.65); animation-delay: -.4s; }
@keyframes lg-gulls { from { transform: translate(0, 0); } 50% { transform: translate(60vw, -18px); } to { transform: translate(125vw, 6px); } }
@keyframes lg-flap { from { height: 7px; margin-top: 0; } to { height: 3px; margin-top: 3px; } }

.lg-scroll {
  position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-top) + 14px) 14px calc(var(--safe-bottom) + 64px);
}
.lg-brand { position: relative; text-align: center; margin: 4px 0 14px; }
.lg-sun {
  position: absolute; width: 74px; height: 74px; right: -30px; top: -8px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff6cf, #ffd75e 58%, #ffb347); box-shadow: 0 0 0 9px rgba(255, 215, 94, .28), 0 0 36px rgba(255, 190, 80, .7);
  animation: sc-bob 3.2s ease-in-out infinite;
}
.lg-sun i { position: absolute; inset: -22px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 215, 94, .45) 0 7deg, transparent 7deg 22deg); animation: lg-spin 24s linear infinite; z-index: -1;
  -webkit-mask: radial-gradient(circle, transparent 40%, #000 42%, #000 62%, transparent 72%); mask: radial-gradient(circle, transparent 40%, #000 42%, #000 62%, transparent 72%); }
@keyframes lg-spin { to { transform: rotate(360deg); } }
.lg-sun { z-index: 0; }
.lg-logo { position: relative; z-index: 1; margin: 0; font-size: clamp(46px, 13vw, 76px); font-weight: 700; line-height: .95; letter-spacing: 1px; white-space: nowrap; }
.lg-logo .lg-w1, .lg-logo .lg-w2 { display: inline-block; }
.lg-logo .lg-w2 { margin-left: .22em; }
.lg-ch { display: inline-block; animation: lg-letter 3.6s ease-in-out infinite; }
.lg-w1 .lg-ch { color: #fff; text-shadow: 0 3px 0 #1d8fa3, 0 6px 0 #146d80, 0 12px 18px rgba(12, 60, 90, .35); }
.lg-w2 .lg-ch { color: #ffd75e; text-shadow: 0 3px 0 #e8892b, 0 6px 0 #b8611c, 0 12px 18px rgba(12, 60, 90, .35); }
@keyframes lg-letter { 0%, 70%, 100% { transform: translateY(0) rotate(0); } 80% { transform: translateY(-8px) rotate(-3deg); } 90% { transform: translateY(0) rotate(2deg); } }
.lg-sign {
  display: inline-block; margin-top: 12px; padding: 6px 18px; border-radius: 10px; position: relative; transform: rotate(-2deg);
  background: var(--wood-grain), linear-gradient(180deg, var(--wood-light), var(--wood)); border: 3px solid var(--wood-dark);
  box-shadow: 0 4px 0 var(--wood-deep), 0 10px 16px rgba(30, 50, 64, .2); color: #fff; font-weight: 600; font-size: 16px; text-shadow: 0 2px 0 rgba(122, 81, 50, .55);
}
.lg-sign::before, .lg-sign::after { content: ''; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #8a6040; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.lg-sign::before { left: 7px; } .lg-sign::after { right: 7px; }

.lg-card {
  width: min(460px, 100%); padding: 16px 14px 14px; position: relative;
  animation: lg-card-in .55s var(--ease-spring) both; animation-delay: .1s;
}
@keyframes lg-card-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.lg-head { text-align: center; margin-bottom: 10px; }
.lg-h { margin: 0; font-size: 22px; font-weight: 700; }
.lg-sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.lg-text { text-align: center; color: var(--ink-soft); margin: 8px 4px 0; }
.lg-search { margin-bottom: 10px; }
.lg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.lg-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 9px 4px 8px;
  border-radius: 18px; border: 3px solid var(--sand-dark); background: var(--paper); color: var(--ink); cursor: pointer; font-family: var(--font);
  box-shadow: 0 3px 0 var(--sand-deep); animation: lg-tile-in .45s var(--ease-spring) both; transition: transform .15s var(--ease-spring), border-color .15s, box-shadow .15s;
}
.lg-tile:hover { transform: translateY(-2px); border-color: var(--turq); }
.lg-tile:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sand-deep); }
.lg-tile:focus-visible { outline: 3px solid var(--turq); outline-offset: 2px; }
.lg-tile:disabled { opacity: .7; }
@keyframes lg-tile-in { from { opacity: 0; transform: translateY(10px) scale(.9); } to { opacity: 1; transform: none; } }
.lg-face {
  display: block; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex: none;
  background: linear-gradient(180deg, #bff3ec, #86e6dc); border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .1), 0 0 0 2px var(--sand-dark);
  animation: lg-bob 3s ease-in-out infinite;
}
.lg-face canvas { display: block; width: 100% !important; height: 100% !important; }
.lg-face.big { width: 104px; height: 104px; margin: 0 auto 8px; }
@keyframes lg-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.lg-name { max-width: 100%; padding: 0 4px; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-lock { position: absolute; top: 5px; right: 6px; font-size: 13px; filter: drop-shadow(0 1px 0 #fff); }
.lg-flag { position: absolute; top: 7px; left: 7px; display: flex; line-height: 0; pointer-events: none; }
.lg-cake { position: absolute; top: 56px; right: 10px; font-size: 18px; line-height: 1; pointer-events: none; animation: lg-bob 1.6s ease-in-out infinite; filter: drop-shadow(0 1px 0 #fff); }
.lg-demo-grid .lg-cake { top: 46px; font-size: 16px; }
.lg-divider { display: flex; align-items: center; gap: 8px; margin: 14px 2px 10px; color: var(--ink-faint); font-size: 12.5px; font-weight: 600; }
.lg-divider::before, .lg-divider::after { content: ''; flex: 1; border-top: 2px dashed var(--sand-dark); }
.lg-demo-grid .lg-face { width: 60px; height: 60px; }
.lg-demo-grid .lg-name { font-size: 13.5px; }
.lg-actions { display: flex; justify-content: center; margin-top: 14px; }
.lg-actions .sc-btn { min-width: 70%; }
.lg-new { font-size: 17px; }
.lg-note { text-align: center; font-weight: 600; font-size: 14.5px; padding: 8px 10px; margin-bottom: 10px; border-radius: 14px; background: rgba(46, 196, 198, .16); border: 2px solid rgba(46, 196, 198, .45); }
.lg-note.soft { font-weight: 500; font-size: 13px; background: rgba(255, 215, 94, .18); border-color: rgba(205, 176, 122, .7); margin: 2px 0 0; }
.lg-back {
  position: absolute; left: 10px; top: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-soft); font: 600 15px var(--font); cursor: pointer;
}
.lg-back:hover { background: rgba(0, 0, 0, .05); }
.lg-hello { text-align: center; margin: 14px 0 12px; }
.lg-form { display: flex; flex-direction: column; gap: 7px; }
.lg-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.lg-label i { font-style: normal; font-weight: 500; color: var(--ink-faint); margin-right: auto; }
.lg-count { font-weight: 500; font-size: 12.5px; color: var(--ink-faint); }
.lg-nick { font-size: 19px; font-weight: 600; }
.lg-bad { border-color: var(--red) !important; }
.lg-pwwrap { position: relative; }
.lg-pwwrap .sc-input { padding-right: 50px; }
.lg-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 38px; border: 0; background: transparent; font-size: 18px; cursor: pointer; border-radius: 10px; }
.lg-err { min-height: 18px; color: var(--red-dark); font-size: 13.5px; font-weight: 500; }
.lg-hint { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }
.lg-demo { font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); padding: 8px 10px; border-radius: 12px; background: rgba(255, 215, 94, .16); border: 2px dashed var(--sand-deep); }
.lg-row { display: flex; gap: 8px; margin-top: 6px; }
.lg-row .sc-btn { flex: 1; padding-left: 8px; padding-right: 8px; }
.lg-form > .sc-btn { margin-top: 6px; }
.lg-busy { animation: lg-busy .9s ease-in-out infinite; }
@keyframes lg-busy { 50% { opacity: .65; } }
.lg-shake { animation: lg-shake .42s ease; }
@keyframes lg-shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.lg-full-art { display: flex; justify-content: center; gap: 6px; font-size: 40px; margin: 8px 0 6px; }
.lg-full-art span { animation: lg-bob 2.4s ease-in-out infinite; }
.lg-full-art span:nth-child(2) { animation-delay: -.8s; font-size: 48px; }
.lg-full-art span:nth-child(3) { animation-delay: -1.6s; }
.lg-v-full { text-align: center; }
.lg-foot {
  margin-top: 12px; padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: #fff;
  background: rgba(28, 106, 156, .42); text-shadow: 0 1px 0 rgba(0, 0, 0, .25); white-space: nowrap;
}
.lg-waves { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; pointer-events: none; overflow: hidden; }
.lg-waves i { position: absolute; left: -60px; right: -60px; bottom: 0; height: 100%; background-repeat: repeat-x; animation: lg-wave 7s ease-in-out infinite alternate; }
.lg-waves .w1 { background-image: radial-gradient(40px 18px at 40px 0, transparent 97%, rgba(46, 196, 198, .55) 100%); background-size: 80px 46px; bottom: -6px; opacity: .8; }
.lg-waves .w2 { background-image: radial-gradient(40px 16px at 40px 0, transparent 97%, rgba(255, 255, 255, .5) 100%); background-size: 80px 40px; bottom: -14px; animation-duration: 5s; animation-delay: -2s; }
@keyframes lg-wave { from { transform: translateX(0); } to { transform: translateX(-40px); } }

@media (min-width: 700px) {
  .lg-scroll { padding-top: calc(var(--safe-top) + 40px); }
  .lg-card { padding: 20px 20px 18px; }
  .lg-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
  .lg-sun { right: -56px; }
}
@media (max-width: 370px) {
  .lg-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .lg-face { width: 62px; height: 62px; }
}

/* =====================================================================================================
 * CREATOR — full-screen editor
 * ===================================================================================================== */
.cr-root {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; overflow: hidden; pointer-events: auto;
  background: var(--panel-bg); color: var(--ink); font-family: var(--font); animation: cr-in .35s var(--ease-soft) both;
}
@keyframes cr-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* top bar */
.cr-top {
  flex: none; display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-top) + 8px) 10px 8px; color: #fff;
  background: var(--wood-grain), linear-gradient(180deg, var(--wood-light), var(--wood)); border-bottom: 4px solid var(--wood-dark);
  box-shadow: 0 3px 0 rgba(122, 81, 50, .25); text-shadow: 0 2px 0 rgba(122, 81, 50, .55); position: relative; z-index: 2;
}
.cr-top-b {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 42px; height: 42px; padding: 0 12px;
  border-radius: 999px; border: 2px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer;
  font: 600 15px var(--font); text-shadow: inherit; transition: transform .12s var(--ease-spring), background .15s;
}
.cr-top-b:hover { background: rgba(255, 255, 255, .28); }
.cr-top-b:active { transform: translateY(2px); }
.cr-top-b:disabled { opacity: .4; pointer-events: none; }
.cr-undo { font-size: 20px; padding: 0; width: 42px; }
.cr-random { background: linear-gradient(180deg, #ffe690, #ffd75e); border-color: #d9a93a; color: #5a4221; text-shadow: none; box-shadow: 0 3px 0 #b98a2a; }
.cr-random:hover { background: linear-gradient(180deg, #fff0b0, #ffdf78); }
.cr-dice { display: inline-block; font-size: 18px; }
.cr-roll .cr-dice { animation: cr-roll .6s var(--ease-spring); }
@keyframes cr-roll { from { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.3); } to { transform: rotate(360deg) scale(1); } }
.cr-title { flex: 1; min-width: 0; text-align: center; line-height: 1.1; }
.cr-title b { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-title small { display: block; font-size: 11.5px; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cr-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* live preview stage */
.cr-stage { position: relative; flex: none; height: clamp(208px, 35vh, 330px); overflow: hidden; background: #bdefff; transition: background .5s; }
.cr-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #a9e6ff 0%, #d8f6ff 55%, #eafcff 100%); transition: opacity .5s; }
.cr-sun { position: absolute; width: 46px; height: 46px; right: 16%; top: 12%; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fff6cf, #ffd75e 60%, #ffb347);
  box-shadow: 0 0 0 7px rgba(255, 215, 94, .25), 0 0 26px rgba(255, 190, 80, .6); transition: all .5s; }
.cr-cloud { position: absolute; width: 70px; height: 20px; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 16px -9px 0 2px rgba(255, 255, 255, .92), 36px -2px 0 0 rgba(255, 255, 255, .92);
  animation: cr-cloud 40s linear infinite; }
.cr-cloud.a { top: 16%; left: 6%; }
.cr-cloud.b { top: 30%; left: 60%; transform: scale(.7); animation-duration: 55s; animation-delay: -20s; }
@keyframes cr-cloud { from { margin-left: -30%; } to { margin-left: 70%; } }
.cr-lights { position: absolute; left: -5%; right: -5%; top: 8%; height: 40px; opacity: 0; transition: opacity .5s;
  background: radial-gradient(circle at 20px 22px, #ffe07a 0 4px, rgba(255, 224, 122, .35) 5px 9px, transparent 10px) 0 0 / 40px 40px repeat-x;
  border-top: 2px solid rgba(40, 30, 20, .35); border-radius: 0 0 50% 50% / 0 0 18px 18px; }
.cr-sea { position: absolute; left: 0; right: 0; top: 50%; height: 20%;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0) 0 7px, rgba(255, 255, 255, .22) 7px 9px), linear-gradient(180deg, #2596c2, #3fc6d2 60%, #86e6dc);
  transition: filter .5s; }
.cr-sand { position: absolute; left: -10%; right: -10%; bottom: 0; top: 64%; border-radius: 50% 50% 0 0 / 22px 22px 0 0;
  background: radial-gradient(60% 50% at 50% 70%, #fff6de, rgba(255, 246, 222, 0) 70%), linear-gradient(180deg, #f8ebcd, #efd9ab); box-shadow: 0 -4px 0 rgba(255, 255, 255, .6); transition: filter .5s; }
.cr-cvbox { position: absolute; inset: 0; }
.cr-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.cr-obar { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.cr-ob {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .55); font-size: 19px; cursor: pointer;
  box-shadow: 0 2px 0 rgba(30, 50, 64, .15); transition: transform .15s var(--ease-spring), background .15s;
}
.cr-ob.on { background: #fff; border-color: var(--turq); box-shadow: 0 0 0 3px rgba(46, 196, 198, .45), 0 2px 0 rgba(30, 50, 64, .15); transform: scale(1.08); }
.cr-turn { position: absolute; right: 10px; bottom: 10px; z-index: 1; width: 46px; height: 46px; font-size: 20px; }
.cr-namepill {
  position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); max-width: 60%; padding: 3px 14px; border-radius: 999px; z-index: 1;
  background: rgba(255, 250, 240, .94); border: 2px solid #cdb07a; color: #4a3b33; font-weight: 700; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 0 rgba(122, 81, 50, .2);
}
/* stage moods per outfit */
.cr-stage.o-swim .cr-sea { top: 44%; height: 28%; }
.cr-stage.o-swim .cr-sand { top: 70%; }
.cr-stage.o-party .cr-sky { background: linear-gradient(180deg, #2f2560 0%, #5b3f95 60%, #8a5fb8 100%); }
.cr-stage.o-party .cr-sun { background: radial-gradient(circle at 60% 40%, #fffbe8, #f3ecd0 70%); box-shadow: 0 0 22px rgba(255, 250, 220, .5); width: 34px; height: 34px; }
.cr-stage.o-party .cr-lights { opacity: 1; animation: cr-twinkle 1.6s ease-in-out infinite alternate; }
.cr-stage.o-party .cr-cloud, .cr-stage.o-pajamas .cr-cloud { opacity: .15; }
.cr-stage.o-party .cr-sea { filter: brightness(.55) saturate(1.2) hue-rotate(20deg); }
.cr-stage.o-party .cr-sand { filter: brightness(.78) sepia(.2) hue-rotate(-10deg); background: repeating-linear-gradient(90deg, #c98f5a 0 26px, #b97f4c 26px 28px); }
.cr-stage.o-pajamas .cr-sky { background: radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 35%, #fff, transparent), radial-gradient(2px 2px at 48% 14%, #fff, transparent),
  radial-gradient(1.5px 1.5px at 66% 30%, #fff, transparent), radial-gradient(2px 2px at 86% 22%, #fff, transparent), radial-gradient(1.5px 1.5px at 76% 44%, #fff, transparent),
  linear-gradient(180deg, #182552 0%, #2d3f7c 70%, #3f559a 100%); }
.cr-stage.o-pajamas .cr-sun { background: radial-gradient(circle at 65% 35%, #fffbe8, #ece2bf 70%); box-shadow: 0 0 24px rgba(255, 250, 220, .55); width: 34px; height: 34px; right: 22%; }
.cr-stage.o-pajamas .cr-sea { filter: brightness(.45) saturate(.9); }
.cr-stage.o-pajamas .cr-sand { filter: brightness(.62) saturate(.8); }
@keyframes cr-twinkle { from { filter: brightness(.85); } to { filter: brightness(1.2); } }

/* editor column */
.cr-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--panel-bg); border-top: 3px solid var(--sand-dark); }
.cr-tabs {
  flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; background: var(--sand); border-bottom: 2px solid var(--sand-dark);
  scrollbar-width: none; touch-action: pan-x; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.cr-tabs::-webkit-scrollbar { display: none; }
.cr-tab {
  flex: none; display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--sand-dark); background: var(--paper); color: var(--ink); font: 600 14px var(--font); transition: transform .12s var(--ease-spring), background .15s;
}
.cr-tab-i { font-size: 17px; }
.cr-tab.on { background: var(--turq); border-color: var(--turq-dark); color: #fff; box-shadow: 0 3px 0 #157186; text-shadow: 0 1px 0 rgba(21, 113, 134, .6); }
.cr-tab:active { transform: translateY(2px); }
.cr-pane { flex: 1; min-height: 0; padding: 12px 12px 18px; animation: cr-pane .25s var(--ease-soft); }
@keyframes cr-pane { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cr-sec { margin-bottom: 12px; padding: 10px 12px 12px; border-radius: 18px; background: var(--paper); border: 2px solid var(--sand-dark); }
.cr-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 30px; }
.cr-sec-t { margin: 0; font-size: 15.5px; font-weight: 700; }
.cr-count { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.cr-hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.35; }
.cr-hint.center { text-align: center; margin: 2px 0 10px; }
.cr-msg { min-height: 18px; margin-top: 5px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.cr-msg.ok { color: var(--green-dark); }
.cr-msg.bad { color: var(--red-dark); }
.cr-bad { border-color: var(--red) !important; }
.cr-intro {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border-radius: 16px; font-size: 14px; line-height: 1.35;
  background: linear-gradient(135deg, rgba(255, 215, 94, .32), rgba(134, 230, 220, .32)); border: 2px solid rgba(205, 176, 122, .55);
}
.cr-intro-i { font-size: 30px; animation: sc-bob 2.6s ease-in-out infinite; }
.cr-name { font-size: 20px; font-weight: 600; }

/* height slider */
.cr-height { display: flex; align-items: center; gap: 10px; }
.cr-hend { font-size: 22px; }
.cr-range { flex: 1; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; --p: 50%; }
.cr-range::-webkit-slider-runnable-track { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--turq) var(--p), var(--sand-dark) var(--p)); }
.cr-range::-moz-range-track { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--turq) var(--p), var(--sand-dark) var(--p)); }
.cr-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -9px; border-radius: 50%; background: #fff; border: 4px solid var(--turq-dark); box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.cr-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--turq-dark); }
.cr-hlabel { text-align: center; font-weight: 700; color: var(--turq-dark); font-size: 14px; }

/* privacy toggles */
.cr-lock {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--sand-dark); background: var(--sand-light); color: var(--ink-soft); font: 600 12.5px var(--font); transition: background .15s, transform .12s var(--ease-spring);
}
.cr-lock:active { transform: scale(.95); }
.cr-lock.on { background: linear-gradient(180deg, #8b6fd8, #7556c8); border-color: #5b40a8; color: #fff; box-shadow: 0 2px 0 #4a338c; }
.cr-lock-i { font-size: 14px; }
.cr-privrow {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding: 6px 6px 6px 12px; border-radius: 14px;
  background: rgba(165, 139, 255, .12); border: 2px dashed rgba(165, 139, 255, .5); font-size: 13px; color: var(--ink-soft); font-weight: 500;
}
.cr-privlist { display: flex; flex-direction: column; margin-top: 6px; }
.cr-privline { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed var(--sand-dark); }
.cr-privline:last-child { border-bottom: 0; }
.cr-privname { font-weight: 600; font-size: 14px; }
.cr-cardprev { padding: 10px; border-radius: 14px; background: var(--sand-light); border: 2px solid var(--sand-dark); }

/* color swatches */
.cr-swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.cr-sw {
  position: relative; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; background: var(--sw, #ccc);
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--sand-dark), 0 2px 0 2px rgba(0, 0, 0, .06); transition: transform .15s var(--ease-spring), box-shadow .15s;
}
.cr-sw:hover { transform: scale(1.06); }
.cr-sw.on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--turq-dark), 0 3px 6px rgba(0, 0, 0, .15); }
.cr-sw.on::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; text-shadow: 0 0 3px rgba(0, 0, 0, .7), 0 1px 1px rgba(0, 0, 0, .6); }

/* option grids with painted previews */
.cr-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.cr-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 6px 3px 6px; border-radius: 15px; cursor: pointer;
  border: 2px solid var(--sand-dark); background: var(--sand-light); color: var(--ink); font-family: var(--font); transition: transform .15s var(--ease-spring), border-color .15s, background .15s;
}
.cr-opt:hover { border-color: var(--turq); }
.cr-opt:active { transform: scale(.96); }
.cr-opt-img { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #e4faf7, #bdefe8); }
.cr-opts.body .cr-opt-img { width: 60px; height: 80px; background: linear-gradient(180deg, #e4faf7 0%, #d2f4ef 70%, #f6e7c6 70%, #efd9ab 100%); }
.cr-opt canvas { display: block; opacity: 0; transform: scale(.94); transition: opacity .25s, transform .25s var(--ease-spring); }
.cr-opt canvas.cr-ready { opacity: 1; transform: none; }
.cr-opt-l { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cr-opt.on { border-color: var(--turq-dark); background: rgba(46, 196, 198, .16); box-shadow: 0 0 0 2px var(--turq) inset; }
.cr-opt.on::after { content: '✓'; position: absolute; top: 3px; right: 4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--turq); color: #fff; font-size: 12px; font-weight: 700; }

/* outfit kinds */
.cr-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 4px; }
.cr-seg-b {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 54px; padding: 5px 2px; border-radius: 15px; cursor: pointer;
  border: 2px solid var(--sand-dark); background: var(--paper); color: var(--ink); font: 600 12.5px var(--font);
}
.cr-seg-i { font-size: 22px; }
.cr-seg-b.on { background: var(--turq); border-color: var(--turq-dark); color: #fff; box-shadow: 0 3px 0 #157186; }

/* personality */
.cr-tools { display: flex; align-items: center; gap: 6px; margin: 8px 0 12px; }
.cr-mini { min-height: 34px; }
.cr-traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 8px; }
.cr-trait {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 58px; border-radius: 15px; cursor: pointer; text-align: left;
  border: 2px solid var(--sand-dark); background: var(--sand-light); color: var(--ink); font-family: var(--font); transition: transform .15s var(--ease-spring), background .15s, border-color .15s;
}
.cr-trait:active { transform: scale(.98); }
.cr-trait-i { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 21px; background: var(--sand); transition: transform .25s var(--ease-spring); }
.cr-trait-txt { flex: 1; min-width: 0; }
.cr-trait-txt b { display: block; font-size: 14.5px; }
.cr-trait-txt small { display: block; font-size: 12px; line-height: 1.25; color: var(--ink-soft); }
.cr-trait-tick { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--sand-dark); color: transparent; font-weight: 700; font-size: 14px; }
.cr-trait.on { border-color: var(--turq-dark); background: rgba(46, 196, 198, .16); }
.cr-trait.on .cr-trait-i { background: #fff; transform: scale(1.1) rotate(-6deg); }
.cr-trait.on .cr-trait-tick { background: var(--turq); border-color: var(--turq-dark); color: #fff; }

/* tags */
.cr-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 28px; align-items: center; }
.cr-tag { padding: 3px 4px 3px 11px; font-size: 13.5px; animation: cr-pop .3s var(--ease-spring); }
.cr-tag.hobbies { background: rgba(46, 196, 198, .18); border-color: rgba(29, 143, 163, .5); }
.cr-tag.likes { background: rgba(255, 215, 94, .3); border-color: rgba(217, 169, 58, .7); }
.cr-tag.dislikes { background: rgba(255, 122, 107, .18); border-color: rgba(214, 61, 61, .45); }
@keyframes cr-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.cr-x { width: 24px; height: 24px; margin-left: 2px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .1); color: inherit; font: 700 16px/1 var(--font); cursor: pointer; }
.cr-x:hover { background: rgba(0, 0, 0, .18); }
.cr-empty { font-size: 13px; color: var(--ink-faint); }
.cr-tagrow { display: flex; gap: 8px; }
.cr-tagrow .sc-input { flex: 1; min-width: 0; }
.sc-btn.cr-tagadd { min-width: 48px; min-height: 44px; font-size: 26px; font-weight: 700; padding: 0 10px; line-height: 1; }
.cr-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cr-sg { min-height: 32px; padding: 3px 11px; border-radius: 999px; border: 2px dashed var(--sand-deep); background: transparent; color: var(--ink-soft); font: 600 13px var(--font); cursor: pointer; }
.cr-sg:hover { background: rgba(46, 196, 198, .12); border-color: var(--turq); color: var(--ink); }
.cr-bio { min-height: 88px; resize: none; line-height: 1.4; }

/* birthday & country (§11.1 #9) */
.cr-bday { display: grid; grid-template-columns: minmax(64px, .8fr) minmax(0, 1.5fr) minmax(76px, 1fr); gap: 8px; }
.cr-bsel {
  min-width: 0; height: 46px; padding: 0 30px 0 12px; font: 600 15.5px var(--font); color: var(--ink); cursor: pointer;
  -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237a5132' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
}
.cr-brow2 { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cr-bstat { flex: 1; min-width: 0; padding: 7px 11px; border-radius: 12px; font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--ink-soft); background: var(--sand-light); border: 2px dashed var(--sand-dark); }
.cr-bstat.ok { color: var(--green-dark); background: rgba(67, 196, 107, .12); border: 2px solid rgba(67, 196, 107, .4); }
.cr-bstat.warn { color: #9a6a12; background: rgba(255, 215, 94, .2); border-color: rgba(217, 169, 58, .6); }
.cr-bstat.bad { color: var(--red-dark); background: rgba(255, 122, 107, .14); border-color: rgba(214, 61, 61, .45); }
.cr-sub { margin: 10px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.cr-ccur { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 8px 6px 12px; border-radius: 14px; background: var(--sand-light); border: 2px solid var(--sand-dark); }
.cr-cname { flex: 1; min-width: 0; font-size: 16.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-cnone { flex: 1; font-size: 13.5px; color: var(--ink-soft); font-weight: 500; }
.cr-cquick { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-cq {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 3px 11px 3px 8px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--sand-dark); background: var(--paper); color: var(--ink); font: 600 13px var(--font); transition: transform .12s var(--ease-spring), background .15s;
}
.cr-cq:active { transform: scale(.95); }
.cr-cq.on { border-color: var(--turq-dark); background: rgba(46, 196, 198, .18); box-shadow: 0 0 0 1px var(--turq) inset; }
.cr-csearch { width: 100%; margin-top: 10px; }
.cr-clist {
  margin-top: 8px; max-height: 248px; overflow-y: auto; border-radius: 14px; border: 2px solid var(--sand-dark); background: var(--paper);
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.cr-crow {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 12px; cursor: pointer; text-align: left;
  border: 0; border-bottom: 1px dashed var(--sand-dark); background: transparent; color: var(--ink); font: 500 14.5px var(--font);
}
.cr-crow:last-child { border-bottom: 0; }
.cr-crow:hover { background: rgba(46, 196, 198, .08); }
.cr-crow-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-crow-c { flex: none; font-size: 11.5px; font-weight: 700; color: var(--ink-faint); }
.cr-crow.on { background: rgba(46, 196, 198, .18); font-weight: 700; }
.cr-crow.on .cr-crow-c { color: #fff; background: var(--turq); border-radius: 999px; padding: 1px 7px; }
.cr-cempty { margin-top: 8px; font-size: 13px; color: var(--ink-soft); text-align: center; }
@media (max-width: 380px) {
  .cr-bday { grid-template-columns: 62px minmax(0, 1fr) 78px; gap: 6px; }
  .cr-bsel { padding: 0 24px 0 9px; font-size: 14.5px; background-position: right 8px center; }
}

/* bottom bar */
.cr-bottom { flex: none; padding: 8px 12px calc(var(--safe-bottom) + 10px); background: var(--sand); border-top: 3px solid var(--sand-dark); }
.cr-brow { display: flex; gap: 8px; }
.cr-brow .sc-btn { flex: 1; min-height: 48px; font-size: 16.5px; }
.cr-next { flex: .8 !important; font-size: 15px !important; }
.cr-errbar { display: none; margin-bottom: 6px; text-align: center; font-size: 13px; font-weight: 600; color: var(--red-dark); }
.cr-errbar.show { display: block; animation: cr-pop .3s var(--ease-spring); }
.cr-glow { animation: cr-glow 1.8s ease-in-out infinite; }
@keyframes cr-glow { 0%, 100% { box-shadow: 0 4px 0 #237a3e, 0 0 0 0 rgba(67, 196, 107, .5); } 50% { box-shadow: 0 4px 0 #237a3e, 0 0 0 8px rgba(67, 196, 107, 0); } }
.cr-shake { animation: lg-shake .42s ease; }
.cr-save:disabled { filter: grayscale(.5) opacity(.55); }

/* confirm dialog */
.cr-dlg-back { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(24, 36, 48, .45); animation: lg-in .2s ease both; }
.cr-dlg { width: min(340px, 100%); padding: 18px 16px 16px; text-align: center; animation: lg-card-in .35s var(--ease-spring) both; }
.cr-dlg-t { font-weight: 600; font-size: 16.5px; margin-bottom: 14px; line-height: 1.35; }
.cr-dlg-row { display: flex; gap: 8px; }
.cr-dlg-row .sc-btn { flex: 1; padding-left: 8px; padding-right: 8px; }

.cr-bk-i { font-size: 22px; line-height: 1; margin-top: -2px; }
@media (max-width: 520px) {
  .cr-top { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .cr-bk-l { display: none; }
  .cr-cancel { width: 42px; padding: 0; }
  .cr-title b { font-size: 16.5px; }
  .cr-title small { font-size: 11px; }
  .cr-stage { height: clamp(200px, 33vh, 320px); }
}
@media (max-width: 380px) {
  .cr-rl { display: none; }
  .cr-random { width: 42px; padding: 0; }
  .cr-title b { font-size: 15px; }
  .cr-opts { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
}
/* tablets & desktop: preview on the left, editor on the right */
@media (min-width: 820px) {
  .cr-main { flex-direction: row; }
  .cr-stage { flex: 0 0 40%; max-width: 520px; height: auto; }
  .cr-stage .cr-sea { top: 52%; height: 12%; }
  .cr-stage .cr-sand { top: 62%; }
  .cr-stage.o-swim .cr-sea { top: 48%; height: 18%; }
  .cr-stage.o-swim .cr-sand { top: 66%; }
  .cr-editor { border-top: 0; border-left: 4px solid var(--sand-dark); }
  .cr-tabs { padding: 10px 16px; flex-wrap: wrap; }
  .cr-pane { padding: 16px 20px 24px; }
  .cr-pane > * { max-width: 820px; }
  .cr-obar { left: 16px; top: 16px; }
  .cr-ob { width: 46px; height: 46px; font-size: 22px; }
  .cr-namepill { bottom: 16px; font-size: 18px; }
  .cr-turn { right: 16px; bottom: 16px; }
  .cr-bottom { padding: 10px 20px calc(var(--safe-bottom) + 12px); }
  .cr-brow { max-width: 820px; justify-content: flex-end; }
  .cr-brow .sc-btn { flex: 0 1 240px; }
  .cr-next { flex: 0 1 200px !important; }
}

/* =====================================================================================================
 * PROFILE panel
 * ===================================================================================================== */
.pf-root { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 8px; color: var(--ink); font-family: var(--font); }
.pf-hero { display: flex; gap: 12px; align-items: flex-start; }
.pf-stage {
  position: relative; flex: none; width: 112px; height: 140px; border-radius: 20px; overflow: hidden; border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--sand-dark), 0 4px 0 2px rgba(122, 81, 50, .18);
  background: linear-gradient(180deg, #a9e6ff 0%, #dcf7ff 48%, #3fc6d2 48%, #86e6dc 62%, #f8ebcd 62%, #efd9ab 100%);
}
.pf-sun { position: absolute; width: 26px; height: 26px; right: 10px; top: 10px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fff6cf, #ffd75e 60%, #ffb347); box-shadow: 0 0 14px rgba(255, 190, 80, .6); }
.pf-wave { position: absolute; left: -20px; right: -20px; top: 60%; height: 8px; background: radial-gradient(10px 5px at 10px 0, transparent 95%, rgba(255, 255, 255, .7) 100%) 0 0 / 20px 8px repeat-x; animation: lg-wave 4s ease-in-out infinite alternate; }
.pf-cv { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); cursor: pointer; }
.pf-headtxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.pf-namerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pf-name { margin: 0; font-size: 25px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-you { flex: none; font-size: 11.5px; padding: 1px 8px; }
.pf-dynhead { display: flex; flex-direction: column; gap: 7px; }
.pf-stats { display: flex; gap: 6px; }
.pf-stat { flex: 1; min-width: 0; padding: 4px 4px 3px; text-align: center; border-radius: 12px; background: var(--paper); border: 2px solid var(--sand-dark); }
.pf-stat b { display: block; font-size: 19px; line-height: 1.1; }
.pf-stat small { display: block; font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pf-headchips .sc-chip { font-size: 12.5px; }
.pf-where { background: rgba(46, 196, 198, .14); border-color: rgba(29, 143, 163, .45); }
.pf-wb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.pf-wbl { flex: none; }
.pf-meter { flex: 1; }
.pf-wbv { flex: none; min-width: 34px; text-align: right; }
.pf-wb.low .sc-meter > i { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.pf-tip { font-size: 12px; line-height: 1.3; color: var(--ink-soft); padding: 5px 9px; border-radius: 10px; background: rgba(67, 196, 107, .12); }
.pf-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-sec { padding: 10px 12px 11px; border-radius: 18px; background: var(--paper); border: 2px solid var(--sand-dark); }
.pf-h { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.pf-hrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pf-hrow .pf-h { margin-bottom: 8px; }
.pf-link { border: 0; background: none; color: var(--turq-dark); font: 600 13.5px var(--font); cursor: pointer; min-height: 32px; padding: 0 4px; margin-top: -8px; }
.pf-goalsum { font-size: 12.5px; color: var(--ink-soft); margin: -3px 0 7px; }
.pf-goal { display: flex; align-items: center; gap: 9px; padding: 7px 9px; margin-bottom: 6px; border-radius: 13px; background: var(--sand-light); border: 2px solid transparent; }
.pf-goal:last-child { margin-bottom: 0; }
.pf-gi { flex: none; font-size: 20px; width: 26px; text-align: center; }
.pf-gt { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; }
.pf-gm { height: 7px; margin-top: 4px; }
.pf-gp { flex: none; font-weight: 700; font-size: 13px; color: var(--turq-dark); }
.pf-goal.done { background: rgba(67, 196, 107, .14); border-color: rgba(67, 196, 107, .45); }
.pf-goal.done .pf-gp { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-size: 14px; }
.pf-hist { display: flex; align-items: center; gap: 9px; padding: 6px 2px; border-bottom: 1px dashed var(--sand-dark); }
.pf-hist:last-child { border-bottom: 0; }
.pf-hd { flex: none; display: grid; place-items: center; min-width: 44px; height: 30px; padding: 0 6px; border-radius: 999px; font-weight: 700; font-size: 14.5px; color: #fff; background: var(--green); box-shadow: 0 2px 0 var(--green-dark); }
.pf-hist.neg .pf-hd { background: var(--red); box-shadow: 0 2px 0 var(--red-dark); }
.pf-ht { flex: 1; min-width: 0; }
.pf-ht b { display: block; font-size: 14px; font-weight: 600; }
.pf-ht small { display: block; font-size: 12px; line-height: 1.25; color: var(--ink-soft); }
.pf-hday { flex: none; font-size: 11px; color: var(--ink-faint); }
.pf-card { display: flex; flex-direction: column; gap: 9px; }
.pf-field { display: grid; grid-template-columns: 104px 1fr; gap: 8px; align-items: start; }
.pf-fl { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 26px; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.pf-fi { font-size: 15px; }
.pf-fv { min-width: 0; min-height: 26px; display: flex; align-items: center; flex-wrap: wrap; }
.pf-only { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: rgba(165, 139, 255, .2); color: #6b52c8; white-space: nowrap; }
.pf-trait { background: rgba(255, 215, 94, .22); border-color: rgba(217, 169, 58, .55); }
.pf-tag.hob { background: rgba(46, 196, 198, .15); border-color: rgba(29, 143, 163, .45); }
.pf-tag.like { background: rgba(255, 215, 94, .24); border-color: rgba(217, 169, 58, .6); }
.pf-tag.dis { background: rgba(255, 122, 107, .15); border-color: rgba(214, 61, 61, .4); }
.pf-private { background: rgba(122, 81, 50, .1); border-color: var(--sand-deep); color: var(--ink-soft); }
.pf-bio { margin: 0; padding: 7px 11px; border-radius: 12px; background: var(--sand-light); font-size: 14px; line-height: 1.4; }
.pf-val { font-size: 14px; font-weight: 500; }
.pf-look { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 13px; }
.pf-lk b { font-weight: 600; color: var(--ink-soft); }
.pf-none { font-size: 13px; color: var(--ink-faint); }
.pf-note { font-size: 12.5px; color: var(--ink-soft); text-align: center; padding: 0 8px; }
.pf-foot { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pf-foot-t { font-size: 12px; color: var(--ink-faint); }
.pf-empty { align-items: center; text-align: center; padding: 28px 12px; }
.pf-empty-i { font-size: 52px; animation: sc-bob 2.6s ease-in-out infinite; }
.pf-empty p { margin: 4px 0 0; color: var(--ink-soft); }
/* iteration 2: country, birthday, workshop badges, connections, consent-workshop card */
.pf-nflag { flex: none; display: flex; line-height: 0; }
.pf-country { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.pf-bdv { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.pf-age { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.pf-bday { background: linear-gradient(90deg, rgba(255, 143, 177, .25), rgba(255, 215, 94, .3)); border-color: rgba(255, 143, 177, .7); animation: pf-party 2.4s ease-in-out infinite; }
@keyframes pf-party { 0%, 100% { transform: none; } 8% { transform: rotate(-3deg) scale(1.04); } 16% { transform: rotate(3deg) scale(1.04); } 24% { transform: none; } }
.pf-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-badge {
  --bc: #2ec4c6; display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 28px; padding: 2px 10px 2px 4px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--ink); background: rgba(46, 196, 198, .12); border: 2px solid rgba(46, 196, 198, .45);
  background: color-mix(in srgb, var(--bc) 16%, var(--paper)); border-color: color-mix(in srgb, var(--bc) 55%, transparent);
}
.pf-badge-i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 13px; background: var(--paper); box-shadow: 0 0 0 2px var(--bc); }
.pf-badge-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-romance { font-weight: 600; }
.pf-conn .pf-connrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed var(--sand-dark); }
.pf-conn .pf-connrow:last-of-type { border-bottom: 0; }
.pf-conn-t { min-width: 0; font-size: 14px; font-weight: 600; }
.pf-conn-v { flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(165, 139, 255, .18); color: #6b52c8; }
.pf-conn-v.pub { background: rgba(46, 196, 198, .16); color: var(--turq-dark); }
.pf-hint { margin-top: 6px; font-size: 12px; line-height: 1.3; color: var(--ink-soft); }
.pf-req {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(67, 196, 107, .16), rgba(255, 215, 94, .2)); border: 2px solid rgba(67, 196, 107, .5);
}
.pf-req-i { flex: none; font-size: 28px; animation: sc-bob 2.6s ease-in-out infinite; }
.pf-req-t { flex: 1; min-width: 0; }
.pf-req-t b { display: block; font-size: 14.5px; }
.pf-req-t small { display: block; font-size: 12px; line-height: 1.3; color: var(--ink-soft); }
.pf-req-go { flex: none; }
@media (max-width: 380px) { .pf-req { flex-wrap: wrap; } .pf-req-go { width: 100%; } }
.cr-cardprev .pf-card { gap: 7px; }
.cr-cardprev .pf-field { grid-template-columns: 96px 1fr; }
@media (max-width: 380px) {
  .pf-stage { width: 96px; height: 124px; }
  .pf-field { grid-template-columns: 1fr; gap: 2px; }
  .pf-name { font-size: 22px; }
}

/* =====================================================================================================
 * Dev fallbacks (only used while the ui module is not loaded)
 * ===================================================================================================== */
.acct-fb-sheet-back { position: fixed; inset: 0; z-index: 72; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 30, 40, .35); pointer-events: auto; animation: lg-in .25s ease both; }
.acct-fb-sheet { width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; border-radius: 26px 26px 0 0; border-bottom: 0; animation: acct-up .35s var(--ease-soft) both; }
@keyframes acct-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.acct-fb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 6px 16px; }
.acct-fb-title { font-weight: 700; font-size: 18px; }
.acct-fb-body { flex: 1; min-height: 0; padding: 4px 14px calc(var(--safe-bottom) + 16px); }
@media (min-width: 700px) {
  .acct-fb-sheet-back { align-items: center; }
  .acct-fb-sheet { border-radius: 26px; border-bottom: 4px solid var(--panel-border); max-height: 84vh; }
}
