/* Brick Design Studio styles — "daylight studio" theme: cream paper, red→blue accents, edge sidebars, breathing-glow chat. */
:root {
  --bg0: #ece8dc; --bg1: #f6f3ec; --panel: #ffffff; --line: #e1ddd2;
  --txt: #1d2230; --dim: #5a6270; --accent: #d9262c; --gold: #c08a00;
  --glow1: #d9262c; --glow2: #2e6fe0; --glow3: #f0b43c;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 'Segoe UI', system-ui, sans-serif; color: var(--txt);
  background: radial-gradient(1300px 800px at 55% 15%, #fdfcf7 0%, var(--bg1) 45%, var(--bg0) 100%);
  overflow: hidden;
}
button {
  background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; font: 13px 'Segoe UI', sans-serif;
}
button:hover { border-color: #c8c2b2; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button:disabled { opacity: .5; cursor: default; }
input, textarea {
  background: rgba(255,255,255,.85); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: 14px 'Segoe UI', sans-serif; outline: none;
}
input:focus, textarea:focus { border-color: #9db4dd; }
.dim { color: var(--dim); font-size: 12.5px; }
.err { color: #c0262c; font-size: 13px; min-height: 18px; }
.spacer { flex: 1; }
.brand { font-weight: 600; font-size: 16px; letter-spacing: .3px; white-space: nowrap; }
.brand .logo { background: var(--accent); color: #fff; font-weight: 800; padding: 2px 7px; border-radius: 5px; margin-right: 2px; }
.pad { padding: 10px 14px; }

/* ---------- segmented controls ---------- */
.seg { display: flex; }
.seg button { border-radius: 0; }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.seg.mini button { padding: 3px 9px; font-size: 11.5px; }
.seg.mini button.on { background: linear-gradient(120deg, var(--glow1), var(--glow2)); border-color: transparent; }

/* ---------- landing ---------- */
.landing { position: relative; height: 100%; overflow-y: auto; overflow-x: hidden; }
.landing h1, .landing h2, .landing h3, .landing .pill, .landing .step b, .landing .cardtitle {
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
}
/* reveal-on-scroll (class added in markup; .in added by IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* layered backdrop: aurora blobs + perspective stud floor + dot field + film grain */
.land-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(110px); will-change: transform; }
.blob.b1 { width: 720px; height: 720px; left: -200px; top: -260px; background: rgba(58,123,213,.22); animation: drift1 19s ease-in-out infinite; }
.blob.b2 { width: 640px; height: 640px; right: -180px; top: -80px; background: rgba(226,59,63,.18); animation: drift2 23s ease-in-out infinite; }
.blob.b3 { width: 560px; height: 560px; left: 34%; bottom: -300px; background: rgba(240,180,60,.18); animation: drift1 27s ease-in-out infinite reverse; }
@keyframes drift1 { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(70px,40px) scale(1.12); } }
@keyframes drift2 { 0%, 100% { transform: translate(0,0) scale(1.05); } 50% { transform: translate(-60px,50px) scale(.95); } }
.floor {
  position: absolute; left: -25%; right: -25%; bottom: -16%; height: 56%;
  background-image: radial-gradient(circle at 14px 14px, rgba(46,111,224,.18) 4.5px, transparent 5.6px);
  background-size: 56px 56px;
  transform: perspective(620px) rotateX(63deg);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.85) 8%, transparent 82%);
  mask-image: linear-gradient(to top, rgba(0,0,0,.85) 8%, transparent 82%);
}
.studfield {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 5px 5px, rgba(30,40,60,.06) 2.4px, transparent 3.2px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(1100px 720px at 60% 12%, #000 0%, transparent 75%);
  mask-image: radial-gradient(1100px 720px at 60% 12%, #000 0%, transparent 75%);
}
.grain {
  position: absolute; inset: 0; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.landhead { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 20px 42px 4px; }
.navnote {
  font-size: 12px; color: #6a7180; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; background: rgba(255,255,255,.55); backdrop-filter: blur(8px);
}

.hero {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.12fr .88fr;
  gap: 30px; align-items: center; padding: 24px 56px 10px; max-width: 1460px; margin: 0 auto;
  min-height: calc(100vh - 190px);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  letter-spacing: 1.6px; text-transform: uppercase; color: #a32d2d;
  border: 1px solid rgba(217,38,44,.32); border-radius: 999px; padding: 6px 14px;
  background: linear-gradient(120deg, rgba(217,38,44,.08), rgba(46,111,224,.08));
}
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--glow1); box-shadow: 0 0 10px 2px rgba(217,38,44,.55); animation: pulse 2.4s ease-in-out infinite; }
.hero-copy h1 { font-size: clamp(38px, 4.6vw, 66px); font-weight: 700; line-height: 1.04; letter-spacing: -1.5px; margin: 22px 0 18px; }
.hero-copy h1 .grad { background: linear-gradient(100deg, var(--glow1) 10%, var(--glow2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy .sub { color: #5a6270; font-size: 17px; line-height: 1.6; max-width: 540px; margin: 0; }
.steps { display: flex; align-items: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.step {
  display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: #3a4150;
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px;
  background: rgba(255,255,255,.6); backdrop-filter: blur(8px);
}
.step b {
  font-size: 11px; letter-spacing: 1px; color: transparent;
  background: linear-gradient(120deg, var(--glow1), var(--glow2));
  -webkit-background-clip: text; background-clip: text;
}
.sarr { color: #b6b0a2; }

/* the jet flies over the card's shoulder: absolute behind, card pushed down */
.hero-side { position: relative; display: flex; justify-content: center; padding-top: 190px; }
.hero-jet {
  position: absolute; top: -30px; right: -40px; width: min(44vw, 640px); z-index: 0; pointer-events: none;
  filter: drop-shadow(0 30px 50px rgba(46,111,224,.28)) drop-shadow(0 8px 22px rgba(217,38,44,.16));
  animation: floaty 7s ease-in-out infinite;
  will-change: transform;
}
@keyframes floaty {
  0%, 100% { transform: translateY(-8px) rotate(-1.4deg); }
  50% { transform: translateY(8px) rotate(1deg); }
}
.authcard {
  position: relative; z-index: 1; width: 350px; display: flex; flex-direction: column; gap: 12px;
  padding: 26px 28px; border-radius: 20px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) padding-box,
    linear-gradient(150deg, rgba(217,38,44,.55), rgba(46,111,224,.40) 38%, rgba(46,111,224,.12) 75%) border-box;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(70,62,45,.18), 0 0 40px rgba(46,111,224,.07);
}
.cardtitle { margin: 0 0 4px; font-size: 18px; letter-spacing: -.2px; }
.authcard input { background: rgba(252,251,247,.9); }
.authcard input:focus { border-color: rgba(46,111,224,.55); box-shadow: 0 0 0 3px rgba(46,111,224,.13); }

.bento {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px; max-width: 1180px; margin: 26px auto 0; padding: 0 42px;
}
.bcard {
  border: 1px solid var(--line); border-radius: 18px; padding: 22px 22px 20px;
  background: rgba(255,255,255,.66); backdrop-filter: blur(10px);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, opacity .6s ease;
}
.bcard:hover { transform: translateY(-5px); border-color: rgba(46,111,224,.45); box-shadow: 0 18px 44px rgba(70,62,45,.16), 0 0 30px rgba(46,111,224,.08); }
.bico {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; border-radius: 12px; margin-bottom: 14px;
  background: linear-gradient(140deg, rgba(217,38,44,.10), rgba(46,111,224,.10));
  border: 1px solid rgba(217,38,44,.25);
}
.bcard h3 { margin: 0 0 8px; font-size: 16.5px; letter-spacing: -.2px; }
.bcard p { margin: 0; color: #5a6270; font-size: 13.5px; line-height: 1.55; }
.bcard.reveal:nth-child(2) { transition-delay: .08s; }
.bcard.reveal:nth-child(3) { transition-delay: .16s; }

.showcase { position: relative; z-index: 1; text-align: center; padding: 64px 24px 30px; }
.showcase h2 { font-size: clamp(24px, 2.6vw, 36px); letter-spacing: -.8px; margin: 0 0 34px; }
.showcase h2 .grad { background: linear-gradient(100deg, var(--glow1), var(--glow2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.shelf { display: flex; justify-content: center; align-items: flex-end; gap: 34px; flex-wrap: wrap; max-width: 1240px; margin: 0 auto; }
.modeltile { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.modeltile img { height: 200px; width: auto; filter: drop-shadow(0 18px 30px rgba(70,62,45,.35)); transition: transform .3s ease; }
.modeltile:hover img { transform: translateY(-8px) scale(1.04); }
.modeltile figcaption {
  font-size: 13px; color: #3a4150; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; background: rgba(255,255,255,.65);
}
.modeltile.reveal:nth-child(2) { transition-delay: .08s; }
.modeltile.reveal:nth-child(3) { transition-delay: .16s; }
.modeltile.reveal:nth-child(4) { transition-delay: .24s; }

.landfoot { position: relative; z-index: 1; text-align: center; color: #9a937f; font-size: 11.5px; padding: 34px 0 24px; }
.landfoot span { display: block; color: #6a7180; margin-bottom: 4px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding: 16px 26px 0; }
  .hero-side { padding-top: 0; margin-top: 14px; flex-direction: column; align-items: center; }
  .hero-jet { position: static; width: min(76vw, 480px); margin-bottom: -26px; }
  .bento { grid-template-columns: 1fr; }
}

/* ---------- auth ---------- */
.center-screen { height: 100%; display: flex; align-items: center; justify-content: center; }
.glowcard {
  position: relative; background: rgba(255,255,255,.92); border-radius: 18px; padding: 34px 38px;
  display: flex; flex-direction: column; gap: 12px; width: 340px;
  border: 1px solid transparent;
  background-clip: padding-box;
  animation: breathe 4.5s ease-in-out infinite;
}
.glowcard .tag { margin: -6px 0 8px; color: var(--dim); font-size: 13px; }
.glowcard .row { display: flex; gap: 10px; }
.glowcard .row button { flex: 1; }
.authseg { margin: 0 0 4px; }
.authseg button { flex: 1; padding: 8px 12px; font-size: 13px; }
#authNote { margin: -6px 0 0; font-size: 12px; }
#authGo { padding: 9px 12px; font-size: 14px; }

/* ---------- gallery ---------- */
.gallery { height: 100%; display: flex; flex-direction: column; }
.gallery header, .editor header {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: rgba(255,255,255,.78); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.gallery h2 { margin: 26px 36px 6px; font-size: 15px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--dim); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; padding: 16px 36px; overflow-y: auto; }
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 18px; cursor: pointer; min-height: 110px; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); border-color: #c8c2b2; box-shadow: 0 8px 26px -10px rgba(46,111,224,.25); }
.card .cname { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.card .cmeta { color: var(--dim); font-size: 12.5px; }
.card .del { position: absolute; top: 10px; right: 10px; padding: 2px 8px; font-size: 11px; opacity: 0; }
.card:hover .del { opacity: .8; }
.newcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-style: dashed; color: var(--dim); }
.newcard .plus { font-size: 30px; line-height: 1; color: var(--glow1); }
.newcard:hover { color: var(--txt); border-color: var(--glow1); }

/* ---------- editor layout: sidebars on opposite edges ---------- */
.editor { height: 100%; display: flex; flex-direction: column; }
.editor main { flex: 1; display: flex; min-height: 0; }
.namefield {
  background: transparent; border-color: transparent; font-size: 15px; font-weight: 600; width: 230px;
}
.namefield:hover, .namefield:focus { border-color: var(--line); background: rgba(255,255,255,.7); }
aside {
  width: 268px; min-width: 268px; background: rgba(251,250,245,.8); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; min-height: 0;
}
#leftbar { border-right: 1px solid var(--line); }
#rightbar { border-left: 1px solid var(--line); }
aside h2 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--dim); margin: 14px 14px 8px; }
#steplist { overflow-y: auto; flex: 1; }
#steplist .item { padding: 7px 14px; cursor: pointer; color: var(--dim); border-left: 3px solid transparent; font-size: 13px; }
#steplist .item:hover { color: var(--txt); }
#steplist .item.cur { color: var(--txt); border-left-color: var(--accent); background: rgba(217,38,44,.07); }
#stepparts { overflow-y: auto; flex: 1; padding: 4px 10px 14px; }
.pchip { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 6px; }
.pchip:hover { background: rgba(30,40,60,.05); }
.pchip img { width: 52px; height: 40px; object-fit: contain; background: rgba(30,40,60,.06); border-radius: 5px; }
.pchip .nm { font-size: 12.3px; line-height: 1.25; }
.pchip .nm small { color: var(--dim); display: block; }
.pchip .qty { margin-left: auto; font-weight: 700; color: var(--gold); font-size: 13px; text-align: right; }
.pchip .qty small { display: block; color: var(--dim); font-weight: 400; font-size: 10.5px; }
.pchip .shop { text-decoration: none; font-size: 13px; padding: 2px 4px; border-radius: 6px;
  opacity: .45; transition: opacity .12s; }
.pchip:hover .shop { opacity: 1; }
.pchip .shop:hover { background: rgba(30,40,60,.08); }
.partshead { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.partshead h2 { flex: 1; }
.partshead button { padding: 3px 10px; font-size: 11.5px; white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; border: 1px solid #0006; vertical-align: -1px; }

/* ---------- stage ---------- */
#stage { flex: 1; position: relative; min-width: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#cv:active { cursor: grabbing; }
#emptyHint {
  position: absolute; top: 56%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; color: var(--dim); font-size: 17px; pointer-events: none; line-height: 1.7;
}
#emptyHint span { font-size: 13.5px; opacity: .8; }
.toolbar { position: absolute; bottom: 16px; left: 16px; display: flex; gap: 6px; }
.toolbar button { padding: 5px 10px; font-size: 12px; background: rgba(255,255,255,.85); }
.explode {
  position: absolute; right: 16px; bottom: 16px; background: rgba(255,255,255,.85); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; color: var(--dim); display: flex; gap: 8px; align-items: center;
}
.explode input { width: 100px; accent-color: var(--accent); }
.stepbar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 16px;
  display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,.85);
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(6px);
}
.stepbar .lbl { min-width: 200px; text-align: center; font-size: 13px; }
.stepbar .lbl b { color: var(--gold); }
.stepbar input[type=range] { width: 180px; accent-color: var(--accent); }
#hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #9a9482; font-size: 11px; pointer-events: none; }
.editor #hint { left: auto; right: 180px; transform: none; }

/* ---------- the chat panel: snaps to any stage edge, breathing glow ---------- */
#chatPanel {
  position: absolute; z-index: 5;
  background: rgba(255,255,255,.88); backdrop-filter: blur(14px);
  border-radius: 20px; padding: 12px 14px 12px;
  border: 1px solid rgba(46,111,224,.30);
  animation: breathe 4.5s ease-in-out infinite;
  display: flex; flex-direction: column; gap: 8px;
}
#chatPanel.working { animation: breathe 1.4s ease-in-out infinite; }
#chatPanel.pos-top    { top: 18px; left: 50%; transform: translateX(-50%); width: min(620px, calc(100% - 48px)); }
#chatPanel.pos-bottom { bottom: 70px; left: 50%; transform: translateX(-50%); width: min(620px, calc(100% - 48px)); }
#chatPanel.pos-right  { top: 18px; bottom: 18px; right: 18px; width: min(360px, calc(100% - 48px)); }
#chatPanel.pos-left   { top: 18px; bottom: 18px; left: 18px;  width: min(360px, calc(100% - 48px)); }
#chatPanel.pos-right #chatLog, #chatPanel.pos-left #chatLog { flex: 1; max-height: none; }
#chatPanel.pos-right.min, #chatPanel.pos-left.min { bottom: auto; }
#chatPanel.dragging { opacity: .8; animation: none; }
.dockzone {
  position: absolute; z-index: 4; pointer-events: none; border-radius: 18px;
  border: 2px dashed rgba(46,111,224,.5); background: rgba(46,111,224,.07);
}
@keyframes breathe {
  0%, 100% {
    box-shadow: 0 0 14px 1px rgba(46,111,224,.16), 0 0 44px 6px rgba(217,38,44,.07),
                inset 0 0 18px rgba(46,111,224,.04);
    border-color: rgba(46,111,224,.22);
  }
  50% {
    box-shadow: 0 0 26px 5px rgba(46,111,224,.32), 0 0 70px 14px rgba(217,38,44,.14),
                inset 0 0 26px rgba(46,111,224,.08);
    border-color: rgba(46,111,224,.55);
  }
}
.chathead { display: flex; align-items: center; gap: 8px; font-size: 12.5px; letter-spacing: .6px;
  text-transform: uppercase; color: var(--dim);
  cursor: grab; touch-action: none; user-select: none; }
#chatPanel.dragging .chathead { cursor: grabbing; }
.chathead .grip { color: #b3ad9e; font-size: 13px; margin-right: -2px; }
.chathead button { padding: 2px 8px; font-size: 12px; background: transparent; border-color: transparent; }
.chathead button:hover { border-color: var(--line); }
#modelSeg button { flex: 1; padding: 3px 4px; white-space: nowrap; }
#keyBtn.set { filter: drop-shadow(0 0 4px rgba(22,163,74,.6)); }
.orb {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe3e3, var(--glow1) 60%, var(--glow2));
  animation: orbpulse 2.6s ease-in-out infinite;
}
@keyframes orbpulse {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(217,38,44,.5); }
  50% { box-shadow: 0 0 12px 4px rgba(46,111,224,.55); }
}
#keyPop { background: rgba(250,249,244,.95); border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; gap: 6px; }
#keyPop label { font-size: 11.5px; color: var(--dim); }
#keyPop .row { display: flex; gap: 8px; }
#keyPop input { flex: 1; }

/* ---------- first-run tips ---------- */
.tip {
  position: relative; background: #eef3fc; border: 1px solid #b9cdee; border-radius: 12px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
  display: flex; flex-direction: column; gap: 8px;
}
.tip .tiprow { display: flex; gap: 9px; align-items: flex-start; }
.tip .tipico { font-size: 16px; line-height: 1.3; }
.tip .row { display: flex; gap: 8px; align-items: center; }
.tip button { padding: 4px 12px; font-size: 12px; }
.tip .tiplink { color: var(--glow2); font-size: 12px; text-decoration: none; margin-left: auto; }
.tip .tiplink:hover { text-decoration: underline; }
.tip::after {
  content: ''; position: absolute; width: 11px; height: 11px;
  background: inherit; border-color: inherit; border-style: solid; transform: rotate(45deg);
}
#tipKey::after { top: -6.5px; right: 32px; border-width: 1px 0 0 1px; }      /* points up at the key button */
#tipPrompt::after { bottom: -6.5px; left: 36px; border-width: 0 1px 1px 0; } /* points down at the input */
.tip.crit { border-color: rgba(192,138,0,.65); box-shadow: 0 0 16px rgba(192,138,0,.16); }
#keyBtn.need { border-color: rgba(192,138,0,.75); animation: keyneed 1.6s ease-in-out infinite; }
@keyframes keyneed {
  0%, 100% { box-shadow: 0 0 3px rgba(192,138,0,.30); }
  50% { box-shadow: 0 0 10px 2px rgba(192,138,0,.55); }
}
/* ---------- build-complexity "age rating" slider ---------- */
.agehead {
  display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 0;
  font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--dim);
}
.agehead .ageblurb {
  margin-left: auto; text-transform: none; letter-spacing: .2px;
  font-size: 11px; color: #9a7a14; font-style: italic;
}
.agerow {
  display: flex; align-items: center; gap: 9px; padding: 1px 4px 0;
}
.agerow .fig { height: 21px; width: 21px; fill: var(--gold); opacity: .55; transition: opacity .15s, transform .15s; flex: none; }
.agerow .fig.baby { height: 17px; width: 17px; }
.agerow .fig.on { opacity: 1; transform: scale(1.12); filter: drop-shadow(0 0 5px rgba(192,138,0,.45)); }
.agerow input[type=range] { flex: 1; accent-color: var(--gold); height: 14px; min-width: 60px; }
.agerow .agelbl {
  font-size: 11px; font-weight: 800; color: #fff; background: var(--gold);
  border-radius: 5px; padding: 2px 6px; min-width: 26px; text-align: center; flex: none;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
}
#chatPanel.min .agerow { display: none; }

#chatLog { max-height: 34vh; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 2px; }
#chatLog:empty { display: none; }
.msg { max-width: 86%; padding: 8px 12px; border-radius: 14px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, #dde9fb, #d2e0f7); border: 1px solid #b9cdee; }
.msg.agent { align-self: flex-start; background: #ffffff; border: 1px solid var(--line); }

/* live thinking: dim italic stream, collapses to one line when the thought ends */
.msg.think {
  align-self: flex-start; max-width: 94%; background: transparent;
  border: 1px dashed rgba(46,111,224,.35); color: var(--dim);
  font-style: italic; font-size: 12px; line-height: 1.4; cursor: pointer;
}
.msg.think .tbody { max-height: 76px; overflow-y: auto; }
.msg.think.done .tbody { display: none; }
.msg.think.done.open .tbody { display: block; max-height: 180px; }
.msg.think .thead { color: #4a6db5; font-style: normal; font-size: 11px;
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 2px; }
.chip {
  align-self: center; font-size: 11.5px; color: var(--dim); background: rgba(30,40,60,.04);
  border: 1px dashed var(--line); border-radius: 999px; padding: 3px 12px;
}
.chip.status { color: #2e6fe0; border-color: #b9cdee; animation: pulse 1.6s ease-in-out infinite; }
.chip.err { color: #c0262c; border-color: #e4b9bb; animation: none; }
.chip.hello { border-style: solid; padding: 6px 14px; line-height: 1.5; }
@keyframes pulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }
.chatrow { display: flex; gap: 8px; align-items: flex-end; }
.chatrow textarea { flex: 1; resize: none; max-height: 110px; border-radius: 12px; }
.chatrow .primary { border-radius: 12px; padding: 8px 14px; }
#chatPanel.min #chatLog, #chatPanel.min .chatrow, #chatPanel.min #keyPop, #chatPanel.min .tip, #chatPanel.min #modelSeg { display: none; }
#chatPanel.min { width: 300px; }

/* ---------- buy-all modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(45,40,30,.4);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center;
}
.modal { width: min(560px, calc(100% - 40px)); }
.modal textarea { font: 11.5px/1.4 Consolas, monospace; resize: vertical; }
.modal .row { display: flex; gap: 8px; flex-wrap: wrap; }
.modal .row .primary { flex: 1; }

/* auth card shares the glow */
.glowcard.auth { animation-duration: 5.5s; }
