/* ==========================================================================
   LYRA — maison design language
   Rule of the house: gold is jewellery, not paint. Solid gold only on the one
   action that matters (send / begin). Everything else whispers: hairlines,
   smoked glass, ivory type.
   ========================================================================== */
:root {
  --bg: #0b0612;
  --ink: #f6f0fa;
  --ink-dim: #bfb1cf;
  --ink-faint: #7f7193;
  --gold: #e2b866;
  --gold-soft: #f4dcaa;
  --gold-deep: #a97d36;
  --champagne: linear-gradient(135deg, #f7e4bb 0%, #e2b866 48%, #c4954a 100%);
  --violet: #9b5de5;
  --rose: #f39ac0;
  --glass: rgba(16, 9, 26, 0.46);
  --glass-strong: rgba(14, 8, 22, 0.72);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --hair: rgba(255, 255, 255, 0.08);
  --hair-hi: rgba(255, 255, 255, 0.16);
  --hair-gold: rgba(226, 184, 102, 0.34);
  --radius: 26px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, .9, .24, 1);
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.104 26%, 1.1 27.7%, 1.016 38.1%, 0.996 42.7%, 0.991 47.3%, 1.002 63.4%, 1);
  --shadow-float: 0 24px 60px -18px rgba(0, 0, 0, .7), 0 2px 10px rgba(0, 0, 0, .25);
  --inner-hi: inset 0 1px 0 rgba(255, 255, 255, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 1px solid var(--gold-soft); outline-offset: 3px;
}
::selection { background: rgba(226, 184, 102, .35); color: #fff; }

.app { position: relative; width: 100vw; height: 100dvh; overflow: hidden; --voice-lvl: 0; }

/* ---------- Intro curtain ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: radial-gradient(120% 80% at 50% 60%, #1a0e28 0%, #07040c 70%);
  transition: opacity 1.4s var(--ease), visibility 0s linear 1.4s;
}
.intro.done { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-mono {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--hair-gold);
  font-family: var(--serif); font-weight: 300; font-size: 40px; color: var(--gold-soft);
  animation: monoIn 1.6s var(--ease) both;
}
.intro-word {
  font-family: var(--serif); font-weight: 400; font-size: 15px; letter-spacing: .62em; margin-right: -.62em;
  color: var(--ink-dim); animation: fadeUp 1.4s .35s var(--ease) both;
}
.intro-line { width: 120px; height: 1px; background: var(--hair); overflow: hidden; animation: fadeUp 1s .6s var(--ease) both; }
.intro-line i { display: block; height: 100%; width: 0; background: var(--champagne); transition: width .5s var(--ease); }
@keyframes monoIn { from { opacity: 0; transform: scale(.85); filter: blur(6px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Fullscreen 3D Stage ---------- */
.stage, .portrait, .stage3d { position: fixed; inset: 0; width: 100vw; height: 100dvh; }
.stage { z-index: 0; }
.stage3d { z-index: 1; }
.lyra3d-canvas { width: 100% !important; height: 100% !important; display: block; cursor: grab; touch-action: none; }
.lyra3d-canvas:active { cursor: grabbing; }

.portrait::after {
  content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 3, 12, .55) 0%, rgba(7, 3, 12, 0) 16%),
    linear-gradient(0deg, rgba(7, 3, 12, .7) 0%, rgba(7, 3, 12, 0) 22%);
}

.load3d {
  position: fixed; left: 50%; bottom: 20%; translate: -50% 0; z-index: 5;
  padding: 10px 20px; border-radius: 99px; font-size: 12px; letter-spacing: .08em; color: var(--ink-dim);
  background: var(--glass); border: 1px solid var(--hair); backdrop-filter: blur(18px) saturate(140%);
}

/* ---------- Light sparks ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.spark {
  position: absolute; width: var(--sz, 8px); height: var(--sz, 8px); border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--spark-color, #f5dca1) 40%, transparent 70%);
  box-shadow: 0 0 18px var(--spark-color, #f5dca1);
  mix-blend-mode: screen;
  will-change: transform, opacity;
  animation: sparkFloat 1.8s cubic-bezier(.18, .85, .32, 1) forwards;
}
.spark.star {
  width: calc(var(--sz, 8px) * 1.5); height: calc(var(--sz, 8px) * 1.5);
  clip-path: polygon(50% 0%, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0% 50%, 44% 44%);
  border-radius: 0;
}
@keyframes sparkFloat {
  0% { transform: translate(0, 0) scale(.3); opacity: 0; }
  18% { opacity: .95; transform: translate(calc(var(--dx) * .25), -24px) scale(1); }
  100% { transform: translate(var(--dx), -160px) scale(.15); opacity: 0; }
}

/* Thought bubble: whispered caption, not a chat bubble */
.thought {
  position: fixed; top: 22%; right: clamp(24px, 24vw, 340px); z-index: 8; max-width: min(300px, 40vw);
  padding: 12px 18px; border-radius: 18px 18px 18px 4px;
  background: var(--glass-strong); color: var(--ink);
  font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.35;
  border: 1px solid var(--hair); box-shadow: var(--shadow-float), var(--inner-hi);
  backdrop-filter: blur(18px) saturate(140%); text-wrap: pretty;
  opacity: 0; transform: translateY(10px) scale(.96); filter: blur(4px);
  transition: opacity .5s var(--ease), transform .6s var(--spring), filter .5s var(--ease); pointer-events: none;
}
@media (min-width: 900px) {
  .app:not(.chat-hidden) .thought { right: min(430px, 36vw); top: 24%; }
  .app.wardrobe-open .thought { right: min(400px, 42vw); top: 24%; max-width: min(260px, 34vw); }
}
.thought.show { opacity: 1; transform: none; filter: none; }

/* ---------- HUD ---------- */
.hud-top-left, .hud-top-right, .hud-bottom { position: fixed; z-index: 10; pointer-events: none; }
.hud-top-left { top: 26px; left: 32px; display: flex; flex-direction: column; gap: 22px; max-width: min(260px, 46vw); }
.hud-top-right { top: 22px; right: 22px; }
.hud-top-left > *, .hud-top-right > *, .hud-bottom > *, .hud-bar { pointer-events: auto; }
.hud-top-left, .hud-bar, .hud-bottom { animation: hudIn 1.2s .2s var(--ease) both; }
@keyframes hudIn { from { opacity: 0; transform: translateY(-6px); } }
.hud-bottom { animation-name: hudInUp; animation-delay: .45s; }
@keyframes hudInUp { from { opacity: 0; translate: 0 10px; } }

.brand { display: flex; flex-direction: column; gap: 6px; }
.brand-mark {
  font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1;
  letter-spacing: .5em; margin-right: -.5em;
  background: var(--champagne); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub {
  font-size: 9.5px; font-weight: 500; letter-spacing: .34em; text-transform: uppercase; color: var(--ink-faint);
}

/* single smoked-glass control bar */
.hud-bar {
  display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 99px; background: var(--glass); border: 1px solid var(--hair);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow-float), var(--inner-hi);
}
.hud-sep { width: 1px; height: 20px; background: var(--hair-hi); margin: 0 6px; }

.cam-toggle { display: flex; gap: 2px; align-items: center; position: relative; }
.cam-toggle button {
  border: 0; background: none; color: var(--ink-faint); font-size: 12px; font-weight: 500; letter-spacing: .04em;
  min-height: 38px; padding: 0 14px; border-radius: 99px; transition: color .3s var(--ease), background .3s var(--ease);
}
.cam-toggle button:hover { color: var(--ink); }
.cam-toggle button[aria-pressed="true"] { color: var(--ink); background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px var(--hair-gold); }

