* { box-sizing: border-box; }
:root {
  --app-scrollbar-size: 10px;
  --app-scrollbar-track: rgba(255,255,255,.02);
  --app-scrollbar-thumb: rgba(126, 162, 255, .30);
  --app-scrollbar-thumb-hover: rgba(144, 181, 255, .46);
}
html, body { height: 100%; }
html {
  scrollbar-width: thin;
  scrollbar-color: var(--app-scrollbar-thumb) var(--app-scrollbar-track);
}
body { margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background:
  radial-gradient(circle at top left, rgba(67, 110, 255, 0.18), transparent 28%),
  radial-gradient(circle at top right, rgba(0, 217, 255, 0.12), transparent 24%),
  linear-gradient(180deg, #07111f 0%, #091321 38%, #0b1020 100%); color: #e8ecf3; overflow: hidden; }
* {
  scrollbar-width: thin;
  scrollbar-color: var(--app-scrollbar-thumb) transparent;
}
*::-webkit-scrollbar {
  width: var(--app-scrollbar-size);
  height: var(--app-scrollbar-size);
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(126, 162, 255, .34) 0%, rgba(91, 140, 255, .24) 100%);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(144, 181, 255, .52) 0%, rgba(106, 154, 255, .34) 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; border-radius: 12px; padding: 10px 14px; background: linear-gradient(135deg, #5b8cff 0%, #7a5cff 100%); color: #fff; font-weight: 700; letter-spacing: .01em; box-shadow: 0 10px 28px rgba(91, 140, 255, .24); transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
button:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 14px 32px rgba(91, 140, 255, .30); }
input, textarea, select { width: 100%; border: 1px solid rgba(101, 124, 170, 0.28); background: rgba(15, 24, 44, 0.82); color: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
textarea { resize: vertical; min-height: 120px; }
.auth-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.auth-card { width: 420px; background: #12182b; border: 1px solid #283250; border-radius: 16px; padding: 28px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.auth-card h1 { margin-top: 0; }
.auth-card h2 { margin-bottom: 18px; color: #9fb0d8; }
.auth-card form { display: grid; gap: 12px; }
.auth-switch { margin-top: 16px; color: #9aa8c7; }
.auth-switch a { color: #7ea2ff; }
.error-banner { background: #3a1620; color: #ffb5c0; padding: 12px; border-radius: 10px; margin-bottom: 12px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid rgba(95, 123, 188, 0.16); background: rgba(8, 14, 28, 0.76); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.topbar-compact { padding: 10px 16px; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left-compact { gap: 12px; }
.topbar strong { letter-spacing: .03em; color: #f3f7ff; }
.brand-mark { font-size: 14px; text-transform: lowercase; }
.topbar-nav-cluster, .topbar-meta-cluster { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-meta-cluster { margin-left: auto; }
.top-link, .ghost-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(96, 122, 177, 0.28); color: #c9d6f2; background: rgba(20, 30, 52, .62); white-space: nowrap; backdrop-filter: blur(10px); }
.top-link.active { border-color: rgba(111, 147, 255, .72); background: rgba(28, 40, 68, .9); color: #fff; }
.top-link-muted { background: rgba(255,255,255,.03); color: #9fb0d8; }
.top-link:hover, .ghost-link:hover { border-color: #6f93ff; color: #fff; background: rgba(31, 44, 77, .85); }
.user-email-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(96, 122, 177, 0.16); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.topbar-logout-btn { min-height: 36px; padding: 0 14px; }
.ghost-btn { background: rgba(11, 18, 34, .35); border: 1px solid rgba(96, 122, 177, 0.28); box-shadow: none; }
.layout { display: grid; grid-template-columns: 220px 1fr; height: calc(100vh - 57px); min-height: calc(100vh - 57px); overflow: hidden; }
.sidebar { border-right: 1px solid rgba(95, 123, 188, 0.12); padding: 12px 10px; background: linear-gradient(180deg, rgba(8, 14, 28, .94) 0%, rgba(11, 17, 31, .96) 100%); display: grid; grid-template-rows: auto 1fr; gap: 10px; min-height: 0; overflow: hidden; }
.sidebar-upgraded { padding-top: 14px; }
.sidebar-section { display: grid; grid-template-rows: auto 1fr; min-height: 0; overflow: hidden; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sidebar-header-projects { padding: 2px 2px 0; }
.new-conversation-btn { min-height: 34px; padding: 0 12px; border-radius: 12px; font-size: 12px; }
.sidebar-kicker { color: #7f94c5; font-size: 11px; text-transform: uppercase; letter-spacing: .16em; }
.sidebar-header h3 { margin: 4px 0 0; }
.sidebar-header.compact { margin-bottom: 8px; }
.conversation-list { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; padding-right: 6px; scrollbar-gutter: stable; }
.conversation-list::-webkit-scrollbar { width: 8px; }
.conversation-list::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(124, 159, 255, .30) 0%, rgba(91, 140, 255, .18) 100%); }
.conversation-list::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(144, 181, 255, .48) 0%, rgba(106, 154, 255, .28) 100%); }
.conversation-row { display: grid; grid-template-columns: 1fr 28px; gap: 6px; align-items: stretch; }
.conversation-row-upgraded { gap: 4px; }
.conversation-item { display: block; padding: 10px 10px; border-radius: 14px; background: rgba(14, 22, 39, .64); border: 1px solid rgba(88, 112, 164, 0.05); min-width: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.01); transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.conversation-item.active, .conversation-item:hover { border-color: rgba(111, 147, 255, .32); background: rgba(20, 31, 55, .88); box-shadow: none; transform: translateY(-1px); }
.conversation-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.conversation-active-dot { width: 8px; height: 8px; border-radius: 999px; margin-top: 6px; background: #7c9fff; box-shadow: 0 0 0 6px rgba(124, 159, 255, .16); flex: 0 0 auto; }
.conversation-delete-btn { background: rgba(74, 29, 38, .28); border: 1px solid rgba(124, 51, 67, .35); color: #ffb5c0; padding: 0 10px; min-width: 64px; opacity: .18; }
.conversation-delete-btn-compact { min-width: 20px; width: 20px; padding: 0; border-radius: 8px; font-size: 12px; font-weight: 700; }
.conversation-row:hover .conversation-delete-btn, .conversation-delete-btn:hover { opacity: .95; background: #642433; border-color: rgba(124, 51, 67, .7); }
.conversation-title { font-weight: 600; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.35; }
.conversation-time { color: #8c9aba; font-size: 11px; }
.main-panel { display: grid; grid-template-rows: auto 1fr; gap: 16px; padding: 14px; min-height: 0; overflow: hidden; }
.app-main-panel { grid-template-rows: 1fr; }
.settings-card, .chat-panel { background: linear-gradient(180deg, rgba(11, 19, 35, .90) 0%, rgba(13, 21, 39, .94) 100%); border: 1px solid rgba(95, 123, 188, 0.18); border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.20); }
.settings-card { padding: 16px; }
.settings-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.settings-grid { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 10px; }
.settings-grid.token-only { grid-template-columns: 1fr auto; }
.chat-panel { display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; height: 100%; overflow: hidden; }
.chat-panel-full { height: 100%; min-height: 0; }
.chat-header { padding: 10px 14px; border-bottom: 1px solid #24304e; }
.chat-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.generation-list { padding: 4px; overflow: auto; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; background: transparent; align-content: start; scrollbar-width: none; -ms-overflow-style: none; }
.generation-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
.generation-list-upgraded { padding-right: 4px; min-height: 100%; }
.generation-list-capped { grid-auto-rows: max-content; max-height: calc((132px + 1px) * 2 + 12px * 2 + 18px + 72px + 48px); overflow-y: auto; overflow-x: hidden; padding-right: 6px; mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 92%, rgba(0,0,0,.22) 100%); -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 92%, rgba(0,0,0,.22) 100%); }
.generation-list-sparse { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); min-height: 100%; align-content: start; }
.generation-list-sparse .generation-card { max-width: none; }
.generation-list-sparse .image-stage { height: 132px; min-height: 132px; }
.generation-list-sparse .prompt-clamped-gallery { -webkit-line-clamp: 2; }
.generation-card { background: linear-gradient(180deg, rgba(16, 26, 46, .78) 0%, rgba(13, 21, 38, .88) 100%); border: 1px solid rgba(88, 112, 164, 0.12); border-radius: 20px; padding: 16px; box-shadow: 0 14px 28px rgba(0,0,0,.10); }
.generation-card-product { padding: 0; overflow: hidden; display: grid; grid-template-columns: 1fr; min-height: 0; }
.generation-card-gallery { border-radius: 20px; }
.generation-card-media { position: relative; background: linear-gradient(180deg, rgba(9, 16, 30, .95) 0%, rgba(12, 19, 35, .95) 100%); }
.generation-card-media.has-image { border-right: none; border-bottom: 1px solid rgba(88, 112, 164, 0.14); }
.generation-card-body { display: grid; align-content: start; gap: 8px; padding: 12px; }
.generation-card-body-gallery { gap: 8px; }
.generation-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.generation-card-topline-gallery { align-items: center; }
.card-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.card-delete-btn, .danger-btn { background: #4a1d26; border: 1px solid #7c3343; color: #ffb5c0; }
.card-delete-btn:hover, .danger-btn:hover { opacity: 1; background: #642433; }
.prompt { white-space: pre-wrap; line-height: 1.6; }
.prompt-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.68; color: #f2f6ff; }
.prompt-clamped-gallery { -webkit-line-clamp: 2; font-size: 12px; line-height: 1.5; color: #cdd9f5; }
.params { margin-top: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.status-row { margin: 12px 0; display: flex; align-items: center; gap: 10px; }
.status-row-overlay { position: absolute; top: 8px; left: 8px; margin: 0; z-index: 2; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.status-badge.pending { background: #203457; color: #9cc4ff; }
.status-badge.processing { background: #3f3210; color: #ffd66e; }
.status-badge.retrying { background: #4d2f08; color: #ffbd66; }
.status-badge.success { background: #0e402b; color: #7ff0b1; }
.status-badge.failed { background: #4a1d26; color: #ff9fb2; }
.image-wrap { margin-top: 0; width: 100%; height: auto; border-radius: 0; overflow: hidden; border: none; background: #0b1020; position: relative; }
.image-preview-trigger { padding: 0; box-shadow: none; background: transparent; border-radius: 0; border: none; }
.image-preview-trigger:hover { transform: none; box-shadow: none; opacity: 1; }
.image-stage { display: block; width: 100%; height: 132px; min-height: 132px; margin-top: 0; border: none; border-radius: 0; background: #0b1020; }
.image-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-stage-placeholder { display: grid; place-items: center; color: #9fb0d8; font-weight: 700; letter-spacing: .03em; background:
  radial-gradient(circle at center, rgba(87, 118, 255, .14), transparent 34%),
  linear-gradient(180deg, rgba(9, 16, 30, .98) 0%, rgba(12, 19, 35, .98) 100%); }
.image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; background: #0b1020; transform: translateZ(0); }
.image-thumb-link { display: block; }
.image-thumb-link:hover { border-color: #537bff; box-shadow: 0 0 0 1px rgba(83,123,255,.35) inset; }
.image-link { display: inline-block; margin-top: 10px; color: #8eb0ff; }
.error-text { margin-top: 10px; color: #ffb5c0; background: #351821; border-radius: 10px; padding: 10px; }
.meta { margin-top: 10px; font-size: 12px; }
.composer { border-top: 1px solid rgba(95, 123, 188, 0.14); padding: 8px 12px 10px; display: grid; gap: 8px; background: transparent; flex: 0 0 auto; }
.composer-clean { grid-template-columns: 1fr; }
.composer-toolbar { display: grid; grid-template-columns: 1.2fr 1.2fr 140px; gap: 8px; align-items: end; }
.composer-toolbar-v2 { grid-template-columns: 1.2fr 1.2fr 140px; }
.field-group { display: grid; gap: 6px; }
.field-group label { color: #9fb0d8; font-size: 12px; font-weight: 600; }
.toolbar-action { display: flex; align-items: end; }
.toolbar-action button { width: 100%; height: 38px; border-radius: 10px; }
.toolbar-action-stack { display: grid; gap: 8px; }
.helper-entry-link { width: 100%; }
.composer-main { display: grid; gap: 4px; }
.clean-main textarea { min-height: 88px; border-radius: 12px; padding: 10px 12px; }
.composer-main-rich { border: 1px solid #24304e; border-radius: 14px; padding: 10px; background: #0c1427; min-height: 190px; max-height: none; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.composer-main-rich textarea { border: none; background: transparent; min-height: 0; height: 100%; max-height: none; padding: 0 0 6px; overflow: auto; }
.composer-main-rich.has-images textarea { min-height: 0; max-height: none; }
.composer-main-rich textarea:focus { outline: none; }
.composer-inline-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; border-top: 1px solid #24304e; padding-top: 8px; }
.upload-trigger { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid #334369; color: #c9d6f2; background: rgba(19,27,49,.7); white-space: nowrap; cursor: pointer; }
.upload-trigger:hover { border-color: #537bff; color: #fff; }
.hint { text-align: right; margin-left: auto; }
.mode-hint { display: inline-flex; width: fit-content; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.mode-hint.generate { background: #203457; color: #9cc4ff; }
.mode-hint.edit { background: #0e402b; color: #7ff0b1; }
.input-images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.input-images-compact { margin-top: 0; }
.input-images-gallery { gap: 8px; }
.preview-list { margin-top: 0; align-content: flex-start; overflow: auto; min-height: 0; max-height: 132px; }
.input-image-thumb { width: 88px; height: 88px; border-radius: 12px; overflow: hidden; border: 1px solid #2a3557; background: #0b1020; display: block; position: relative; }
.input-image-thumb-mini { width: 52px; height: 52px; border-radius: 10px; }
.input-image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.removable-thumb { cursor: default; }
.thumb-remove-btn { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 999px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: rgba(18, 24, 43, .88); color: #fff; border: 1px solid rgba(255,255,255,.18); font-size: 16px; line-height: 1; z-index: 2; }
.thumb-remove-btn:hover { opacity: 1; background: #4a1d26; border-color: #a64d5f; }
.thumb-file-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 6px; font-size: 11px; line-height: 1.2; color: #fff; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.78) 70%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.limit-hint { color: #ffbd66; }
.muted { color: #94a3c3; }
.small { font-size: 12px; }
.empty, .blank-state { color: #93a1bf; padding: 24px; text-align: center; }
.blank-state-upgraded { min-height: 72vh; display: grid; place-content: center; gap: 16px; max-width: 760px; margin: 0 auto; }
.blank-state-upgraded h2 { margin: 0; font-size: 44px; line-height: 1.08; color: #f3f7ff; }
.blank-state-upgraded p { margin: 0; font-size: 16px; line-height: 1.8; }
.blank-state-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-badge { display: inline-flex; justify-self: center; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(99, 135, 255, .38); color: #9dc0ff; background: rgba(20, 41, 85, .42); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
.workspace-shell { display: grid; gap: 16px; padding: 12px; min-height: 100%; overflow: hidden; }
.workspace-shell-dense { padding: 10px 6px 6px; min-height: 100%; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1.17fr) 440px; gap: 18px; min-height: 100%; overflow: hidden; }
.studio-grid-dense { align-items: stretch; }
.studio-panel { min-height: 0; height: 100%; border-radius: 26px; border: 1px solid rgba(95, 123, 188, 0.14); background: linear-gradient(180deg, rgba(11, 18, 34, .82) 0%, rgba(9, 16, 29, .90) 100%); box-shadow: 0 18px 40px rgba(0,0,0,.12); display: grid; }
.studio-panel-history { grid-template-rows: auto minmax(0, 1fr); overflow: hidden; height: 100%; padding: 22px; background: linear-gradient(180deg, rgba(10, 16, 30, .56) 0%, rgba(9, 15, 27, .38) 100%); }
.studio-panel-history-dense { padding-top: 20px; }
.studio-panel-composer { grid-template-rows: auto minmax(0, 1fr); padding: 16px; overflow-x: hidden; overflow-y: auto; background: linear-gradient(180deg, rgba(12, 18, 33, .92) 0%, rgba(10, 16, 29, .98) 100%); }
.studio-panel-composer select { min-width: 0; max-width: 100%; }
.studio-panel-composer-dense { padding-top: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 30px; line-height: 1.08; max-width: 720px; letter-spacing: -.02em; }
.panel-head-main { display: grid; gap: 6px; }
.panel-head-main-results { max-width: 760px; }
.panel-head-main-composer { gap: 2px; }
.panel-subtitle { font-size: 13px; line-height: 1.55; max-width: 560px; }
.panel-head-main-composer .panel-subtitle { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.panel-head-results { margin-bottom: 22px; }
.panel-head-results-upgraded { align-items: flex-start; }
.panel-head-composer { margin-bottom: 10px; align-items: center; }
.panel-head-composer-upgraded h3 { font-size: 20px; line-height: 1.1; }
.panel-head-actions-results { padding-top: 4px; align-items: flex-start; }
.results-summary-card { display: grid; gap: 4px; min-width: 96px; padding: 10px 12px; border-radius: 16px; border: 1px solid rgba(95, 123, 188, 0.14); background: rgba(18, 27, 47, .58); }
.results-summary-card span { color: #8fa7d8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.results-summary-card strong { font-size: 24px; line-height: 1; color: #fff; }
.delete-conversation-btn { min-height: 36px; padding: 0 12px; border-radius: 12px; }
.panel-head-actions { display: flex; align-items: center; gap: 10px; }
.panel-kicker { color: #78a5ff; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.composer-productized { gap: 8px; padding: 0; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.composer-toolbar-productized { grid-template-columns: 1.5fr minmax(112px, .9fr) 110px; gap: 8px; min-width: 0; }
.composer-toolbar-tight { grid-template-columns: 1.5fr minmax(112px, .9fr) 110px; align-items: end; }
.compact-field { min-width: 0; }
.compact-field label { margin-bottom: 3px; }
.compact-field select { min-width: 0; width: 100%; padding: 10px 12px; font-size: 13px; }
.compact-generate-action button { min-height: 40px; font-size: 13px; padding: 0 12px; }
.composer-main-productized { min-height: 0; height: 100%; max-height: none; padding: 14px; border: 1px solid rgba(94, 118, 171, .14); border-radius: 22px; background: linear-gradient(180deg, rgba(15, 23, 41, .96) 0%, rgba(11, 18, 32, .98) 100%); min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 8px; align-content: stretch; }
.prompt-stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 0; }
.prompt-stage-head-tight { align-items: center; margin-bottom: 0; }
.composer-main-productized textarea { min-height: 0; height: 100%; max-height: none; font-size: 14px; line-height: 1.72; resize: none; }
.composer-inline-tools-productized { margin-top: 0; gap: 8px; }
.primary-cta { background: linear-gradient(135deg, #5da2ff 0%, #7a5cff 45%, #8c54ff 100%); box-shadow: 0 18px 40px rgba(107, 112, 255, .28); }
.auth-page-upgraded { position: relative; overflow: hidden; }
.auth-shell { width: min(1180px, calc(100vw - 40px)); min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 420px); gap: 24px; align-items: center; }
.auth-background-glow { position: fixed; width: 460px; height: 460px; border-radius: 50%; filter: blur(90px); opacity: .35; pointer-events: none; }
.auth-background-glow-a { background: #416dff; top: -120px; left: -120px; }
.auth-background-glow-b { background: #00d0ff; bottom: -140px; right: -140px; }
.auth-brand-panel { position: relative; z-index: 1; display: grid; gap: 18px; max-width: 620px; }
.auth-brand-panel h1 { margin: 0; font-size: 58px; line-height: 1.02; }
.auth-brand-panel p { margin: 0; color: #a8bbdc; font-size: 16px; line-height: 1.9; }
.auth-feature-list { display: grid; gap: 12px; margin-top: 8px; }
.auth-feature-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(95, 123, 188, 0.14); background: rgba(13, 21, 39, .52); }
.auth-feature-item span { color: #7ba6ff; font-size: 12px; font-weight: 800; letter-spacing: .10em; }
.auth-card-upgraded { position: relative; z-index: 1; width: 100%; background: rgba(12, 20, 36, .82); border: 1px solid rgba(100, 124, 176, .18); border-radius: 28px; padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.24); backdrop-filter: blur(14px); }
.settings-page-wrap-upgraded { padding: 28px; }
.settings-page-card-upgraded { max-width: 860px; background: linear-gradient(180deg, rgba(12, 20, 36, .94) 0%, rgba(11, 18, 33, .98) 100%); border-radius: 26px; border: 1px solid rgba(95, 123, 188, 0.18); }
.settings-head-upgraded { margin-bottom: 18px; }
.settings-status-card { display: grid; gap: 6px; min-width: 160px; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(95, 123, 188, 0.16); background: rgba(16, 26, 47, .78); }
.settings-status-card span { color: #8fa7d8; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.settings-status-card strong { font-size: 22px; color: #fff; }
.settings-form-upgraded { gap: 16px; }
.field-card { padding: 18px; border-radius: 20px; border: 1px solid rgba(95, 123, 188, 0.16); background: rgba(15, 24, 43, .62); display: grid; gap: 10px; }
.settings-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.retry-btn { background: #a64d5f; }
.retry-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.retry-tools-inline { margin-top: 0; }
.retry-tools-gallery { gap: 6px; }
.retry-tools select { width: auto; min-width: 160px; padding: 8px 10px; }
.retry-with-model-btn { background: #365fcf; }
.generation-actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.generation-actions-row-gallery { justify-content: flex-start; padding-top: 6px; gap: 8px; }
.generation-actions-row .ghost-link,
.generation-actions-row .ghost-btn,
.generation-actions-row .card-delete-btn { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 10px; }
.image-action-primary { background: rgba(89, 126, 255, .14); border: 1px solid rgba(89, 126, 255, .28); color: #dce7ff; }
.image-action-primary:hover { background: rgba(89, 126, 255, .22); border-color: rgba(115, 148, 255, .46); }
.settings-page-wrap { min-height: calc(100vh - 66px); padding: 28px; display: flex; align-items: flex-start; justify-content: center; overflow: auto; }
.settings-page-card { width: 100%; max-width: 720px; background: #10172a; border: 1px solid #24304e; border-radius: 18px; padding: 24px; box-shadow: 0 18px 40px rgba(0,0,0,.18); }
.settings-page-card h2 { margin: 0 0 8px; }
.settings-form { display: grid; gap: 14px; margin-top: 18px; }
.settings-form label { color: #c9d6f2; font-weight: 600; }
.settings-actions { display: flex; gap: 10px; align-items: center; }
.manual-link { width: fit-content; }
.admin-wrap { padding: 20px; display: grid; gap: 16px; overflow: auto; height: calc(100vh - 66px); }
.admin-grid { display: grid; gap: 16px; }
.stats-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.system-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
.admin-card, .admin-stat-card { background: #10172a; border: 1px solid #24304e; border-radius: 16px; padding: 18px; box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.admin-stat-label { color: #94a3c3; font-size: 13px; margin-bottom: 8px; }
.admin-stat-value { font-size: 32px; font-weight: 700; }
.success-text { color: #7ff0b1; }
.failed-text { color: #ff9fb2; }
.retry-text { color: #ffbd66; }
.table-wrap { overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid #24304e; text-align: left; vertical-align: top; }
.admin-table th { color: #9fb0d8; font-size: 13px; background: rgba(19,27,49,.5); position: sticky; top: 0; }
.ellipsis-cell { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-filter-form { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)) auto auto; gap: 10px; margin: 14px 0 16px; align-items: center; }
.admin-filter-form input, .admin-filter-form select { height: 40px; }
.admin-log-table .ellipsis-cell { max-width: 220px; }
.log-pre { white-space: pre-wrap; word-break: break-word; background: #0c1427; border: 1px solid #24304e; border-radius: 12px; padding: 12px; margin-top: 10px; max-height: 420px; overflow: auto; color: #d7e3ff; }
@media (max-width: 960px) {
  body { overflow: auto; }
  .workspace-shell { padding: 12px; overflow: visible; }
  .studio-grid, .auth-shell, .settings-info-grid, .composer-tips-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 12px; }
  .topbar-left { flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
  .topbar form { width: 100%; }
  .topbar form button { width: 100%; }
  .top-link, .ghost-link { min-height: 36px; padding: 0 12px; }
  .layout { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 53px); overflow: visible; }
  .sidebar { border-right: none; border-bottom: 1px solid #24304e; grid-template-rows: auto auto; overflow: visible; padding: 12px; }
  .sidebar-nav-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conversation-list { overflow: visible; max-height: none; }
  .sidebar-section { overflow: visible; }
  .main-panel { overflow: visible; padding: 12px; }
  .chat-panel { overflow: visible; }
  .settings-grid, .settings-grid.token-only, .composer, .composer-clean, .composer-toolbar, .prompt-helper-grid, .structured-grid { grid-template-columns: 1fr; }
  .prompt-helper-head, .prompt-helper-actions.split { flex-direction: column; align-items: stretch; }
  .prompt-helper-head-actions { flex-direction: column; }
  .toolbar-action { display: block; }
  .settings-page-wrap { padding: 16px; }
  .settings-actions { flex-direction: column; align-items: stretch; }
  .stats-grid, .system-grid { grid-template-columns: 1fr; }
  .admin-wrap { padding: 16px; height: auto; }
  .image-wrap { width: 100%; max-width: none; height: auto; }
  .generation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .generation-list-capped { max-height: none; overflow: visible; mask-image: none; -webkit-mask-image: none; }
  .generation-list-sparse { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: auto; }
  .panel-head { grid-template-columns: 1fr; }
  .panel-head-actions-results { width: 100%; justify-content: space-between; }
  .results-summary-card { min-width: 88px; }
  .generation-card-product { grid-template-columns: 1fr; }
  .generation-card-media.has-image { border-right: none; border-bottom: 1px solid rgba(88, 112, 164, 0.18); }
  .image-stage { height: 140px; min-height: 140px; }
  .auth-shell { width: min(100vw - 24px, 680px); min-height: auto; padding: 40px 0; }
  .auth-brand-panel h1 { font-size: 42px; }
  .blank-state-upgraded h2 { font-size: 30px; }
  .prompt-helper-page { gap: 14px; }
  .prompt-helper-panel { padding: 14px; border-radius: 14px; }
  .prompt-helper-head-actions select { width: 100%; min-width: 0; }
  .chip-list { gap: 8px; }
  .chip { min-height: 38px; padding: 8px 12px; }
  .prompt-helper-actions, .prompt-helper-actions-left { display: grid; grid-template-columns: 1fr; }
  .prompt-helper-actions > button,
  .prompt-helper-actions-left > button,
  #sendToDrawBtn,
  #composeBtn,
  #resetBtn { width: 100%; min-height: 42px; }
  .field-group label { font-size: 13px; }
  .result-textarea { min-height: 108px; }
}


.announcement-bell-btn { position: relative; gap: 8px; }
.announcement-badge { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: #ff5d7d; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.hidden { display: none !important; }
.announcement-modal { position: fixed; inset: 0; z-index: 1000; }
.announcement-modal-mask { position: absolute; inset: 0; background: rgba(3, 7, 18, .68); backdrop-filter: blur(2px); }
.announcement-modal-panel { position: relative; width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); margin: 24px auto; background: #0f1628; border: 1px solid #2a3557; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.42); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.image-preview-modal-panel { width: min(1240px, calc(100vw - 32px)); }
.image-preview-modal-header { padding-bottom: 10px; }
.image-preview-meta-summary { max-width: 520px; color: rgba(191, 204, 233, .62); }
.image-preview-modal-body { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr); }
.image-preview-stage-wrap { min-height: 0; background: radial-gradient(circle at top, rgba(86, 126, 255, .07), transparent 38%), linear-gradient(180deg, rgba(9, 15, 30, .98) 0%, rgba(8, 16, 31, .98) 100%); display: grid; place-items: center; padding: 24px; }
.image-preview-modal-img { max-width: 100%; max-height: calc(100vh - 196px); border-radius: 18px; object-fit: contain; box-shadow: 0 30px 78px rgba(0,0,0,.26); }
.image-preview-side { display: grid; align-content: start; gap: 10px; padding: 14px; border-left: 1px solid rgba(57, 73, 113, .28); }
.image-preview-side-upgraded { grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; padding: 18px; min-height: 0; overflow: hidden; background: linear-gradient(180deg, rgba(13, 19, 35, .48) 0%, rgba(10, 15, 28, .72) 100%); }
.image-preview-section { border: 1px solid rgba(60, 78, 120, .14); border-radius: 18px; background: rgba(14, 20, 37, .32); box-shadow: inset 0 1px 0 rgba(255,255,255,.012); }
.image-preview-section-head { display: grid; gap: 4px; margin-bottom: 12px; }
.image-preview-section-head-compact { margin-bottom: 10px; }
.image-preview-section-head span { color: #8eb0ff; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.image-preview-section-head strong { color: #eef3ff; font-size: 15px; line-height: 1.4; }
.image-preview-overview-card { padding: 14px; }
.image-preview-overview-card-light,
.image-preview-reference-card-light,
.image-preview-prompt-card-light { background: rgba(13, 19, 35, .24); border-color: rgba(60, 78, 120, .10); }
.image-preview-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.image-preview-meta-grid-compact { gap: 8px; }
.image-preview-meta-item { padding: 12px; border-radius: 14px; background: rgba(20, 31, 54, .74); border: 1px solid rgba(85, 108, 158, .18); display: grid; gap: 6px; min-width: 0; }
.image-preview-meta-item-quiet { padding: 10px 12px; background: rgba(19, 29, 50, .26); border-color: rgba(82, 103, 152, .08); }
.image-preview-meta-item span { color: #8fa7d8; font-size: 11px; }
.image-preview-meta-item strong { color: #fff; font-size: 13px; line-height: 1.45; word-break: break-word; }
.image-preview-meta-item-wide { grid-column: 1 / -1; }
.image-preview-meta-row-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.image-preview-meta-row-action > div { display: grid; gap: 6px; min-width: 0; }
.tip-card-preview { padding: 14px; border-radius: 18px; min-height: 0; align-content: start; }
.image-preview-reference-card { padding: 14px; }
.image-preview-reference-summary-wrap { display: grid; gap: 12px; }
.image-preview-reference-summary { color: #c8d6f6; font-size: 13px; line-height: 1.7; }
.image-preview-reference-open-btn { width: 100%; justify-content: center; min-height: 40px; }
.image-preview-reference-list { display: flex; flex-wrap: wrap; gap: 10px; }
.image-preview-reference-thumb { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; border: 1px solid rgba(88, 112, 164, 0.18); background: rgba(10, 15, 28, .72); display: block; box-shadow: 0 10px 20px rgba(0,0,0,.12); }
.image-preview-reference-thumb:hover { border-color: rgba(111, 147, 255, .40); box-shadow: 0 12px 22px rgba(0,0,0,.18); }
.image-preview-reference-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-preview-reference-empty { color: #7f94c5; font-size: 12px; line-height: 1.6; }
.reference-gallery-modal-panel { width: min(1040px, calc(100vw - 32px)); }
.reference-gallery-modal-body { min-height: 0; padding: 18px; overflow: auto; }
.reference-gallery-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.reference-gallery-item { display: grid; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid rgba(82, 103, 152, .14); background: rgba(15, 23, 41, .64); text-decoration: none; color: #dbe6ff; box-shadow: 0 12px 24px rgba(0,0,0,.14); }
.reference-gallery-item:hover { border-color: rgba(111, 147, 255, .34); background: rgba(19, 29, 50, .82); }
.reference-gallery-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; display: block; background: rgba(8, 13, 24, .82); }
.reference-gallery-item span { font-size: 12px; color: #c7d7fb; }
.image-preview-prompt-card { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; overflow: hidden; }
.image-preview-prompt-text { white-space: pre-wrap; word-break: break-word; line-height: 1.86; font-size: 13px; color: #dbe6ff; min-height: 0; max-height: none; overflow: auto; padding-right: 6px; letter-spacing: .01em; }
.image-preview-prompt-text::after { content: ''; display: block; height: 14px; }
.image-preview-download-btn { width: 100%; justify-content: center; }
.image-preview-download-btn-inline { width: auto; min-width: 112px; min-height: 38px; padding: 0 14px; border-radius: 12px; background: rgba(26, 39, 68, .62); border: 1px solid rgba(103, 126, 184, .18); }
.image-preview-download-btn-inline:hover { background: rgba(33, 47, 82, .82); border-color: rgba(111, 147, 255, .36); }
.announcement-modal-header, .announcement-modal-footer { padding: 16px 18px; border-bottom: 1px solid #24304e; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.announcement-modal-footer { border-bottom: none; border-top: 1px solid #24304e; justify-content: flex-end; }
.announcement-modal-subtitle { color: #8eb0ff; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.announcement-modal-header h3 { margin: 0 0 4px; }
.announcement-modal-body { min-height: 0; display: grid; grid-template-columns: 280px 1fr; }
.announcement-sidebar { border-right: 1px solid #24304e; padding: 14px; overflow: auto; }
.announcement-list { display: grid; gap: 10px; }
.announcement-list-item { width: 100%; text-align: left; background: #131b31; border: 1px solid #2a3557; border-radius: 14px; padding: 12px; }
.announcement-list-item:hover, .announcement-list-item.active { border-color: #537bff; background: #16203a; opacity: 1; }
.announcement-list-item-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.announcement-list-item-title { font-weight: 700; }
.announcement-list-item-meta { margin-top: 8px; color: #94a3c3; font-size: 12px; }
.announcement-unread-dot { width: 8px; height: 8px; border-radius: 999px; background: #ff5d7d; flex: 0 0 auto; }
.announcement-content-wrap { padding: 18px; overflow: auto; }
.announcement-content { white-space: normal; line-height: 1.75; color: #e8ecf3; }
.announcement-preview { margin-top: 6px; max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.announcement-form { display: grid; gap: 14px; margin-top: 14px; }
.announcement-form-grid { display: grid; grid-template-columns: 1.6fr .8fr .8fr; gap: 12px; }
.announcement-form-grid label, .announcement-form-body label { display: block; margin-bottom: 8px; color: #c9d6f2; font-weight: 600; }
.announcement-form-body textarea { min-height: 160px; }
.announcement-form-actions, .admin-inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.prompt-helper-page { display: grid; gap: 18px; overflow: auto; }
.prompt-helper-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.prompt-helper-head h2 { margin: 0 0 6px; }
.prompt-helper-head-actions { display: flex; gap: 10px; }
.prompt-helper-head-actions select { width: auto; min-width: 140px; }
.prompt-helper-grid { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr); gap: 16px; min-height: 0; }
.prompt-helper-panel { background: #0c1427; border: 1px solid #24304e; border-radius: 16px; padding: 16px; display: grid; gap: 14px; align-content: start; }
.prompt-helper-label { color: #c9d6f2; font-weight: 700; }
.prompt-helper-toolbar { display: flex; justify-content: flex-end; margin-top: -6px; }
.prompt-helper-block { display: grid; gap: 10px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: #131b31; border: 1px solid #334369; color: #d8e1f8; border-radius: 999px; padding: 8px 14px; }
.chip.secondary { background: #10182d; }
.chip.active { background: #2446a8; border-color: #537bff; color: #fff; }
.prompt-helper-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.prompt-helper-actions.split { justify-content: space-between; }
.prompt-helper-actions-left { display: flex; gap: 10px; flex-wrap: wrap; }
.helper-inline-hint { display: inline-flex; align-items: center; gap: 8px; color: #8db4ff; font-size: 13px; }
.loading-dot { width: 10px; height: 10px; border-radius: 999px; background: #5b8cff; box-shadow: 0 0 0 0 rgba(91, 140, 255, 0.55); animation: helperPulse 1.2s ease-in-out infinite; }
#composeBtn[disabled] { opacity: 0.72; cursor: wait; }
.prompt-helper-result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.prompt-helper-result-head h3 { margin: 0; }
.structured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compact-textarea { min-height: 88px; }
.result-textarea { min-height: 120px; }
.prompt-helper-grid-enhanced { grid-template-columns: minmax(360px, 0.95fr) minmax(460px, 1.05fr); }
.template-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.template-card { display: grid; gap: 6px; text-align: left; background: #111b31; border: 1px solid #2f3d63; border-radius: 14px; padding: 12px; }
.template-card:hover, .template-card.active { opacity: 1; border-color: #537bff; background: #16203a; }
.template-card-title { font-weight: 700; color: #eef3ff; }
.template-card-desc { color: #94a3c3; font-size: 12px; line-height: 1.5; }
.history-block { border-top: 1px solid #24304e; padding-top: 14px; }
.prompt-history-list { display: grid; gap: 10px; max-height: 280px; overflow: auto; padding-right: 2px; }
.prompt-history-item { width: 100%; text-align: left; background: #111a2f; border: 1px solid #2a3557; border-radius: 12px; padding: 12px; }
.prompt-history-item:hover { opacity: 1; border-color: #537bff; background: #16203a; }
.prompt-history-title { font-weight: 600; color: #eef3ff; line-height: 1.5; }
.prompt-history-meta { margin-top: 6px; color: #90a1c6; font-size: 12px; }
.prompt-history-empty { padding: 16px 10px; }
.structured-grid-extended { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-group-span-2 { grid-column: span 2; }
.prompt-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preview-card { background: #11192d; border: 1px solid #24304e; border-radius: 14px; padding: 12px; min-height: 132px; }
.preview-card-label { color: #9fb0d8; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.preview-card-body { white-space: pre-wrap; line-height: 1.7; color: #e8ecf3; }
.preview-summary-list { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.summary-pill { display: inline-flex; flex-direction: column; gap: 4px; min-width: 120px; background: #18243f; border: 1px solid #314a85; border-radius: 12px; padding: 10px 12px; }
.summary-pill span { color: #8db4ff; font-size: 12px; }
.summary-pill strong { color: #fff; font-size: 13px; line-height: 1.5; }

@keyframes helperPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(91, 140, 255, 0.55); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(91, 140, 255, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(91, 140, 255, 0); }
}

@media (max-width: 960px) {
  .announcement-modal-panel { width: calc(100vw - 20px); margin: 10px auto; max-height: calc(100vh - 20px); }
  .announcement-modal-body, .image-preview-modal-body { grid-template-columns: 1fr; }
  .image-preview-side { border-left: none; border-top: 1px solid #24304e; }
  .image-preview-side-upgraded { grid-template-rows: auto auto auto; padding: 14px; }
  .image-preview-meta-grid { grid-template-columns: 1fr 1fr; }
  .image-preview-meta-row-action { align-items: flex-start; flex-direction: column; }
  .image-preview-download-btn-inline { width: 100%; }
  .image-preview-prompt-text { min-height: 120px; max-height: 260px; }
}

@media (max-width: 640px) {
  .generation-list { grid-template-columns: 1fr; gap: 12px; }
  .generation-list-sparse { grid-template-columns: 1fr; min-height: auto; }
  .image-stage { height: 168px; min-height: 168px; }
  .panel-head h3 { font-size: 24px; }
  .panel-subtitle { font-size: 12px; }
  .results-summary-card strong { font-size: 20px; }
  .announcement-sidebar { border-right: none; border-bottom: 1px solid #24304e; }
  .announcement-form-grid { grid-template-columns: 1fr; }
  .image-preview-meta-grid { grid-template-columns: 1fr; }
  .image-preview-modal-img { max-height: 52vh; }
  .image-preview-prompt-text { min-height: 112px; max-height: 220px; }
}

@media (max-width: 640px) {
  .topbar { padding: 10px; }
  .studio-panel-history, .studio-panel-composer, .auth-card-upgraded { padding: 14px; }
  .panel-head-actions { width: 100%; justify-content: space-between; }
  .composer-toolbar-tight { grid-template-columns: 1fr; }
  .composer-main-productized { padding: 14px; min-height: 280px; }
  .prompt-stage-head { display: grid; grid-template-columns: 1fr; }
  .topbar-left strong { width: 100%; }
  .top-link, .ghost-link, .announcement-bell-btn { width: calc(50% - 4px); }
  .layout { min-height: calc(100vh - 80px); }
  .sidebar { padding: 10px; gap: 10px; }
  .sidebar-nav-group { grid-template-columns: 1fr; }
  .sidebar-menu-item { min-height: 40px; }
  .conversation-item { padding: 10px; }
  .main-panel { padding: 10px; gap: 10px; }
  .settings-card { padding: 12px; border-radius: 14px; }
  .prompt-helper-page { gap: 12px; }
  .prompt-helper-head h2 { font-size: 20px; }
  .prompt-helper-panel { padding: 12px; gap: 12px; }
  .prompt-helper-toolbar { margin-top: -2px; }
  #userInput { min-height: 132px; }
  .compact-textarea { min-height: 78px; }
  .result-textarea { min-height: 96px; }
  .prompt-helper-result-head,
  .prompt-helper-head { gap: 8px; }
  .prompt-helper-result-head .small,
  #helperStatus,
  .helper-inline-hint { font-size: 12px; }
  .muted { line-height: 1.5; }
}

@media (max-width: 420px) {
  .top-link, .ghost-link, .announcement-bell-btn { width: 100%; }
  .chip-list { display: flex; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .chip { flex: 0 0 auto; white-space: nowrap; }
  .prompt-helper-panel,
  .settings-card { padding: 10px; }
  .field-group input,
  .field-group textarea,
  .prompt-helper-head-actions select,
  #userInput { font-size: 16px; }
}

@media (max-width: 960px) {
  .main-panel.app-main-panel {
    display: block;
    padding: 12px;
    min-height: auto;
    overflow: visible;
  }

  .settings-card.prompt-helper-page {
    display: grid;
    gap: 14px;
    padding: 14px;
    overflow: visible;
  }

  .prompt-helper-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .prompt-helper-panel,
  .result-panel {
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .structured-grid {
    grid-template-columns: 1fr;
  }

  .prompt-helper-head,
  .prompt-helper-result-head,
  .prompt-helper-actions.split,
  .prompt-helper-head-actions,
  .prompt-helper-actions-left {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .prompt-helper-head-actions select,
  .prompt-helper-actions > button,
  .prompt-helper-actions-left > button,
  #sendToDrawBtn,
  #composeBtn,
  #resetBtn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .main-panel.app-main-panel {
    padding: 10px;
  }

  .settings-card.prompt-helper-page,
  .prompt-helper-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .prompt-helper-grid {
    gap: 12px;
  }

  .prompt-helper-head h2 {
    font-size: 20px;
  }

  #userInput {
    min-height: 132px;
  }

  .compact-textarea {
    min-height: 78px;
  }

  .result-textarea {
    min-height: 96px;
  }
}

@media (max-width: 420px) {
  .main-panel.app-main-panel {
    padding: 8px;
  }

  .settings-card.prompt-helper-page,
  .prompt-helper-panel {
    padding: 10px;
  }
}

@media (max-width: 960px) {
  .prompt-helper-block .chip-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    margin: 0 -2px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .prompt-helper-block .chip-list::-webkit-scrollbar {
    height: 4px;
  }

  .prompt-helper-block .chip-list::-webkit-scrollbar-thumb {
    background: rgba(83, 123, 255, 0.35);
    border-radius: 999px;
  }

  .prompt-helper-block .chip {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 14px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  .prompt-helper-block {
    gap: 8px;
  }

  .prompt-helper-block .chip-list {
    gap: 8px;
    padding-bottom: 8px;
  }

  .prompt-helper-block .chip {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 999px;
  }
}

@media (max-width: 420px) {
  .prompt-helper-block .chip-list {
    gap: 8px;
  }

  .prompt-helper-block .chip {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }
}

.wallet-page-wrap { overflow: auto; }
.wallet-page-card { max-width: 1080px; }
.wallet-package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 24px; }
.wallet-package-card { display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: rgba(16, 26, 46, .78); border: 1px solid rgba(95, 123, 188, 0.18); box-shadow: 0 14px 28px rgba(0,0,0,.10); }
.wallet-package-card h3 { margin: 0; }
.wallet-package-credits { color: #fff; font-size: 28px; font-weight: 800; line-height: 1; }
.wallet-package-price { color: #7ff0b1; font-size: 18px; font-weight: 800; }
.wallet-pay-btn:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.wallet-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0 12px; }
.wallet-section-head h3 { margin: 4px 0 0; }
.wallet-order-list { display: grid; gap: 8px; }
.wallet-order-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(14, 22, 39, .64); border: 1px solid rgba(88, 112, 164, 0.10); }
.wallet-order-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: #cdd9f5; white-space: nowrap; }
