:root {
  color-scheme: dark;
  --bg: #070b18;
  --bg-soft: #0c1226;
  --panel: rgba(17, 25, 52, .78);
  --panel-solid: #111934;
  --panel-2: #161f3e;
  --line: rgba(160, 174, 255, .15);
  --line-strong: rgba(160, 174, 255, .28);
  --text: #f5f6ff;
  --muted: #9da8c8;
  --faint: #697391;
  --primary: #8b5cf6;
  --primary-2: #6d5dfc;
  --primary-soft: rgba(139, 92, 246, .16);
  --cyan: #50d5ff;
  --success: #42d49b;
  --warning: #ffbf69;
  --danger: #ff6b8a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --max: 1180px;
}

/* GPT-style conversation portal (v2.2) */
.studio-conversation {
  width: min(100%, 900px);
  padding: 42px 28px 210px;
}
.studio-turn-list { display: grid; gap: 34px; }
.studio-user-turn { margin: 0; }
.studio-user-bubble {
  display: grid;
  max-width: min(76%, 680px);
  padding: 12px 16px;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 22px 22px 6px 22px;
  background: #303136;
  color: #f4f4f5;
  line-height: 1.55;
  box-shadow: none;
}
.studio-user-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.studio-user-reference {
  display: block;
  width: min(280px, 100%);
  max-height: 240px;
  border-radius: 14px;
  object-fit: cover;
}
.studio-user-reference-placeholder {
  width: max-content;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #cfcfd2;
  font-size: 12px;
}
.studio-assistant-turn {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
.studio-assistant-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 9px;
  background: #f2f3f5;
  color: #17181a;
  font-size: 12px;
  font-weight: 750;
}
.studio-assistant-content { min-width: 0; padding-top: 4px; }
.studio-status-turn {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d8d8db;
}
.studio-status-turn[data-tone="error"] { color: #ff9ba4; }
.studio-status-turn[data-tone="warning"] { color: #f3c982; }
.studio-status-turn[data-tone="success"] { color: #b8bdc8; }
.studio-status-turn .status-line { display: flex; align-items: center; gap: 9px; color: inherit; line-height: 1.55; }
.studio-status-turn .progress { width: min(420px, 100%); height: 2px; margin-top: 11px; background: rgba(255,255,255,.07); }
.studio-status-turn .progress-bar { background: linear-gradient(90deg, #a9b8ff, #d4c9ff); }
.assistant-thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9d9df;
  box-shadow: 14px 0 rgba(217,217,223,.42), 28px 0 rgba(217,217,223,.17);
  animation: assistant-thinking 1.15s ease-in-out infinite;
  margin-right: 28px;
}
@keyframes assistant-thinking {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}
.studio-result-content { margin-top: 16px; }
.studio-result-heading { margin: 0 0 14px; }
.studio-result-heading strong { color: #f2f2f4; font-size: 15px; }
.studio-result-heading span { color: #83858c; }
.studio-result-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.studio-result-gallery .image-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: #18191b;
}
.studio-result-gallery .image-preview { display: block; background: #111214; }
.studio-result-gallery .image-preview img { width: 100%; height: auto; min-height: 150px; max-height: 580px; object-fit: contain; }
.studio-result-gallery .image-actions { justify-content: flex-end; padding: 9px 10px 10px; }
.chat-image-download {
  padding: 6px 10px;
  border-radius: 8px;
  color: #d7d7db;
  background: rgba(255,255,255,.07);
  font-size: 12px;
}
.chat-image-download:hover { color: #fff; background: rgba(255,255,255,.12); }

.studio-composer-dock {
  padding: 18px 28px 14px;
  background: linear-gradient(180deg, rgba(32,33,35,0), #202123 24%, #202123 100%);
}
.studio-composer {
  position: relative;
  width: min(100%, 820px);
  padding: 8px 9px 8px 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 26px;
  background: #2b2c2f;
  box-shadow: 0 8px 32px rgba(0,0,0,.24);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.studio-composer::before {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: none;
  place-items: center;
  border: 2px dashed #aebaff;
  border-radius: inherit;
  background: rgba(37,38,42,.96);
  color: #f0f1ff;
  content: "松开图片即可添加";
  font-size: 14px;
  font-weight: 650;
}
.studio-composer.is-dragging::before { display: grid; }
.studio-composer:focus-within { border-color: rgba(255,255,255,.24); box-shadow: 0 12px 38px rgba(0,0,0,.3); }
.studio-composer .composer-input-row { display: flex; align-items: flex-end; min-height: 44px; gap: 10px; }
.studio-composer textarea {
  min-height: 44px;
  max-height: 190px;
  padding: 11px 2px 9px;
  color: #f2f2f4;
  line-height: 1.5;
}
.studio-composer textarea::placeholder { color: #8c8e95; }
.composer-send-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #f3f3f4;
  color: #1d1e20;
}
.composer-send-button:hover:not(:disabled) { background: #fff; transform: none; }
.composer-send-button:disabled { background: #46474b; color: #85868a; }
.composer-attachment-preview {
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin: 2px 0 7px;
  padding: 6px 8px 6px 6px;
  gap: 9px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 13px;
  background: #232427;
}
.composer-attachment-preview[hidden] { display: none; }
.composer-attachment-preview img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; }
.composer-attachment-preview > span { display: grid; min-width: 0; line-height: 1.25; }
.composer-attachment-preview strong { color: #e7e7ea; font-size: 12px; }
.composer-attachment-preview small { margin-top: 3px; color: #86888e; font-size: 10px; }
.composer-attachment-preview button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  color: #b8b9bd;
  cursor: pointer;
}
.studio-composer-note { margin-top: 8px; color: #73757b; font-size: 10px; }

@media (max-width: 760px) {
  .studio-conversation { padding: 24px 15px 180px; }
  .studio-turn-list { gap: 27px; }
  .studio-user-bubble { max-width: 88%; }
  .studio-assistant-turn { grid-template-columns: 26px minmax(0,1fr); gap: 10px; }
  .studio-assistant-mark { width: 26px; height: 26px; border-radius: 8px; }
  .studio-composer-dock { padding: 12px 10px 9px; }
  .studio-composer { padding-left: 14px; border-radius: 23px; }
  .studio-result-gallery { grid-template-columns: 1fr; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -4%, rgba(93, 61, 232, .25), transparent 30rem),
    radial-gradient(circle at 95% 12%, rgba(23, 147, 205, .13), transparent 28rem),
    var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .26;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 75%);
}

a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, [role="button"] { cursor: pointer; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color: #111;
}
.skip-link:focus { top: 16px; }

.container { width: min(calc(100% - 36px), var(--max)); margin: 0 auto; }
.page { min-height: calc(100vh - 150px); padding: 36px 0 64px; }
.page-narrow { width: min(calc(100% - 36px), 720px); margin: 0 auto; }
.stack { display: grid; gap: 18px; }
.stack-sm { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tiny { font-size: 12px; }
.small { font-size: 14px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }
.money { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(160,174,255,.1);
  background: rgba(7, 11, 24, .78);
  backdrop-filter: blur(20px) saturate(135%);
}

.nav-shell {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo {
  width: 38px;
  height: 38px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  background: #f7f9ff;
  box-shadow: 0 10px 30px rgba(35, 91, 255, .18);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 11px;
  background: linear-gradient(145deg, var(--primary), #3949d7);
  box-shadow: 0 10px 30px rgba(110, 79, 244, .3);
  font-weight: 900;
}
.brand-logo:not([hidden]) + .brand-mark { display: none; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-name { font-weight: 780; letter-spacing: -.02em; }
.brand-tagline { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.brand-copy strong { font-weight: 780; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }

.nav-menu { display: flex; align-items: center; gap: 10px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  transition: .18s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.06); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-menu a, .nav-logout {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
}
.nav-menu a:hover, .nav-logout:hover { color: #fff; background: rgba(255,255,255,.06); }
.logout-form { margin: 0; }
.balance { display: inline-flex; padding: 6px 10px; border: 1px solid rgba(80,213,255,.2); border-radius: 999px; color: #bdefff; background: rgba(80,213,255,.07); font-size: 13px; }
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid rgba(80,213,255,.2);
  border-radius: 999px;
  color: #bdefff;
  background: rgba(80,213,255,.07);
  font-size: 13px;
}
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255,255,255,.07);
  font-weight: 680;
  font-size: 14px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.11); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .input:focus, .select:focus, .textarea:focus {
  outline: 3px solid rgba(139,92,246,.22);
  border-color: rgba(168,140,255,.72);
}
.btn-primary {
  border-color: rgba(255,255,255,.1);
  background: linear-gradient(135deg, #9467ff, #6255e7);
  box-shadow: 0 12px 30px rgba(110, 79, 244, .24);
}
.btn-primary:hover { background: linear-gradient(135deg, #a17aff, #7063f4); }
.btn-secondary { border-color: var(--line); background: rgba(255,255,255,.035); }
.btn-danger { border-color: rgba(255,107,138,.22); color: #ffc2cf; background: rgba(255,107,138,.1); }
.btn-success { border-color: rgba(66,212,155,.22); color: #baffdf; background: rgba(66,212,155,.1); }
.btn-sm { min-height: 34px; padding: 6px 11px; border-radius: 9px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 12px 22px; border-radius: 14px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { cursor: not-allowed; opacity: .5; transform: none; }
.link-button { border: 0; padding: 8px 10px; color: var(--muted); background: none; }
.link-button:hover { color: #fff; }

.hero {
  position: relative;
  padding: 86px 0 72px;
  overflow: hidden;
}
.hero::after {
  position: absolute;
  top: 60px;
  right: max(5vw, 30px);
  width: 310px;
  height: 310px;
  content: "";
  border-radius: 50%;
  background: conic-gradient(from 90deg, rgba(80,213,255,.08), rgba(139,92,246,.28), rgba(80,213,255,.08));
  filter: blur(2px);
  opacity: .7;
  mask-image: radial-gradient(circle, transparent 40%, #000 41%, #000 44%, transparent 45%, transparent 54%, #000 55%, transparent 64%);
}
.hero-inner { position: relative; z-index: 1; max-width: 820px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 999px;
  color: #c9baff;
  background: rgba(139,92,246,.1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow::before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.hero h1 {
  max-width: 760px;
  margin: 24px 0 20px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.06;
  letter-spacing: -.055em;
}
.gradient-text { color: transparent; background: linear-gradient(100deg, #fff 0%, #b9a9ff 45%, #64dafd 100%); -webkit-background-clip: text; background-clip: text; }
.hero-copy { max-width: 640px; margin: 0; color: #afb9d6; font-size: clamp(16px, 2vw, 19px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 42px; color: var(--muted); font-size: 13px; }
.trust-row span::before { margin-right: 7px; color: var(--success); content: "✓"; }

.feature-grid, .stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-card, .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(20,29,59,.86), rgba(12,18,38,.8));
  box-shadow: 0 18px 45px rgba(0,0,0,.13);
}
.feature-card { padding: 24px; }
.feature-card h3 { margin: 14px 0 8px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 14px; }
.feature-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #d8d0ff; background: var(--primary-soft); font-weight: 800; }
.section { padding: 62px 0; }
.section-title { margin: 0 0 10px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.035em; }
.section-copy { max-width: 650px; margin: 0 0 30px; color: var(--muted); }

.card { padding: 22px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.card-title { margin: 0; font-size: 18px; letter-spacing: -.015em; }
.card-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.card-footer { margin: 20px -22px -22px; padding: 16px 22px; border-top: 1px solid var(--line); background: rgba(0,0,0,.08); border-radius: 0 0 var(--radius) var(--radius); }
.card-accent { position: relative; overflow: hidden; }
.card-accent::before { position: absolute; inset: 0 auto 0 0; width: 3px; content: ""; background: linear-gradient(var(--primary), var(--cyan)); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); }

.alert { margin-bottom: 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.page > .alert { width: min(calc(100% - 36px), var(--max)); margin-right: auto; margin-left: auto; }
.alert-success { border-color: rgba(66,212,155,.3); color: #baf8dd; background: rgba(66,212,155,.09); }
.alert-error { border-color: rgba(255,107,138,.3); color: #ffc1ce; background: rgba(255,107,138,.09); }
.alert-warning { border-color: rgba(255,191,105,.3); color: #ffe0b6; background: rgba(255,191,105,.09); }
.alert-info { border-color: rgba(80,213,255,.25); color: #c4f2ff; background: rgba(80,213,255,.07); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #dbe0f1; font-size: 13px; font-weight: 650; }
.label small { color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(4,8,20,.58);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input, .select { padding: 9px 12px; }
.textarea { min-height: 132px; padding: 12px; resize: vertical; line-height: 1.65; }
.input::placeholder, .textarea::placeholder { color: #5e6887; }
.input:disabled, .select:disabled, .textarea:disabled { cursor: not-allowed; opacity: .56; }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.help { margin: 0; color: var(--muted); font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.checkbox, .radio { display: inline-flex; align-items: center; gap: 8px; color: #d8dced; font-size: 14px; }
.checkbox input, .radio input { width: 17px; height: 17px; accent-color: var(--primary); }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

.auth-page { display: grid; place-items: center; min-height: calc(100vh - 70px); padding: 42px 18px; }
.auth-shell { width: min(100%, 460px); }
.auth-brand { justify-content: center; margin-bottom: 24px; }
.auth-card { padding: 30px; }
.auth-title { margin: 0 0 7px; text-align: center; font-size: 28px; letter-spacing: -.03em; }
.auth-copy { margin: 0 0 24px; color: var(--muted); text-align: center; font-size: 14px; }
.auth-foot { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.auth-foot a { color: #c7b8ff; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 20px; align-items: start; }
.generator-card { padding: 26px; }
.prompt-field { position: relative; }
.prompt-count { position: absolute; right: 12px; bottom: 9px; color: var(--faint); font-size: 11px; }
.quality-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.quality-option { position: relative; }
.quality-option input { position: absolute; opacity: 0; pointer-events: none; }
.quality-tile { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); transition: .18s ease; }
.quality-tile strong { font-size: 14px; }
.quality-tile small { color: var(--muted); font-size: 11px; }
.quality-option input:checked + .quality-tile { border-color: rgba(159,130,255,.75); background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(159,130,255,.2); }
.quality-option input:disabled + .quality-tile { opacity: .38; cursor: not-allowed; }

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 148px;
  padding: 20px;
  border: 1px dashed rgba(162,145,255,.38);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(108,85,225,.055);
  text-align: center;
  transition: .18s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: #a98eff; background: rgba(108,85,225,.11); }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.dropzone strong { display: block; margin-bottom: 4px; color: #e2ddff; }
.upload-icon { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 10px; border-radius: 12px; color: #cfc4ff; background: rgba(139,92,246,.15); }
.file-list { display: grid; gap: 8px; margin-top: 10px; }
.file-chip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); font-size: 12px; }

.estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 15px;
  border: 1px solid rgba(139,92,246,.22);
  border-radius: 13px;
  background: rgba(139,92,246,.08);
}
.estimate-label { color: var(--muted); font-size: 12px; }
.estimate-value { display: block; margin-top: 2px; font-size: 23px; font-weight: 780; letter-spacing: -.025em; }
.estimate-note { max-width: 240px; color: var(--muted); font-size: 11px; text-align: right; }

.status-panel { min-height: 100px; }
.status-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.16); border-top-color: #a78bfa; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 7px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.progress-bar { height: 100%; width: 16%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--cyan)); transition: width .35s ease; }

.summary-card { padding: 20px; }
.summary-value { margin: 6px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.035em; }
.summary-list { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.summary-list li { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.summary-list strong { color: var(--text); font-weight: 650; }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.image-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-solid); }
.image-preview { position: relative; aspect-ratio: 1; overflow: hidden; background: #090e1e; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.image-card:hover .image-preview img { transform: scale(1.02); }
.image-meta { padding: 12px; }
.image-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.empty-state { display: grid; place-items: center; min-height: 230px; padding: 34px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; color: #c8bbff; background: var(--primary-soft); font-size: 22px; }

.filters { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(130px, .55fr)) auto; gap: 10px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; background: rgba(10,15,32,.5); }
.table th, .table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
.table th { color: var(--muted); background: rgba(255,255,255,.025); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255,255,255,.018); }
.table .actions { text-align: right; }
.table-empty { padding: 42px !important; color: var(--muted); text-align: center !important; }
.thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 9px; background: #080d1c; }
.task-cell { display: flex; align-items: center; gap: 11px; max-width: 360px; }
.task-prompt { overflow: hidden; color: #e4e7f2; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge::before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: currentColor; }
.badge-success, .badge-completed, .badge-active, .badge-succeeded { border-color: rgba(66,212,155,.24); color: var(--success); background: rgba(66,212,155,.08); }
.badge-danger, .badge-failed, .badge-disabled, .badge-suspended, .badge-canceled { border-color: rgba(255,107,138,.24); color: var(--danger); background: rgba(255,107,138,.08); }
.badge-generation_restricted { color: #a54b08; background: #fff4e5; border: 1px solid #edc497; }
.badge-warning, .badge-processing, .badge-partially_succeeded, .badge-running, .badge-asset_pending, .badge-needs_reconcile { border-color: rgba(255,191,105,.24); color: var(--warning); background: rgba(255,191,105,.08); }
.badge-info, .badge-pending, .badge-queued { border-color: rgba(80,213,255,.24); color: var(--cyan); background: rgba(80,213,255,.08); }
.badge-neutral::before { display: none; }

.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.page-link { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 13px; }
.page-link:hover, .page-link.active { border-color: rgba(139,92,246,.45); color: #fff; background: var(--primary-soft); }

.admin-tabs { display: flex; gap: 5px; margin-bottom: 24px; padding: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(10,15,32,.62); scrollbar-width: thin; }
.admin-tab { flex: 0 0 auto; padding: 8px 11px; border-radius: 9px; color: var(--muted); font-size: 13px; }
.admin-tab:hover, .admin-tab.active { color: #fff; background: rgba(139,92,246,.15); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .38fr); gap: 18px; align-items: start; }
.stat-card { padding: 20px; }
.stat-label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.stat-value { margin: 8px 0 2px; font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -.035em; }
.stat-note { color: var(--faint); font-size: 11px; }
.metric-positive { color: var(--success); }
.metric-negative { color: var(--danger); }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: #d8cfff; background: var(--primary-soft); }

.setting-section + .setting-section { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.setting-section h3 { margin: 0 0 4px; font-size: 16px; }
.setting-section > p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: relative; width: 42px; height: 24px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(255,255,255,.08); transition: .2s ease; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; content: ""; border-radius: 50%; background: #aeb6cf; transition: .2s ease; }
.switch input:checked + .switch-track { border-color: rgba(139,92,246,.6); background: rgba(139,92,246,.48); }
.switch input:checked + .switch-track::after { left: 21px; background: #fff; }

.price-grid { overflow-x: auto; }
.price-table { min-width: 820px; }
.price-input { width: 104px; min-height: 36px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: rgba(0,0,0,.2); }
.quality-row { display: grid; grid-template-columns: 22px .72fr 1.1fr .78fr .52fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.quality-row:last-child { border-bottom: 0; }
.drag-handle { color: var(--faint); cursor: grab; user-select: none; }

.detail-list { display: grid; gap: 0; margin: 0; }
.detail-row { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 13px; }
.detail-row dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.code-block { padding: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; color: #cdd5ee; background: #080d1c; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }

.site-footer { padding: 26px 0; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.toast-wrap { position: fixed; top: 84px; right: 18px; z-index: 500; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(17,25,52,.96); box-shadow: var(--shadow); animation: toast-in .22s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 980px) {
  .workspace, .admin-grid { grid-template-columns: 1fr; }
  .feature-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters > :first-child { grid-column: 1 / -1; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-toggle { display: grid; place-items: center; }
  .nav-menu {
    position: absolute;
    top: 70px;
    right: 18px;
    left: 18px;
    display: none;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(10,15,32,.98);
    box-shadow: var(--shadow);
  }
  .nav-menu.open { display: grid; gap: 8px; }
  .nav-menu .nav-links, .nav-menu .nav-actions { align-items: stretch; flex-direction: column; }
  .nav-menu .nav-link, .nav-menu .btn, .nav-menu .balance-pill { width: 100%; justify-content: flex-start; }
  .nav-menu a, .nav-menu .balance, .nav-menu .nav-logout, .nav-menu .logout-form { width: 100%; justify-content: flex-start; }
}

@media (max-width: 680px) {
  .container { width: min(calc(100% - 24px), var(--max)); }
  .page { padding: 26px 0 46px; }
  .hero { padding: 58px 0 52px; }
  .hero h1 { font-size: 42px; }
  .feature-grid, .stats-grid, .form-grid, .form-grid-3, .gallery, .quality-picker { grid-template-columns: 1fr; }
  .page-heading, .split { align-items: flex-start; flex-direction: column; }
  .card, .generator-card { padding: 18px; }
  .card-footer { margin-right: -18px; margin-bottom: -18px; margin-left: -18px; }
  .estimate { align-items: flex-start; flex-direction: column; }
  .estimate-note { max-width: none; text-align: left; }
  .filters { grid-template-columns: 1fr; }
  .filters > :first-child { grid-column: auto; }
  .quality-row { grid-template-columns: 22px 1fr auto; }
  .quality-row > .mobile-break { grid-column: 2 / -1; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .auth-card { padding: 23px 19px; }
  .brand-tagline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Conversation-style image studio */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.studio-page,
body:has(.studio-app) {
  overflow: hidden;
  background: #101114;
}
body.studio-page::before,
body:has(.studio-app)::before { display: none; }
body.studio-page > .site-header,
body.studio-page > .site-footer,
body:has(.studio-app) > .site-header,
body:has(.studio-app) > .site-footer { display: none; }
body.studio-page > .page,
body:has(.studio-app) > .page {
  height: 100vh;
  min-height: 0;
  padding: 0;
}
body.studio-page > .page > .alert,
body:has(.studio-app) > .page > .alert {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 100;
  width: min(calc(100% - 28px), 560px);
  margin: 0;
  transform: translateX(-50%);
  box-shadow: 0 16px 42px rgba(0,0,0,.28);
}

.studio-app {
  --studio-sidebar: 274px;
  --studio-line: rgba(255, 255, 255, .105);
  --studio-muted: #9b9b9b;
  --studio-surface: #202123;
  --studio-surface-hover: #2b2c2f;
  --studio-composer: #2b2c2f;
  display: grid;
  grid-template-columns: var(--studio-sidebar) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  min-height: 0;
  color: #ececec;
  background: #101114;
  transition: grid-template-columns .22s ease;
}

.studio-app svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.studio-sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border-right: 1px solid rgba(255,255,255,.055);
  flex-direction: column;
  background: #171719;
  transition: width .22s ease, transform .22s ease;
}

.studio-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 8px;
}

.studio-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 4px;
  border-radius: 10px;
}
.studio-brand:hover { background: rgba(255,255,255,.05); }
.studio-brand .brand-logo,
.studio-brand .brand-mark {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
}
.studio-brand .brand-logo { padding: 3px; }
.studio-brand .brand-mark { font-size: 14px; }
.studio-brand > .studio-sidebar-label { display: grid; min-width: 0; line-height: 1.15; }
.studio-brand strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.studio-brand small { margin-top: 3px; color: #777; font-size: 9px; letter-spacing: .08em; }

.studio-icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #b7b7b7;
  background: transparent;
}
.studio-icon-button:hover { color: #fff; background: rgba(255,255,255,.075); }
.studio-icon-button:focus-visible,
.studio-new-button:focus-visible,
.studio-history-item:focus-visible,
.composer-attach-button:focus-within,
.composer-send-button:focus-visible,
.composer-quality-chip input:focus-visible + span,
.composer-product-type input:focus-visible + span,
.composer-select-chip:focus-within {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

.studio-new-button {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 14px 0 12px;
  padding: 8px 11px;
  gap: 10px;
  border: 1px solid var(--studio-line);
  border-radius: 11px;
  color: #f0f0f0;
  background: rgba(255,255,255,.025);
  font-size: 14px;
  font-weight: 600;
}
.studio-new-button:hover { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.07); }

.studio-history {
  min-height: 0;
  overflow: hidden;
  flex: 1;
}
.studio-sidebar-section-title {
  padding: 9px 9px 7px;
  color: #787878;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .03em;
}
.studio-sidebar-empty { margin: 8px 9px; color: #6f6f6f; font-size: 12px; }
.studio-history-list { display: grid; gap: 2px; }
.studio-history-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 7px;
  align-items: center;
  min-height: 50px;
  padding: 7px 8px;
  gap: 8px;
  border-radius: 9px;
  color: #c8c8c8;
}
.studio-history-item:hover { color: #fff; background: rgba(255,255,255,.065); }
.studio-history-item > svg { width: 18px; height: 18px; color: #777; }
.studio-history-copy { display: grid; min-width: 0; line-height: 1.25; }
.studio-history-copy > span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.studio-history-copy small { margin-top: 3px; overflow: hidden; color: #707070; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.studio-history-status { display: block; width: 6px; height: 6px; min-width: 6px; border-radius: 50%; background: #4fca91; }
.studio-history-status.status-pending,
.studio-history-status.status-processing,
.studio-history-status.status-queued,
.studio-history-status.status-running,
.studio-history-status.status-asset_pending,
.studio-history-status.status-needs_reconcile { background: #70b7ff; box-shadow: 0 0 8px rgba(112,183,255,.45); }
.studio-history-status.status-failed,
.studio-history-status.status-cancelled,
.studio-history-status.status-canceled { background: #ff747f; }
.studio-all-history { display: block; margin: 7px 8px; color: #888; font-size: 12px; }
.studio-all-history:hover { color: #ddd; }

.studio-account {
  padding: 12px 8px 5px;
  border-top: 1px solid rgba(255,255,255,.075);
}
.studio-account-balance { display: flex; align-items: center; gap: 10px; }
.studio-account-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  min-width: 31px;
  border-radius: 50%;
  color: #d9d1ff;
  background: rgba(139,92,246,.2);
  font-size: 13px;
  font-weight: 800;
}
.studio-account-balance > .studio-sidebar-label { display: grid; line-height: 1.2; }
.studio-account-balance small { color: #777; font-size: 10px; }
.studio-account-balance strong { margin-top: 2px; font-size: 13px; }
.studio-quota { display: flex; margin-top: 10px; gap: 7px; color: #777; font-size: 9px; }
.studio-quota span { padding-right: 7px; border-right: 1px solid rgba(255,255,255,.08); }
.studio-quota span:last-child { padding-right: 0; border-right: 0; }
.studio-balance-note { margin: 8px 0 0; color: #656565; font-size: 9px; }
.studio-account-actions { display: grid; margin-top: 10px; gap: 3px; }
.studio-account-actions form { margin: 0; }
.studio-account-actions a,
.studio-account-actions button {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  padding: 6px 8px;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  color: #858585;
  background: transparent;
  font: inherit;
  font-size: 11px;
  text-align: left;
}
.studio-account-actions a:hover,
.studio-account-actions button:hover { color: #eee; background: rgba(255,255,255,.055); }
.studio-account-actions svg { width: 16px; height: 16px; min-width: 16px; }

.studio-main {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #101114;
}
.studio-main-head {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 8px 18px;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  background: rgba(16,17,20,.88);
  backdrop-filter: blur(12px);
}
.studio-main-title { display: flex; align-items: center; min-width: 0; gap: 9px; }
.studio-main-title strong { font-size: 14px; }
.studio-main-title span {
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: #888;
  font-size: 9px;
  letter-spacing: .04em;
}

.studio-chat-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  scrollbar-color: #454545 transparent;
}
.studio-conversation {
  width: min(100%, 960px);
  min-height: 100%;
  margin: 0 auto;
  padding: 28px 30px 210px;
}
.studio-notices { margin-bottom: 10px; }
.studio-notices .alert { margin-bottom: 10px; }

.studio-empty-state {
  display: flex;
  min-height: max(380px, calc(100vh - 330px));
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.studio-empty-logo {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 22px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(139,92,246,.2), rgba(80,213,255,.08));
  box-shadow: 0 18px 55px rgba(0,0,0,.22);
}
.studio-empty-logo img,
.studio-empty-logo .brand-mark {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 13px;
  object-fit: contain;
}
.studio-empty-logo img { padding: 4px; background: #f7f9ff; }
.studio-empty-logo .brand-mark { display: grid; place-items: center; }
.studio-empty-logo [data-brand-logo]:not([hidden]) + .brand-mark,
.studio-assistant-mark [data-brand-logo]:not([hidden]) + .brand-mark { display: none; }
.studio-empty-state h1 { margin: 0; font-size: clamp(24px, 3.3vw, 32px); font-weight: 650; letter-spacing: -.03em; }
.studio-empty-state > p { margin: 10px 0 0; color: var(--studio-muted); font-size: 14px; }

.studio-user-turn { display: flex; justify-content: flex-end; margin: 18px 0 28px; }
.studio-user-bubble {
  max-width: min(72%, 650px);
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  color: #f0f0f0;
  background: #2f3033;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.studio-status-turn {
  width: min(100%, 720px);
  margin: 0 0 26px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.studio-status-turn[data-tone="success"] { border-color: rgba(66,212,155,.2); background: rgba(66,212,155,.045); }
.studio-status-turn[data-tone="warning"] { border-color: rgba(255,191,105,.22); background: rgba(255,191,105,.05); }
.studio-status-turn[data-tone="error"] { border-color: rgba(255,107,138,.2); background: rgba(255,107,138,.045); }
.studio-status-turn .status-line { color: #c8c8c8; }
.studio-status-turn .progress { height: 4px; background: rgba(255,255,255,.07); }

.studio-result-turn {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  margin: 0 0 36px;
  gap: 12px;
}
.studio-assistant-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(139,92,246,.18);
}
.studio-assistant-mark img,
.studio-assistant-mark .brand-mark {
  width: 28px;
  height: 28px;
  padding: 2px;
  border: 0;
  border-radius: 8px;
  object-fit: contain;
  font-size: 11px;
}
.studio-result-content { min-width: 0; }
.studio-result-heading { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 13px; gap: 12px; }
.studio-result-heading > div { display: grid; }
.studio-result-heading strong { font-size: 14px; font-weight: 650; }
.studio-result-heading span { margin-top: 3px; color: #858585; font-size: 11px; }
.studio-result-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.studio-result-gallery .image-card {
  border-color: rgba(255,255,255,.09);
  border-radius: 14px;
  background: #191a1d;
}
.studio-result-gallery .image-preview { background: #0b0c0e; }
.studio-result-gallery .image-meta { padding: 10px; }
.studio-result-gallery .image-actions { justify-content: flex-end; margin-top: 8px; }
.studio-result-gallery .btn {
  min-height: 32px;
  padding: 5px 10px;
  border-color: rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  font-size: 11px;
}
.studio-result-gallery .btn:hover { background: rgba(255,255,255,.09); }

.studio-composer-dock {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 22px max(24px, calc((100% - 900px) / 2)) 8px;
  background: linear-gradient(to bottom, rgba(16,17,20,0), #101114 24px, #101114 100%);
}
.studio-composer {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: var(--studio-composer);
  box-shadow: 0 12px 38px rgba(0,0,0,.24);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.studio-composer:focus-within { border-color: rgba(255,255,255,.22); box-shadow: 0 14px 42px rgba(0,0,0,.3); }
.composer-input-row { position: relative; display: flex; align-items: flex-end; min-height: 64px; padding: 10px 10px 7px; gap: 5px; }
.composer-input-row textarea {
  width: 100%;
  max-height: 170px;
  min-height: 43px;
  padding: 11px 43px 8px 7px;
  overflow-y: auto;
  border: 0;
  outline: 0;
  color: #f2f2f2;
  background: transparent;
  line-height: 1.5;
  resize: none;
}
.composer-input-row textarea::placeholder { color: #8a8a8a; }
.composer-count { position: absolute; right: 62px; bottom: 16px; color: #6e6e6e; font-size: 9px; pointer-events: none; }
.composer-attach-button,
.composer-send-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
}
.composer-attach-button { color: #c6c6c6; background: rgba(255,255,255,.065); }
.composer-attach-button:hover,
.composer-attach-button.dragover { color: #fff; background: rgba(255,255,255,.12); }
.composer-attach-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.composer-send-button { color: #171719; background: #f1f1f1; }
.composer-send-button:hover { background: #fff; }
.composer-send-button:disabled { color: #737373; background: #454545; cursor: not-allowed; }
.composer-send-button.is-busy svg {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.composer-send-button.is-busy svg path { display: none; }

.composer-attachments {
  display: flex;
  overflow-x: auto;
  padding: 10px 12px 0;
  gap: 8px;
  scrollbar-width: thin;
}
.composer-file-list { display: flex; gap: 8px; }
.composer-reference-chip,
.composer-file-list .file-chip {
  display: flex;
  align-items: center;
  width: max-content;
  min-height: 34px;
  padding: 5px 7px;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  color: #c6c6c6;
  background: rgba(0,0,0,.14);
  font-size: 10px;
}
.composer-reference-thumb {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  color: #b9a9ff;
  background: rgba(139,92,246,.14);
}
.composer-reference-thumb svg { width: 14px; height: 14px; }
.composer-reference-chip button,
.composer-file-list .file-remove {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #888;
  background: transparent;
  font-size: 15px;
}
.composer-reference-chip button:hover,
.composer-file-list .file-remove:hover { color: #fff; background: rgba(255,255,255,.08); }
.composer-file-list .file-chip .muted { color: #737373; font-size: 9px; }

.composer-tools {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 12px 11px 54px;
  gap: 7px;
}
.composer-quality { display: flex; align-items: center; gap: 3px; }
.composer-quality-chip { position: relative; }
.composer-quality-chip input { position: absolute; opacity: 0; pointer-events: none; }
.composer-quality-chip span,
.composer-select-chip {
  display: flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 999px;
  color: #a9a9a9;
  background: rgba(255,255,255,.025);
  font-size: 10px;
}
.composer-quality-chip span { padding: 5px 9px; cursor: pointer; }
.composer-quality-chip input:checked + span { border-color: rgba(167,139,250,.42); color: #ddd5ff; background: rgba(139,92,246,.15); }
.composer-quality-chip input:disabled + span { opacity: .35; cursor: not-allowed; }
.composer-product-types { display: flex; align-items: center; gap: 4px; }
.composer-product-type { position: relative; }
.composer-product-type input { position: absolute; opacity: 0; pointer-events: none; }
.composer-product-type span {
  display: flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 10px;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 999px;
  color: #aaa;
  background: rgba(255,255,255,.025);
  font-size: 10px;
  cursor: pointer;
}
.composer-product-type span::before {
  content: '';
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: .72;
}
.composer-product-type[data-product-type="detail"] span::before { width: 8px; height: 11px; }
.composer-product-type small { color: #777; font-size: 9px; }
.composer-product-type input:checked + span {
  border-color: rgba(167,139,250,.42);
  color: #ddd5ff;
  background: rgba(139,92,246,.15);
}
.composer-product-type input:checked + span small { color: #b9adf1; }
.composer-product-type input:disabled + span { opacity: .35; cursor: not-allowed; }
.composer-select-chip { position: relative; gap: 4px; padding: 2px 5px 2px 8px; }
.composer-select-chip svg { width: 13px; height: 13px; color: #858585; pointer-events: none; }
.composer-select-chip select {
  max-width: 176px;
  min-height: 22px;
  padding: 0 17px 0 1px;
  border: 0;
  outline: 0;
  appearance: none;
  color: inherit;
  background: linear-gradient(45deg, transparent 50%, #777 50%) calc(100% - 8px) 9px/4px 4px no-repeat,
              linear-gradient(135deg, #777 50%, transparent 50%) calc(100% - 5px) 9px/4px 4px no-repeat;
  font-size: 10px;
  cursor: pointer;
}
.composer-select-chip select option { color: #eee; background: #252628; }
.composer-quantity-chip select,
.composer-quantity-chip input {
  width: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
}
.composer-estimate {
  display: flex;
  align-items: baseline;
  margin-left: auto;
  gap: 4px;
  color: #898989;
  font-size: 9px;
  white-space: nowrap;
}
.composer-estimate strong { color: #e6e6e6; font-size: 12px; }
.composer-estimate small {
  max-width: 110px;
  overflow: hidden;
  color: #6f6f6f;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-composer-note { margin: 7px 0 0; color: #606060; font-size: 9px; text-align: center; }

.studio-sidebar-backdrop { display: none; }

.studio-app.sidebar-collapsed { grid-template-columns: 70px minmax(0, 1fr); }
.studio-app.sidebar-collapsed .studio-sidebar { padding-right: 10px; padding-left: 10px; }
.studio-app.sidebar-collapsed .studio-sidebar-label { display: none; }
.studio-app.sidebar-collapsed .studio-sidebar-head { justify-content: center; }
.studio-app.sidebar-collapsed .studio-brand { display: none; }
.studio-app.sidebar-collapsed .studio-collapse-button svg { transform: rotate(180deg); }
.studio-app.sidebar-collapsed .studio-new-button { justify-content: center; padding: 8px; }
.studio-app.sidebar-collapsed .studio-history-item { display: flex; justify-content: center; padding: 7px; }
.studio-app.sidebar-collapsed .studio-history-item > svg { color: #8b8b8b; }
.studio-app.sidebar-collapsed .studio-account { display: flex; align-items: center; justify-content: center; flex-direction: column; padding-right: 0; padding-left: 0; }
.studio-app.sidebar-collapsed .studio-account-balance { gap: 0; }
.studio-app.sidebar-collapsed .studio-account-actions { margin-top: 8px; }
.studio-app.sidebar-collapsed .studio-account-actions a,
.studio-app.sidebar-collapsed .studio-account-actions button { width: 32px; justify-content: center; padding: 6px; }

@media (max-width: 840px) {
  .studio-app { display: block; }
  .studio-main { height: 100%; }
  .studio-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(286px, calc(100vw - 48px));
    transform: translateX(-102%);
    box-shadow: 18px 0 55px rgba(0,0,0,.35);
  }
  .studio-app.sidebar-open .studio-sidebar { transform: translateX(0); }
  .studio-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
  }
  .studio-app.sidebar-open .studio-sidebar-backdrop[hidden] { display: block !important; }
  .studio-menu-button { display: grid; }
  .studio-conversation { padding: 22px 18px 215px; }
  .studio-composer-dock { padding-right: 14px; padding-left: 14px; }
  .studio-app.sidebar-collapsed .studio-sidebar-label { display: initial; }
  .studio-app.sidebar-collapsed .studio-brand > .studio-sidebar-label,
  .studio-app.sidebar-collapsed .studio-history-copy { display: grid; }
  .studio-app.sidebar-collapsed .studio-brand { display: flex; }
  .studio-app.sidebar-collapsed .studio-sidebar-head { justify-content: space-between; }
  .studio-app.sidebar-collapsed .studio-new-button { justify-content: flex-start; padding: 8px 11px; }
  .studio-app.sidebar-collapsed .studio-history-item { display: grid; justify-content: initial; padding: 7px 8px; }
  .studio-app.sidebar-collapsed .studio-account { display: block; padding: 12px 8px 5px; }
  .studio-app.sidebar-collapsed .studio-account-balance { gap: 10px; }
  .studio-app.sidebar-collapsed .studio-account-actions a,
  .studio-app.sidebar-collapsed .studio-account-actions button { width: 100%; justify-content: flex-start; padding: 6px 8px; }
}

@media (min-width: 841px) {
  .studio-menu-button { display: none; }
}

/* Final light-theme contrast guard: keep secondary copy readable after legacy studio rules. */
body.user-shell .studio-result-heading span,
body.user-shell .studio-composer-note,
body.user-shell .studio-history-copy small,
body.user-shell .studio-sidebar-empty,
body.user-shell .studio-settings-profile small,
body.user-shell .studio-settings-details span,
body.user-shell .studio-settings-password p,
body.user-shell .studio-trash-note,
body.user-shell .studio-trash-item small { color: var(--user-muted); }
body.user-shell .studio-composer textarea::placeholder { color: #68707c; opacity: 1; }

@media (max-width: 620px) {
  .studio-main-head { min-height: 54px; padding: 7px 10px; }
  .studio-empty-state { min-height: calc(100vh - 345px); }
  .studio-empty-logo { width: 52px; height: 52px; margin-bottom: 17px; }
  .studio-empty-logo img,
  .studio-empty-logo .brand-mark { width: 38px; height: 38px; }
  .studio-empty-state > p { font-size: 12px; }
  .studio-user-bubble { max-width: 86%; }
  .studio-result-turn { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; }
  .studio-assistant-mark { width: 27px; height: 27px; }
  .studio-assistant-mark img,
  .studio-assistant-mark .brand-mark { width: 24px; height: 24px; }
  .studio-result-gallery { grid-template-columns: 1fr; }
  .studio-composer-dock { padding: 19px 8px 5px; }
  .studio-composer { border-radius: 18px; }
  .composer-input-row { padding-right: 8px; padding-left: 8px; }
  .composer-tools {
    overflow-x: auto;
    padding: 0 9px 9px;
    scrollbar-width: none;
  }
  .composer-tools::-webkit-scrollbar { display: none; }
  .composer-estimate { margin-left: 3px; }
  .composer-estimate small { display: none; }
  .studio-composer-note { display: none; }
}

/* Image portal v2: generate/edit composer and task archive. */
.studio-conversation { padding-bottom: 285px; }
.composer-mode-switch {
  display: flex;
  margin: 10px 12px 2px;
  padding: 3px;
  gap: 3px;
  border: 0;
  border-radius: 12px;
  background: rgba(0,0,0,.16);
}
.composer-mode-switch label { position: relative; min-width: 0; flex: 1; cursor: pointer; }
.composer-mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.composer-mode-switch label > span {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #8d8d8d;
  font-size: 10px;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.composer-mode-switch label > span strong { font-size: 11px; font-weight: 700; }
.composer-mode-switch label > span small { color: #696969; font-size: 9px; }
.composer-mode-switch input:checked + span {
  border-color: rgba(167,139,250,.28);
  color: #e5dfff;
  background: rgba(139,92,246,.14);
}
.composer-mode-switch input:checked + span small { color: #a99ed7; }
.composer-mode-switch input:focus-visible + span { outline: 2px solid rgba(167,139,250,.72); outline-offset: 1px; }

.composer-edit-upload { padding: 8px 12px 2px; }
.composer-upload-drop {
  position: relative;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  gap: 10px;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 12px;
  color: #bcbcbc;
  background: rgba(0,0,0,.12);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.composer-upload-drop:hover,
.composer-upload-drop.dragover { border-color: rgba(167,139,250,.62); background: rgba(139,92,246,.09); }
.composer-upload-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.composer-upload-drop > span:last-child { display: grid; gap: 2px; }
.composer-upload-drop strong { font-size: 11px; font-weight: 650; }
.composer-upload-drop small { color: #777; font-size: 9px; }
.composer-upload-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #cfc5ff;
  background: rgba(139,92,246,.16);
}
.composer-upload-icon svg { width: 18px; height: 18px; }
.composer-edit-preview {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 28px;
  min-height: 66px;
  align-items: center;
  padding: 6px;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(0,0,0,.16);
}
.composer-edit-preview img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: #111; }
.composer-edit-preview > span { display: grid; min-width: 0; gap: 3px; }
.composer-edit-preview strong { overflow: hidden; color: #d8d8d8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.composer-edit-preview small { color: #777; font-size: 9px; }
.composer-edit-preview button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #999;
  background: rgba(255,255,255,.05);
  font-size: 18px;
}
.composer-edit-preview button:hover { color: #fff; background: rgba(255,255,255,.11); }

.studio-composer .composer-input-row { min-height: 59px; }
.studio-composer .composer-tools { padding-left: 12px; }
.composer-readonly-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 999px;
  color: #aaa;
  background: rgba(255,255,255,.025);
  font-size: 10px;
  white-space: nowrap;
}
.composer-readonly-chip small { color: #666; font-size: 8px; }
.composer-policy-chip { border-color: rgba(80,213,255,.2); color: #c8f3ff; background: rgba(80,213,255,.055); }
.composer-policy-chip small { color: #73aab7; }
.composer-capability-note {
  margin: -4px 12px 9px;
  color: #717171;
  font-size: 9px;
  line-height: 1.4;
}
.composer-capability-note[data-tone="warning"] { color: #c99a59; }

.history-filters { grid-template-columns: minmax(220px, 1fr) minmax(170px, .35fr) auto; }
.history-task-table .table { min-width: 980px; }
.history-task-cell { max-width: 430px; }
.history-task-copy { min-width: 0; }
.history-thumb-link { display: block; width: 50px; height: 50px; flex: 0 0 auto; border-radius: 9px; }
.history-thumb-link:hover { outline: 2px solid rgba(167,139,250,.38); outline-offset: 2px; }
.history-thumb-placeholder { display: grid; place-items: center; flex: 0 0 auto; color: #555e75; font-size: 13px; }
.history-config { display: grid; justify-items: start; gap: 5px; }
.history-config > .badge { margin-right: 4px; }

@media (max-width: 840px) {
  .studio-conversation { padding-bottom: 315px; }
  .history-filters { grid-template-columns: 1fr minmax(150px, .45fr) auto; }
}

@media (max-width: 620px) {
  .studio-conversation { padding-bottom: 350px; }
  .studio-composer-dock { max-height: calc(100vh - 58px); overflow-y: auto; }
  .composer-mode-switch { margin: 7px 8px 1px; }
  .composer-mode-switch label > span { min-height: 33px; padding: 4px 7px; }
  .composer-mode-switch label > span small { display: none; }
  .composer-edit-upload { padding: 7px 8px 1px; }
  .composer-upload-drop { min-height: 58px; justify-content: flex-start; }
  .composer-upload-icon { width: 30px; height: 30px; }
  .studio-composer .composer-tools { padding-left: 9px; }
  .composer-capability-note { margin-right: 9px; margin-left: 9px; }
  .history-filters { grid-template-columns: 1fr; }
  .history-filters .btn { width: 100%; }
}

/* Keep the conversation redesign after legacy portal rules in the cascade. */
.studio-conversation { width: min(100%, 900px); padding: 42px 28px 210px; }
.studio-user-turn { margin: 0; }
.studio-user-bubble { display: grid; max-width: min(76%, 680px); padding: 12px 16px; gap: 10px; border-radius: 22px 22px 6px 22px; background: #303136; box-shadow: none; }
.studio-assistant-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #f2f3f5; color: #17181a; }
.studio-status-turn { width: 100%; min-height: 24px; margin: 0; padding: 0; border: 0; background: transparent; }
.studio-status-turn[data-tone="success"],
.studio-status-turn[data-tone="warning"],
.studio-status-turn[data-tone="error"] { border: 0; background: transparent; }
.studio-result-content { min-width: 0; margin-top: 16px; }
.studio-result-gallery .image-card { border-radius: 16px; background: #18191b; }
.studio-composer-dock { padding: 18px 28px 14px; background: linear-gradient(180deg, rgba(32,33,35,0), #202123 24%, #202123 100%); }
.studio-composer { width: min(100%, 820px); padding: 8px 9px 8px 18px; border-radius: 26px; background: #2b2c2f; }
.studio-composer .composer-input-row { min-height: 44px; padding: 0; }
.studio-composer textarea { min-height: 44px; padding: 11px 2px 9px; }
.studio-composer-note { margin-top: 8px; }
@media (max-width: 840px) {
  .studio-conversation { padding: 24px 15px 180px; }
}
@media (max-width: 620px) {
  .studio-conversation { padding-bottom: 170px; }
  .studio-composer-dock { max-height: none; padding: 12px 10px 9px; overflow: visible; }
  .studio-composer { padding-left: 14px; border-radius: 23px; }
}

.chat-history-page { width: min(100%, 980px); }
.chat-history-page .page-heading p { max-width: 620px; }
.history-conversation-list { display: grid; margin-top: 24px; gap: 20px; }
.history-conversation-card {
  padding: 18px 20px 22px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  background: rgba(18,23,42,.72);
  box-shadow: 0 18px 50px rgba(0,0,0,.16);
}
.history-conversation-card > header { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--faint); font-size: 11px; }
.history-message-user { display: flex; justify-content: flex-end; margin: 20px 0 24px; }
.history-message-user > div { max-width: min(76%, 680px); padding: 11px 15px; border-radius: 20px 20px 6px 20px; background: #2d3246; line-height: 1.55; }
.history-message-user p { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.history-message-user small { display: block; margin-bottom: 6px; color: #aab2d0; font-size: 10px; }
.history-message-assistant { display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: start; gap: 13px; }
.history-assistant-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #f2f3f5; color: #17181a; font-size: 12px; font-weight: 750; }
.history-assistant-answer { min-width: 0; }
.history-assistant-answer > p { margin: 4px 0 15px; color: #eceef7; line-height: 1.55; }
.history-assistant-answer > footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; gap: 8px; color: var(--faint); font-size: 10px; }
.history-assistant-answer > footer a { padding: 6px 9px; border-radius: 8px; color: #d8dcf3; background: rgba(255,255,255,.06); }
.history-assistant-answer > footer a:hover { color: #fff; background: rgba(255,255,255,.1); }
.history-image-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.history-image-grid a, .history-single-image { position: relative; display: block; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: #080b14; }
.history-image-grid img, .history-single-image img { display: block; width: 100%; max-height: 460px; object-fit: contain; }
.history-image-grid a span, .history-single-image span { position: absolute; right: 8px; bottom: 8px; padding: 5px 8px; border-radius: 8px; background: rgba(5,7,13,.78); color: #f2f3f7; font-size: 10px; backdrop-filter: blur(8px); }
.history-single-image { max-width: 560px; }
.history-thinking { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.history-thinking i { width: 8px; height: 8px; border-radius: 50%; background: #c8ccef; box-shadow: 13px 0 rgba(200,204,239,.42), 26px 0 rgba(200,204,239,.16); margin-right: 26px; animation: assistant-thinking 1.15s ease-in-out infinite; }
@media (max-width: 680px) {
  .history-conversation-card { padding: 14px 13px 18px; border-radius: 16px; }
  .history-message-user > div { max-width: 90%; }
  .history-message-assistant { grid-template-columns: 26px minmax(0,1fr); gap: 10px; }
  .history-assistant-mark { width: 26px; height: 26px; }
  .history-image-grid { grid-template-columns: 1fr; }
}

/* Multi-image response viewer and in-page lightbox. */
.studio-result-gallery { display: block; }
.chat-image-viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  align-items: stretch;
  max-width: 760px;
  gap: 10px;
}
.chat-image-stage {
  display: grid;
  width: 100%;
  min-height: 360px;
  max-height: 680px;
  padding: 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  background: #0b0c0f;
  cursor: zoom-in;
}
.chat-image-stage img { display: block; width: 100%; max-height: 680px; object-fit: contain; }
.chat-image-thumbs {
  display: flex;
  max-height: 680px;
  flex-direction: column;
  gap: 8px;
  overflow: hidden auto;
  scrollbar-color: rgba(255,255,255,.25) transparent;
  scrollbar-width: thin;
}
.chat-image-thumbs button {
  width: 66px;
  min-height: 66px;
  padding: 2px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #15161a;
  cursor: pointer;
  opacity: .66;
}
.chat-image-thumbs button:hover { opacity: .92; }
.chat-image-thumbs button.active { border-color: #f2f2f5; opacity: 1; }
.chat-image-thumbs img { display: block; width: 100%; height: 58px; border-radius: 8px; object-fit: cover; }
.chat-image-viewer-actions { display: flex; align-items: center; flex-wrap: wrap; margin-top: 10px; gap: 8px; }
.chat-image-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 10px;
  color: #e4e4e7;
  background: rgba(255,255,255,.055);
  font-size: 12px;
  cursor: pointer;
}
.chat-image-action:hover { color: #fff; background: rgba(255,255,255,.1); }
.chat-image-action.primary { color: #18191c; background: #f1f1f3; }
.chat-image-action.primary:hover { background: #fff; }
.chat-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #090a0c;
  color: #fff;
}
.chat-lightbox::backdrop { background: rgba(0,0,0,.88); }
.chat-lightbox-toolbar {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 18px;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,.72), transparent);
}
.chat-lightbox-toolbar > span { margin-right: auto; color: #c8c9cd; font-size: 12px; }
.chat-lightbox-download,
.chat-lightbox-close {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  color: #f3f3f4;
  background: rgba(255,255,255,.09);
}
.chat-lightbox-close { width: 38px; padding: 0; font-size: 24px; cursor: pointer; }
.chat-lightbox-frame { position: relative; display: grid; width: 100%; height: 100%; place-items: center; padding: 72px 76px 28px; }
.chat-lightbox-frame > img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.chat-lightbox-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.52);
  font-size: 32px;
  cursor: pointer;
  transform: translateY(-50%);
}
.chat-lightbox-nav.previous { left: 18px; }
.chat-lightbox-nav.next { right: 18px; }
@media (max-width: 700px) {
  .chat-image-viewer { grid-template-columns: 1fr; }
  .chat-image-stage { min-height: 260px; border-radius: 16px; }
  .chat-image-thumbs { max-height: none; flex-direction: row; overflow: auto hidden; }
  .chat-image-thumbs button { min-width: 58px; width: 58px; min-height: 58px; }
  .chat-image-thumbs img { height: 50px; }
  .chat-lightbox-frame { padding: 68px 12px 18px; }
  .chat-lightbox-nav { width: 38px; height: 38px; font-size: 28px; }
  .chat-lightbox-nav.previous { left: 8px; }
  .chat-lightbox-nav.next { right: 8px; }
  .chat-lightbox-download { min-height: 34px; padding: 6px 9px; }
}

/* 帧境 | Fira user experience v2.3: titanium canvas and substantial Apple-inspired cards. */
body.user-shell {
  color-scheme: light;
  --user-bg: #eef1f5;
  --user-canvas: #f7f8fa;
  --user-card: #fff;
  --user-card-muted: #f4f5f7;
  --user-line: rgba(23, 28, 38, .09);
  --user-line-strong: rgba(23, 28, 38, .15);
  --user-text: #17191d;
  --user-muted: #555b66;
  --user-faint: #626975;
  --user-accent: #6875f5;
  --user-accent-soft: rgba(104, 117, 245, .11);
  --user-shadow: 0 22px 58px rgba(45, 52, 67, .13), 0 4px 14px rgba(45, 52, 67, .07);
  --user-shadow-soft: 0 12px 34px rgba(45, 52, 67, .10), 0 2px 8px rgba(45, 52, 67, .06);
  min-height: 100vh;
  color: var(--user-text);
  background: var(--user-bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}
body.user-shell::before { display: none; }
body.user-shell a:hover { color: var(--user-text); }
body.user-shell .site-header {
  border-bottom-color: var(--user-line);
  background: rgba(247, 248, 250, .82);
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
  backdrop-filter: blur(22px) saturate(150%);
}
body.user-shell .brand-name,
body.user-shell .brand-copy strong { color: var(--user-text); }
body.user-shell .brand-tagline,
body.user-shell .brand-copy small { color: var(--user-muted); }
body.user-shell .nav-menu a,
body.user-shell .nav-logout,
body.user-shell .nav-menu .balance { color: var(--user-muted); }
body.user-shell .nav-menu a:hover,
body.user-shell .nav-logout:hover { color: var(--user-text); background: #fff; }
body.user-shell .nav-toggle { border-color: var(--user-line); color: var(--user-text); background: #fff; }
body.user-shell .nav-toggle img { width: 20px; height: 20px; }
body.user-shell .site-footer { border-top-color: var(--user-line); color: var(--user-muted); background: #f7f8fa; }
body.user-shell .page-heading h1,
body.user-shell .auth-title { color: var(--user-text); }
body.user-shell .page-heading p,
body.user-shell .auth-copy,
body.user-shell .auth-foot,
body.user-shell .muted,
body.user-shell .card-subtitle,
body.user-shell .help { color: var(--user-muted); }
body.user-shell .faint { color: var(--user-faint); }
body.user-shell .card,
body.user-shell .filters,
body.user-shell .history-conversation-card {
  border: 1px solid var(--user-line);
  background: var(--user-card);
  box-shadow: var(--user-shadow-soft);
}
body.user-shell .input,
body.user-shell .select,
body.user-shell textarea {
  border-color: var(--user-line-strong);
  color: var(--user-text);
  background: #f8f9fb;
}
body.user-shell .input:focus,
body.user-shell .select:focus,
body.user-shell textarea:focus { border-color: rgba(104,117,245,.52); box-shadow: 0 0 0 4px rgba(104,117,245,.10); }
body.user-shell .input::placeholder,
body.user-shell textarea::placeholder { color: #68707c; opacity: 1; }
body.user-shell .input:disabled,
body.user-shell .select:disabled,
body.user-shell textarea:disabled { opacity: .78; }
body.user-shell .label { color: #4e535d; }
body.user-shell .checkbox,
body.user-shell .radio { color: #3f4550; font-weight: 600; }
body.user-shell .btn[disabled] { opacity: .72; }
body.user-shell .btn-primary { color: #fff; background: #202226; box-shadow: 0 8px 22px rgba(24,27,32,.18); }
body.user-shell .btn-primary:hover { color: #fff; background: #07080a; }
body.user-shell .btn-secondary { border-color: var(--user-line-strong); color: var(--user-text); background: #fff; }
body.user-shell .auth-page { min-height: calc(100vh - 150px); }
body.user-shell .auth-shell { width: min(100%, 460px); }
body.user-shell .auth-card { padding: 32px; border-radius: 28px; box-shadow: var(--user-shadow); }
body.user-shell .auth-brand { margin-bottom: 28px; }

body.user-shell.studio-page,
body.user-shell:has(.studio-app) { overflow: hidden; background: var(--user-bg); }
body.user-shell.studio-page > .page,
body.user-shell:has(.studio-app) > .page { min-height: 100vh; }
.user-shell .studio-app {
  --studio-sidebar: 236px;
  display: grid;
  grid-template-columns: var(--studio-sidebar) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  padding: 12px;
  gap: 12px;
  color: var(--user-text);
  background: var(--user-bg);
}
.user-shell .studio-app.sidebar-collapsed { grid-template-columns: 70px minmax(0,1fr); }
.user-shell .studio-sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 14px 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  color: var(--user-text);
  background: rgba(255,255,255,.86);
  box-shadow: var(--user-shadow);
  backdrop-filter: blur(26px) saturate(145%);
}
.user-shell .studio-sidebar-head { min-height: 46px; padding: 2px 3px 10px; }
.user-shell .studio-brand { min-width: 0; padding: 6px 7px; gap: 9px; border-radius: 14px; }
.user-shell .studio-brand:hover { background: #f3f4f7; }
.user-shell .studio-brand .brand-logo,
.user-shell .studio-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.user-shell .studio-brand strong { color: var(--user-text); font-size: 15px; font-weight: 720; letter-spacing: -.025em; }
.user-shell .studio-brand small { color: var(--user-faint); font-size: 9px; font-weight: 580; letter-spacing: .08em; }
.user-shell .studio-icon-button {
  border: 1px solid var(--user-line);
  color: var(--user-muted);
  background: rgba(255,255,255,.78);
  box-shadow: 0 3px 10px rgba(45,52,67,.06);
}
.user-shell .studio-icon-button:hover { color: var(--user-text); background: #fff; }
.user-shell .studio-icon-button img,
.user-shell .studio-new-button img,
.user-shell .studio-account-actions img { width: 18px; height: 18px; }
.user-shell .studio-new-button {
  min-height: 50px;
  margin: 8px 3px 20px;
  padding: 10px 15px;
  gap: 10px;
  border: 1px solid var(--user-line);
  border-radius: 16px;
  color: var(--user-text);
  background: #fff;
  box-shadow: 0 10px 24px rgba(45,52,67,.10), 0 2px 6px rgba(45,52,67,.06);
}
.user-shell .studio-new-button:hover { color: #000; border-color: var(--user-line-strong); background: #fbfbfc; transform: translateY(-1px); }
.user-shell .studio-history { min-height: 0; overflow: hidden auto; scrollbar-width: thin; }
.user-shell .studio-sidebar-section-title { margin: 0 9px 8px; color: var(--user-muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.user-shell .studio-history-list { display: grid; gap: 3px; }
.user-shell .studio-history-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) 30px;
  align-items: center;
  border-radius: 14px;
}
.user-shell .studio-history-row.is-pinned .studio-history-copy > span::before { content: '⌖ '; color: #777d89; }
.user-shell .studio-history-item {
  display: block;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--user-text);
  background: transparent;
}
.user-shell .studio-history-item:hover { border-color: var(--user-line); color: var(--user-text); background: #fff; box-shadow: 0 7px 18px rgba(45,52,67,.07); }
.user-shell .studio-history-more {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  opacity: 0;
  cursor: pointer;
  color: #636975;
  background: transparent;
  transition: opacity .16s ease, background .16s ease;
}
.user-shell .studio-history-row:hover .studio-history-more,
.user-shell .studio-history-row:focus-within .studio-history-more { opacity: 1; }
.user-shell .studio-history-more:hover { background: #eceef2; }
.user-shell .studio-history-menu {
  position: absolute;
  z-index: 70;
  top: 44px;
  right: 4px;
  width: 176px;
  padding: 7px;
  border: 1px solid var(--user-line);
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 46px rgba(38,43,54,.18), 0 4px 12px rgba(38,43,54,.08);
}
.user-shell .studio-history-menu[hidden] { display: none; }
.user-shell .studio-history-menu form { margin: 0; }
.user-shell .studio-history-menu button {
  display: flex;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  color: #262930;
  background: transparent;
  text-align: left;
}
.user-shell .studio-history-menu button:hover { background: #f0f2f5; }
.user-shell .studio-history-menu button.danger { color: #dc3044; }
.user-shell .studio-history-menu button > span { width: 17px; text-align: center; }
.user-shell .studio-history-copy { display: grid; min-width: 0; gap: 4px; }
.user-shell .studio-history-copy > span { overflow: hidden; color: #2b2e34; font-size: 12px; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.user-shell .studio-history-copy small { overflow: hidden; color: var(--user-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-shell .studio-all-history { display: block; margin: 8px 9px; color: var(--user-muted); font-size: 11px; }
.user-shell .studio-sidebar-empty { color: var(--user-faint); }
.user-shell .studio-account {
  position: relative;
  margin: 12px 2px 0;
  padding: 0;
  border: 1px solid var(--user-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(45,52,67,.08);
}
.user-shell .studio-account-usage {
  display: grid;
  padding: 11px 11px 10px;
  gap: 6px;
  border-bottom: 1px solid var(--user-line);
}
.user-shell .studio-account-usage-line {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #747b87;
  font-size: 10px;
  line-height: 1.2;
}
.user-shell .studio-account-usage-line strong {
  overflow: hidden;
  color: #24282f;
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-shell .studio-account-usage-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e6ec;
}
.user-shell .studio-account-usage-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1689fa, #53afff);
  box-shadow: 0 0 10px rgba(31,145,250,.22);
  transition: width .28s ease;
}
.user-shell .studio-account-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #2b2e34; background: #e9ebef; font-size: 13px; font-weight: 700; }
.user-shell .studio-account-trigger {
  display: grid;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  grid-template-columns: 34px minmax(0,1fr) 18px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: inherit;
  color: var(--user-text);
  background: transparent;
  text-align: left;
}
.user-shell .studio-account-trigger:hover { background: #f4f5f7; }
.user-shell .studio-account-trigger > .studio-sidebar-label { display: grid; min-width: 0; gap: 2px; }
.user-shell .studio-account-trigger strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-shell .studio-account-trigger small { color: var(--user-muted); font-size: 10px; }
.user-shell .studio-account-chevron { width: 16px; height: 16px; opacity: .5; transition: transform .18s ease; }
.user-shell .studio-account.is-open .studio-account-chevron { transform: rotate(180deg); }
.user-shell .studio-account-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  z-index: 60;
  width: max(100%, 218px);
  padding: 7px;
  border: 1px solid rgba(255,255,255,.96);
  border-radius: 17px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 48px rgba(43,48,59,.18), 0 2px 8px rgba(43,48,59,.08);
  backdrop-filter: blur(22px) saturate(150%);
}
.user-shell .studio-account-menu[hidden] { display: none !important; }
.user-shell .studio-account-menu-profile { display: flex; align-items: center; padding: 7px 8px 10px; gap: 9px; border-bottom: 1px solid var(--user-line); }
.user-shell .studio-account-menu-profile > span:last-child { display: grid; min-width: 0; gap: 2px; }
.user-shell .studio-account-menu-profile strong { overflow: hidden; color: var(--user-text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-shell .studio-account-menu-profile small { color: var(--user-muted); font-size: 10px; }
.user-shell .studio-account-quota { padding: 11px 8px 10px; border-bottom: 1px solid var(--user-line); }
.user-shell .studio-account-quota-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #4f5560; font-size: 10px; }
.user-shell .studio-account-quota-head strong { color: #20242a; font-size: 10px; font-weight: 700; }
.user-shell .studio-account-quota-track { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #e1e5eb; }
.user-shell .studio-account-quota-track > span { display: block; width: var(--quota-remaining,0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg,#1688f8,#46a6ff); transition: width .25s ease; }
.user-shell .studio-account-quota-number { margin-top: 7px; color: var(--user-muted); font-size: 10px; }
.user-shell .studio-account-quota-number strong { color: #24282f; font-size: 11px; }
.user-shell .studio-account-menu form { margin: 0; }
.user-shell .studio-account-menu-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  padding: 8px 9px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  color: #343840;
  background: transparent;
  font-size: 12px;
  text-align: left;
}
.user-shell .studio-account-menu-item:hover { color: #111317; background: #eff1f4; }
.user-shell .studio-account-menu-item img { width: 17px; height: 17px; opacity: .72; }

.user-shell .studio-main {
  position: relative;
  min-width: 0;
  height: calc(100vh - 24px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 26px;
  background: var(--user-canvas);
  box-shadow: var(--user-shadow);
}
.user-shell .studio-main-head {
  min-height: 62px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--user-line);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(22px) saturate(150%);
}
.user-shell .studio-main-title strong { color: var(--user-text); font-size: 14px; }
.user-shell .studio-main-title span { color: var(--user-muted); }
.user-shell .studio-chat-scroll { background: var(--user-canvas); scrollbar-color: rgba(83,89,101,.22) transparent; }
.user-shell .studio-conversation { width: min(100%, 930px); padding: 44px 34px 210px; }
.user-shell .studio-turn-list { gap: 26px; }
.user-shell .studio-notices .alert { border-radius: 16px; box-shadow: 0 8px 24px rgba(45,52,67,.07); }
.user-shell .studio-empty-state {
  min-height: calc(100vh - 86px);
  padding: 0 32px 320px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.user-shell .studio-empty-state h1 { color: var(--user-text); font-size: clamp(27px,4vw,40px); letter-spacing: -.04em; }
.user-shell .studio-empty-state p { color: var(--user-muted); }
.user-shell .studio-main:has(.studio-empty-state:not([hidden])) .studio-conversation { padding-bottom: 0; }
.user-shell .studio-main.is-empty .studio-conversation { padding-bottom: 0; }
.user-shell .studio-main:has(.studio-empty-state:not([hidden])) .studio-composer-dock {
  top: 54%;
  bottom: auto;
  padding: 22px max(20px, calc((100% - 930px) / 2)) 0;
  background: transparent;
}
.user-shell .studio-main.is-empty .studio-composer-dock {
  top: 54%;
  bottom: auto;
  padding: 22px max(20px, calc((100% - 930px) / 2)) 0;
  background: transparent;
}
.user-shell .studio-main:has(.studio-empty-state:not([hidden])) .studio-composer { width: min(100%, 930px); }
.user-shell .studio-main.is-empty .studio-composer { width: min(100%, 930px); }
.user-shell .studio-main:has(.studio-empty-state:not([hidden])) .studio-composer-note { margin-top: 9px; }
.user-shell .studio-main.is-empty .studio-composer-note { margin-top: 9px; }
.user-shell .studio-user-turn { margin: 0; }
.user-shell .studio-user-bubble {
  max-width: min(74%, 620px);
  padding: 16px;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 24px 24px 7px 24px;
  color: var(--user-text);
  background: #fff;
  box-shadow: var(--user-shadow-soft);
}
.user-shell .studio-user-reference { width: min(310px,100%); max-height: 280px; border-radius: 17px; background: #eef0f3; box-shadow: inset 0 0 0 1px var(--user-line); }
.user-shell .studio-user-reference-list {
  display: flex;
  width: min(100%,232px);
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 8px;
}
.user-shell .studio-user-reference-list .studio-user-reference { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 12px; object-fit: cover; }
.user-shell .studio-user-reference-placeholder { color: var(--user-muted); background: #f0f2f5; }
.user-shell .studio-assistant-turn { grid-template-columns: minmax(0,1fr); gap: 0; }
.user-shell .studio-assistant-mark { display: none; }
.user-shell .studio-assistant-content { padding-top: 0; }
.user-shell .studio-status-turn {
  width: min(100%, 480px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--user-text);
  background: transparent;
  box-shadow: none;
}
.user-shell .studio-status-turn[data-tone="success"],
.user-shell .studio-status-turn[data-tone="warning"],
.user-shell .studio-status-turn[data-tone="error"] { border: 0; color: var(--user-text); background: transparent; }
.user-shell .studio-status-turn .status-line { margin: 0 0 16px; color: #4d5158; font-size: 14px; font-weight: 520; line-height: 1.55; }
.user-shell .assistant-thinking-dot { display: none; }
.user-shell .studio-loading-visual {
  position: relative;
  width: min(100%, 480px);
  height: clamp(180px, 32vw, 260px);
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(circle at 24% 28%, rgba(255,255,255,.96), transparent 36%),
    linear-gradient(135deg, #eef0f4 0%, #f8f9fb 46%, #e7eaf0 100%);
  contain: layout paint;
}
.user-shell .studio-loading-glow {
  position: absolute;
  inset: -45% -70%;
  background: linear-gradient(108deg, transparent 38%, rgba(255,255,255,.86) 49%, transparent 60%);
  transform: translateX(-34%);
  animation: studio-light-sweep 2.3s cubic-bezier(.45,0,.2,1) infinite;
}
.user-shell .studio-loading-rail {
  position: absolute;
  right: 28px;
  bottom: 25px;
  left: 28px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102,109,123,.14);
}
.user-shell .studio-loading-rail > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9da6ff, #6875f5);
  box-shadow: 0 0 16px rgba(104,117,245,.32);
  transition: width .55s cubic-bezier(.22,.8,.3,1);
}
@keyframes studio-light-sweep {
  0% { opacity: .28; transform: translateX(-34%); }
  55% { opacity: .72; }
  100% { opacity: .25; transform: translateX(34%); }
}
.user-shell .studio-result-content {
  width: min(100%, 820px);
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.user-shell .chat-image-viewer { max-width: none; grid-template-columns: minmax(0,1fr) 74px; gap: 12px; }
.user-shell .chat-image-stage {
  min-height: 390px;
  max-height: 650px;
  border: 0;
  border-radius: 21px;
  background: transparent;
  box-shadow: none;
}
.user-shell .chat-image-stage img { max-height: 650px; }
.user-shell .chat-image-thumbs { gap: 9px; scrollbar-color: rgba(83,89,101,.24) transparent; }
.user-shell .chat-image-thumbs button { width: 68px; min-height: 68px; border-color: transparent; border-radius: 14px; background: #f0f1f4; opacity: .68; }
.user-shell .chat-image-thumbs button.active { border-color: var(--user-accent); background: #fff; box-shadow: 0 6px 18px rgba(45,52,67,.12); opacity: 1; }
.user-shell .chat-image-thumbs img { height: 58px; border-radius: 10px; }
.user-shell .chat-image-viewer-actions { margin-top: 14px; }
.user-shell .chat-image-action {
  min-height: 38px;
  border: 1px solid var(--user-line);
  border-radius: 12px;
  color: #4e535d;
  background: #f6f7f9;
  box-shadow: 0 4px 12px rgba(45,52,67,.05);
}
.user-shell .chat-image-action:hover { border-color: var(--user-line-strong); color: var(--user-text); background: #fff; }
.user-shell .chat-image-action.primary { color: #fff; background: #202226; }
.user-shell .chat-image-action.primary:hover { color: #fff; background: #060708; }

.user-shell .studio-composer-dock {
  padding: 14px max(20px, calc((100% - 930px) / 2)) 16px;
  background: var(--user-canvas);
}
.user-shell .studio-composer {
  width: min(100%, 930px);
  padding: 9px 10px;
  border: 1px solid var(--user-line);
  border-radius: 27px;
  background: #f1f3f6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}
.user-shell .studio-composer::before { border-radius: 25px; color: #343943; background: rgba(238,241,245,.96); }
.user-shell .studio-composer:focus-within { border-color: rgba(104,117,245,.32); box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 0 0 4px rgba(104,117,245,.08); }
.user-shell .studio-composer .composer-input-row { min-height: 48px; gap: 8px; }
.user-shell .studio-composer textarea { min-height: 48px; padding: 13px 4px 10px; border: 0; color: var(--user-text); background: transparent; box-shadow: none; }
.user-shell .studio-composer textarea::placeholder { color: #9a9fa8; }
.user-shell .composer-upload-button,
.user-shell .composer-send-button {
  display: grid;
  width: 42px;
  height: 42px;
  min-width: 42px;
  margin: 3px 0;
  padding: 0;
  place-items: center;
  border: 1px solid var(--user-line);
  border-radius: 50%;
  background: #f2f3f6;
  box-shadow: 0 4px 12px rgba(45,52,67,.07);
}
.user-shell .composer-upload-button:hover { background: #fff; transform: translateY(-1px); }
.user-shell .composer-upload-button img,
.user-shell .composer-send-button img { width: 20px; height: 20px; }
.user-shell .composer-send-button { border-color: #202226; color: #fff; background: #202226; }
.user-shell .composer-send-button img { filter: invert(1); }
.user-shell .composer-send-button:hover:not(:disabled) { background: #050607; transform: translateY(-1px); }
.user-shell .composer-send-button:disabled { border-color: #d8dbe1; background: #d8dbe1; box-shadow: none; }
.user-shell .composer-attachment-preview { display: block; margin: 0 2px 4px; padding: 4px 4px 2px; overflow: hidden; border: 0; color: var(--user-text); background: transparent; }
.user-shell .composer-attachment-list { display: flex; max-width: 100%; padding: 3px 4px 6px; gap: 9px; overflow: auto hidden; scrollbar-width: thin; }
.user-shell .composer-attachment-item { position: relative; width: 78px; height: 78px; flex: 0 0 78px; }
.user-shell .composer-attachment-item > img { display: block; width: 78px; height: 78px; border: 1px solid var(--user-line); border-radius: 14px; object-fit: cover; background: #e9ebef; }
.user-shell .composer-attachment-remove { position: absolute; top: -3px; right: -3px; display: grid; width: 24px; height: 24px; padding: 0; place-items: center; border: 1px solid rgba(20,23,30,.18); border-radius: 50%; color: #050607; background: #fff; box-shadow: 0 4px 12px rgba(20,23,30,.22); }
.user-shell .composer-attachment-remove img { width: 13px; height: 13px; filter: none; }
.user-shell .composer-attachment-remove:hover { background: #eceef2; transform: scale(1.04); }
.user-shell .composer-upload-progress {
  position: absolute;
  inset: 1px;
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: 13px;
  background: rgba(17,20,26,.32);
  backdrop-filter: blur(5px);
}
.user-shell .composer-upload-progress > span {
  display: block;
  width: 34px !important;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(#fff calc(var(--upload-progress,0) * 1%), rgba(255,255,255,.24) 0);
  -webkit-mask: radial-gradient(circle,transparent 50%,#000 53%);
  mask: radial-gradient(circle,transparent 50%,#000 53%);
  transition: background .18s linear;
}
.user-shell .composer-upload-progress > small {
  position: absolute;
  display: block;
  color: #fff;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: -.02em;
}
.user-shell .composer-attachment-item[data-upload-status="ready"] .composer-upload-progress { opacity: 0; transition: opacity .35s ease .2s; }
.user-shell .composer-attachment-item[data-upload-status="error"] .composer-upload-progress { background: rgba(141,24,40,.72); }
.user-shell .composer-attachment-item[data-upload-status="error"] .composer-upload-progress > span { background: conic-gradient(#fff 100%,rgba(255,255,255,.25) 0); }
.user-shell .composer-attachment-preview strong { color: var(--user-text); }
.user-shell .composer-attachment-preview small { color: var(--user-muted); }
.user-shell .composer-attachment-preview button { color: var(--user-muted); background: #fff; }
.user-shell .studio-composer-note { color: var(--user-faint); }

.user-shell .chat-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--user-text);
  background: #f5f6f8;
  box-shadow: 0 40px 120px rgba(19,23,32,.32);
}
.user-shell .chat-lightbox::backdrop { background: rgba(49,54,64,.46); backdrop-filter: blur(18px); }
.user-shell .chat-lightbox-toolbar {
  position: absolute;
  min-height: 68px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--user-line);
  color: var(--user-text);
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(22px) saturate(150%);
}
.user-shell .chat-lightbox-toolbar > span { margin: 0 auto; color: #484d56; font-size: 12px; font-weight: 650; }
.user-shell .chat-lightbox-download,
.user-shell .chat-lightbox-close { border-color: var(--user-line); color: #3f444d; background: #fff; box-shadow: 0 5px 14px rgba(45,52,67,.08); }
.user-shell .chat-lightbox-close { width: 40px; flex: 0 0 auto; }
.user-shell .chat-lightbox-close img { width: 20px; height: 20px; }
.user-shell .chat-lightbox-body { display: grid; grid-template-columns: 92px minmax(0,1fr); width: 100%; height: 100%; padding-top: 68px; }
.user-shell .chat-lightbox-thumbs { display: flex; min-height: 0; flex-direction: column; padding: 18px 12px; gap: 10px; overflow: hidden auto; border-right: 1px solid var(--user-line); background: rgba(255,255,255,.62); }
.user-shell .chat-lightbox-thumbs button { width: 66px; min-height: 66px; padding: 3px; overflow: hidden; border: 2px solid transparent; border-radius: 14px; background: #e9ebef; opacity: .68; }
.user-shell .chat-lightbox-thumbs button.active { border-color: var(--user-accent); background: #fff; box-shadow: 0 7px 18px rgba(45,52,67,.14); opacity: 1; }
.user-shell .chat-lightbox-thumbs img { display: block; width: 100%; height: 56px; border-radius: 9px; object-fit: cover; }
.user-shell .chat-lightbox-scroll { min-width: 0; overflow: hidden auto; overscroll-behavior: contain; scroll-snap-type: y proximity; scrollbar-color: rgba(65,71,82,.3) transparent; }
.user-shell .chat-lightbox-item { display: grid; min-height: calc(100vh - 93px); margin: 0; padding: 42px 5vw; place-items: center; scroll-snap-align: start; }
.user-shell .chat-lightbox-item + .chat-lightbox-item { border-top: 1px solid var(--user-line); }
.user-shell .chat-lightbox-item img { display: block; max-width: min(100%, 1180px); max-height: calc(100vh - 160px); border-radius: 18px; object-fit: contain; box-shadow: 0 24px 72px rgba(45,52,67,.14); }

.user-shell .studio-app.sidebar-collapsed .studio-history-row { grid-template-columns: 1fr; }
.user-shell .studio-app.sidebar-collapsed .studio-history-more,
.user-shell .studio-app.sidebar-collapsed .studio-history-menu { display: none; }

@media (hover: none) {
  .user-shell .studio-history-more { opacity: 1; }
}

.studio-rename-dialog {
  width: min(92vw, 430px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(30,34,43,.12);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(28,33,44,.28);
}
.studio-rename-dialog::backdrop { background: rgba(45,50,60,.34); backdrop-filter: blur(10px); }
.studio-rename-dialog form { display: grid; padding: 22px; gap: 18px; }
.studio-rename-dialog header,
.studio-rename-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.studio-rename-dialog h2 { margin: 0; font-size: 19px; }
.studio-rename-dialog header button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #f1f2f5; }
.studio-rename-dialog label { display: grid; gap: 8px; color: #666c77; font-size: 12px; }
.studio-rename-dialog input { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #d8dce3; border-radius: 13px; font: inherit; }
.studio-rename-dialog footer { justify-content: flex-end; }
.studio-rename-dialog footer button { min-height: 39px; padding: 8px 16px; border: 1px solid #d8dce3; border-radius: 12px; background: #fff; }
.studio-rename-dialog footer button.primary { border-color: #202226; color: #fff; background: #202226; }

.user-shell .history-conversation-card { border-radius: 26px; box-shadow: var(--user-shadow); }
.user-shell .history-message-user > div { border: 1px solid var(--user-line); color: var(--user-text); background: #fff; box-shadow: var(--user-shadow-soft); }
.user-shell .history-message-user p { color: var(--user-text); }
.user-shell .history-user-reference { display: block; width: min(290px,100%); max-height: 270px; margin-bottom: 11px; border-radius: 17px; object-fit: cover; }
.user-shell .history-assistant-mark { background: #fff; box-shadow: 0 7px 18px rgba(45,52,67,.10); }
.user-shell .history-assistant-mark img,
.user-shell .empty-icon img { display: block; width: 24px; height: 24px; object-fit: contain; }
.user-shell .history-assistant-answer > p { color: var(--user-text); }
.user-shell .history-image-grid a,
.user-shell .history-single-image { border-color: var(--user-line); background: #f1f2f5; box-shadow: var(--user-shadow-soft); }
.user-shell .history-assistant-answer > footer a { color: #464b55; background: #f1f2f5; }
.user-shell .history-assistant-answer > footer a:hover { color: var(--user-text); background: #e9ebef; }

@media (max-width: 840px) {
  body.user-shell.auth-shell-page > .site-header,
  body.user-shell:has(.auth-page) > .site-header { display: none !important; }
  body.user-shell.auth-shell-page > .page,
  body.user-shell:has(.auth-page) > .page { min-height: 100dvh; padding: 0; }
  body.user-shell.auth-shell-page .auth-page,
  body.user-shell:has(.auth-page) .auth-page { min-height: 100dvh; padding: max(22px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom)); }
  body.user-shell.auth-shell-page .auth-shell,
  body.user-shell:has(.auth-page) .auth-shell { width: min(100%, 460px); }
  body.user-shell.studio-page,
  body.user-shell:has(.studio-app) { overflow: hidden; }
  .user-shell .studio-app { display: block; padding: 0; background: var(--user-canvas); }
  .user-shell .studio-main { height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .user-shell .studio-sidebar {
    position: fixed;
    top: 10px;
    bottom: 10px;
    left: 10px;
    width: min(278px,calc(100vw - 72px));
    padding: 12px 10px;
    border-radius: 22px;
    transform: translateX(calc(-100% - 20px));
  }
  .user-shell .studio-app.sidebar-open .studio-sidebar { transform: translateX(0); }
  .user-shell .studio-sidebar-backdrop { background: rgba(49,54,64,.38); backdrop-filter: blur(8px); }
  .user-shell .studio-conversation { padding: 28px 16px 190px; }
  .user-shell .studio-composer-dock { padding: 12px 16px calc(10px + env(safe-area-inset-bottom)); }
  .user-shell .studio-main:has(.studio-empty-state:not([hidden])) .studio-conversation { padding-bottom: 0; }
  .user-shell .studio-main.is-empty .studio-conversation { padding-bottom: 0; }
  .user-shell .studio-main:has(.studio-empty-state:not([hidden])) .studio-composer-dock,
  .user-shell .studio-main.is-empty .studio-composer-dock {
    top: auto;
    bottom: 0;
    padding: 12px 16px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(247,248,250,0), rgba(247,248,250,.94) 22px, var(--user-canvas) 50px);
  }
  .user-shell .studio-user-bubble { max-width: 88%; }
  .user-shell .studio-result-content { padding: 0; border-radius: 0; }
  .user-shell .chat-image-viewer { grid-template-columns: 1fr; }
  .user-shell .chat-image-stage { min-height: 270px; border-radius: 17px; }
  .user-shell .chat-image-thumbs { max-height: none; flex-direction: row; overflow: auto hidden; }
  .user-shell .chat-image-thumbs button { width: 60px; min-width: 60px; min-height: 60px; }
  .user-shell .chat-image-thumbs img { height: 50px; }
}

@media (max-width: 620px) {
  .user-shell .studio-main-head { min-height: 58px; padding: 8px 10px; }
  .user-shell .studio-main-title strong { font-size: 14px; }
  .user-shell .studio-main-title span { display: none; }
  .user-shell .studio-conversation { padding: 22px 12px 166px; }
  .user-shell .studio-empty-state { min-height: calc(100vh - 58px); padding: 0 18px 220px; }
  .user-shell .studio-empty-state h1 { font-size: 28px; }
  .user-shell .studio-main:has(.studio-empty-state:not([hidden])) .studio-composer-dock,
  .user-shell .studio-main.is-empty .studio-composer-dock { padding: 12px 12px calc(10px + env(safe-area-inset-bottom)); }
  .user-shell .studio-user-bubble { max-width: 92%; padding: 13px; border-radius: 20px 20px 6px 20px; }
  .user-shell .studio-user-reference-list { width: min(100%,208px); gap: 8px; }
  .user-shell .studio-user-reference-list .studio-user-reference { width: 64px; height: 64px; flex-basis: 64px; border-radius: 11px; }
  .user-shell .studio-assistant-turn { grid-template-columns: minmax(0,1fr); gap: 0; }
  .user-shell .studio-status-turn { width: min(100%, 330px); min-height: 0; padding: 0; border-radius: 0; }
  .user-shell .studio-status-turn .status-line { margin-bottom: 12px; font-size: 13px; }
  .user-shell .studio-loading-visual { width: min(100%, 310px); border-radius: 30px; }
  .user-shell .studio-result-content { width: 100%; padding: 0; }
  .user-shell .chat-image-stage { min-height: 240px; }
  .user-shell .chat-image-viewer-actions { gap: 6px; }
  .user-shell .chat-image-action { min-height: 36px; padding: 7px 10px; font-size: 11px; }
  .user-shell .studio-composer { padding: 7px; border-radius: 24px; }
  .user-shell .composer-attachment-item,
  .user-shell .composer-attachment-item > img { width: 70px; height: 70px; flex-basis: 70px; }
  .user-shell .composer-upload-button,
  .user-shell .composer-send-button { width: 40px; height: 40px; min-width: 40px; }
  .user-shell .studio-composer-note { display: none; }
  .user-shell .chat-lightbox { width: 100vw; height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .user-shell .chat-lightbox-toolbar { min-height: 60px; padding: 9px 10px; }
  .user-shell .chat-lightbox-toolbar > span { font-size: 11px; }
  .user-shell .chat-lightbox-download { min-height: 36px; padding: 7px 9px; font-size: 11px; }
  .user-shell .chat-lightbox-body { display: flex; height: 100%; padding-top: 60px; flex-direction: column-reverse; }
  .user-shell .chat-lightbox-thumbs { z-index: 2; min-height: 82px; flex-direction: row; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); overflow: auto hidden; border-top: 1px solid var(--user-line); border-right: 0; background: rgba(255,255,255,.9); }
  .user-shell .chat-lightbox-thumbs button { width: 58px; min-width: 58px; min-height: 58px; }
  .user-shell .chat-lightbox-thumbs img { height: 48px; }
  .user-shell .chat-lightbox-scroll { flex: 1; }
  .user-shell .chat-lightbox-item { min-height: calc(100vh - 142px); padding: 24px 12px; }
  .user-shell .chat-lightbox-item img { max-height: calc(100vh - 190px); border-radius: 14px; }
  body.user-shell .auth-card { padding: 25px 20px; border-radius: 24px; }
  body.user-shell.auth-shell-page .auth-brand .brand-tagline,
  body.user-shell:has(.auth-page) .auth-brand .brand-tagline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .user-shell .studio-loading-glow { animation-duration: 4.5s; }
}

/* Flat conversation results: images belong to the canvas, never to a card. */
body.user-shell.studio-page .studio-assistant-content,
body.user-shell.studio-page .studio-result-content,
body.user-shell.studio-page .studio-result-gallery,
body.user-shell.studio-page .chat-image-viewer {
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.user-shell.studio-page .studio-result-content {
  width: min(100%, 820px);
  margin: 0;
  padding: 0 !important;
}
body.user-shell.studio-page .studio-user-bubble {
  justify-items: end;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.user-shell.studio-page .studio-user-bubble p {
  max-width: 100%;
  padding: 0;
  color: var(--user-text);
  text-align: right;
}
body.user-shell.studio-page .studio-message-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  gap: 3px;
}
body.user-shell.studio-page .studio-message-action {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #747a85;
  background: transparent;
}
body.user-shell.studio-page .studio-message-action:hover { color: #17191d; background: rgba(36,40,48,.06); }
body.user-shell.studio-page .studio-message-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.user-shell.studio-page .studio-reference-summary {
  display: block;
  margin-top: 6px;
  color: #7b818d;
  font-size: 10px;
  font-weight: 560;
  line-height: 1.45;
  text-align: right;
}
body.user-shell.studio-page .studio-reference-summary[hidden] { display: none; }
.user-shell .studio-app.sidebar-collapsed .studio-account-trigger { padding: 9px; grid-template-columns: 34px; justify-content: center; }
.user-shell .studio-app.sidebar-collapsed .studio-account-usage { display: none; }
.user-shell .studio-app.sidebar-collapsed .studio-account-chevron { display: none; }
.user-shell .studio-app.sidebar-collapsed .studio-sidebar { overflow: visible; }
body.user-shell.studio-page .chat-image-viewer {
  width: fit-content;
  max-width: 100%;
  align-items: start;
}
body.user-shell.studio-page .chat-image-stage {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 0 !important;
  max-height: none !important;
  height: auto;
  justify-self: start;
  overflow: hidden;
  border: 0 !important;
  border-radius: 30px !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.user-shell.studio-page .chat-image-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(650px, 68vh);
  border-radius: inherit;
  object-fit: contain;
}

/* Keep the composer in its existing dock while making it a clean floating surface. */
body.user-shell.studio-page .studio-composer {
  border: 1px solid rgba(30, 34, 43, .10) !important;
  background: #fff !important;
  box-shadow:
    0 18px 48px rgba(35, 40, 52, .16),
    0 4px 14px rgba(35, 40, 52, .08),
    inset 0 1px 0 rgba(255, 255, 255, .98) !important;
}
body.user-shell.studio-page .studio-composer-dock {
  background: transparent !important;
  isolation: isolate;
}
body.user-shell.studio-page .studio-composer:focus-within {
  border-color: rgba(30, 34, 43, .16) !important;
  box-shadow:
    0 22px 56px rgba(35, 40, 52, .18),
    0 5px 16px rgba(35, 40, 52, .09),
    inset 0 1px 0 rgba(255, 255, 255, .98) !important;
}
body.user-shell.studio-page .studio-composer .composer-input-row,
body.user-shell.studio-page .studio-composer textarea,
body.user-shell.studio-page .studio-composer textarea:focus,
body.user-shell.studio-page .studio-composer textarea:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.user-shell.studio-page .composer-analysis-picker {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  align-self: center;
  max-width: 142px;
}
body.user-shell.studio-page .composer-analysis-picker::after {
  position: absolute;
  right: 8px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #747982;
  border-bottom: 1.5px solid #747982;
  content: '';
  pointer-events: none;
  transform: translateY(-2px) rotate(45deg);
}
body.user-shell.studio-page .composer-analysis-picker select {
  width: 100%;
  min-height: 36px;
  padding: 0 24px 0 8px;
  border: 0;
  border-radius: 12px;
  appearance: none;
  color: #4d525b;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
body.user-shell.studio-page .composer-analysis-picker select:hover,
body.user-shell.studio-page .composer-analysis-picker select:focus-visible {
  outline: 0;
  color: #15171b;
  background: #f2f3f5;
}
body.user-shell.studio-page .composer-model-controls {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  align-self: center;
  gap: 2px;
  min-width: 0;
}
body.user-shell.studio-page .composer-cost-preview {
  flex: 0 0 auto;
  padding: 0 3px;
  color: #626975;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
@media (max-width: 620px) {
  body.user-shell.studio-page .composer-model-controls { max-width: 164px; overflow-x: auto; scrollbar-width: none; }
  body.user-shell.studio-page .composer-model-controls::-webkit-scrollbar { display: none; }
  body.user-shell.studio-page .composer-analysis-picker { min-width: 100px; max-width: 112px; }
  body.user-shell.studio-page .composer-analysis-picker select { padding-left: 5px; font-size: 10px; }
  body.user-shell.studio-page .composer-cost-preview { display: none; }
}

/* A live conversation gives the composer its own layout row so it never covers images. */
body.user-shell.studio-page .studio-main:not(.is-empty) .studio-composer-dock {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  flex: 0 0 auto;
}
body.user-shell.studio-page .studio-main:not(.is-empty) .studio-conversation {
  padding-bottom: 40px;
}
body.user-shell.studio-page .studio-main:not(.is-empty) .studio-chat-scroll {
  scroll-padding-bottom: 40px;
}

/* Message content stays calm and readable: flat green text surface, controls directly below. */
body.user-shell.studio-page .studio-user-turn {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
}
body.user-shell.studio-page .studio-user-bubble {
  display: grid;
  width: min(78%, 720px);
  max-width: 100%;
  justify-items: end;
  gap: 10px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.user-shell.studio-page .studio-message-surface {
  width: fit-content;
  max-width: 100%;
  min-width: min(220px, 100%);
  padding: 14px 17px 11px;
  border: 0;
  border-radius: 23px;
  color: #13211a;
  background: #dff3e5;
  box-shadow: none;
}
body.user-shell.studio-page .studio-user-bubble.is-collapsible .studio-message-surface,
body.user-shell.studio-page .studio-user-bubble.is-editing .studio-message-surface {
  width: 100%;
}
body.user-shell.studio-page .studio-message-body,
body.user-shell.studio-page .studio-user-bubble p {
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: inherit;
  font-size: 15px;
  font-weight: 430;
  line-height: 1.7;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.user-shell.studio-page .studio-message-body.is-collapsed {
  max-height: 184px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 72%, transparent 100%);
}
body.user-shell.studio-page .studio-message-toggle {
  display: inline-flex;
  margin: 5px 0 -2px;
  padding: 4px 0;
  align-items: center;
  border: 0;
  color: #315d42;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
body.user-shell.studio-page .studio-message-toggle:hover { color: #173923; }
body.user-shell.studio-page .studio-message-actions {
  display: flex;
  align-self: flex-end;
  justify-content: flex-end;
  margin: 4px 2px 0;
  gap: 2px;
}
body.user-shell.studio-page .studio-inline-editor[hidden] { display: none !important; }
body.user-shell.studio-page .studio-inline-editor {
  display: grid;
  width: 100%;
  gap: 12px;
}
body.user-shell.studio-page .studio-inline-editor-input {
  width: 100%;
  min-height: 210px;
  max-height: min(56vh, 520px);
  resize: vertical;
  padding: 0 5px 0 0;
  overflow: auto;
  border: 0;
  outline: 0;
  color: #13211a;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 15px;
  line-height: 1.7;
}
body.user-shell.studio-page .studio-inline-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
body.user-shell.studio-page .studio-inline-editor-actions button {
  min-height: 36px;
  padding: 7px 15px;
  border: 1px solid rgba(20, 36, 27, .13);
  border-radius: 18px;
  color: #17211b;
  background: rgba(255,255,255,.72);
  font-weight: 650;
  cursor: pointer;
}
body.user-shell.studio-page .studio-inline-editor-actions button.primary {
  border-color: #17211b;
  color: #fff;
  background: #17211b;
}
body.user-shell.studio-page .studio-inline-editor-actions button:disabled { opacity: .55; cursor: wait; }
body.user-shell.studio-page .studio-composer.is-inline-editing .composer-attachment-preview { display: none !important; }

@media (max-width: 760px) {
  body.user-shell.studio-page .studio-user-bubble { width: min(94%, 720px); }
  body.user-shell.studio-page .studio-message-surface { border-radius: 20px; padding: 13px 15px 10px; }
  body.user-shell.studio-page .studio-message-body,
  body.user-shell.studio-page .studio-user-bubble p,
  body.user-shell.studio-page .studio-inline-editor-input { font-size: 14px; line-height: 1.65; }
  body.user-shell.studio-page .studio-inline-editor-input { min-height: 180px; }
}
body.user-shell.studio-page .chat-image-stage img {
  object-fit: contain !important;
  object-position: center;
}

@media (max-width: 620px) {
  body.user-shell.studio-page .studio-result-content { width: 100%; }
  body.user-shell.studio-page .chat-image-stage { border-radius: 24px !important; }
  body.user-shell.studio-page .chat-image-stage img { max-height: 66vh; }
}

.studio-settings-dialog {
  width: min(92vw, 620px);
  max-width: none;
  max-height: min(88vh, 760px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  color: var(--user-text);
  background: transparent;
  box-shadow: 0 30px 90px rgba(35,40,50,.30);
}
.studio-settings-dialog::backdrop { background: rgba(55,60,70,.34); backdrop-filter: blur(12px); }
.studio-settings-panel { max-height: min(88vh,760px); padding: 22px; overflow: hidden auto; background: rgba(255,255,255,.98); }
.studio-settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 20px; }
.studio-settings-head > div { display: grid; gap: 3px; }
.studio-settings-head span { color: var(--user-muted); font-size: 10px; letter-spacing: .08em; }
.studio-settings-head h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.studio-settings-head button { display: grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 1px solid var(--user-line); border-radius: 50%; background: #f4f5f7; }
.studio-settings-head button:hover { background: #e9ebef; }
.studio-settings-head img { width: 18px; height: 18px; }
.studio-settings-profile { display: flex; align-items: center; padding: 14px; gap: 12px; border: 1px solid var(--user-line); border-radius: 18px; background: #f7f8fa; }
.studio-settings-avatar { display: grid; width: 48px; height: 48px; min-width: 48px; place-items: center; border-radius: 50%; color: #202329; background: #e3e6ec; font-size: 18px; font-weight: 750; }
.studio-settings-profile > div { display: grid; min-width: 0; gap: 3px; }
.studio-settings-profile strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.studio-settings-profile small { overflow: hidden; color: var(--user-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.studio-settings-details { display: grid; margin: 12px 0 20px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.studio-settings-details > div { display: grid; padding: 12px 14px; gap: 4px; border: 1px solid var(--user-line); border-radius: 14px; }
.studio-settings-details span { color: var(--user-muted); font-size: 10px; }
.studio-settings-details strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.studio-settings-password { padding-top: 18px; border-top: 1px solid var(--user-line); }
.studio-settings-password > div { margin-bottom: 14px; }
.studio-settings-password h3 { margin: 0; font-size: 16px; }
.studio-settings-password p { margin: 5px 0 0; color: var(--user-muted); font-size: 11px; }
.studio-trash-note { margin: -5px 0 18px; color: var(--user-muted); font-size: 12px; line-height: 1.7; }
.studio-trash-list { display: grid; gap: 9px; }
.studio-trash-item { display: flex; min-width: 0; padding: 13px 14px; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--user-line); border-radius: 16px; background: #f7f8fa; }
.studio-trash-item > div { display: grid; min-width: 0; gap: 5px; }
.studio-trash-item strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.studio-trash-item small { color: var(--user-muted); font-size: 10px; }
.studio-trash-item form { margin: 0; }
.studio-trash-item button { min-height: 34px; padding: 7px 13px; border: 1px solid var(--user-line); border-radius: 11px; color: #202329; background: #fff; font-size: 12px; font-weight: 700; }
.studio-trash-item button:hover { background: #eceff3; }
.studio-trash-empty { padding: 38px 18px; border: 1px dashed var(--user-line); border-radius: 18px; color: var(--user-muted); background: #f8f9fa; text-align: center; }
@media (max-width: 620px) {
  .studio-settings-dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); border-radius: 22px; }
  .studio-settings-panel { max-height: calc(100vh - 24px); padding: 18px 16px; }
  .studio-settings-details { grid-template-columns: 1fr; }
  .studio-trash-item { align-items: flex-start; }
}

/* Immediate conversation feedback and the server-backed send/cancel state. */
body.user-shell.studio-page .studio-history-row.is-active {
  background: rgba(228, 231, 237, .82);
}
body.user-shell.studio-page .studio-history-row.is-active .studio-history-item {
  border-color: rgba(37, 42, 52, .08);
  background: rgba(255, 255, 255, .74);
}
body.user-shell.studio-page .studio-history-row.is-pending .studio-history-copy small {
  color: #4f62d7;
}
body.user-shell.studio-page .studio-chat-scroll { position: relative; }
body.user-shell.studio-page .composer-send-button.is-task-stop,
body.user-shell.studio-page .composer-send-button.is-task-stop:disabled {
  position: relative;
  border-color: #1d1f23 !important;
  opacity: 1;
  color: #fff;
  background: #1d1f23 !important;
  box-shadow: 0 4px 12px rgba(20, 22, 27, .14);
}
body.user-shell.studio-page .composer-send-button.is-task-stop img { display: none; }
body.user-shell.studio-page .composer-send-button.is-task-stop::after {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  content: '';
  background: #fff;
}
body.user-shell.studio-page .composer-send-button.is-task-stop:not(:disabled) { cursor: pointer; }
body.user-shell.studio-page .composer-send-button.is-task-stop:not(:disabled):hover { background: #050607 !important; }
body.user-shell.studio-page .composer-send-button.is-task-stop-locked { cursor: default; }

/* Conversation rail and live account capacity. */
body.user-shell.studio-page .studio-history-section + .studio-history-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(35, 40, 49, .07);
}
body.user-shell.studio-page .studio-history-section.is-pinned-section .studio-sidebar-section-title {
  color: #4e5562;
}
body.user-shell.studio-page .studio-history-compact-icon {
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(41, 47, 58, .09);
  border-radius: 11px;
  color: #505762;
  background: rgba(245, 246, 249, .94);
  font-size: 11px;
  font-weight: 760;
}
body.user-shell.studio-page .studio-history-row.is-pinned .studio-history-compact-icon {
  color: #3d4fc3;
  background: #eceeff;
}
body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history {
  overflow: hidden auto;
}
body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-section {
  display: grid;
  justify-items: center;
}
body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-section + .studio-history-section {
  width: 42px;
  margin-top: 9px;
  padding-top: 9px;
}
body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-list {
  width: 100%;
  justify-items: center;
  gap: 6px;
}
body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-row {
  width: 38px;
}
body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-item {
  display: grid;
  width: 38px;
  min-height: 38px;
  padding: 2px;
  place-items: center;
  border-radius: 12px;
}
body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-compact-icon { display: grid; }
body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-copy { display: none !important; }

@media (max-width: 840px) {
  body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-section {
    display: block;
    width: auto;
  }
  body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-section + .studio-history-section {
    width: auto;
    margin-top: 12px;
    padding-top: 12px;
  }
  body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-list { width: auto; justify-items: stretch; }
  body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-row { width: auto; }
  body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-item {
    display: block;
    width: auto;
    min-height: 58px;
    padding: 9px 10px;
  }
  body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-compact-icon { display: none; }
  body.user-shell.studio-page .studio-app.sidebar-collapsed .studio-history-copy { display: grid !important; }
}

@media (max-width: 620px) {
  body.user-shell.studio-page .studio-main-title { display: none; }
}

/* Product Design 2.10 — one coherent creator experience from sign-in to delivery. */
body.user-shell {
  --creator-bg: #f2f3f5;
  --creator-canvas: #fbfbfc;
  --creator-surface: rgba(255, 255, 255, .88);
  --creator-surface-solid: #fff;
  --creator-text: #111318;
  --creator-muted: #525a66;
  --creator-faint: #747c88;
  --creator-line: rgba(25, 29, 37, .10);
  --creator-line-strong: rgba(25, 29, 37, .17);
  --creator-blue: #0a84ff;
  --creator-blue-soft: rgba(10, 132, 255, .11);
  --creator-green: #e3f5e9;
  --creator-shadow: 0 22px 62px rgba(28, 34, 45, .12), 0 3px 12px rgba(28, 34, 45, .05);
  --creator-shadow-soft: 0 10px 30px rgba(28, 34, 45, .08), 0 2px 6px rgba(28, 34, 45, .04);
  color: var(--creator-text);
  background: var(--creator-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Login: no secondary navigation, no duplicate logo, one focused task. */
body.user-shell.auth-shell-page {
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 12%, rgba(255,255,255,.96), rgba(255,255,255,0) 38%),
    linear-gradient(145deg, #eef1f6 0%, #f8f8fa 52%, #eceff4 100%);
}
body.user-shell.auth-shell-page .page { min-height: 100vh; }
body.user-shell.auth-shell-page .site-header,
body.user-shell.auth-shell-page .site-footer { display: none !important; }
body.user-shell.auth-shell-page .alert { position: fixed; z-index: 20; top: 20px; left: 50%; width: min(92vw, 460px); transform: translateX(-50%); }
body.user-shell.auth-shell-page .auth-page {
  display: grid;
  min-height: 100vh;
  padding: 32px 20px;
  place-items: center;
}
body.user-shell.auth-shell-page .auth-shell { width: min(100%, 430px); }
body.user-shell.auth-shell-page .auth-card {
  padding: 38px;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 30px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 30px 80px rgba(31,38,51,.15), inset 0 1px 0 rgba(255,255,255,.98);
  backdrop-filter: blur(26px) saturate(145%);
}
body.user-shell.auth-shell-page .auth-title { margin-bottom: 8px; font-size: 31px; font-weight: 720; letter-spacing: -.045em; }
body.user-shell.auth-shell-page .auth-copy { margin-bottom: 30px; color: var(--creator-muted); font-size: 14px; }
body.user-shell.auth-shell-page .auth-card .stack { gap: 17px; }
body.user-shell.auth-shell-page .auth-card .label { color: #3e4550; font-size: 12px; font-weight: 650; }
body.user-shell.auth-shell-page .auth-card .input {
  min-height: 52px;
  border: 1px solid var(--creator-line-strong);
  border-radius: 15px;
  color: var(--creator-text);
  background: rgba(247,248,250,.92);
  font-size: 15px;
}
body.user-shell.auth-shell-page .auth-card .input:focus { border-color: rgba(10,132,255,.55); box-shadow: 0 0 0 4px rgba(10,132,255,.10); }
body.user-shell.auth-shell-page .auth-card .btn-primary { min-height: 52px; margin-top: 4px; border-radius: 15px; background: #17191e; box-shadow: 0 12px 26px rgba(23,25,30,.20); }
body.user-shell.auth-shell-page .auth-foot { margin-top: 24px; color: var(--creator-muted); font-size: 12px; }
/* Registration entry: readable on the light login card; other links stay unchanged. */
body.user-shell.auth-shell-page .auth-foot a[href$="/register.php"] {
  color: #0969da;
  font-weight: 600;
  margin-inline-start: 4px;
  text-decoration: underline;
  text-decoration-color: rgba(9,105,218,.4);
  text-underline-offset: 3px;
}
body.user-shell.auth-shell-page .auth-foot a[href$="/register.php"]:hover {
  color: #0755b5;
  text-decoration-color: currentColor;
}
body.user-shell.auth-shell-page .auth-foot a[href$="/register.php"]:focus-visible {
  outline: 2px solid #0969da;
  outline-offset: 4px;
  border-radius: 3px;
}
/* End registration entry */
body.user-shell.auth-shell-page .auth-maintenance-notice {
  display: grid;
  margin: -10px 0 24px;
  padding: 14px 15px;
  gap: 8px;
  border: 1px solid rgba(18, 113, 102, .13);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(244,252,250,.94), rgba(248,249,251,.92));
}
body.user-shell.auth-shell-page .auth-maintenance-notice.is-closed {
  border-color: rgba(196, 118, 30, .18);
  background: linear-gradient(145deg, rgba(255,248,237,.96), rgba(250,248,246,.94));
}
body.user-shell.auth-shell-page .auth-maintenance-notice__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
body.user-shell.auth-shell-page .auth-maintenance-notice__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a394;
  box-shadow: 0 0 0 4px rgba(22,163,148,.09);
}
body.user-shell.auth-shell-page .auth-maintenance-notice.is-closed .auth-maintenance-notice__dot {
  background: #d6892f;
  box-shadow: 0 0 0 4px rgba(214,137,47,.10);
}
body.user-shell.auth-shell-page .auth-maintenance-notice__head strong {
  overflow: hidden;
  color: #282d34;
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.user-shell.auth-shell-page .auth-maintenance-notice__status {
  padding: 4px 8px;
  border-radius: 999px;
  color: #0f766e;
  background: rgba(22,163,148,.09);
  font-size: 10px;
  font-weight: 700;
}
body.user-shell.auth-shell-page .auth-maintenance-notice.is-closed .auth-maintenance-notice__status { color: #a55b12; background: rgba(214,137,47,.10); }
body.user-shell.auth-shell-page .auth-maintenance-notice p {
  margin: 0;
  color: #5e6570;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
body.user-shell.auth-shell-page .auth-maintenance-notice small {
  color: #9a5a19;
  font-size: 10px;
  line-height: 1.55;
}

/* Creator shell. */
body.user-shell.studio-page .studio-app {
  --studio-sidebar: 252px;
  height: 100dvh;
  padding: 10px;
  gap: 10px;
  background: var(--creator-bg);
}
body.user-shell.studio-page .studio-sidebar {
  padding: 13px 11px;
  border: 1px solid rgba(255,255,255,.94);
  border-radius: 26px;
  background: rgba(250,250,252,.84);
  box-shadow: var(--creator-shadow-soft);
  backdrop-filter: blur(28px) saturate(150%);
}
body.user-shell.studio-page .studio-sidebar-head { min-height: 48px; padding: 1px 2px 11px; }
body.user-shell.studio-page .studio-brand { padding: 6px 7px; }
body.user-shell.studio-page .studio-brand strong { color: var(--creator-text); font-size: 15px; }
body.user-shell.studio-page .studio-brand small { color: var(--creator-muted); font-size: 10px; letter-spacing: .03em; }
body.user-shell.studio-page .studio-new-button {
  min-height: 48px;
  margin: 6px 2px 18px;
  border-radius: 15px;
  border-color: var(--creator-line);
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 22px rgba(30,35,45,.07);
}
body.user-shell.studio-page .studio-history { padding-right: 1px; }
body.user-shell.studio-page .studio-sidebar-section-title { margin: 0 10px 7px; color: var(--creator-muted); font-weight: 670; }
body.user-shell.studio-page .studio-history-row { border-radius: 13px; }
body.user-shell.studio-page .studio-history-item { min-height: 52px; padding: 8px 10px; border-radius: 13px; }
body.user-shell.studio-page .studio-history-copy > span { color: #272b32; font-size: 12px; }
body.user-shell.studio-page .studio-history-copy small { color: var(--creator-faint); }
body.user-shell.studio-page .studio-history-row.is-active { background: rgba(226,229,235,.80); }
body.user-shell.studio-page .studio-history-row.is-active .studio-history-item { background: rgba(255,255,255,.76); box-shadow: inset 0 0 0 1px rgba(25,29,37,.06); }
body.user-shell.studio-page .studio-account {
  margin-top: 10px;
  border-color: var(--creator-line);
  border-radius: 17px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 24px rgba(29,34,44,.07);
}
body.user-shell.studio-page .studio-account-usage { padding: 11px 11px 9px; gap: 7px; border-bottom-color: var(--creator-line); }
body.user-shell.studio-page .studio-account-usage-line { color: var(--creator-muted); }
body.user-shell.studio-page .studio-account-usage-line strong { color: var(--creator-text); }
body.user-shell.studio-page .studio-account-usage-track { height: 5px; background: #dfe3e9; }
body.user-shell.studio-page .studio-account-usage-track > span { background: linear-gradient(90deg, #0a84ff, #63b4ff); }
body.user-shell.studio-page .studio-account-trigger { min-height: 52px; }
body.user-shell.studio-page .studio-account-menu { border: 1px solid rgba(255,255,255,.95); border-radius: 18px; box-shadow: 0 20px 60px rgba(27,32,42,.17); }

body.user-shell.studio-page .studio-main {
  display: flex;
  height: calc(100dvh - 20px);
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.94);
  border-radius: 28px;
  background: var(--creator-canvas);
  box-shadow: var(--creator-shadow-soft);
}
body.user-shell.studio-page .studio-main-head {
  min-height: 58px;
  padding: 8px 17px;
  border-bottom-color: rgba(25,29,37,.08);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(24px) saturate(150%);
}
body.user-shell.studio-page .studio-main-title strong { color: var(--creator-text); }
body.user-shell.studio-page .studio-main-title span { color: var(--creator-muted); }
body.user-shell.studio-page .studio-chat-scroll {
  min-height: 0;
  flex: 1 1 auto;
  background:
    radial-gradient(circle at 50% 0, rgba(255,255,255,.92), rgba(255,255,255,0) 34%),
    var(--creator-canvas);
}
body.user-shell.studio-page .studio-conversation { width: min(100%, 980px); padding: 46px 38px 42px; }
body.user-shell.studio-page .studio-turn-list { gap: 36px; }
body.user-shell.studio-page .studio-empty-state {
  min-height: calc(100dvh - 116px);
  padding: 0 30px 250px;
}
body.user-shell.studio-page .studio-empty-logo { width: 58px; height: 58px; margin-bottom: 22px; border-radius: 19px; background: rgba(255,255,255,.72); box-shadow: 0 12px 32px rgba(35,42,55,.10); }
body.user-shell.studio-page .studio-empty-state h1 { color: var(--creator-text); font-size: clamp(30px, 4vw, 44px); font-weight: 720; }
body.user-shell.studio-page .studio-empty-state p { max-width: 540px; color: var(--creator-muted); font-size: 14px; line-height: 1.7; }

/* Message hierarchy: quiet user surface, completely flat assistant canvas. */
body.user-shell.studio-page .studio-user-turn { gap: 3px; }
body.user-shell.studio-page .studio-user-bubble { width: min(82%, 740px); }
body.user-shell.studio-page .studio-message-surface {
  min-width: min(180px,100%);
  padding: 13px 17px 11px;
  border-radius: 22px;
  color: #152019;
  background: var(--creator-green);
}
body.user-shell.studio-page .studio-message-body,
body.user-shell.studio-page .studio-user-bubble p { font-size: 15px; line-height: 1.68; }
body.user-shell.studio-page .studio-user-reference-list { width: min(100%, 410px); flex-wrap: wrap; gap: 7px; }
body.user-shell.studio-page .studio-user-reference-list .studio-user-reference { width: 70px; height: 70px; border-radius: 13px; box-shadow: inset 0 0 0 1px var(--creator-line); }
body.user-shell.studio-page .studio-message-actions { margin-top: 3px; }
body.user-shell.studio-page .studio-message-action { color: #656d79; }
body.user-shell.studio-page .studio-assistant-content,
body.user-shell.studio-page .studio-result-content,
body.user-shell.studio-page .studio-result-gallery { width: 100%; max-width: 860px; }

/* Square animated light field replaces every horizontal generation rail. */
body.user-shell.studio-page .studio-status-turn { width: min(100%, 520px); }
body.user-shell.studio-page .studio-status-turn .status-line {
  margin: 0 0 16px;
  color: #303640;
  font-size: clamp(18px, 1.35vw, 20px);
  font-weight: 560;
  line-height: 1.65;
}
body.user-shell.studio-page .studio-status-turn .assistant-thinking-dot { display: none; }
body.user-shell.studio-page .studio-loading-visual {
  position: relative;
  display: grid;
  width: min(100%, clamp(300px, 42vw, 440px));
  height: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(31,38,50,.06);
  border-radius: 32px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255,255,255,.94), rgba(255,255,255,0) 42%),
    linear-gradient(145deg, rgba(245,247,250,.96), rgba(232,236,242,.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.96);
}
.studio-light-matrix {
  display: grid;
  width: 64%;
  aspect-ratio: 1;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(5px, .8vw, 10px);
  place-items: center;
}
.studio-light-matrix > span {
  width: 100%;
  max-width: 15px;
  aspect-ratio: 1;
  border-radius: 34%;
  background: linear-gradient(145deg,#fff,#dce1e8);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.9), 0 3px 7px rgba(41,50,64,.08);
  opacity: .34;
  animation: creator-light-pulse 2.6s cubic-bezier(.4,0,.2,1) infinite;
  animation-delay: calc((var(--light-row) + var(--light-column)) * 74ms - 850ms);
}
.studio-light-matrix > span.is-progress {
  background: linear-gradient(145deg,#8bc8ff,#4e75ee 62%,#7967dc);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.55), 0 5px 13px rgba(78,117,238,.22);
  opacity: .86;
}
.studio-light-matrix > span.is-frontier {
  background: linear-gradient(145deg,#a7dcff,#5e87f5 58%,#8b72e8);
  box-shadow: 0 0 0 5px rgba(79,119,240,.09),0 6px 15px rgba(77,108,226,.28);
  opacity: 1;
}
@keyframes creator-light-pulse {
  0%, 72%, 100% { transform: translateY(2px) scale(.84); filter: saturate(.78); }
  34% { opacity: 1; transform: translateY(-2px) scale(1); filter: saturate(1.08); }
}
body.user-shell.studio-page .studio-loading-glow,
body.user-shell.studio-page .studio-loading-rail { display: none !important; }

/* Result viewer: dimensions follow the source image; thumbnails always stay at the side. */
body.user-shell.studio-page .chat-image-viewer {
  display: grid;
  width: min(100%, 860px);
  grid-template-columns: minmax(0,1fr) 72px;
  align-items: start;
  gap: 12px;
}
body.user-shell.studio-page .chat-image-viewer.is-single {
  width: fit-content;
  grid-template-columns: minmax(0,1fr);
}
body.user-shell.studio-page .chat-image-stage {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--result-aspect, 1 / 1);
  place-items: center;
  overflow: hidden;
  border-radius: 30px !important;
  background: transparent !important;
}
body.user-shell.studio-page .chat-image-stage img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: inherit;
  object-fit: contain !important;
  opacity: 1;
  transition: opacity .25s ease;
}
body.user-shell.studio-page .chat-image-stage.is-loading img,
body.user-shell.studio-page .chat-image-viewer.is-history-deferred .chat-image-stage img { opacity: 0; }
.studio-image-stage-loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  place-items: center;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.94), rgba(255,255,255,0) 44%),
    linear-gradient(145deg,#f4f6f8,#e9edf2);
}
body.user-shell.studio-page .chat-image-stage.is-loading .studio-image-stage-loader,
body.user-shell.studio-page .chat-image-viewer.is-history-deferred .studio-image-stage-loader { display: grid; }
.studio-image-stage-loader .studio-light-matrix { width: min(58%, 300px); }
body.user-shell.studio-page .chat-image-viewer.is-history-deferred .studio-light-matrix > span { animation-play-state: paused; opacity: .18; }
body.user-shell.studio-page .chat-image-thumbs {
  display: flex;
  max-height: min(720px,72dvh);
  flex-direction: column;
  gap: 9px;
  overflow: hidden auto;
  scrollbar-width: thin;
}
body.user-shell.studio-page .chat-image-thumbs button { width: 68px; min-width: 68px; min-height: 68px; padding: 3px; border: 2px solid transparent; border-radius: 15px; background: #eef0f3; }
body.user-shell.studio-page .chat-image-thumbs button.active { border-color: var(--creator-blue); background: #fff; box-shadow: 0 7px 20px rgba(32,40,54,.12); }
body.user-shell.studio-page .chat-image-thumbs img { width: 100%; height: 58px; border-radius: 10px; object-fit: cover; }
body.user-shell.studio-page .chat-image-viewer-actions { margin-top: 12px; gap: 7px; }
body.user-shell.studio-page .chat-image-action { min-height: 38px; border-radius: 13px; color: #353b44; background: rgba(255,255,255,.80); }

/* Composer is a floating control, but remains in layout so it never crops results. */
body.user-shell.studio-page .studio-composer-dock { flex: 0 0 auto; padding: 12px 24px 15px; background: linear-gradient(180deg, rgba(251,251,252,0), rgba(251,251,252,.92) 36%, #fbfbfc 100%) !important; }
body.user-shell.studio-page .studio-main:not(.is-empty) .studio-composer-dock { position: relative; }
body.user-shell.studio-page .studio-composer {
  width: min(100%, 900px);
  padding: 7px 8px;
  border: 1px solid rgba(28,33,42,.11) !important;
  border-radius: 27px;
  background: rgba(255,255,255,.94) !important;
  box-shadow: 0 18px 48px rgba(28,34,45,.14), 0 3px 10px rgba(28,34,45,.06) !important;
  backdrop-filter: blur(22px) saturate(145%);
}
body.user-shell.studio-page .studio-composer:focus-within { border-color: rgba(10,132,255,.26) !important; box-shadow: 0 20px 54px rgba(28,34,45,.15), 0 0 0 4px rgba(10,132,255,.07) !important; }
body.user-shell.studio-page .studio-composer textarea { color: var(--creator-text); font-size: 15px; }
body.user-shell.studio-page .studio-composer textarea::placeholder { color: #7c838e; }
body.user-shell.studio-page .composer-upload-button,
body.user-shell.studio-page .composer-send-button { width: 44px; height: 44px; border-radius: 50%; }
body.user-shell.studio-page .composer-upload-button { border-color: var(--creator-line); background: #f5f6f8; }
body.user-shell.studio-page .composer-send-button { border-color: #17191e; background: #17191e; }
body.user-shell.studio-page .composer-attachment-preview { margin: 1px 2px 3px; }
body.user-shell.studio-page .composer-attachment-list { gap: 8px; }

/* Full-screen image inspection and a calmer settings sheet. */
body.user-shell.studio-page .chat-lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
body.user-shell.studio-page .chat-lightbox-body { grid-template-columns: 88px minmax(0,1fr); }
body.user-shell.studio-page .studio-settings-dialog {
  width: min(92vw, 590px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.94);
  border-radius: 30px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 32px 90px rgba(27,32,42,.24);
  backdrop-filter: blur(28px) saturate(150%);
}
body.user-shell.studio-page .studio-settings-panel { max-height: min(88dvh, 760px); padding: 26px; background: transparent; }
body.user-shell.studio-page .studio-settings-profile { border-color: var(--creator-line); border-radius: 19px; background: #f5f6f8; }
body.user-shell.studio-page .studio-settings-details > div { border-color: var(--creator-line); background: rgba(255,255,255,.76); }
body.user-shell.studio-page .studio-settings-password { border-top-color: var(--creator-line); }

@media (max-width: 840px) {
  body.user-shell.studio-page .studio-app { display: block; padding: 0; }
  body.user-shell.studio-page .studio-main { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  body.user-shell.studio-page .studio-sidebar { width: min(72vw, 274px); height: calc(100dvh - 20px); margin: 10px; border-radius: 25px; }
  body.user-shell.studio-page .studio-sidebar-backdrop { background: rgba(35,40,49,.24); backdrop-filter: blur(8px); }
  body.user-shell.studio-page .studio-conversation { padding: 30px 18px 34px; }
  body.user-shell.studio-page .studio-composer-dock { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
}

@media (max-width: 620px) {
  body.user-shell.auth-shell-page .auth-page { padding: 18px 16px; }
  body.user-shell.auth-shell-page .auth-card { padding: 28px 22px; border-radius: 25px; }
  body.user-shell.auth-shell-page .auth-title { font-size: 27px; }
  body.user-shell.studio-page .studio-main-head { min-height: 54px; padding: 7px 10px; }
  body.user-shell.studio-page .studio-conversation { padding: 24px 13px 28px; }
  body.user-shell.studio-page .studio-empty-state { min-height: calc(100dvh - 74px); padding: 0 18px 205px; }
  body.user-shell.studio-page .studio-empty-logo { width: 50px; height: 50px; margin-bottom: 18px; border-radius: 16px; }
  body.user-shell.studio-page .studio-empty-state h1 { font-size: 29px; }
  body.user-shell.studio-page .studio-empty-state p { font-size: 12px; }
  body.user-shell.studio-page .studio-turn-list { gap: 30px; }
  body.user-shell.studio-page .studio-user-bubble { width: min(94%, 720px); }
  body.user-shell.studio-page .studio-message-surface { padding: 12px 14px 10px; border-radius: 20px; }
  body.user-shell.studio-page .studio-message-body,
  body.user-shell.studio-page .studio-user-bubble p { font-size: 14px; }
  body.user-shell.studio-page .studio-status-turn { width: 100%; }
  body.user-shell.studio-page .studio-status-turn .status-line { margin-bottom: 14px; font-size: clamp(17px, 4.6vw, 19px); line-height: 1.6; }
  body.user-shell.studio-page .studio-loading-visual { width: min(88vw, 330px); height: auto; aspect-ratio: 1 / 1; border-radius: 26px; }
  .studio-light-matrix > span { width: 100%; max-width: 11px; }
  body.user-shell.studio-page .chat-image-viewer { grid-template-columns: minmax(0,1fr) 52px; gap: 8px; }
  body.user-shell.studio-page .chat-image-stage { border-radius: 24px !important; }
  body.user-shell.studio-page .chat-image-thumbs { max-height: min(66dvh, 520px); gap: 7px; }
  body.user-shell.studio-page .chat-image-thumbs button { width: 50px; min-width: 50px; min-height: 50px; padding: 2px; border-radius: 12px; }
  body.user-shell.studio-page .chat-image-thumbs img { height: 44px; border-radius: 8px; }
  body.user-shell.studio-page .studio-composer-dock { padding-right: 10px; padding-left: 10px; }
  body.user-shell.studio-page .studio-composer { padding: 6px; border-radius: 25px; }
  body.user-shell.studio-page .composer-upload-button,
  body.user-shell.studio-page .composer-send-button { width: 42px; height: 42px; }
  body.user-shell.studio-page .studio-settings-dialog {
    width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 28px 28px 0 0;
  }
  body.user-shell.studio-page .studio-settings-panel { max-height: 92dvh; padding: 22px 17px calc(22px + env(safe-area-inset-bottom)); }
  body.user-shell.studio-page .chat-lightbox-body { grid-template-columns: 58px minmax(0,1fr); }
  body.user-shell.studio-page .chat-lightbox-thumbs { padding: 12px 7px; }
  body.user-shell.studio-page .chat-lightbox-thumbs button { width: 44px; min-height: 44px; }
  body.user-shell.studio-page .chat-lightbox-thumbs img { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .studio-light-matrix > span { animation: none; opacity: .44; }
}

/* Product Design 2.11 — selected gallery workspace. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: studio-page-out .10s ease both; }
::view-transition-new(root) { animation: studio-page-in .18s ease-out both; }
@keyframes studio-page-out { to { opacity: .82; } }
@keyframes studio-page-in { from { opacity: .72; } }

body.user-shell.studio-page .studio-result-turn {
  transition: opacity .26s ease, transform .26s cubic-bezier(.22,.75,.25,1);
  will-change: opacity, transform;
}
body.user-shell.studio-page .studio-result-turn.is-entering {
  opacity: 0;
  transform: translateY(10px);
}
body.user-shell.studio-page .chat-image-stage img {
  transition: opacity .26s ease !important;
}
body.user-shell.studio-page .chat-image-stage img.is-entering { opacity: 0; }
body.user-shell.studio-page .studio-image-stage-loader {
  background: #f3f4f6;
  transition: opacity .18s ease;
}
body.user-shell.studio-page .studio-image-stage-loader .studio-light-matrix { display: none; }

body.user-shell.studio-page {
  --gallery-blue: #2f6fff;
  --gallery-ink: #17191d;
  --gallery-muted: #5f6670;
  --gallery-faint: #818894;
  --gallery-line: rgba(23, 25, 29, .10);
  --gallery-surface: #ffffff;
  --gallery-soft: #f5f6f8;
  overflow: hidden;
  background: #fff;
}

body.user-shell.studio-page .studio-app {
  --studio-sidebar: 202px;
  height: 100dvh;
  padding: 0;
  gap: 0;
  background: #fff;
}

/* Text-only conversation navigation. */
body.user-shell.studio-page .studio-sidebar {
  padding: 20px 14px 14px;
  border: 0;
  border-right: 1px solid var(--gallery-line);
  border-radius: 0;
  background: #fbfbfc;
  box-shadow: none;
  backdrop-filter: none;
}
body.user-shell.studio-page .studio-sidebar-head { min-height: 42px; padding: 0 3px 12px; }
body.user-shell.studio-page .studio-brand { padding: 7px 4px; gap: 0; }
body.user-shell.studio-page .studio-brand .brand-logo,
body.user-shell.studio-page .studio-brand .brand-mark { display: none !important; }
body.user-shell.studio-page .studio-brand > .studio-sidebar-label { display: block; }
body.user-shell.studio-page .studio-brand strong { color: var(--gallery-ink); font-size: 18px; font-weight: 730; letter-spacing: -.035em; }
body.user-shell.studio-page .studio-brand small { display: none; }
body.user-shell.studio-page .studio-collapse-button { width: 34px; height: 34px; min-width: 34px; border-radius: 10px; }
body.user-shell.studio-page .studio-collapse-button:hover { background: #f0f1f3; }
body.user-shell.studio-page .studio-new-button {
  min-height: 42px;
  margin: 8px 1px 22px;
  padding: 8px 7px;
  border: 0;
  border-radius: 10px;
  color: var(--gallery-ink);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 620;
}
body.user-shell.studio-page .studio-new-button:hover { color: var(--gallery-blue); background: #f2f4f8; }
body.user-shell.studio-page .studio-new-button img { width: 19px; height: 19px; }
body.user-shell.studio-page .studio-history { padding: 0; }
body.user-shell.studio-page .studio-history-section + .studio-history-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(23,25,29,.07); }
body.user-shell.studio-page .studio-sidebar-section-title { margin: 0 7px 6px; padding: 0; color: #777e88; font-size: 11px; font-weight: 680; }
body.user-shell.studio-page .studio-sidebar-empty { margin: 9px 7px; color: var(--gallery-faint); font-size: 11px; line-height: 1.55; }
body.user-shell.studio-page .studio-history-list { gap: 1px; }
body.user-shell.studio-page .studio-history-row { border-radius: 0; background: transparent !important; }
body.user-shell.studio-page .studio-history-row.is-active { border-left: 2px solid var(--gallery-blue); }
body.user-shell.studio-page .studio-history-item,
body.user-shell.studio-page .studio-history-row.is-active .studio-history-item {
  min-height: 48px;
  padding: 7px 7px 7px 9px;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
}
body.user-shell.studio-page .studio-history-item:hover { background: #f0f2f5; }
body.user-shell.studio-page .studio-history-compact-icon { display: none !important; }
body.user-shell.studio-page .studio-history-copy > span { color: #24272d; font-size: 12px; font-weight: 570; }
body.user-shell.studio-page .studio-history-copy small { margin-top: 4px; color: #858c96; font-size: 10px; }
body.user-shell.studio-page .studio-history-more { color: #747b85; }
body.user-shell.studio-page .studio-account {
  margin: 12px 0 0;
  border: 0;
  border-top: 1px solid rgba(23,25,29,.08);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.user-shell.studio-page .studio-account-usage { padding: 12px 6px 8px; border-bottom-color: rgba(23,25,29,.06); }
body.user-shell.studio-page .studio-account-usage-line { color: #737a84; font-size: 10px; }
body.user-shell.studio-page .studio-account-usage-line strong { color: #25282e; }
body.user-shell.studio-page .studio-account-usage-track { height: 3px; background: #e3e5e9; }
body.user-shell.studio-page .studio-account-usage-track > span { background: var(--gallery-blue); }
body.user-shell.studio-page .studio-account-trigger { min-height: 48px; padding: 7px 5px; }
body.user-shell.studio-page .studio-account-icon { color: #22262d; background: #eef0f3; }

/* The image gallery owns the canvas; there is no outer app card. */
body.user-shell.studio-page .studio-main {
  --composer-safe-space: 136px;
  width: 100%;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
body.user-shell.studio-page .studio-main-head { display: none; }
body.user-shell.studio-page .studio-chat-scroll {
  background: #fff;
  scroll-padding-top: 24px;
  scroll-padding-bottom: var(--composer-safe-space);
  scrollbar-color: #c7cbd1 transparent;
  overscroll-behavior: contain;
}
body.user-shell.studio-page .studio-conversation {
  width: min(100%, 1160px);
  min-height: 100%;
  padding: 32px 34px var(--composer-safe-space);
}
body.user-shell.studio-page .studio-turn-list { gap: 42px; }
body.user-shell.studio-page .studio-empty-state {
  min-height: calc(100dvh - var(--composer-safe-space));
  padding: 0 24px 8vh;
}
body.user-shell.studio-page .studio-empty-logo { display: none; }
body.user-shell.studio-page .studio-empty-state h1 { color: var(--gallery-ink); font-size: clamp(32px, 4vw, 48px); font-weight: 720; }
body.user-shell.studio-page .studio-empty-state p { max-width: 560px; color: var(--gallery-muted); font-size: 15px; }

body.user-shell.studio-page .studio-user-turn { margin: 8px 0 34px; }
body.user-shell.studio-page .studio-user-bubble { width: min(72%, 720px); }
body.user-shell.studio-page .studio-message-surface {
  padding: 12px 16px 11px;
  border: 1px solid rgba(47,111,255,.11);
  border-radius: 19px;
  color: #252b34;
  background: #f2f6ff;
}
body.user-shell.studio-page .studio-message-body,
body.user-shell.studio-page .studio-user-bubble p { font-size: 15px; line-height: 1.62; }
body.user-shell.studio-page .studio-user-reference-list { width: min(100%, 480px); gap: 8px; }
body.user-shell.studio-page .studio-user-reference-list .studio-user-reference { width: 74px; height: 74px; border-radius: 14px; }
body.user-shell.studio-page .studio-message-actions { margin-top: 5px; }

body.user-shell.studio-page .studio-assistant-turn,
body.user-shell.studio-page .studio-assistant-content,
body.user-shell.studio-page .studio-result-content,
body.user-shell.studio-page .studio-result-gallery { width: 100%; max-width: none; }

/* Square progress is the final image slot, so the result fades into the same geometry. */
body.user-shell.studio-page .studio-status-turn {
  display: grid;
  width: min(100%, 380px);
  margin: 0 auto 22px 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.user-shell.studio-page .studio-status-turn .status-line {
  order: 2;
  margin: 12px 0 0;
  color: #343a44;
  font-size: 15px;
  font-weight: 590;
  line-height: 1.5;
}
body.user-shell.studio-page .studio-loading-visual {
  order: 1;
  width: min(100%, 380px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 28px;
  background: #f1f2f4;
  box-shadow: inset 0 0 0 1px rgba(23,25,29,.05);
}
body.user-shell.studio-page .studio-loading-visual::after {
  position: absolute;
  right: 18px;
  bottom: 16px;
  content: attr(aria-valuenow) '%';
  color: var(--gallery-blue);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -.02em;
}
body.user-shell.studio-page .studio-loading-visual .studio-light-matrix { width: 62%; }
body.user-shell.studio-page .studio-light-matrix > span {
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 10px rgba(35,43,55,.12);
}
body.user-shell.studio-page .studio-light-matrix > span.is-progress,
body.user-shell.studio-page .studio-light-matrix > span.is-frontier { background: #4a7cff; }

/* Large uncropped gallery with a vertical thumbnail rail. */
body.user-shell.studio-page .chat-image-viewer {
  width: min(100%, 1080px);
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 14px;
}
body.user-shell.studio-page .chat-image-viewer.is-single { width: min(100%, 980px); }
body.user-shell.studio-page .chat-image-stage {
  border: 0 !important;
  border-radius: 30px !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none;
}
body.user-shell.studio-page .chat-image-stage img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
  transition: opacity .34s ease;
}
body.user-shell.studio-page .studio-image-stage-loader { background: #f1f2f4; }
body.user-shell.studio-page .chat-image-thumbs {
  max-height: min(760px, 74dvh);
  gap: 10px;
  padding: 1px;
  scrollbar-width: none;
}
body.user-shell.studio-page .chat-image-thumbs::-webkit-scrollbar { display: none; }
body.user-shell.studio-page .chat-image-thumbs button {
  width: 82px;
  min-width: 82px;
  min-height: 82px;
  padding: 3px;
  border: 0;
  border-radius: 17px;
  background: #f0f1f3;
}
body.user-shell.studio-page .chat-image-thumbs button.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(47,111,255,.72), 0 8px 22px rgba(31,40,58,.12);
}
body.user-shell.studio-page .chat-image-thumbs img { height: 74px; border-radius: 13px; }
body.user-shell.studio-page .chat-image-viewer-actions { margin-top: 13px; gap: 20px; }
body.user-shell.studio-page .chat-image-action {
  min-height: 34px;
  padding: 5px 0;
  border: 0;
  border-radius: 0;
  color: #373d47;
  background: transparent;
  font-size: 13px;
  font-weight: 570;
}
body.user-shell.studio-page .chat-image-action:hover { color: var(--gallery-blue); background: transparent; }
body.user-shell.studio-page .chat-image-action.primary { color: #1f2630; background: transparent; }
body.user-shell.studio-page .chat-image-feedback { min-width: 32px; font-size: 17px; filter: grayscale(.22); }
body.user-shell.studio-page .chat-image-feedback.is-selected { color: var(--gallery-blue); filter: none; }
body.user-shell.studio-page .studio-user-reference { cursor: zoom-in; }
body.user-shell.studio-page .studio-user-reference:focus-visible { outline: 3px solid rgba(47,111,255,.34); outline-offset: 3px; }

body.user-shell.studio-page .studio-support-banner {
  position: absolute;
  top: 12px;
  right: 18px;
  left: 18px;
  z-index: 24;
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid rgba(47,111,255,.16);
  border-radius: 14px;
  color: #3b4452;
  background: rgba(245,248,255,.94);
  box-shadow: 0 10px 30px rgba(31,40,58,.08);
  backdrop-filter: blur(18px);
  font-size: 12px;
}
body.user-shell.studio-page .studio-support-banner strong { color: #1f2630; }
body.user-shell.studio-page .studio-support-banner a { margin-left: 6px; color: var(--gallery-blue); font-weight: 700; }
body.user-shell.studio-page .studio-app[data-support-readonly="1"] .studio-chat-scroll { padding-top: 60px; }
body.user-shell.studio-page .studio-settings-password input[readonly] { color: #6b7280; background: #f2f3f5; cursor: not-allowed; }

/* v2.15.6 · User-visible industry and adaptive personalization. */
body.user-shell.studio-page .studio-personalization-settings {
  display: grid;
  gap: 16px;
}
body.user-shell.studio-page .studio-personalization-settings > div,
body.user-shell.studio-page .studio-personalization-settings > form {
  margin-bottom: 0;
}
body.user-shell.studio-page .studio-personalization-settings .field small {
  display: block;
  margin-top: 6px;
  color: #5f6b7a;
  font-size: 12px;
  line-height: 1.55;
}
body.user-shell.studio-page .studio-personalization-result {
  padding: 16px;
  border: 1px solid var(--creator-line);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
}
body.user-shell.studio-page .studio-personalization-result > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
body.user-shell.studio-page .studio-personalization-result > div span {
  color: #253047;
  font-weight: 700;
}
body.user-shell.studio-page .studio-personalization-result > div strong {
  padding: 4px 9px;
  border-radius: 999px;
  color: #24543e;
  background: #e8f6ef;
  font-size: 12px;
}
body.user-shell.studio-page .studio-personalization-result p {
  margin: 12px 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.75;
  white-space: normal;
}
@media (max-width: 640px) {
  body.user-shell.studio-page .studio-personalization-result { padding: 14px; }
}

/* Truly floating and centered. Dynamic safe space keeps the bottom unobstructed. */
body.user-shell.studio-page .studio-composer-dock,
body.user-shell.studio-page .studio-main:not(.is-empty) .studio-composer-dock {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 28px 28px calc(20px + env(safe-area-inset-bottom));
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.88) 44%, #fff 100%) !important;
}
body.user-shell.studio-page .studio-composer {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 7px 8px;
  border: 1px solid rgba(23,25,29,.11) !important;
  border-radius: 28px;
  background: rgba(255,255,255,.95) !important;
  box-shadow: 0 20px 48px rgba(24,29,38,.14), 0 3px 9px rgba(24,29,38,.05) !important;
  pointer-events: auto;
  backdrop-filter: blur(24px) saturate(150%);
}
body.user-shell.studio-page .studio-composer textarea { min-height: 48px; color: var(--gallery-ink); font-size: 15px; }
body.user-shell.studio-page .studio-composer textarea::placeholder { color: #7c838d; opacity: 1; }
body.user-shell.studio-page .composer-upload-button { border-color: #e1e4e9; background: #f5f6f8; }
body.user-shell.studio-page .composer-send-button { border-color: #17191d; background: #17191d; }

@media (max-width: 1080px) {
  body.user-shell.studio-page .studio-app { --studio-sidebar: 216px; }
  body.user-shell.studio-page .studio-conversation { padding-right: 24px; padding-left: 24px; }
  body.user-shell.studio-page .chat-image-viewer { grid-template-columns: minmax(0,1fr) 70px; gap: 10px; }
  body.user-shell.studio-page .chat-image-thumbs button { width: 66px; min-width: 66px; min-height: 66px; border-radius: 14px; }
  body.user-shell.studio-page .chat-image-thumbs img { height: 58px; border-radius: 10px; }
}

@media (max-width: 840px) {
  body.user-shell.studio-page .studio-app { display: block; }
  body.user-shell.studio-page .studio-main { height: 100dvh; }
  body.user-shell.studio-page .studio-main-head {
    display: flex;
    min-height: 54px;
    padding: 7px 10px;
    border-bottom: 1px solid rgba(23,25,29,.07);
    background: rgba(255,255,255,.90);
  }
  body.user-shell.studio-page .studio-main-title { display: flex; }
  body.user-shell.studio-page .studio-main-title strong { font-size: 15px; }
  body.user-shell.studio-page .studio-main-title span { display: none; }
  body.user-shell.studio-page .studio-sidebar {
    width: min(78vw, 260px);
    height: calc(100dvh - 16px);
    margin: 8px;
    border: 1px solid rgba(23,25,29,.08);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(25,31,42,.18);
  }
  body.user-shell.studio-page .studio-conversation {
    width: 100%;
    padding: 24px 18px var(--composer-safe-space);
  }
  body.user-shell.studio-page .studio-user-bubble { width: min(90%, 720px); }
  body.user-shell.studio-page .studio-composer-dock,
  body.user-shell.studio-page .studio-main:not(.is-empty) .studio-composer-dock {
    padding: 24px 14px calc(12px + env(safe-area-inset-bottom));
  }
  body.user-shell.studio-page .studio-composer { width: min(100%, 720px); }
}

@media (max-width: 620px) {
  body.user-shell.studio-page .studio-conversation { padding: 20px 12px var(--composer-safe-space); }
  body.user-shell.studio-page .studio-turn-list { gap: 32px; }
  body.user-shell.studio-page .studio-empty-state { padding-right: 14px; padding-left: 14px; }
  body.user-shell.studio-page .studio-empty-state h1 { font-size: 30px; }
  body.user-shell.studio-page .studio-empty-state p { font-size: 14px; }
  body.user-shell.studio-page .studio-user-bubble { width: min(96%, 720px); }
  body.user-shell.studio-page .studio-message-surface { padding: 11px 13px 10px; border-radius: 17px; }
  body.user-shell.studio-page .studio-message-body,
  body.user-shell.studio-page .studio-user-bubble p { font-size: 14px; }
  body.user-shell.studio-page .studio-user-reference-list .studio-user-reference { width: 62px; height: 62px; border-radius: 12px; }
  body.user-shell.studio-page .studio-status-turn { width: min(100%, 340px); }
  body.user-shell.studio-page .studio-loading-visual { width: min(88vw, 340px); border-radius: 24px; }
  body.user-shell.studio-page .chat-image-viewer { grid-template-columns: minmax(0,1fr) 50px; gap: 7px; }
  body.user-shell.studio-page .chat-image-stage { border-radius: 22px !important; }
  body.user-shell.studio-page .chat-image-thumbs { gap: 7px; }
  body.user-shell.studio-page .chat-image-thumbs button { width: 48px; min-width: 48px; min-height: 48px; padding: 2px; border-radius: 11px; }
  body.user-shell.studio-page .chat-image-thumbs img { height: 42px; border-radius: 8px; }
  body.user-shell.studio-page .chat-image-viewer-actions { flex-wrap: wrap; gap: 12px; }
  body.user-shell.studio-page .studio-composer-dock,
  body.user-shell.studio-page .studio-main:not(.is-empty) .studio-composer-dock { padding-right: 10px; padding-left: 10px; }
  body.user-shell.studio-page .studio-composer { padding: 6px; border-radius: 25px; }
  body.user-shell.studio-page .studio-composer textarea { font-size: 16px; }
}