.hud-icon {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-dim);
  transition: color .3s var(--ease), background .3s var(--ease), transform .4s var(--spring);
}
.hud-icon:hover { color: var(--ink); background: var(--glass-hi); }
.hud-icon:active { transform: scale(.9); }
.hud-icon[aria-pressed="true"] { color: var(--gold-soft); }
.hud-icon[aria-pressed="true"]::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; width: 3px; height: 3px; border-radius: 50%;
  translate: -50% 0; background: var(--gold); box-shadow: 0 0 6px var(--gold);
}
#soundBtn .sound-off { display: inline; }
#soundBtn .sound-wave { display: none; }
#soundBtn[aria-pressed="true"] .sound-off { display: none; }
#soundBtn[aria-pressed="true"] .sound-wave { display: inline; }

/* tooltips */
[data-tip]::before {
  content: attr(data-tip); position: absolute; top: calc(100% + 12px); left: 50%;
  translate: -50% -4px; opacity: 0; pointer-events: none; white-space: nowrap;
  padding: 6px 11px; border-radius: 9px; font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--ink);
  background: var(--glass-strong); border: 1px solid var(--hair); backdrop-filter: blur(14px);
  transition: opacity .25s var(--ease), translate .3s var(--ease);
}
[data-tip]:hover::before, [data-tip]:focus-visible::before { opacity: 1; translate: -50% 0; }
@media (hover: none) { [data-tip]::before { display: none; } }

/* bond — a whisper, not a game HUD */
.bond { width: 100%; padding: 0; }
.bond-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.bond-level { font-family: var(--serif); font-size: 21px; font-weight: 400; font-style: italic; color: var(--ink); letter-spacing: .01em; }
.bond-value { font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.bond-value::after { content: "%"; }
.bond-bar { position: relative; height: 1px; background: var(--hair-hi); overflow: visible; }
.bond-fill {
  position: relative; height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(155, 93, 229, .2), var(--rose) 70%, var(--gold-soft));
  transition: width 1.4s var(--ease);
}
.bond-fill::after {
  content: ""; position: absolute; right: -3px; top: 50%; width: 5px; height: 5px; border-radius: 50%; translate: 0 -50%;
  background: #fff6e2; box-shadow: 0 0 10px 2px rgba(255, 214, 160, .8); animation: glint 3.2s ease-in-out infinite;
}
@keyframes glint { 50% { box-shadow: 0 0 16px 4px rgba(255, 190, 220, .7); } }
.live-activity {
  margin-top: 10px; font-size: 11px; color: var(--ink-faint); letter-spacing: .06em;
  display: flex; align-items: center; gap: 8px;
}
.live-activity::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #8fe3b7; box-shadow: 0 0 8px #8fe3b7; flex: none; }

/* action dock — jewel row of icons, labels on hover */
.hud-bottom {
  left: 50%; bottom: 26px; transform: translateX(-50%); max-width: calc(100vw - 32px);
  transition: left .6s var(--ease);
}
@media (min-width: 900px) {
  .app:not(.chat-hidden) .hud-bottom { left: calc(50% - 195px); }
  .app.wardrobe-open .hud-bottom { left: calc(50% - 190px); }
}
.actions-dock {
  display: flex; align-items: center; gap: 4px; padding: 6px;
  border-radius: 99px; background: var(--glass); border: 1px solid var(--hair);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow-float), var(--inner-hi);
}
.chip {
  position: relative; flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-dim);
  transition: color .3s var(--ease), background .3s var(--ease), transform .45s var(--spring);
}
.chip svg { width: 19px; height: 19px; transition: transform .45s var(--spring), filter .3s; }
.chip:hover { color: var(--gold-soft); background: radial-gradient(circle at 50% 40%, rgba(226, 184, 102, .16), rgba(226, 184, 102, 0) 70%); }
.chip:hover svg { transform: translateY(-1px) scale(1.08); filter: drop-shadow(0 0 6px rgba(244, 220, 170, .55)); }
.chip:active { transform: scale(.88); }
.chip:disabled { opacity: .35; pointer-events: none; }
.chip-label {
  position: absolute; bottom: calc(100% + 14px); left: 50%; translate: -50% 4px;
  white-space: nowrap; pointer-events: none; opacity: 0;
  padding: 6px 11px; border-radius: 9px; font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--ink);
  background: var(--glass-strong); border: 1px solid var(--hair); backdrop-filter: blur(14px);
  transition: opacity .25s var(--ease), translate .3s var(--ease);
}
.chip:hover .chip-label, .chip:focus-visible .chip-label { opacity: 1; translate: -50% 0; }

/* ---------- Drawers (chat & wardrobe) ---------- */
.chat, .wardrobe {
  position: fixed; top: 84px; right: 22px; bottom: 22px; z-index: 12;
  display: flex; flex-direction: column; min-height: 0;
  border: 1px solid var(--hair); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 11, 32, .58), rgba(11, 6, 18, .74));
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--shadow-float), var(--inner-hi);
  overflow: hidden;
  transition: transform .7s var(--spring), opacity .4s var(--ease), filter .5s var(--ease);
}
.chat { width: min(370px, calc(100vw - 32px)); }
.wardrobe { width: min(360px, calc(100vw - 32px)); }
.app.chat-hidden .chat, .app:not(.wardrobe-open) .wardrobe {
  transform: translateX(calc(100% + 40px)) scale(.98); opacity: 0; filter: blur(6px); pointer-events: none;
  transition: transform .5s var(--ease), opacity .3s var(--ease), filter .3s var(--ease);
}

