/* ═══════════ Studio v2 — "Editorial Night" ═══════════
   Same brand colours as the site (periwinkle → lavender → pink → peach), but calmer and sharper:
   type-led layouts (Unbounded caps + Cormorant italic accents + mono labels), hairlines instead of glows,
   a still background instead of animated stars, and instant view switches. Loaded after app.css/chat.css. */

:root {
  --bg: #060609;
  --bg2: #0b0b12;
  --s1: rgba(255, 255, 255, 0.035);
  --s2: rgba(255, 255, 255, 0.06);
  --s3: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.075);
  --line2: rgba(255, 255, 255, 0.14);
  --tx: #f5f3fb;
  --tx2: rgba(240, 238, 250, 0.66);
  --tx3: rgba(240, 238, 250, 0.4);
  --serif: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 20px;
  --r-sm: 14px;
}

/* ── first frame: nothing shows until the real screen is rendered (see app.js shown()) ── */
body.booting .app,
body.booting .tabbar,
body.booting .cta-bar { visibility: hidden; }

/* ── after the first screen: views switch instantly, nothing replays entrance animations ── */
.view.is-active { animation: viewFast 0.14s linear both; }
@keyframes viewFast { from { opacity: 0.4; } to { opacity: 1; } }
.settled .reveal,
.settled .view.is-active,
.settled .reveal * { animation: none !important; }
.reveal { animation-duration: 0.45s; }
.reveal:nth-child(n) { animation-delay: 0s; }

/* ── background: still, deep, a single brand glow and fine grain ── */
.sky { background: radial-gradient(90% 55% at 50% -12%, rgba(124, 108, 255, 0.22), transparent 70%), radial-gradient(70% 40% at 100% 108%, rgba(255, 141, 187, 0.12), transparent 70%), var(--bg); }
#stars, .constellation { display: none !important; }
.aurora { animation: none !important; opacity: 0.18; }
.grain { animation: none !important; opacity: 0.05; }

/* ── header ── */
.brand-text { font-family: var(--display); letter-spacing: -0.04em; }
.balance-pill { font-family: var(--mono); font-weight: 600; letter-spacing: -0.02em; box-shadow: inset 0 0 0 1px var(--line2); background: rgba(255, 255, 255, 0.04); }

/* ── hero: type does the work ── */
.hero { min-height: 0; padding: 18px 0 18px; }
.eyebrow { padding: 0; margin: 0 0 16px; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tx3); }
.eyebrow::before { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(180, 140, 255, 0.15); }
.hero-title { max-width: none; font-weight: 700; font-size: clamp(30px, 9.4vw, 42px); line-height: 0.96; letter-spacing: -0.06em; text-transform: uppercase; }
.hero-title .grad-text { display: inline-block; font-family: var(--serif); font-style: italic; font-weight: 500; text-transform: none; font-size: 1.22em; line-height: 0.9; letter-spacing: -0.02em; padding: 0.02em 0.08em 0.06em 0; animation: none; background-size: 100% 100%; }
.grad-text { animation: none; }
.view-title { font-weight: 700; font-size: 25px; line-height: 1; letter-spacing: -0.055em; text-transform: uppercase; margin: 20px 0 8px; }
.view-sub { font-size: 14px; }

/* ── showcase: one slow strip of editorial frames ── */
.showcase { gap: 0; margin-bottom: 14px; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.sc-row { gap: 8px; animation-duration: 70s; }
#scRow2:empty { display: none; }
.sc-item { width: 132px; height: 176px; border-radius: 14px; box-shadow: none; background: var(--bg2); transition: transform 0.18s ease; }
.sc-item::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); background: linear-gradient(180deg, transparent 70%, rgba(0, 0, 0, 0.28)); }
.sc-item img { opacity: 0; transition: opacity 0.35s ease; }
.sc-item img.is-loaded { opacity: 1; }
.sc-hint { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx3); }

