:root {
  --bg: #fafaf7;
  --surface: #fff;
  --raised: #f0f0e8;
  --text: #0f0f12;
  --muted: #8a8a92;
  --secondary: #4a4a52;
  --border: #e8e8e0;
  --divider: #ecece5;
  --accent: #2d4fe0;
  --accent-soft: #e5eafb;
  --success: #1f8a55;
  --butter: #f4c95d;
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --font: Inter, "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --display: Geist, "PingFang SC", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
*[hidden] { display: none !important; }
html { overflow-y: scroll; scrollbar-gutter: stable; }
body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; }
body { overflow: hidden; background: var(--bg); color: var(--text); font: 13px/1.5 var(--font); }
button, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { display: block; max-width: 100%; }

.app { display: flex; height: 100dvh; min-height: 570px; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar { display: flex; height: 56px; flex: 0 0 56px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: var(--surface); padding: 0 16px; }
.topbar-left, .app-brand, .topbar-account, .balance-top, .reset-time, .shortcut, .agent-card { display: flex; align-items: center; }
.topbar-left { min-width: 0; gap: 8px; }
.app-brand { min-width: 0; gap: 7px; color: var(--text); font: 700 13px/20px var(--display); }
.app-brand img { width: 24px; height: 24px; border-radius: 6px; object-fit: contain; }
.topbar-account { gap: 8px; }
.icon-button { position: relative; display: grid; width: 32px; height: 32px; place-items: center; border-radius: var(--r-sm); background: transparent; color: var(--secondary); }
.icon-button:hover { background: var(--raised); }
.mobile-menu { display: none; }
.collapse-button::before { width: 10px; height: 10px; content: ""; border: 1.4px solid currentColor; border-right-color: transparent; }
.collapse-button::after { position: absolute; width: 1.2px; height: 11px; content: ""; background: currentColor; transform: translateX(1px); }
.balance-top { height: 32px; flex: 0 0 auto; gap: 6px; border: 1px solid var(--border); border-radius: 4px; background: #fffdf7; padding: 0 10px; color: var(--secondary); font-size: 11px; font-weight: 600; }
.balance-top:hover { border-color: var(--butter); }
.balance-top b { color: #aa8131; font: 500 11px var(--mono); }
.account-action { height: 32px; border: 1px solid var(--border); border-radius: 4px; padding: 0 11px; color: var(--text); font-size: 12px; font-weight: 700; }
.login-action { background: var(--accent); border-color: var(--accent); color: #fff; }
.logout-action { background: #fff; }
.logout-action:hover { border-color: #d79090; color: #b42318; }

.workspace { display: flex; min-height: 0; flex: 1; }
.sidebar { display: flex; width: 248px; min-width: 248px; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); transition: width .2s ease, min-width .2s ease; }
.agent-card { height: 79px; gap: 10px; border-bottom: 1px solid var(--divider); padding: 0 16px; }
.agent-avatar { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 8px; object-fit: cover; }
.agent-card strong { min-width: 0; flex: 1; overflow: hidden; color: var(--text); font: 700 14px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.collapse-button { width: 24px; height: 24px; }
.side-scroll { min-height: 0; flex: 1; overflow-y: auto; padding: 18px 12px 10px; scrollbar-width: thin; }
.side-section-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 9px; color: var(--muted); font-size: 11px; }
.small-icon { width: 22px; height: 22px; }
.small-icon::before, .project-add::before, .plus-icon::before { position: absolute; width: 11px; height: 1.3px; content: ""; background: currentColor; }
.small-icon::after, .project-add::after, .plus-icon::after { position: absolute; width: 1.3px; height: 11px; content: ""; background: currentColor; }
.project-row, .session-row, .load-sessions { width: 100%; color: var(--secondary); text-align: left; }
.project-row { display: flex; height: 36px; align-items: center; gap: 8px; border-radius: 7px; padding: 0 9px; background: var(--accent-soft); color: #30499d; font-size: 12px; }
.project-row b { flex: 1; font-weight: 600; }
.project-row:hover { background: #dce4ff; }
.project-add { position: relative; width: 15px; height: 15px; border: 1px solid #8492c7; border-radius: 3px; }
.project-add::before, .project-add::after { top: 50%; left: 50%; width: 7px; height: 1px; transform: translate(-50%, -50%); }
.project-add::after { width: 1px; height: 7px; }
.chevron { position: relative; display: inline-block; width: 10px; height: 10px; flex: 0 0 10px; }
.chevron.down::before { position: absolute; top: 1px; left: 2px; width: 6px; height: 6px; content: ""; border-right: 1.3px solid currentColor; border-bottom: 1.3px solid currentColor; transform: rotate(45deg); }
.chevron.right::before { position: absolute; top: 2px; left: 1px; width: 6px; height: 6px; content: ""; border-top: 1.3px solid currentColor; border-right: 1.3px solid currentColor; transform: rotate(45deg); }
.session-list { padding: 3px 0 14px 25px; }
.session-row { display: flex; min-height: 30px; align-items: center; gap: 7px; border-radius: 4px; padding: 5px 5px 5px 0; font-size: 12px; }
.session-row:hover { color: var(--text); }
.session-row.active { color: var(--accent); font-weight: 600; }
.session-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-mark { width: 0; height: 13px; border-left: 1px solid #dadad5; }
.session-empty { margin: 7px 0 4px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.load-sessions { padding: 7px 0 4px; background: transparent; color: #777782; font-size: 12px; }
.load-sessions:hover { color: var(--accent); }
.secondary-project { margin-top: 1px; background: transparent; color: var(--secondary); }
.secondary-project:hover { background: var(--raised); }
.side-actions { display: flex; gap: 5px; }
.side-actions i { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.secondary-session { margin-left: 25px; width: calc(100% - 25px); }
.sidebar-shortcuts { display: grid; gap: 10px; border-top: 1px solid var(--divider); padding: 12px; }
.shortcut { min-height: 52px; gap: 9px; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 8px 10px; color: var(--secondary); text-align: left; }
.shortcut:hover { border-color: #cfd4eb; box-shadow: 0 2px 8px #2d4fe014; }
.shortcut-copy { min-width: 0; flex: 1; }
.shortcut-copy b, .shortcut-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut-copy b { color: var(--text); font-size: 12px; }
.shortcut-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.shortcut-copy em { margin-left: 3px; border-radius: 3px; padding: 1px 4px; background: #e8eafb; color: #5266b5; font-style: normal; font-size: 10px; }
.community em { background: #fbf1d6; color: #a57c2a; }
.shortcut-icon { position: relative; width: 16px; height: 16px; flex: 0 0 16px; border: 1.5px solid var(--accent); border-radius: 3px; }
.users-icon { border-radius: 50%; border-color: #c59d40; }
.clipboard-icon::after { position: absolute; top: -4px; left: 4px; width: 5px; height: 3px; content: ""; border: 1.4px solid var(--accent); border-bottom: 0; border-radius: 2px 2px 0 0; }

.main-area { min-width: 0; flex: 1; }
.conversation { position: relative; display: flex; height: 100%; min-width: 0; flex-direction: column; }
.main-content { width: min(100%, 760px); flex: 1; overflow-x: hidden; overflow-y: auto; margin: 0 auto; padding: 24px 24px 236px; scroll-padding-bottom: 236px; scrollbar-width: thin; }
.welcome-row { display: flex; height: 100px; flex: 0 0 100px; gap: 12px; }
.assistant-avatar { width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid var(--border); border-radius: 7px; object-fit: cover; }
.welcome-copy { min-width: 0; padding-top: 4px; }
.welcome-copy p { margin: 8px 0; color: var(--secondary); font-size: 13px; line-height: 22.75px; }
.welcome-copy strong { color: var(--text); font-weight: 700; }
.welcome-copy ul { margin: 8px 0; padding-left: 20px; color: var(--secondary); font-size: 14px; line-height: 22.75px; }
.welcome-copy li { margin-bottom: 4px; }
.inspiration { margin-top: 0; padding-top: 16px; }
.section-heading { display: flex; min-height: 23px; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-heading h1 { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--text); font: 700 13px var(--display); }
.sparkle-icon, .sparkle-mini { position: relative; display: inline-block; width: 16px; height: 16px; color: var(--accent); }
.sparkle-icon::before, .sparkle-icon::after, .sparkle-mini::before { position: absolute; top: 50%; left: 50%; content: ""; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.sparkle-icon::before, .sparkle-mini::before { width: 12px; height: 2px; border-radius: 2px; }
.sparkle-icon::after { width: 2px; height: 12px; border-radius: 2px; }
.more-button { height: 23px; border: 1.3px solid var(--text); border-radius: 4px; background: #fff; padding: 0 11px; color: var(--text); font-size: 10px; font-weight: 600; }
.more-button:hover { border-color: var(--accent); color: var(--accent); }
.inspiration-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.inspiration-card { position: relative; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.card-image { display: block; width: 100%; height: 100%; padding: 0; background: #eee; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.inspiration-card:hover .card-image img { transform: scale(1.035); }
.card-actions { position: absolute; right: 10px; bottom: 10px; left: 10px; display: flex; gap: 5px; opacity: 0; transform: translateY(4px); transition: opacity .16s ease, transform .16s ease; }
.inspiration-card:hover .card-actions { opacity: 1; transform: none; }
.card-actions button { display: flex; align-items: center; gap: 4px; height: 26px; border: 1px solid #ffffffb8; border-radius: 4px; background: #0f0f12d1; padding: 0 7px; color: #fff; font-size: 11px; }
.card-actions button:hover { background: var(--accent); }

.composer-area { position: absolute; right: 0; bottom: 0; left: 0; width: min(100%, 828px); margin: auto; padding: 0 clamp(24px, 3.1vw, 34px) 22px; background: linear-gradient(0deg, var(--bg) 78%, #fafaf700); }
.quota-row { display: flex; height: 32px; align-items: center; gap: 7px; padding-left: 0; color: var(--muted); font-size: 11px; }
.reset-time { gap: 7px; white-space: nowrap; }
.reset-time b { color: var(--success); font-weight: 500; }
.reset-time strong { color: #ba8730; font: 500 11px var(--mono); }
.clock-icon { position: relative; width: 15px; height: 15px; border: 1.4px solid var(--success); border-radius: 50%; }
.clock-icon::before { position: absolute; top: 3px; left: 6px; width: 1px; height: 4px; content: ""; background: var(--success); }
.clock-icon::after { position: absolute; top: 6px; left: 6px; width: 3px; height: 1px; content: ""; background: var(--success); transform: rotate(30deg); transform-origin: left center; }
.help-button { position: relative; width: 18px; height: 18px; border-radius: 50%; background: transparent; color: var(--muted); }
.help-button::before { display: grid; width: 12px; height: 12px; place-items: center; content: "?"; border: 1px solid currentColor; border-radius: 50%; font: 700 9px var(--mono); }
.composer { overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px #2d4fe03d; }
.composer-main { display: flex; min-height: 92px; gap: 12px; padding: 10px 12px 3px; }
.composer-main.is-drop-target { outline: 2px dashed var(--accent); outline-offset: -5px; background: #f5f7ff; }
.reference-shelf { display: flex; gap: 7px; }
.add-reference, .reference-thumb { width: 54px; height: 67px; flex: 0 0 54px; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: var(--raised); }
.add-reference { position: relative; display: grid; place-items: center; color: var(--muted); transform: rotate(-6deg); transition: transform .15s ease, background .15s ease; }
.add-reference:hover { background: #e6e6db; transform: rotate(0); }
.plus-icon { position: relative; display: block; width: 20px; height: 20px; }
.plus-icon::before { top: 9px; left: 4px; width: 13px; }
.plus-icon::after { top: 4px; left: 10px; height: 13px; }
.reference-thumb { position: relative; transform: none; }
.reference-thumb img { width: 100%; height: 100%; object-fit: cover; }
.reference-thumb button { position: absolute; top: 3px; right: 3px; display: grid; width: 16px; height: 16px; place-items: center; border-radius: 50%; background: #0f0f12c9; color: #fff; font-size: 14px; line-height: 1; }
#prompt { width: 100%; min-width: 0; min-height: 76px; resize: none; border: 0; outline: 0; background: transparent; padding: 2px 0 0; color: var(--text); font: 13px/24px var(--font); }
#prompt::placeholder { color: #9a9a9c; }
.composer-tools { display: flex; min-height: 54px; align-items: center; gap: 7px; padding: 4px 10px 8px; flex-wrap: wrap; }
.mention-button { width: 26px; height: 28px; background: transparent; color: var(--secondary); font: 500 20px/1 var(--display); }
.mention-button:hover { color: var(--accent); }
.tool-spacer { flex: 1; }
.tool-button { display: inline-flex; height: 32px; min-width: 0; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--raised); padding: 0 9px; color: var(--secondary); font-size: 11px; font-weight: 500; white-space: nowrap; }
.tool-button:hover, .price-button:hover { border-color: var(--accent); color: var(--accent); }
.parameter-button { color: #4a59a0; }
.sliders-icon { position: relative; width: 15px; height: 15px; background: linear-gradient(currentColor, currentColor) 0 4px/15px 1px no-repeat, linear-gradient(currentColor, currentColor) 0 10px/15px 1px no-repeat; }
.sliders-icon::before, .sliders-icon::after { position: absolute; width: 4px; height: 4px; content: ""; border: 1px solid currentColor; border-radius: 50%; background: var(--raised); }
.sliders-icon::before { top: 2px; left: 3px; }.sliders-icon::after { top: 8px; right: 3px; }
.image-mini { width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 2px; background: linear-gradient(135deg, transparent 53%, currentColor 54% 59%, transparent 60%), linear-gradient(45deg, transparent 53%, currentColor 54% 59%, transparent 60%); }
.price-button { display: flex; height: 32px; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; padding: 0 5px; color: var(--muted); font: 500 11px var(--mono); white-space: nowrap; }
.generation-cost { color: var(--muted); font-size: 11px; white-space: nowrap; }
.generation-select-label { display: inline-flex; align-items: center; gap: 5px; color: var(--secondary); font-size: 11px; white-space: nowrap; }
.generation-select-label select { max-width: 168px; height: 32px; border: 1px solid var(--border); border-radius: 5px; background: var(--raised); padding: 0 6px; color: var(--text); font: 500 11px var(--font); cursor: pointer; }
.generation-select-label select#generationRatio { max-width: 112px; }
.provider-quality { color: #a53b35; font-size: 10px; white-space: nowrap; }
.provider-quality[data-quality="high"] { color: #18734a; }
.provider-quality[data-quality="unrated"] { color: var(--muted); }
.generation-select-label select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) { .composer-tools { height: auto; gap: 6px; } .generation-select-label span { display: none; } .generation-select-label select { max-width: 126px; } .generation-cost { font-size: 10px; } }
.send-button { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 8px; background: var(--accent); color: #fff; opacity: .45; }
.send-button:not(:disabled) { opacity: 1; }.send-button:not(:disabled):hover { background: #183bcb; }
.send-icon { width: 0; height: 0; margin-left: 2px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 13px solid currentColor; transform: rotate(-40deg); }
.disclaimer { margin: 4px 0 0; color: #a2a2a4; text-align: center; font-size: 10px; }

.popover-layer { position: fixed; z-index: 20; inset: 0; }
.popover { position: absolute; width: min(490px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 12px; box-shadow: 0 12px 25px -10px #2d4fe040; }
.popover-link { float: right; background: transparent; color: var(--accent); font-size: 10px; }
.popover-copy { margin: 7px 0 2px; color: var(--secondary); font-size: 12px; line-height: 1.8; }
.popover-copy strong { color: #a97b29; font: 600 15px var(--mono); }
.popover-copy small { color: var(--muted); }
.settings-panel { width: min(490px, calc(100vw - 32px)); }
.settings-panel h3 { margin: 1px 0 7px; color: var(--secondary); font: 600 12px var(--display); }
.settings-panel h3:not(:first-child) { margin-top: 16px; }
.ratio-grid, .segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ratio-choice, .segment { display: flex; min-height: 48px; align-items: center; justify-content: center; border-radius: 4px; background: var(--raised); color: var(--muted); font-size: 11px; }
.ratio-choice.active, .segment.active { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--accent); }
.segmented { grid-template-columns: repeat(3, 1fr); gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; }
.segment { min-height: 30px; border-right: 1px solid var(--border); border-radius: 0; }.segment:last-child { border-right: 0; }
.segment.active { background: #fff; box-shadow: inset 0 0 0 1px #dde2ff; }
.size-inputs { display: flex; align-items: center; gap: 10px; }.size-inputs label { display: flex; min-width: 0; flex: 1; align-items: center; gap: 6px; color: var(--muted); }.size-inputs input { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 4px; padding: 0 9px; color: var(--text); font: 13px var(--mono); }
.quality-grid, .quantity-grid { grid-template-columns: repeat(5, 1fr); }
.model-panel { width: 250px; }.model-option { display: flex; width: 100%; align-items: center; gap: 8px; border-radius: 5px; background: transparent; padding: 9px; color: var(--secondary); text-align: left; }.model-option:hover, .model-option.active { background: var(--raised); color: var(--text); }.model-badge { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font: 700 11px var(--display); }.model-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.library-panel { width: min(610px, calc(100vw - 32px)); }.library-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }.library-panel h3 { margin: 0; font: 700 14px var(--display); }.library-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }.library-grid button { overflow: hidden; border: 1px solid var(--border); border-radius: 6px; padding: 0; background: #fff; }.library-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }.library-grid span { display: block; padding: 5px; color: var(--secondary); font-size: 10px; }

.modal-layer { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; background: #0f0f1266; padding: 22px; }
.community-dialog { position: relative; width: min(390px, 100%); border-radius: 12px; background: #fff; padding: 28px; text-align: center; box-shadow: 0 24px 80px #0f0f124d; }.community-dialog h2 { margin: 0; font: 700 20px var(--display); }.community-dialog p { margin: 8px 0 18px; color: var(--muted); font-size: 13px; }.community-dialog img { display: block; width: min(290px, 100%); margin: 0 auto; border-radius: 8px; }
.preview-dialog { position: relative; display: grid; width: min(730px, 100%); max-height: min(650px, 100%); grid-template-columns: minmax(0, 1fr) minmax(190px, .42fr); overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 24px 80px #0f0f124d; }
.preview-image { width: 100%; height: 100%; min-height: 360px; object-fit: contain; background: #151517; }.preview-info { padding: 26px 22px; }.preview-info h2 { margin: 0 0 12px; font: 700 18px var(--display); }.preview-info p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--secondary); font-size: 12px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 10; }.use-example { width: 100%; margin-top: 20px; border-radius: 5px; background: var(--accent); padding: 9px; color: #fff; font-weight: 700; }.modal-close { position: absolute; z-index: 2; top: 9px; right: 9px; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #0f0f12aa; color: #fff; font-size: 20px; }
.repaint-dialog { position: relative; display: grid; width: min(1120px, 100%); height: min(820px, 92dvh); grid-template-columns: minmax(0, 1fr) 310px; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 24px 80px #0f0f124d; }
.repaint-workspace { position: relative; display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; background: #171719; padding: 24px; }
#repaintCanvas { display: block; max-width: 100%; max-height: 100%; object-fit: contain; cursor: crosshair; touch-action: none; }
#repaintStatus { position: absolute; color: #fff; pointer-events: none; }
.repaint-controls { display: flex; min-height: 0; flex-direction: column; gap: 12px; overflow-y: auto; padding: 28px 20px 20px; }
.repaint-controls h2 { margin: 0; font: 700 19px var(--display); }
.repaint-controls > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.brush-control { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; color: var(--secondary); font-size: 12px; }
.brush-control output { color: var(--muted); font: 11px var(--mono); }
.brush-control input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.repaint-tools { display: flex; gap: 8px; }
.repaint-tools button { flex: 1; border: 1px solid var(--border); border-radius: 5px; background: #fff; padding: 8px; color: var(--secondary); font-size: 12px; }
.repaint-tools button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.repaint-tools button:disabled { opacity: .45; cursor: default; }
.repaint-prompt-label { color: var(--secondary); font-size: 12px; font-weight: 600; }
#repaintPrompt { min-height: 125px; resize: vertical; border: 1px solid var(--border); border-radius: 6px; padding: 9px; color: var(--text); font: 12px/1.65 var(--font); }
.repaint-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.repaint-submit { margin-top: auto; border-radius: 6px; background: var(--accent); padding: 11px; color: #fff; font-weight: 700; }
.repaint-submit:hover:not(:disabled) { background: #183bcb; }
.repaint-submit:disabled { cursor: wait; opacity: .55; }
.toast { position: fixed; z-index: 50; bottom: 24px; left: 50%; max-width: calc(100vw - 32px); transform: translate(-50%, 75px); border-radius: 6px; background: #0f0f12e8; padding: 9px 13px; color: #fff; opacity: 0; pointer-events: none; transition: .2s ease; font-size: 12px; }.toast.show { transform: translate(-50%, 0); opacity: 1; }
.chat-message { max-width: 78%; margin: 18px 0 0 auto; border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.7; }.user-message { background: var(--accent-soft); color: var(--text); white-space: pre-wrap; }.result-message { max-width: 100%; margin-left: 0; border: 1px solid var(--border); background: #fff; }.generated-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }.generated-card { position: relative; min-width: 0; overflow: hidden; border-radius: 6px; background: var(--raised); }.generated-preview { display: block; width: 100%; overflow: hidden; border: 0; border-radius: 6px; padding: 0; background: transparent; }.generated-grid img { display: block; width: 100%; height: auto; border-radius: 6px; object-fit: contain; }.generated-preview:hover { box-shadow: 0 0 0 2px var(--accent); }.generated-actions { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transform: translateY(6px); transition: opacity .16s ease, transform .16s ease; pointer-events: none; }.generated-card:hover .generated-actions, .generated-card:focus-within .generated-actions { opacity: 1; transform: translateY(0); pointer-events: auto; }.generated-action { border: 0; border-radius: 5px; padding: 6px 9px; background: rgba(15, 15, 18, .86); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }.generated-action:hover:not(:disabled) { background: var(--accent); }.generated-action:disabled { cursor: wait; opacity: .75; }.send-button.is-loading { opacity: .75; animation: send-pulse 1s ease-in-out infinite; }
.result-message .result-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.result-message.is-pending { border-color: #d6c080; background: #fffdf4; }
.result-message.is-pending strong::before { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border: 2px solid #c99d2b; border-right-color: transparent; border-radius: 50%; content: ''; animation: result-spin .8s linear infinite; vertical-align: -1px; }
.result-message.is-failed { border-color: #e7b5b5; background: #fff8f8; }
.result-message.is-failed strong { color: #b42318; }
@keyframes result-spin { to { transform: rotate(360deg); } }
.auth-layer { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; background: #0f0f1266; padding: 20px; }
.auth-dialog { position: relative; width: min(380px, 100%); border-radius: 10px; background: #fff; padding: 28px; box-shadow: 0 24px 80px #0f0f124d; }
.auth-close { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: transparent; color: var(--secondary); font-size: 22px; line-height: 1; }
.auth-close:hover { background: var(--raised); }.auth-eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 700; }.auth-dialog h2 { margin: 0; font: 700 19px var(--display); }.auth-copy { margin: 7px 0 20px; color: var(--muted); font-size: 12px; }
.auth-dialog label { display: grid; gap: 6px; margin-top: 13px; color: var(--secondary); font-size: 12px; font-weight: 600; }.auth-dialog input { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 5px; padding: 0 10px; color: var(--text); outline: 0; }.auth-dialog input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #2d4fe020; }
.auth-error { min-height: 18px; margin: 10px 0 0; color: #bd3434; font-size: 11px; }.auth-submit { width: 100%; height: 38px; border-radius: 5px; background: var(--accent); color: #fff; font-weight: 700; }.auth-submit:hover { background: #183bcb; }.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-switch { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }.auth-switch button, .auth-logout { background: transparent; color: var(--accent); font-size: 12px; }.auth-switch button:hover, .auth-logout:hover { text-decoration: underline; }.auth-logout { display: block; width: 100%; margin-top: 18px; color: var(--secondary); }
@keyframes send-pulse { 50% { opacity: .45; } }

.sidebar-collapsed .sidebar { width: 64px; min-width: 64px; }.sidebar-collapsed .agent-card { justify-content: center; padding: 0 7px; }.sidebar-collapsed .agent-card strong, .sidebar-collapsed .collapse-button, .sidebar-collapsed .side-scroll, .sidebar-collapsed .sidebar-shortcuts { display: none; }

@media (max-width: 850px) {
  .sidebar { position: fixed; z-index: 15; top: 56px; bottom: 0; left: 0; box-shadow: 12px 0 28px #0f0f121a; transform: translateX(-102%); transition: transform .22s ease; }.app.sidebar-open .sidebar { transform: none; }.mobile-menu { display: grid; }.collapse-button { display: none; }.main-content { width: 100%; }.composer-area { width: 100%; }.inspiration-grid { gap: 9px; }.card-actions { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 10px; }.app-brand span, .balance-top span { display: none; }.balance-top { padding: 0 8px; }.account-action { padding: 0 8px; }.main-content { padding: 20px 16px 220px; scroll-padding-bottom: 220px; }.welcome-row { height: 100px; flex-basis: 100px; }.welcome-copy p, .welcome-copy ul { font-size: 12px; }.inspiration { padding-top: 13px; }.inspiration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.composer-area { padding: 0 16px 12px; }.quota-row { overflow: hidden; }.reset-time strong { display: none; }.composer-main { min-height: 73px; gap: 9px; }.add-reference, .reference-thumb { width: 47px; height: 58px; flex-basis: 47px; }#prompt { min-height: 62px; }.composer-tools { gap: 5px; padding-inline: 6px; }.tool-spacer { display: none; }.library-button, .model-button span, .parameter-button span { display: none; }.tool-button { width: 32px; padding: 0; }.price-button { padding: 0 2px; }.price-button span { display: none; }.preview-dialog { display: flex; max-height: 90vh; flex-direction: column; }.preview-image { min-height: 0; max-height: 55vh; }.preview-info { padding: 16px; }.preview-info p { -webkit-line-clamp: 3; }
}
@media (max-width: 760px) {
  .repaint-dialog { width: min(100%, 600px); height: min(92dvh, 900px); grid-template-columns: 1fr; grid-template-rows: minmax(180px, 1fr) auto; overflow-y: auto; }
  .repaint-workspace { min-height: 180px; padding: 30px 12px 12px; }
  .repaint-controls { max-height: 42dvh; padding: 16px; }
  #repaintPrompt { min-height: 80px; }
}