.chat-head {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 22px 24px 18px;
}
/* hairline under the header that fades out at both ends */
.chat-head::after {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hair-gold) 22%, var(--hair-gold) 78%, transparent);
  opacity: .7;
}
/* portrait in a thin champagne bezel with a slow light sweep — a cameo, not a profile pic */
.avatar {
  position: relative; flex: none; width: 58px; height: 58px; border-radius: 50%; padding: 2px;
  background: linear-gradient(150deg, #f6dfae, #a8823f 45%, #f1d59c 70%, #8c6a33);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .35), 0 0 22px rgba(226, 184, 102, .14);
  transition: box-shadow .18s linear;
}
.app.is-speaking .avatar {
  box-shadow:
    0 6px 20px rgba(0, 0, 0, .45),
    0 0 0 1px rgba(244, 220, 170, calc(.2 + var(--voice-lvl) * .45)),
    0 0 calc(22px + var(--voice-lvl) * 26px) rgba(226, 184, 102, calc(.18 + var(--voice-lvl) * .42));
}
.app.is-speaking .avatar-ring {
  filter: brightness(calc(1 + var(--voice-lvl) * .55));
}
.app.is-speaking #voiceBtn {
  color: var(--gold-soft);
  filter: drop-shadow(0 0 calc(4px + var(--voice-lvl) * 8px) rgba(244, 220, 170, calc(.35 + var(--voice-lvl) * .55)));
}
.avatar-ring {
  position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 78%, rgba(255, 226, 170, .55) 88%, transparent 96%);
  -webkit-mask: radial-gradient(circle, transparent 33px, #000 33.5px, #000 34.5px, transparent 35px);
  mask: radial-gradient(circle, transparent 33px, #000 33.5px, #000 34.5px, transparent 35px);
  animation: spin 9s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
.avatar img {
  position: relative; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
  background: #1c0f2a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5);
  transition: opacity .26s var(--ease), filter .26s var(--ease);
}
.avatar img.swapping { opacity: 0; filter: blur(4px); }
.who { flex: 1; min-width: 0; }
.who-name {
  font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: .95; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff6e6, #e9cf9c); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.who-status {
  font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-dim);
  margin-top: 7px; display: flex; align-items: center; gap: 8px; letter-spacing: .02em;
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: #8fe3b7; box-shadow: 0 0 8px #8fe3b7; flex: none; animation: breathe 3.2s var(--ease) infinite; }
@keyframes breathe { 50% { opacity: .45; box-shadow: 0 0 3px #8fe3b7; } }
.dot.offline { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.icon-btn { background: none; border: 0; color: var(--ink-dim); padding: 8px; border-radius: 12px; }

.messages {
  flex: 1; overflow-y: auto; padding: 8px 22px 20px; display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 14px), transparent 100%);
}
.messages::-webkit-scrollbar { display: none; }
.msg {
  max-width: 88%; line-height: 1.55; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty;
  animation: msgIn .7s var(--ease) both;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); filter: blur(5px); } }
/* her voice: no bubble, just beautiful type with a hairline */
/* her voice: set like a novel — a refined serif, generous leading, stage directions in champagne italic */
.msg.her {
  position: relative; align-self: flex-start; padding: 0 0 0 16px; color: #f4ecf3;
  font-family: var(--serif); font-size: 19px; font-weight: 400; line-height: 1.42; letter-spacing: .005em;
  font-feature-settings: "liga", "kern", "onum";
}
.msg.her::before {
  content: ""; position: absolute; left: 0; top: .32em; bottom: .32em; width: 1px;
  background: linear-gradient(180deg, rgba(240, 210, 150, .55), rgba(226, 184, 102, .14));
  transition: background .45s var(--ease), box-shadow .45s var(--ease), opacity .45s var(--ease);
}
.msg.her.is-live::before {
  background: linear-gradient(180deg, rgba(255, 232, 182, calc(.65 + var(--voice-lvl) * .35)), rgba(226, 184, 102, calc(.28 + var(--voice-lvl) * .35)));
  box-shadow: 0 0 calc(6px + var(--voice-lvl) * 10px) rgba(244, 220, 170, calc(.25 + var(--voice-lvl) * .45));
}
.msg.her em {
  font-style: italic; font-weight: 300; font-size: .94em; color: #e3c48c; letter-spacing: .012em;
}
.msg.me {
  align-self: flex-end; padding: 10px 16px 11px; border-radius: 20px 20px 6px 20px;
  font-size: 14px; letter-spacing: .01em; color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .045));
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px rgba(0, 0, 0, .18);
}
.msg.me.action, .msg em { font-style: italic; }
.msg.me em { color: var(--gold-soft); }
.msg.me.action { font-family: var(--serif); font-size: 16px; background: transparent; border-style: dashed; border-color: var(--hair-hi); }
.msg.system {
  align-self: center; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  padding: 4px 0; border: 0; text-align: center;
}
.day {
  align-self: stretch; display: flex; align-items: center; gap: 12px; margin: 10px 0 4px;
  font-family: var(--serif); font-style: italic; font-size: 15px; letter-spacing: .06em; color: var(--gold-soft);
}
.day span::before, .day span::after { content: "\2726"; font-style: normal; font-size: 7px; vertical-align: .35em; margin: 0 9px; opacity: .7; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; }
.day::before { background: linear-gradient(90deg, transparent, var(--hair-gold)); }
.day::after { background: linear-gradient(90deg, var(--hair-gold), transparent); }

.typing { display: inline-flex; gap: 5px; padding: 10px 0 10px 14px !important; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-soft); animation: dots 1.4s infinite var(--ease); }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes dots { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.composer { display: flex; gap: 8px; margin: 0 14px 14px; padding: 6px 6px 6px 8px; align-items: flex-end;
  border-radius: 22px; background: rgba(255, 255, 255, .045); border: 1px solid var(--hair); transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.composer:focus-within { border-color: var(--hair-gold); box-shadow: 0 0 0 4px rgba(226, 184, 102, .06); }
.composer textarea {
  flex: 1; resize: none; max-height: 140px; padding: 10px 8px; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 14.5px; outline: none;
}
.composer textarea:focus-visible { outline: none; }
.composer textarea::placeholder { color: var(--ink-faint); font-family: var(--serif); font-style: italic; font-size: 16px; }
/* the one golden object on screen */
.send {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #2a1806;
  background: var(--champagne);
  box-shadow: 0 8px 22px -6px rgba(226, 184, 102, .55), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .45s var(--spring), box-shadow .3s var(--ease), opacity .3s;
}
.send svg { width: 16px; height: 16px; }
.send:hover { transform: scale(1.07) rotate(-8deg); box-shadow: 0 10px 28px -6px rgba(226, 184, 102, .75), inset 0 1px 0 rgba(255, 255, 255, .5); }
.send:active { transform: scale(.9); }
.send:disabled { opacity: .4; transform: none; }

/* ---------- Wardrobe ---------- */
.wardrobe-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.wardrobe-title { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 500; line-height: 1.1; color: var(--ink); }
.wardrobe-clear {
  min-height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--hair); background: transparent;
  color: var(--ink-faint); font-size: 11px; font-weight: 500; letter-spacing: .06em; transition: .3s var(--ease);
}
.wardrobe-clear:hover { color: var(--ink); border-color: var(--hair-gold); }
.wardrobe-controls { display: flex; flex-direction: column; gap: 10px; padding: 4px 22px 14px; border-bottom: 1px solid var(--hair); }
.wardrobe-control-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wardrobe-control-label, .wardrobe-label {
  font-size: 9.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-faint); flex: none;
}
.wardrobe-model-picker {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
  background: rgba(8, 4, 14, .58);
  border: 1px solid var(--hair);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.wardrobe-model-picker .model-glider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 6px);
  border-radius: 14px;
  pointer-events: none;
  border: 1px solid rgba(226, 184, 102, .45);
  background: linear-gradient(155deg, rgba(226, 184, 102, .18), rgba(155, 93, 229, .08) 72%);
  box-shadow: inset 0 1px 0 rgba(255, 236, 198, .22), 0 8px 20px -10px rgba(226, 184, 102, .45);
  transition: transform .52s var(--spring), background .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.wardrobe-model-picker[data-active="cat"] .model-glider {
  transform: translateX(calc(100% + 4px));
  border-color: rgba(142, 226, 184, .42);
  background: linear-gradient(155deg, rgba(134, 227, 179, .15), rgba(226, 184, 102, .09) 55%, rgba(16, 26, 36, .35));
  box-shadow: inset 0 1px 0 rgba(210, 255, 230, .2), 0 8px 20px -10px rgba(134, 227, 179, .38);
}
.wmodel-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 44px;
  justify-content: center;
  color: var(--ink-dim);
  transition: color .28s var(--ease), transform .35s var(--spring);
}
.wmodel-btn:hover { color: var(--ink); }
.wmodel-btn:active { transform: scale(.97); }
.wmodel-btn[aria-pressed="true"] { color: var(--ink); }
.wmodel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.wmodel-name {
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.05;
}
.wmodel-mark {
  font-size: 9px;
  color: var(--ink-faint);
  opacity: .35;
  transform: scale(.8);
  transition: opacity .28s var(--ease), color .28s var(--ease), transform .4s var(--spring);
}
.wmodel-btn[aria-pressed="true"] .wmodel-mark {
  opacity: 1;
  color: var(--gold-soft);
  transform: scale(1);
}
.wardrobe-model-picker[data-active="cat"] .wmodel-btn[data-model="cat"][aria-pressed="true"] .wmodel-mark {
  color: #a9f0c9;
}
.wmodel-sub {
  font-size: 10px;
  letter-spacing: .03em;
  color: var(--ink-faint);
}
.wmodel-btn[aria-pressed="true"] .wmodel-sub { color: var(--ink-dim); }
.seg-toggle {
  display: flex; padding: 3px; gap: 2px; min-height: 40px; align-items: center; flex: 1;
  border-radius: 99px; background: rgba(255, 255, 255, .03); border: 1px solid var(--hair);
}
.seg-toggle button {
  flex: 1; border: 0; background: none; color: var(--ink-faint); font-size: 12px; font-weight: 500;
  min-height: 32px; padding: 0 10px; border-radius: 99px; transition: .3s var(--ease); white-space: nowrap;
}
.seg-toggle button:hover { color: var(--ink); }
.seg-toggle button[aria-pressed="true"] { color: var(--ink); background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px var(--hair-gold); }
.wardrobe-body {
  flex: 1; overflow-y: auto; padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 22px; scrollbar-width: none;
}
.wardrobe-body::-webkit-scrollbar { display: none; }
.wardrobe-tab { display: flex; flex-direction: column; gap: 22px; }
.wardrobe-tab[hidden] { display: none; }
.wardrobe-group { display: flex; flex-direction: column; gap: 10px; }
.anim-empty {
  margin: 0; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--hair); background: rgba(255, 255, 255, .02);
  font-size: 13px; line-height: 1.55; color: var(--ink-dim); text-wrap: pretty;
}
.anim-catalog { display: flex; flex-direction: column; gap: 18px; }
.anim-auto-btn { width: 100%; justify-content: center; }
.anim-more { border: 1px solid var(--hair); border-radius: 16px; padding: 6px 14px; background: rgba(255, 255, 255, .02); }
.anim-more summary {
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--ink-dim);
  min-height: 40px; display: flex; align-items: center; justify-content: space-between;
}
.anim-more summary:hover { color: var(--ink); }
.anim-more .wardrobe-grid { padding: 8px 0 10px; }