/* ── cards: hairlines, no fog ── */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
.composer:focus-within { box-shadow: inset 0 0 0 1px rgba(180, 140, 255, 0.45), 0 0 0 4px rgba(180, 140, 255, 0.08); }
.feature-card { box-shadow: inset 0 0 0 1px var(--line2); }
.feature-card .fc-glow { opacity: 0.35; }
.fc-title { font-family: var(--display); letter-spacing: -0.04em; text-transform: uppercase; font-size: 15px; }
.fc-new { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ── controls ── */
.segmented { box-shadow: inset 0 0 0 1px var(--line); background: rgba(255, 255, 255, 0.025); }
.chip, .style, .q, .cnt, .tool { box-shadow: inset 0 0 0 1px var(--line); }
.btn-primary { border-radius: 16px; box-shadow: 0 10px 30px -14px rgba(180, 140, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.4); transition: transform 0.15s ease, filter 0.2s, opacity 0.2s; }
.btn-primary::after { animation: none; display: none; }
.cta-cost, .q-price, .pack-credits { font-family: var(--mono); letter-spacing: -0.02em; }

/* ── tab bar: flatter glass, fast indicator ── */
.tabbar { height: 58px; border-radius: 20px; background: rgba(10, 10, 16, 0.82); box-shadow: inset 0 0 0 1px var(--line2), 0 18px 40px -18px rgba(0, 0, 0, 0.95); }
.tab { font-size: 10px; letter-spacing: 0.01em; transition: color 0.15s; }
.tab svg { transition: none; }
.tab-ind { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px var(--line2); transition: transform 0.18s ease; }
.tab.is-on { color: var(--tx); }

/* ── small screens ── */
@media (max-width: 360px) {
  .hero-title { font-size: 28px; }
  .sc-item { width: 116px; height: 156px; }
}

/* the CTA bar follows the view switch without lag */
.cta-bar { transition: transform 0.16s ease, opacity 0.12s linear; }

/* ═══════════ v2 · part 2: line icons, cover cards, tiles, wallet ═══════════ */

/* line icons (icons.js) — currentColor strokes on a 24px grid */
svg.li { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.ic.ic-line { color: var(--ic-c, var(--tx)); }
.ic.ic-line::before, .ic.ic-line::after { display: none !important; content: none !important; }
.ic.ic-line > svg { width: 100% !important; height: 100% !important; }
.ib.ib-line, .ib.ib-bolt, .ib-bolt { display: inline-grid; place-items: center; width: 1.08em; height: 1.08em; vertical-align: -0.17em; }
.ib.ib-line svg, .ib.ib-bolt svg, .ib-bolt svg { width: 100%; height: 100%; }
.ib.ib-line .li { stroke-width: 2; }
.bolt { width: 18px; height: 18px; }
.bolt .ib-bolt { width: 100%; height: 100%; }

/* cover cards: a cinematic frame behind the text (art from tools/gen-showcase.mjs --cards) */
.feature-card { min-height: 112px; padding: 18px 16px; border-radius: 22px; background: #0b0b12; box-shadow: inset 0 0 0 1px var(--line2); isolation: isolate; }
.feature-card .fc-glow { display: none; }
.feature-card::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--fc-art, none) right center / cover no-repeat; opacity: 0.9; transition: transform 0.6s var(--ease); }
.feature-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(6, 6, 9, 0.96) 0%, rgba(6, 6, 9, 0.78) 42%, rgba(6, 6, 9, 0.12) 100%); }
.feature-card:active::before { transform: scale(1.03); }
.vd-card { --fc-art: url(/assets/cards/video.jpg); }
.ps-card { --fc-art: url(/assets/cards/photoshoot.jpg); }
.feature-card[data-tool-link="chat"] { background: radial-gradient(120% 140% at 100% 0%, rgba(180, 140, 255, 0.22), transparent 55%), #0b0b12; }
.fc-ic { width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.fc-ic.ic-line > svg { width: 22px !important; height: 22px !important; }
.fc-title { font-size: 15px; font-weight: 700; letter-spacing: -0.045em; text-transform: uppercase; }
.fc-sub { font-size: 12.5px; color: rgba(240, 238, 250, 0.72); max-width: 26ch; }
.fc-go { width: 36px; height: 36px; background: rgba(255, 255, 255, 0.92); }
.fc-go svg { stroke: #0b0b12; }

/* tool tiles: glyph in a tinted tile, no colour blobs */
.tool { border-radius: 18px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.tool::before { display: none; }
.tool-ic { width: 40px; height: 40px; margin: 0 0 2px; border-radius: 12px; color: var(--tool-c, var(--lav)); background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .tool-ic { background: color-mix(in srgb, var(--tool-c, #b48cff) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tool-c, #b48cff) 28%, transparent); }
}
.tool-ic .ic.ic-line { width: 21px; height: 21px; color: inherit; }
.tool-sm .tool-ic { width: 38px; height: 38px; margin: 0 0 4px; }
.tool-name { font-weight: 600; letter-spacing: -0.015em; }
.tool-cost { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--tx3); }
.tool-new, .fc-new { font-family: var(--mono); font-weight: 600; letter-spacing: 0.08em; }
.group-title { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; }
.trend-ic { font-size: 18px; }

/* quality cards */
.q .ic.ic-line { width: 20px; height: 20px; color: var(--lav); }
.q.is-on .ic.ic-line { color: var(--tx); }

/* wallet */
.pro-card .ic.ic-line, .pp-card .ic.ic-line { color: var(--peach); }
.pack .ic.ic-line { color: var(--lav); }
.bc-icon.ic-line .li { stroke: url(#tabGrad); stroke-width: 1.3; }
.pro-badge .ic.ic-line { width: 18px; height: 18px; }
.sc-hint .ic.ic-line { width: 15px; height: 15px; color: var(--lav); }

/* gallery empty state: three real frames fanned out instead of blank cards */
.empty-art { width: 150px; height: 112px; }
.empty-art span { width: 74px; height: 98px; border-radius: 12px; background: #0b0b12 center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 18px 30px -16px rgba(0, 0, 0, 0.9); }
.empty-art span:nth-child(1) { left: 4px; top: 8px; background-image: url(/assets/showcase/perfume.jpg); }
.empty-art span:nth-child(2) { left: 38px; top: 0; z-index: 1; background-image: url(/assets/showcase/silk.jpg); }
.empty-art span:nth-child(3) { left: 72px; top: 8px; background-image: url(/assets/showcase/tokyo.jpg); }

/* sheets: same type voice as the views */
.ts-title, .sheet-title { font-family: var(--display); letter-spacing: -0.045em; }

/* ═══════════ v2 · part 3: type and emoji ═══════════ */
/* Type scale: Unbounded for display, Onest for reading, Cormorant italic for accents, JetBrains Mono for data. */
body { font-feature-settings: 'ss01' on, 'cv11' on; text-rendering: optimizeLegibility; }
.md { font-size: 15.5px; line-height: 1.58; letter-spacing: -0.005em; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--display); font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; }
.md h3, .md h4 { font-size: 15px; text-transform: none; }
.md code { font-family: var(--mono); font-size: 0.88em; }
.md pre code { font-size: 12.5px; line-height: 1.55; }
.md b, .md strong { font-weight: 650; }
.me-text { font-size: 15.5px; line-height: 1.5; }

/* emoji inside messages: the bot's own Telegram pack, sized to the text */
.md .ib-pack, .me-text .ib-pack { display: inline-block; width: 1.32em; height: 1.32em; margin: 0 0.04em; vertical-align: -0.3em; }
.ib-pack img { width: 100%; height: 100%; object-fit: contain; filter: none; }

/* message actions: copy / listen — the listen button shows loading, playing and "tap again" */
.msg-act { display: inline-flex; align-items: center; gap: 6px; font-family: var(--body); font-weight: 600; letter-spacing: -0.005em; }
.msg-act .ib-line { width: 15px; height: 15px; vertical-align: 0; }
.msg-act.is-busy { opacity: 0.7; pointer-events: none; }
.msg-act.is-busy .ib-line { animation: spin 0.9s linear infinite; }
.msg-act.is-on { color: #0b0b12; background: var(--grad); box-shadow: none; }
.msg-act.is-ready { box-shadow: inset 0 0 0 1px rgba(180, 140, 255, 0.7); animation: readyPulse 1.2s ease-in-out infinite; }
@keyframes readyPulse { 50% { box-shadow: inset 0 0 0 1px rgba(180, 140, 255, 0.25), 0 0 0 4px rgba(180, 140, 255, 0.12); } }

/* ═══════════ v2 · part 4: sheets (video, music, photoshoot, photo tools) and the profile ═══════════ */
.sheet-panel { background: linear-gradient(180deg, #101019 0%, #09090f 220px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 -30px 60px -20px rgba(0, 0, 0, 0.9); border-radius: 26px 26px 0 0; }
.sheet-grip { background: rgba(255, 255, 255, 0.18); }
.ts-head { gap: 14px; }
.ts-ic { border-radius: 14px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line2); color: var(--lav); }
.ts-ic .ic.ic-line { width: 22px; height: 22px; }
.ts-title { font-weight: 700; font-size: 19px; letter-spacing: -0.05em; text-transform: uppercase; line-height: 1.05; }
.ts-sub { color: var(--tx2); font-size: 13px; }
.ts-label { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tx3); }
.ts-x { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line); }

/* choice cards in sheets: a hairline; the chosen one gets a brand-gradient outline instead of a heavy fill */
.ps-pack, .mu-kind, .me-row, .me-stat, .lang-item { background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.ps-pack .ic.ic-line, .mu-kind .ic.ic-line { width: 22px; height: 22px; color: var(--lav); }
.ps-pack .ic.ic-line { flex: none; width: 44px; height: 44px; padding: 11px; border-radius: 13px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--line); }
.ps-pack.is-on, .mu-kind.is-on, .lang-item.is-on {
  background: linear-gradient(#0d0d15, #0d0d15) padding-box, var(--grad) border-box;
  border: 1px solid transparent;
  box-shadow: 0 12px 30px -18px rgba(180, 140, 255, 0.9);
}
.ps-pack.is-on .ic.ic-line, .mu-kind.is-on .ic.ic-line { color: var(--tx); }
.ps-pack-t b, .mu-kind b { font-weight: 650; letter-spacing: -0.01em; }
.chip.is-on { background: rgba(180, 140, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(190, 170, 255, 0.55); }

/* profile */
.me-pane-head b, .me-name { font-weight: 700; letter-spacing: -0.045em; text-transform: uppercase; }
.me-stat b { font-family: var(--mono); font-weight: 600; letter-spacing: -0.03em; }
.me-stat small, .me-sub, .me-id { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.me-ic { border-radius: 12px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--line); color: var(--lav); }
.me-ic .ic.ic-line { width: 19px; height: 19px; }

/* ── owner panel: live strip, daily users, Vertex bar ── */
.adm-live { display: flex; align-items: center; gap: 8px; padding: 2px 2px 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx3); }
.adm-live i { width: 8px; height: 8px; border-radius: 50%; background: #7ee2b0; box-shadow: 0 0 0 0 rgba(126, 226, 176, 0.6); animation: admPulse 1.6s ease-out infinite; }
@keyframes admPulse { 0% { box-shadow: 0 0 0 0 rgba(126, 226, 176, 0.55); } 100% { box-shadow: 0 0 0 9px rgba(126, 226, 176, 0); } }
.adm-dau { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 92px; margin-top: 12px; }
.adm-dau div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.adm-dau i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: var(--grad); opacity: 0.9; }
.adm-dau small { font-family: var(--mono); font-size: 9px; color: var(--tx3); }
.adm-vbar { height: 8px; margin: 2px 0 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.adm-vbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7ee2b0, #b48cff 60%, #ff8d8d); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.adm-row .m { white-space: normal; }
@media (prefers-reduced-motion: reduce) { .adm-live i { animation: none; } }

/* ── avatar: the initial holds the place, the photo fades in over it ── */
.me-ava { position: relative; }
.me-ava .ava-l { position: absolute; inset: 0; display: grid; place-items: center; }
.me-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s ease; }
.me-ava img.is-on { opacity: 1; }

/* ── examples strip: driven by JS (startDrift) — drifts slowly, drags with inertia, taps pick an example ── */
.showcase { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.showcase:active { cursor: grabbing; }
.showcase .sc-row,
.settled .reveal .sc-row { animation: none !important; will-change: transform; }
.showcase .sc-item { -webkit-user-drag: none; }
.showcase .sc-item img { pointer-events: none; -webkit-user-drag: none; }
@media (hover: hover) { .sc-item:hover { transform: translateY(-3px); } }

/* a video still being shot after the Studio was reopened */
.vd-pill { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--safe-b, 0px) + 86px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px; font: 600 14px/1.2 inherit; color: #fff; background: rgba(24, 22, 44, 0.92); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 16px 32px -16px #000; backdrop-filter: blur(14px); white-space: nowrap; }
.vd-pill[hidden] { display: none; }
.vd-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: #a78bfa; animation: vdPulse 1.4s ease-in-out infinite; }
@keyframes vdPulse { 50% { opacity: 0.35; transform: scale(0.75); } }
/* speed card: green fast, red slow */
.adm-row .v.good { color: #7ee2b0; }
.adm-row .v.bad { color: #ff8a9a; }