/* looks — editorial cards */
.wardrobe-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preset-btn {
  position: relative; min-height: 64px; padding: 12px 14px; border-radius: 16px; text-align: left; overflow: hidden;
  border: 1px solid var(--hair); color: var(--ink);
  font-family: var(--serif); font-size: 18px; font-style: italic; font-weight: 400;
  display: flex; align-items: flex-end;
  background: var(--look, linear-gradient(140deg, #2a1640, #130a1e));
  transition: border-color .3s var(--ease), transform .45s var(--spring), box-shadow .3s var(--ease);
}
.preset-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 40%); pointer-events: none; }
.preset-btn[data-preset="evening"] { --look: radial-gradient(120% 120% at 100% 0%, #6b2858 0%, #2a0f2e 55%, #12081a 100%); }
.preset-btn[data-preset="casual"] { --look: radial-gradient(120% 120% at 100% 0%, #344c7a 0%, #1a2140 55%, #0e0c1a 100%); }
.preset-btn[data-preset="cozy"] { --look: radial-gradient(120% 120% at 100% 0%, #5a4372 0%, #241a36 55%, #110b1a 100%); }
.preset-btn[data-preset="chic"] { --look: radial-gradient(120% 120% at 100% 0%, #5b4a4f 0%, #2a2129 55%, #110b14 100%); }
.preset-btn:hover { border-color: var(--hair-hi); transform: translateY(-2px); }
.preset-btn:active { transform: scale(.97); }
.preset-btn[aria-pressed="true"] { border-color: var(--hair-gold); box-shadow: inset 0 0 0 1px rgba(244, 220, 170, .25), 0 10px 30px -12px rgba(226, 184, 102, .4); }
.preset-btn[aria-pressed="true"]::before {
  content: ""; position: absolute; top: 12px; right: 12px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-soft); box-shadow: 0 0 10px var(--gold);
}

.wardrobe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.garment-btn {
  min-height: 48px; padding: 8px 12px 8px 8px; border-radius: 14px;
  border: 1px solid var(--hair); background: rgba(255, 255, 255, .025);
  color: var(--ink-dim); font-size: 13px; font-weight: 500; text-align: left;
  display: flex; align-items: center; gap: 10px; transition: .3s var(--ease);
}
.garment-btn.anim-btn { padding: 8px 12px; line-height: 1.2; }
.garment-btn.is-signature {
  border-color: rgba(226, 184, 102, .22);
  background: linear-gradient(155deg, rgba(226, 184, 102, .08), rgba(155, 93, 229, .05) 60%, rgba(255, 255, 255, .02));
  color: var(--ink);
}
.garment-btn.is-signature::before {
  content: "\2726";
  font-size: 10px;
  color: var(--gold-soft);
  opacity: .85;
}
.garment-btn.is-signature[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(155deg, rgba(226, 184, 102, .18), rgba(155, 93, 229, .10));
}
.garment-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .05); border-color: var(--hair-hi); }
.garment-btn:active { transform: scale(.97); }
.garment-btn[aria-pressed="true"] { color: var(--ink); border-color: var(--hair-gold); background: rgba(226, 184, 102, .06); }
/* fabric chip: a lit swatch with sheen instead of a flat dot */
.swatch {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .1) 62%, rgba(0, 0, 0, .35) 100%),
    var(--sw, #3b184d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 4px 10px -4px rgba(0, 0, 0, .6);
}
.garment-btn[aria-pressed="true"] .swatch { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 0 0 2px rgba(11, 6, 18, .9), 0 0 0 3px var(--gold); }

/* ---------- Onboarding dual-model stage chooser ---------- */
.app.is-onboarding .hud-top-left,
.app.is-onboarding .hud-top-right,
.app.is-onboarding .hud-bottom,
.app.is-onboarding .chat,
.app.is-onboarding .wardrobe,
.app.is-onboarding .boutique,
.app.is-onboarding .thought {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.app.is-onboarding .lyra3d-canvas { cursor: default; }

.onboard-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  pointer-events: none;
}
.onboard-card {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  width: min(366px, 32vw);
  min-width: 308px;
  margin-top: clamp(24px, 7vh, 78px);
  padding: 30px 26px 24px;
  border-radius: 30px;
  border: 1px solid rgba(226, 184, 102, .26);
  background:
    radial-gradient(125% 95% at 50% 0%, rgba(62, 31, 86, .58), rgba(11, 6, 18, .82) 64%),
    rgba(11, 6, 18, .72);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow:
    0 40px 100px -20px rgba(0, 0, 0, .82),
    inset 0 1px 0 rgba(255, 236, 198, .18),
    inset 0 0 0 1px rgba(255, 255, 255, .04);
  color: var(--ink);
  text-align: center;
  animation: onboardIn .85s var(--spring) both;
  transition: opacity .45s var(--ease), transform .45s var(--ease), border-color .4s var(--ease);
}
/* Directional jewel aura on the card edge matching the active companion */
.onboard-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(75% 85% at 0% 42%, rgba(244, 220, 170, .14), transparent 70%);
  transition: opacity .45s var(--ease), transform .55s var(--ease);
}
.onboard-card[data-selected="cat"] {
  border-color: rgba(142, 226, 184, .28);
}
.onboard-card[data-selected="cat"]::before {
  background: radial-gradient(75% 85% at 100% 42%, rgba(134, 227, 179, .14), transparent 70%);
}
.onboard-card > form { position: relative; z-index: 1; }
.onboard-layer.is-leaving .onboard-card {
  opacity: 0;
  transform: translateY(12px) scale(.96);
  pointer-events: none;
}
@keyframes onboardIn {
  from { opacity: 0; transform: translateY(14px) scale(.95); }
}
.onboard-card h1 {
  font-family: var(--serif);
  font-size: clamp(27px, 2.4vw, 33px);
  font-weight: 300;
  letter-spacing: .01em;
  margin: 0 0 14px;
  line-height: 1.06;
  text-wrap: balance;
  background: linear-gradient(180deg, #fff8ec 15%, #e8cc95 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.onboard-rule {
  height: 1px;
  width: 68%;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, var(--hair-gold) 30%, var(--hair-gold) 70%, transparent);
  opacity: .75;
}
.onboard-card .modal-mono {
  position: relative;
  width: 46px;
  height: 46px;
  font-size: 23px;
  margin-bottom: 10px;
  background: radial-gradient(circle at 35% 30%, rgba(244, 220, 170, .12), transparent 70%);
}
.onboard-card .mono-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 74%, rgba(244, 220, 170, .55) 88%, transparent 98%);
  -webkit-mask: radial-gradient(circle, transparent 26.5px, #000 27px, #000 28px, transparent 28.5px);
  mask: radial-gradient(circle, transparent 26.5px, #000 27px, #000 28px, transparent 28.5px);
  animation: spin 11s linear infinite;
}
.onboard-card .modal-brand { margin-bottom: 10px; }
.onboard-card small {
  display: block;
  color: var(--ink-faint);
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: .02em;
}

.model-picker {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
.model-tray {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border-radius: 20px;
  background: rgba(7, 4, 13, .62);
  border: 1px solid var(--hair);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.model-tray .model-glider {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 7px);
  border-radius: 15px;
  pointer-events: none;
  border: 1px solid rgba(226, 184, 102, .48);
  background: linear-gradient(155deg, rgba(226, 184, 102, .18), rgba(155, 93, 229, .09) 72%);
  box-shadow: inset 0 1px 0 rgba(255, 236, 198, .24), 0 10px 26px -12px rgba(226, 184, 102, .48);
  transition: transform .55s var(--spring), background .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.model-picker[data-selected="cat"] .model-glider {
  transform: translateX(calc(100% + 4px));
  border-color: rgba(142, 226, 184, .46);
  background: linear-gradient(155deg, rgba(134, 227, 179, .16), rgba(226, 184, 102, .10) 58%, rgba(16, 26, 36, .34));
  box-shadow: inset 0 1px 0 rgba(210, 255, 230, .22), 0 10px 26px -12px rgba(134, 227, 179, .42);
}
.model-option { min-width: 0; position: relative; z-index: 1; }
.model-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
  min-height: 60px;
  padding: 10px 12px;
  border-radius: 15px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform .4s var(--spring), background .28s var(--ease), border-color .28s var(--ease);
}
.model-card:hover,
.model-option.is-stage-hover .model-card {
  background: rgba(255, 255, 255, .04);
  transform: translateY(-1px);
}
.model-option:active .model-card { transform: scale(.97); }
.model-option input:focus-visible + .model-card {
  outline: 2px solid rgba(255, 255, 255, .82);
  outline-offset: 2px;
}
.model-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.model-name {
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.05;
  color: var(--ink-dim);
  transition: color .28s var(--ease);
}
.model-option input:checked + .model-card .model-name { color: var(--ink); }
.model-mark {
  font-size: 10px;
  line-height: 1;
  color: var(--ink-faint);
  opacity: .3;
  transform: scale(.78);
  transition: opacity .28s var(--ease), color .28s var(--ease), transform .45s var(--spring), text-shadow .28s var(--ease);
}
.model-option input:checked + .model-card .model-mark {
  opacity: 1;
  color: var(--gold-soft);
  transform: scale(1);
  text-shadow: 0 0 10px rgba(244, 220, 170, .7);
}
.model-picker[data-selected="cat"] .model-option[data-choice="cat"] input:checked + .model-card .model-mark {
  color: #a9f0c9;
  text-shadow: 0 0 10px rgba(142, 226, 184, .65);
}
.model-trait {
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: .03em;
  transition: color .28s var(--ease);
}
.model-option input:checked + .model-card .model-trait { color: var(--ink-dim); }

.onboard-field {
  margin-bottom: 16px;
  text-align: left;
}
.onboard-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.onboard-input-wrap {
  position: relative;
}
.onboard-input-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 25%, var(--gold-soft) 75%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .42s var(--ease);
  pointer-events: none;
}
.onboard-input-wrap:focus-within::after { transform: scaleX(1); }
.onboard-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--hair-hi);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: max(1rem, 22px);
  text-align: center;
  outline: none;
  transition: border-color .28s var(--ease);
}
.onboard-field input::placeholder { color: var(--ink-faint); font-style: italic; }
.onboard-field input:focus { border-color: rgba(226, 184, 102, .35); }
.onboard-field input:focus-visible { outline: 1px solid var(--gold-soft); outline-offset: 4px; }
.onboard-field input:user-invalid,
.onboard-field input[aria-invalid="true"] {
  border-color: var(--rose);
}
.field-error {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--rose);
  text-align: center;
}
.field-error:empty { visibility: hidden; }

#onboardSubmit.primary {
  position: relative;
  overflow: hidden;
  text-transform: none;
  letter-spacing: .06em;
  font-size: 14px;
  font-weight: 600;
}
#onboardSubmit.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .36) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform .75s var(--ease);
  pointer-events: none;
}
#onboardSubmit.primary:hover::after { transform: translateX(120%); }

@media (max-width: 859px) {
  .onboard-layer {
    align-items: end;
    padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  }
  .onboard-card {
    width: min(390px, 100%);
    min-width: 0;
    margin-top: 0;
    padding: 18px 18px 16px;
    border-radius: 24px;
  }
  .onboard-card .modal-mono,
  .onboard-card .modal-brand,
  .onboard-rule { display: none; }
  .onboard-card h1 { font-size: 24px; margin-bottom: 12px; }
  .model-picker { margin-bottom: 12px; }
  .model-card { min-height: 54px; padding: 8px 11px; }
  .onboard-field { margin-bottom: 12px; }
  .onboard-card small { margin-top: 10px; }
}

/* ---------- Modals ---------- */
dialog:modal {
  overscroll-behavior: contain;
}
dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}
.modal {
  border: 1px solid var(--hair); border-radius: 30px; padding: 44px 38px 32px; width: min(420px, calc(100vw - 32px));
  background: radial-gradient(130% 90% at 50% 0%, rgba(60, 30, 80, .55), rgba(14, 8, 22, .92) 60%), #0e0816;
  color: var(--ink); text-align: center;
  box-shadow: 0 50px 140px -20px rgba(0, 0, 0, .8), var(--inner-hi);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: .32s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: no-preference) {
  .modal { transform: translateY(14px) scale(.96); }
}
.modal[open] {
  opacity: 1;
  @starting-style {
    opacity: 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    transform: translateY(0) scale(1);
    @starting-style {
      transform: translateY(14px) scale(.96);
    }
  }
}
.modal::backdrop {
  background: rgba(6, 3, 10, 0);
  backdrop-filter: blur(10px);
  transition-property: background-color, display, overlay;
  transition-duration: .32s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
.modal[open]::backdrop {
  background: rgba(6, 3, 10, .55);
  @starting-style {
    background: rgba(6, 3, 10, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .modal, .modal::backdrop { transition-duration: .1s; }
}
.modal-mono {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--hair-gold); font-family: var(--serif); font-weight: 300; font-size: 28px; color: var(--gold-soft);
}
.modal-brand { font-family: var(--serif); font-size: 12px; letter-spacing: .5em; margin-right: -.5em; color: var(--ink-faint); margin-bottom: 18px; }
.modal h2 { font-family: var(--serif); font-size: 36px; font-weight: 400; margin: 0 0 10px; line-height: 1.05; text-wrap: balance; }
.modal p { color: var(--ink-dim); margin: 0 0 26px; text-wrap: pretty; font-family: var(--serif); font-style: italic; font-size: 18px; }
.modal small { display: block; color: var(--ink-faint); margin-top: 20px; font-size: 11px; line-height: 1.5; letter-spacing: .02em; }
.modal input {
  width: 100%; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--hair-hi); border-radius: 0;
  background: transparent; color: var(--ink); font: inherit; font-family: var(--serif); font-size: 22px; text-align: center;
  outline: none; margin-bottom: 26px; transition: border-color .3s var(--ease);
}
.modal input::placeholder { color: var(--ink-faint); font-style: italic; }
.modal input:focus { border-color: var(--gold); }
.modal input:focus-visible { outline: none; }
.modal label { display: block; text-align: left; font-size: 10px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-faint); }
.modal label input { margin-top: 4px; text-align: left; font-size: 20px; letter-spacing: 0; text-transform: none; }
#settings.modal {
  width: min(460px, calc(100vw - 32px)); max-height: min(90dvh, 760px);
  overflow-y: auto; scrollbar-width: none; padding: 34px 30px 28px;
}
#settings.modal::-webkit-scrollbar { display: none; }
.ai-panel {
  margin: -6px 0 18px; padding: 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--hair);
  text-align: left; display: flex; flex-direction: column; gap: 12px;
}
.ai-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-panel-title { font-family: var(--serif); font-size: 19px; font-weight: 500; color: var(--ink); line-height: 1.1; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 0 10px;
  border-radius: 99px; border: 1px solid var(--hair); background: rgba(255, 255, 255, .03);
  font-size: 11px; color: var(--ink-dim); white-space: nowrap;
}
.modal label.ai-field {
  display: flex; flex-direction: column; gap: 6px; margin: 0;
  font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint);
}
.modal label.ai-field input,
.modal label.ai-field select {
  width: 100%; min-height: 44px; padding: 0 12px; margin: 0;
  border: 1px solid var(--hair-hi); border-radius: 12px;
  background: rgba(18, 10, 29, .86); color: var(--ink);
  font-family: var(--sans); font-size: 13.5px; font-weight: 400;
  letter-spacing: 0; text-transform: none; text-align: left; color-scheme: dark;
  transition: border-color .25s var(--ease);
}
.modal label.ai-field input::placeholder { font-style: normal; color: var(--ink-faint); }
.modal label.ai-field input:focus,
.modal label.ai-field select:focus { border-color: var(--gold); }
.modal label.ai-field input:focus-visible,
.modal label.ai-field select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ai-models-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ai-actions { display: flex; align-items: center; gap: 8px; }
.ai-connect-btn,
.ai-disconnect-btn {
  min-height: 44px; padding: 0 16px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  transition: transform .35s var(--spring), border-color .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.ai-connect-btn {
  flex: 1; border: 1px solid var(--hair-gold); color: var(--gold-soft);
  background: rgba(226, 184, 102, .12);
}
.ai-connect-btn:hover { background: rgba(226, 184, 102, .20); color: var(--ink); }
.ai-connect-btn:disabled { opacity: .5; pointer-events: none; }
.ai-disconnect-btn { border: 1px solid var(--hair-hi); background: transparent; color: var(--ink-dim); }
.ai-disconnect-btn:hover { color: var(--ink); border-color: rgba(243, 154, 192, .45); }
.ai-connect-btn:active, .ai-disconnect-btn:active { transform: scale(.97); }
.ai-msg { font-size: 12.5px; line-height: 1.4; text-wrap: pretty; }
.ai-msg.is-ok { color: var(--gold-soft); }
.ai-msg.is-err { color: var(--rose); }
.ai-usage { font-size: 11.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
@media (max-width: 460px) { .ai-models-grid { grid-template-columns: 1fr; } }
.modal label.toggle-row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; margin: -6px 0 22px; cursor: pointer;
  font-size: 13.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-dim);
}
.modal label.toggle-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); flex: none; }
.modal-row { display: flex; gap: 10px; }
.primary, .ghost {
  flex: 1; width: 100%; min-height: 50px; padding: 12px 18px; border-radius: 99px;
  font-weight: 600; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; border: 0;
  transition: transform .45s var(--spring), box-shadow .3s var(--ease), color .3s, border-color .3s;
}
.primary {
  background: var(--champagne); color: #2a1806;
  box-shadow: 0 14px 34px -12px rgba(226, 184, 102, .6), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.primary:hover { box-shadow: 0 18px 40px -10px rgba(226, 184, 102, .75), inset 0 1px 0 rgba(255, 255, 255, .5); transform: translateY(-1px); }
.ghost { background: transparent; border: 1px solid var(--hair-hi); color: var(--ink-dim); }
.ghost:hover { color: var(--ink); border-color: var(--hair-gold); }
.primary:active, .ghost:active { transform: scale(.97); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .hud-top-left { top: calc(70px + env(safe-area-inset-top)); left: 18px; gap: 12px; max-width: 46vw; }
  .brand-mark { font-size: 20px; }
  .brand-sub { display: none; }
  .bond-level { font-size: 17px; }
  .bond-row { margin-bottom: 7px; }
  .live-activity { margin-top: 7px; font-size: 10.5px; }
  .hud-top-right { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
  .hud-bar { padding: 3px; }
  .cam-toggle button { min-height: 34px; padding: 0 10px; font-size: 11px; }
  .hud-sep { margin: 0 3px; height: 16px; }
  .hud-icon { width: 36px; height: 36px; }
  .hud-icon svg { width: 17px; height: 17px; }
  .hud-bottom { left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 24px); }
  .chip { width: 44px; height: 44px; }
  .chip-label { display: none; }
  .thought { top: 18%; right: 16px; max-width: 60vw; font-size: 16px; }
  .chat, .wardrobe {
    top: calc(64px + env(safe-area-inset-top)); left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom));
    width: auto; border-radius: 22px;
  }
  .msg { max-width: 90%; }
}
@media (max-width: 400px) {
  .hud-top-left { max-width: 40vw; }
  .bond-value { display: none; }
  .cam-toggle button { padding: 0 8px; }
  .chip { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Gift boutique ---------- */
.boutique {
  position: fixed; top: 84px; right: 22px; bottom: 22px; z-index: 12; width: min(380px, calc(100vw - 32px));
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  border: 1px solid var(--hair); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(24, 12, 30, .62), rgba(11, 6, 18, .8));
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--shadow-float), var(--inner-hi);
  transition: transform .7s var(--spring), opacity .4s var(--ease), filter .5s var(--ease);
}
.app:not(.boutique-open) .boutique { transform: translateX(calc(100% + 40px)) scale(.98); opacity: 0; filter: blur(6px); pointer-events: none; }
.app.boutique-open .chat, .app.boutique-open .wardrobe { transform: translateX(calc(100% + 40px)) scale(.98); opacity: 0; pointer-events: none; }
.bq-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 22px 24px 16px; }
.bq-head::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hair-gold) 22%, var(--hair-gold) 78%, transparent); opacity: .7; }
.bq-title { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff6e6, #e9cf9c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bq-sub { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-dim); }
.bq-balance { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--hair-gold);
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--gold-soft); background: rgba(226, 184, 102, .06); }
.bq-heart { color: #ff8fb4; }
.bq-body { flex: 1; overflow-y: auto; padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 22px; scrollbar-width: none; }
.bq-body::-webkit-scrollbar { display: none; }
.bq-empty, .bq-note { margin: 0; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-faint); }
.bq-note { margin-top: 8px; font-size: 13px; }
.bq-cat h3 { margin: 0 0 10px; font-size: 10px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-faint); }
.bq-packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bq-pack, .bq-gift {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 13px; text-align: left;
  border-radius: 16px; border: 1px solid var(--hair); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .3s var(--ease), transform .4s var(--spring), background .3s var(--ease);
}
.bq-pack:hover:not(:disabled), .bq-gift:hover:not(:disabled) { border-color: var(--hair-gold); transform: translateY(-2px); }
.bq-pack:active:not(:disabled), .bq-gift:active:not(:disabled), .bq-plus-btn:active:not(:disabled) { transform: scale(.97); }
.bq-pack:disabled, .bq-plus-btn:disabled { opacity: .5; cursor: not-allowed; }
.bq-pack.featured { border-color: var(--hair-gold); background: linear-gradient(180deg, rgba(226, 184, 102, .12), rgba(255, 255, 255, .03)); }
.bq-pack-h { font-family: var(--serif); font-size: 21px; line-height: 1; color: #ffd9e6; font-variant-numeric: tabular-nums; }
.bq-pack-l { font-size: 11.5px; color: var(--ink-dim); }
.bq-pack-l em { font-style: normal; color: var(--gold-soft); }
.bq-pack-p { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.bq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bq-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--gold-soft);
  background: radial-gradient(circle at 30% 25%, rgba(255, 226, 170, .18), rgba(255, 255, 255, .03)); border: 1px solid rgba(226, 184, 102, .18); margin-bottom: 4px; }
.bq-name { font-family: var(--serif); font-size: 16.5px; line-height: 1.15; }
.bq-price { font-size: 12px; color: #ffbfd3; font-variant-numeric: tabular-nums; }
.bq-gift.wish { border-color: rgba(255, 159, 196, .45); box-shadow: 0 0 0 1px rgba(255, 159, 196, .12), 0 8px 26px rgba(255, 120, 170, .08); }
.bq-wish, .bq-perk { font-family: var(--serif); font-style: italic; font-size: 12.5px; color: #ff9fc4; }
.bq-perk { color: var(--gold-soft); }
.bq-gift.owned { opacity: .55; cursor: default; }
.bq-gift.owned .bq-price { color: var(--gold-soft); }
.bq-gift.short { animation: bqShake .5s var(--ease); border-color: #ff8fb4; }
@keyframes bqShake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.bq-messenger { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px;
  border: 1px solid var(--hair-gold); background: linear-gradient(135deg, rgba(42, 171, 238, .12), rgba(226, 184, 102, .06)); }
.bq-messenger b { display: block; font-family: var(--serif); font-weight: 500; font-size: 17px; }
.bq-messenger span { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-dim); }
.bq-tg { flex: none; padding: 9px 14px; border-radius: 999px; border: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, #37b4f0, #1f8fd0); cursor: pointer; }

/* ---------- Moments drawer (shares the boutique shell) ---------- */
.app:not(.moments-open) .moments { transform: translateX(calc(100% + 40px)) scale(.98); opacity: 0; filter: blur(6px); pointer-events: none; }
.app.moments-open .moments { transform: none; opacity: 1; filter: none; pointer-events: auto; }
.app.moments-open .chat, .app.moments-open .wardrobe, .app.moments-open .boutique:not(.moments) { transform: translateX(calc(100% + 40px)) scale(.98); opacity: 0; pointer-events: none; }
.app:not(.boutique-open) .boutique:not(.moments) { transform: translateX(calc(100% + 40px)) scale(.98); opacity: 0; filter: blur(6px); pointer-events: none; }
.mo-list { display: flex; flex-direction: column; gap: 8px; }
.mo-ch {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  border-radius: 18px; border: 1px solid var(--hair);
  background: radial-gradient(120% 140% at 100% 0%, rgba(226, 184, 102, .10), transparent 55%), linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  transition: border-color .3s var(--ease), transform .4s var(--spring);
}
.mo-ch:hover:not(:disabled) { border-color: var(--hair-gold); transform: translateY(-2px); }
.mo-num { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--hair-gold);
  font-family: var(--serif); font-size: 15px; color: var(--gold-soft); }
.mo-txt { flex: 1; min-width: 0; }
.mo-txt b { display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.1; }
.mo-txt span { display: block; margin-top: 3px; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-dim); }
.mo-go { color: var(--gold-soft); font-size: 15px; }
.mo-ch.locked { cursor: default; opacity: .5; filter: saturate(.6); }
.mo-quests { display: grid; gap: 8px; }
.mo-q { display: block; width: 100%; padding: 12px 14px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  border-radius: 16px; border: 1px dashed rgba(143, 227, 183, .35); background: rgba(143, 227, 183, .04); transition: border-color .3s var(--ease), background .3s var(--ease); }
.mo-q:hover { border-color: rgba(143, 227, 183, .7); background: rgba(143, 227, 183, .08); }
.mo-q b { display: block; font-family: var(--serif); font-weight: 400; font-size: 17px; }
.mo-q span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-dim); }

/* ---------- Lyra Plus card ---------- */
.bq-plus {
  position: relative; padding: 18px 18px 16px; border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(240, 210, 150, .45);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 150, 196, .18), transparent 55%),
    radial-gradient(120% 120% at 0% 100%, rgba(226, 184, 102, .16), transparent 60%),
    linear-gradient(180deg, rgba(40, 20, 44, .9), rgba(20, 10, 26, .9));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 240, 210, .12);
}
.bq-plus::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 236, 200, .12) 50%, transparent 65%);
  transform: translateX(-100%); animation: plusSheen 6s var(--ease) infinite; pointer-events: none; }
@keyframes plusSheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.bq-plus-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bq-plus-badge { font-family: var(--serif); font-size: 24px; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff6e6, #e9cf9c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bq-plus-price { font-family: var(--serif); font-size: 22px; color: #ffd9e6; }
.bq-plus-price small, .bq-plus-state { font-size: 12px; color: var(--ink-dim); font-family: var(--sans); }
.bq-plus ul { margin: 12px 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; }
.bq-plus li { position: relative; padding-left: 18px; font-size: 13px; color: var(--ink); }
.bq-plus li::before { content: "✦"; position: absolute; left: 0; top: 0; font-size: 10px; color: var(--gold-soft); }
.bq-plus.on ul { margin-bottom: 0; }
.bq-plus-btn { width: 100%; padding: 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 600; font-size: 13.5px; letter-spacing: .02em; cursor: pointer;
  color: #2a1806; background: linear-gradient(180deg, #f8e2b0, #d9b06a); box-shadow: 0 8px 22px rgba(226, 184, 102, .25); }
.bq-fine { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-faint); }
.bq-cap { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.bq-cap label { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-dim); }
.bq-cap input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--hair); background: rgba(255,255,255,.05); color: var(--ink); font: inherit; }
.bq-cap button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--hair-gold); background: transparent; color: var(--gold-soft); font: inherit; font-size: 12.5px; cursor: pointer; }

/* ---------- 18+ gate ---------- */
.age-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(80% 80% at 50% 40%, rgba(40, 18, 52, .82), rgba(6, 3, 10, .96)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: opacity .5s var(--ease); }
.age-gate.out { opacity: 0; pointer-events: none; }
.age-card { max-width: 380px; text-align: center; padding: 34px 28px 26px; border-radius: 26px; border: 1px solid var(--hair-gold);
  background: linear-gradient(180deg, rgba(30, 15, 40, .9), rgba(14, 8, 20, .92)); box-shadow: var(--shadow-float); }
.age-card .modal-mono { margin: 0 auto 16px; }
.age-card h2 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 32px; }
.age-card p { margin: 0 0 22px; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-dim); }
.age-card .primary { width: 100%; }
.age-no { display: inline-block; margin-top: 14px; font-size: 12px; color: var(--ink-faint); text-decoration: none; letter-spacing: .08em; }

/* cinematic dip between sets */
.set-veil { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0; background: radial-gradient(120% 100% at 50% 45%, #0b0612, #000); transition: opacity .6s var(--ease); }
.set-veil.on { opacity: 1; }
.mo-ch.gift .mo-num { border-color: rgba(255, 159, 196, .5); color: #ffb3cf; }

.bq-body > * { flex-shrink: 0; }

/* way home from a chapter set */
.set-home {
  position: fixed; left: 50%; top: calc(22px + env(safe-area-inset-top)); z-index: 30; transform: translate(-50%, -14px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--hair-gold);
  background: rgba(16, 8, 24, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: var(--gold-soft); font: inherit; font-family: var(--serif); font-style: italic; font-size: 15px; cursor: pointer;
  transition: opacity .5s var(--ease), transform .6s var(--spring);
}
.set-home.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.set-home:hover { border-color: var(--gold-soft); }

/* ---------- phones: drawers become full-width sheets, HUD fits one row ---------- */
@media (max-width: 860px) {
  .boutique {
    top: calc(64px + env(safe-area-inset-top)); left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom));
    width: auto; border-radius: 22px;
  }
  .bq-head { padding: 18px 18px 14px; }
  .bq-title { font-size: 26px; }
  .bq-body { padding: 14px 14px 18px; }
}
@media (max-width: 520px) {
  .hud-top-right { left: 8px; right: 8px; justify-content: space-between; }
  .hud-top-right .cam-toggle, .hud-top-right .hud-sep { display: none; }
  .hud-icon { width: 38px; height: 38px; }
  .hud-top-left { top: calc(66px + env(safe-area-inset-top)); }
  .set-home { top: calc(64px + env(safe-area-inset-top)); }
}

/* ---------- Account recovery, copy button, validation & compliance UI ---------- */
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.modal-head h2 { margin: 0; text-align: left; }
.modal-close {
  flex: none; min-width: 44px; min-height: 44px; display: grid; place-items: center;
  border: 1px solid var(--hair); border-radius: 50%; background: rgba(255, 255, 255, .03);
  color: var(--ink-dim); transition: color .2s, border-color .2s, transform .2s;
}
.modal-close:hover { color: var(--ink); border-color: var(--hair-gold); }
.modal-close:active { transform: scale(.95); }

.onboard-legal, .age-legal {
  margin-top: 12px; font-size: 11.5px; color: var(--ink-faint); line-height: 1.5;
}
.onboard-legal a, .age-legal a, .settings-legal a, .bq-legal a {
  color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px;
}
.onboard-legal a:hover, .age-legal a:hover, .settings-legal a:hover, .bq-legal a:hover { color: var(--gold-soft); }
.settings-legal {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; font-size: 11.5px;
}

.acc-sub { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-dim); font-family: var(--sans); font-style: normal; text-wrap: pretty; }
.acc-hint { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--gold-soft); }
.acc-key-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 14px; border-radius: 12px;
  border: 1px solid var(--hair-gold); background: rgba(12, 7, 19, .85);
}
.acc-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  letter-spacing: .04em; color: var(--gold-soft); word-break: break-all; user-select: all;
}

.copy { position: relative; display: inline-flex; align-items: center; flex: none; }
.copy-button {
  min-inline-size: 40px; min-block-size: 40px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--hair-hi); background: rgba(255, 255, 255, .04);
  color: var(--ink-dim); transition: color .2s, border-color .2s, transform .18s;
}
.copy-button:hover { color: var(--ink); border-color: var(--hair-gold); }
.copy-button:active { transform: scale(.95); }
.copy-button .ico-check { display: none; }
.copy-button[data-copied] { color: #8fe3b7; border-color: rgba(143, 227, 183, .55); }
.copy-button[data-copied] .ico-copy { display: none; }
.copy-button[data-copied] .ico-check { display: block; }
.copy-button[data-failed] { color: var(--rose); border-color: rgba(243, 154, 192, .6); }
.copy-tip {
  position: absolute; bottom: calc(100% + 6px); right: 0; pointer-events: none;
  padding: 4px 9px; border-radius: 8px; font-size: 11px; white-space: nowrap;
  background: var(--glass-strong); border: 1px solid var(--hair-gold); color: var(--ink);
  opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s;
}
.copy-button[data-copied] + .copy-tip,
.copy-button[data-failed] + .copy-tip { opacity: 1; transform: translateY(0); }

.acc-details {
  border-top: 1px solid var(--hair); padding-top: 8px;
}
.acc-details summary {
  min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 500; color: var(--ink-dim); cursor: pointer; list-style: none;
}
.acc-details summary::-webkit-details-marker { display: none; }
.acc-details summary::after { content: "+"; font-size: 15px; color: var(--gold-soft); }
.acc-details[open] summary::after { content: "−"; }
.acc-detail-body { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 6px; }
.acc-field-hint { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
.acc-err {
  display: none; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--rose); line-height: 1.35;
}
.modal label.ai-field input:is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--rose);
}
.modal label.ai-field input:is(:user-invalid, .user-invalid-fallback) + .acc-err {
  display: block;
}
.modal label.ai-field input:is(:user-valid, .user-valid-fallback) {
  border-color: rgba(143, 227, 183, .55);
}

.ledger-list { display: flex; flex-direction: column; gap: 8px; max-height: 180px; overflow-y: auto; }
.ledger-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--ink-dim); padding-bottom: 6px; border-bottom: 1px solid var(--hair);
  font-variant-numeric: tabular-nums;
}
.ledger-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ledger-row strong { color: var(--ink); font-weight: 500; }

.bq-plus-manage {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
}
.bq-manage-link {
  display: inline-flex; align-items: center; min-height: 36px; font-size: 12px; font-weight: 500;
  color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px;
}
.bq-sub-id { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.bq-protect {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--hair);
  background: rgba(255, 255, 255, .03); font-size: 12px; color: var(--ink-dim);
}
.bq-protect-btn {
  flex: none; min-height: 38px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--hair-gold); background: rgba(226, 184, 102, .1);
  color: var(--gold-soft); font-size: 12px; font-weight: 600;
}
.bq-protect-btn:active { transform: scale(.96); }
.bq-legal {
  margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--hair);
  display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 11.5px; color: var(--ink-faint);
}

.modal h2, .wardrobe-title, .bq-title, #onboardTitle { text-wrap: balance; }
@media (prefers-reduced-motion: reduce) {
  .avatar-ring { animation: none; }
  .app.is-speaking .avatar,
  .app.is-speaking .avatar-ring,
  .app.is-speaking #voiceBtn,
  .msg.her.is-live::before { filter: none; box-shadow: none; transition: none; }
}
