/* Monochrome, conversation-first presentation. */
.studio-live #game-frame { width: 100%; height: 100%; border: 0; display: block; background: #edf1e9; }
.studio-live .game-viewport { position: absolute; inset: 0; }
.studio-live .studio-runtime-error { margin: 0 8px 10px; padding: 10px 12px; border-radius: 12px; background: #fff1ec; color: #8d3c27; font-size: 12px; line-height: 1.6; max-height: 100px; overflow: auto; overflow-wrap: anywhere; }
.studio-live .studio-agent-activity ol { max-height: 180px; overflow: auto; }
.studio-live .studio-agent-activity li { overflow-wrap: anywhere; }
:root {
  --bg: #fff; --paper: #fff; --ink: #171717; --subtle: #6b6b6b;
  --muted: #808080; --line: #e8e8e8; --green: #171717;
  --green-dark: #333; --green-light: #eee;
}
body { font-size: 16px; color: var(--ink); }
button, input, textarea, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline-color: #858585; }
::selection { background: #dedede; }
.icon { stroke-width: 1.65; }
.icon-button { width: 44px; height: 44px; color: #262626; border-radius: 50%; }
.icon-button .icon { width: 22px; height: 22px; }
.icon-button:hover { background: #eee; }
.button { font-size: 14px; min-height: 44px; padding: 11px 18px; border-radius: 24px; }
.primary-button { background: #171717; }
.primary-button:hover { background: #333; }
.primary-button:disabled { background: #dedede; color: #fff; }
.secondary-button { color: #222; background: #fff; border-color: #dedede; }
.secondary-button:hover { background: #f3f3f3; }
.text-button, .text-link { color: #292929; font-size: 14px; }
.brand { font-size: 22px; letter-spacing: -.5px; font-weight: 600; }
.app-page { background: #fff; }
.app-content { margin-left: 260px; }
.app-header { height: 72px; padding: 0 28px; position: sticky; top: 0; z-index: 15; background: #ffffffed; backdrop-filter: blur(16px); }
.header-leading { display: flex; align-items: center; gap: 9px; }
.header-brand { font-size: 21px; }
.header-create .icon { width: 23px; height: 23px; }
.nav-toggle, .nav-close { display: none; }
.sidebar { width: 260px; background: #f9f9f9; border: 0; padding: 18px 12px 12px; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; min-height: 40px; margin-bottom: 24px; }
.sidebar-top .brand { font-size: 21px; }
.sidebar-create { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.sidebar-create:hover { background: #ececec; }
.side-nav { margin-top: 6px; gap: 2px; }
.nav-item { padding: 12px 14px; color: #292929; font-size: 14px; font-weight: 400; min-height: 44px; }
.nav-item.active { background: #eaeaea; color: #171717; font-weight: 500; }
.nav-item:hover { background: #ededed; }
.sidebar-recents { min-height: 0; overflow-y: auto; margin-top: 30px; padding-bottom: 20px; scrollbar-width: thin; }
.sidebar-recents>p { color: #7b7b7b; font-size: 12px; padding: 0 14px; margin-bottom: 9px; }
.sidebar-recents nav { display: grid; gap: 2px; }
.sidebar-recents a { padding: 12px 14px; border-radius: 9px; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-recents a:hover { background: #ececec; }
.sidebar-bottom { padding-top: 10px; }
.account { border: 0; padding: 10px; border-radius: 12px; }
.account:hover { background: #ededed; }
.avatar { background: #dedede; color: #3b3b3b; width: 36px; height: 36px; font-size: 14px; }
.account-copy { flex: 1; gap: 4px; }
.account-copy strong { font-size: 14px; font-weight: 500; }
.account-copy>span { font-size: 12px; color: #777; }
.account>.icon { width: 19px; height: 19px; }
.bottom-nav { display: none; }
.nav-backdrop { position: fixed; inset: 0; z-index: 29; background: #0006; }
.header-profile { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.header-profile .avatar { width: 32px; height: 32px; background: #eaeaea; font-size: 13px; }
.header-profile:hover { background: #f3f3f3; }
.workspace-main { max-width: 1080px; padding: 64px 40px 40px; }
.creation-section { max-width: 680px; margin: 0 auto 52px; text-align: center; scroll-margin-top: 90px; }
.creation-section h1 { font-size: 34px; font-weight: 600; line-height: 1.4; letter-spacing: -1px; margin: 0; }
.hero-description { color: #737373; font-size: 15px; margin-top: 10px; }
.idea-suggestions { justify-content: center; gap: 8px; margin-top: 16px; }
.idea-suggestions button { display: flex; align-items: center; gap: 7px; padding: 10px 13px; min-height: 44px; font-size: 13px; color: #626262; background: #fff; border: 1px solid #e8e8e8; border-radius: 22px; }
.idea-suggestions button .icon { width: 17px; height: 17px; color: #626262; }
.idea-suggestions button:hover { background: #f5f5f5; color: #171717; }
.projects-section { max-width: none; margin: 0 auto; }
.section-heading { margin-bottom: 14px; gap: 16px; }
.section-heading h2 { font-size: 19px; letter-spacing: 0; font-weight: 600; }
.heading-inline { gap: 9px; flex-shrink: 0; }
.count-badge { padding: 0; background: transparent; color: #8a8a8a; font-size: 13px; }
.project-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: nowrap; margin-bottom: 20px; }
.project-sort-note { font-size: 12px; color: #858585; white-space: nowrap; }
.filter-tabs { display: flex; gap: 4px; width: auto; }
.filter-tabs button { min-height: 44px; padding: 9px 16px; border-radius: 24px; font-size: 13px; color: #727272; background: transparent; }
.filter-tabs button[aria-pressed=true] { color: #202020; background: #f0f0f0; }
.search-field { display: flex; align-items: center; gap: 8px; height: 44px; width: 190px; padding: 0 13px; border-radius: 24px; border: 1px solid transparent; background: #f6f6f6; }
.search-field:focus-within { border-color: #ccc; }
.search-field .icon { width: 17px; height: 17px; color: #858585; }
.search-field input { width: 100%; font-size: 14px; color: #222; }
.search-field input::placeholder { color: #8a8a8a; font-size: 13px; }
.game-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px 22px; }
.game-card { display: block; min-width: 0; min-height: 0; padding: 0; margin: 0; position: relative; border-radius: 16px; }
.project-card-link { display: block; border-radius: 16px; }
.cover-link { width: 100%; height: auto; border-radius: 16px; overflow: hidden; background: #f5f5f5; }
.game-cover { width: 100%; height: auto; aspect-ratio: 1.5; }
.game-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.project-card-link:hover .game-cover img { transform: scale(1.025); }
.dimension-tag { top: 12px; left: 12px; padding: 4px 7px; border-radius: 6px; background: #ffffffc9; font-size: 11px; font-weight: 500; color: #595959; }
.project-task-badge { bottom: 10px; left: 10px; max-width: calc(100% - 20px); padding: 5px 8px; border-radius: 8px; background: #ffffffed; font-size: 11px; color: #515151; }
.game-card-info { display: block; min-width: 0; padding: 12px 2px 0; }
.game-card-copy { min-width: 0; }
.game-card-copy h3 { font-size: 15px; font-weight: 550; line-height: 1.5; letter-spacing: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.game-card-copy p { font-size: 12px; margin-top: 4px; color: #888; }
.project-menu-button { position: absolute; top: 3px; right: 3px; height: 44px; width: 44px; margin: 0; color: #616161; background: transparent; }
.project-menu-button::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #ffffffd9; transition: background .15s; }
.project-menu-button:hover, .project-menu-button[aria-expanded=true] { background: transparent; }
.project-menu-button:hover::before, .project-menu-button[aria-expanded=true]::before { background: #fff; }
.project-menu-button .icon { position: relative; height: 19px; width: 19px; }
.project-menu { top: 48px; bottom: auto; right: 3px; z-index: 18; background: #fff; border: 1px solid #e5e5e5; border-radius: 14px; padding: 5px; box-shadow: 0 8px 30px #0000001f; min-width: 168px; }
.project-menu button { color: #333; min-height: 45px; padding: 10px; font-size: 14px; border-radius: 9px; }
.project-menu button:hover { background: #f2f2f2; }
.project-menu button .icon { color: #666; }
.prompt-composer { margin: 26px 0 0; padding: 19px 18px 12px; text-align: left; background: #f5f5f5; border: 1px solid #ebebeb; border-radius: 26px; box-shadow: none; }
.prompt-composer:focus-within { border-color: #cfcfcf; box-shadow: 0 0 0 1px #cfcfcf; }
.prompt-composer textarea { display: block; font-size: 16px; line-height: 1.6; min-height: 64px; height: 64px; max-height: 160px; color: #222; padding: 0 2px; scroll-margin: 100px 0 160px; }
textarea::placeholder { color: #8b8b8b; }
.composer-bottom { margin-top: 7px; }
.dimension-picker { padding: 0; gap: 4px; background: transparent; border-radius: 20px; }
.dimension-picker span { min-height: 44px; padding: 10px 12px; border-radius: 24px; font-size: 13px; color: #797979; }
.dimension-picker input:checked+span { background: #e4e4e4; box-shadow: none; color: #222; }
.dimension-picker input:focus-visible+span { outline-color: #888; }
.dimension-picker .icon { height: 17px; width: 17px; }
.create-button { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.create-button .icon { width: 21px; height: 21px; }
.home-preview-note { color: #999; font-size: 11px; line-height: 1.5; margin-top: 48px; text-align: center; }
[data-page=home] .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
.archive-page .workspace-main { padding-bottom: 40px; }
.archive-page .projects-section { padding-top: 30px; }
.archive-notice { border: 0; border-radius: 12px; background: #f5f5f5; color: #777; font-size: 14px; padding: 17px; }
.empty-state { background: transparent; border: 0; padding: 45px 15px; }
.empty-icon { color: #888; background: #f3f3f3; }
.empty-state h3 { font-size: 17px; color: #333; }
.empty-state p { font-size: 14px; color: #777; }
.profile-main { max-width: 800px; padding: 40px 32px 60px; }
.page-heading { margin-bottom: 30px; }
.page-heading h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.6px; }
.page-heading>p:last-child { margin-top: 12px; font-size: 15px; color: #777; }
.profile-card { background: #f7f7f7; border: 0; border-radius: 20px; padding: 24px; }
.avatar-large { width: 56px; height: 56px; border-radius: 50%; font-size: 21px; }
.profile-identity h2 { font-size: 18px; font-weight: 500; }
.profile-identity p { font-size: 13px; color: #777; }
.profile-counts { border-color: #e2e2e2; }
.profile-counts a+a { border-color: #e2e2e2; }
.profile-counts strong { color: #222; font-size: 26px; }
.profile-counts span { font-size: 13px; color: #777; }
.settings-section { margin-top: 30px; }
.settings-section>h2 { font-size: 13px; color: #777; margin-bottom: 10px; margin-left: 3px; }
.settings-list { background: #f7f7f7; border: 0; border-radius: 17px; }
.setting-row { padding: 20px 18px; gap: 13px; }
.setting-row+.setting-row { border-color: #e7e7e7; }
.setting-icon { background: transparent; color: #555; width: 26px; height: 32px; }
.setting-icon .icon { width: 22px; height: 22px; }
.setting-copy strong { font-size: 15px; font-weight: 500; }
.settings-section .setting-copy>span { color: #838383; font-size: 12px; line-height: 1.7; }
.setting-row>[data-icon]:last-child { color: #aaa; }
.switch-track { background: #d8d8d8; }
.switch-input:focus-visible+.switch-track { outline-color: #777; }
.profile-note { font-size: 12px; color: #aaa; margin-top: 35px; }
.app-dialog { background: #fff; border-color: #e8e8e8; box-shadow: 0 20px 70px #0003; border-radius: 22px; }
.app-dialog::backdrop { background: #0006; backdrop-filter: blur(1px); }
.modal-header h2 { font-size: 19px; color: #222; font-weight: 600; }
.modal-body>p, .modal-body form>p { font-size: 14px; line-height: 1.8; color: #777; }
.form-field { color: #555; font-size: 14px; }
.form-field input, .form-field textarea { background: #f6f6f6; border-color: #e4e4e4; color: #222; font-size: 16px; border-radius: 12px; }
.form-field input:focus, .form-field textarea:focus { border-color: #aaa; }
.about-list { font-size: 14px; color: #777; }
.modal-about-mark { color: #333; background: #f2f2f2; }
.toast { background: #252525; color: #fff; border-radius: 20px; font-size: 13px; line-height: 1.5; bottom: 190px; padding: 11px 18px; box-shadow: 0 4px 25px #0002; }

/* The game stays full-screen. Only the opened conversation uses this chrome. */
.sheet-backdrop { background: #00000029; }
.chat-launcher {
  --launcher-safe-top: env(safe-area-inset-top, 0px);
  --launcher-safe-right: env(safe-area-inset-right, 0px);
  --launcher-safe-bottom: env(safe-area-inset-bottom, 0px);
  --launcher-safe-left: env(safe-area-inset-left, 0px);
  background: #fafafa; color: #303030; border: 1px solid #e5e5e5;
  width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 4px 20px #0000001f, 0 1px 3px #0000000d;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transform: none; transition: background .15s, box-shadow .15s;
}
.chat-launcher:hover { background: #fff; transform: none; }
.chat-launcher:active { background: #f0f0f0; }
.chat-launcher.is-dragging { cursor: grabbing; background: #fff; box-shadow: 0 8px 28px #00000029; transition: none; }
.chat-launcher>.icon, .chat-launcher>[data-icon]>.icon { width: 25px; height: 25px; }
.launcher-label { color: inherit; background: transparent; border: 0; font-size: 13px; }
.launcher-dot { background: #5e7968; border-color: #fafafa; }
.studio-page .ai-panel { width: 440px; height: min(700px,calc(100dvh - 116px)); bottom: 88px; background: #fff; border: 1px solid #e7e7e7; border-radius: 22px; box-shadow: 0 15px 65px #0002; }
.studio-page.panel-expanded .ai-panel { width: min(560px,calc(100vw - 48px)); height: calc(100dvh - 48px); bottom: 24px; }
.studio-grip span { background: #d0d0d0; width: 36px; }
.studio-toolbar { min-height: 62px; gap: 5px; padding: 8px 9px; border: 0; }
.studio-project-name { color: #262626; font-size: 16px; font-weight: 550; text-align: left; padding-left: 5px; }
.studio-tools .icon-button, .studio-conversations { width: 40px; height: 44px; color: #333; }
.studio-tools .icon, .studio-conversations .icon { width: 22px; height: 22px; }
.studio-context-line { min-height: 32px; padding: 0 22px; border-bottom: 1px solid #f3f3f3; }
.studio-context-line>button { min-height: 32px; font-size: 12px; color: #777; }
[data-session-title] { max-width: 300px; }
.session-status-dot { display: none; }
.session-chevron { color: #888; }
.studio-context-line>[data-draft-note] { display: none; }
.studio-page .conversation { padding: 25px 22px 25px; gap: 28px; scrollbar-color: #ddd transparent; }
.studio-page .assistant-message { display: block; }
.studio-page .message-avatar { display: none; }
.studio-page .assistant-message p, .studio-page .user-message p { color: #242424; font-size: 16px; line-height: 1.75; }
.studio-page .user-message { padding: 11px 16px; border-radius: 23px; background: #f1f1f1; color: #222; }
.studio-user-block { max-width: 88%; gap: 7px; }
.studio-message-meta { font-size: 12px; color: #8a8a8a; padding-right: 5px; }
.message-reference { color: #777; font-size: 12px; }
.studio-system-message { color: #969696; font-size: 12px; padding: 0 10px; }
.studio-result { border: 0; padding: 0; border-radius: 0; background: transparent; }
.studio-result-heading { color: #272727; font-size: 16px; gap: 8px; }
.studio-result-heading strong { font-weight: 550; }
.studio-result-heading .icon { width: 18px; height: 18px; }
.studio-page .studio-result p { color: #5f5f5f; font-size: 15px; line-height: 1.75; margin: 10px 0 13px; }
.studio-result .button { min-height: 42px; width: auto; padding: 9px 18px; font-size: 14px; }
.studio-result-note { color: #999; font-size: 12px; }
.studio-welcome { display: block; text-align: center; padding: 32px 8px; }
.studio-welcome-icon { display: none; }
.studio-welcome h2 { color: #222; font-size: 23px; font-weight: 600; line-height: 1.5; margin: 0 0 14px; letter-spacing: -.5px; }
.studio-welcome p { color: #828282; font-size: 14px; line-height: 1.8; max-width: 280px; margin: auto; }
.studio-compose-area { padding: 0 13px; }
.studio-composer { background: #f4f4f4; border: 1px solid #e9e9e9; border-radius: 26px; padding: 14px 14px 8px; }
.studio-composer:focus-within { border-color: #cfcfcf; box-shadow: none; }
.studio-composer textarea { color: #222; font-size: 16px; line-height: 1.6; padding: 0 3px; min-height: 30px; max-height: 132px; }
.studio-compose-actions { margin-top: 8px; gap: 7px; }
.studio-composer .context-button { display: grid; place-items: center; min-height: 38px; width: 38px; padding: 0; border-radius: 50%; color: #393939; }
.studio-composer .context-button .icon { width: 24px; height: 24px; }
.studio-composer .context-button:hover, .studio-composer .context-button[aria-pressed=true] { background: #e4e4e4; }
.studio-composer .send-button { background: #171717; height: 37px; width: 37px; border-radius: 50%; }
.studio-composer .send-button .icon { width: 21px; height: 21px; }
.studio-composer .send-button:disabled { background: #d9d9d9; color: #fff; }
.studio-send-hint { color: #949494; font-size: 11px; }
.studio-composer .context-chip { background: #fff; border: 1px solid #e2e2e2; color: #666; font-size: 12px; border-radius: 12px; }
.context-chip button { color: #777; }
.studio-prototype-note { color: #a0a0a0; font-size: 11px; padding: 8px 8px 11px; }
.studio-suggestions { gap: 8px; margin: 0 2px 12px; }
.studio-suggestions button { min-height: 36px; padding: 8px 12px; border: 1px solid #e4e4e4; color: #666; font-size: 12px; }
.studio-work-status { padding: 0 6px 6px; min-height: 42px; gap: 8px; margin-bottom: 10px; }
.studio-work-copy { color: #6c6c6c; font-size: 13px; gap: 8px; }
.studio-work-dots { color: #999; }
.studio-work-status>button { color: #555; min-height: 40px; font-size: 12px; padding: 0 4px; }
.studio-work-copy .spinner { border-color: #ddd; border-top-color: #555; }
.studio-work-track { background: #efefef; }
.studio-work-track i { background: #767676; }
.studio-queue-peek { border: 0; background: #f6f6f6; border-radius: 14px; padding: 11px 13px; gap: 7px; margin-bottom: 10px; }
.studio-queue-label { color: #575757; font-size: 12px; }
.studio-queue-count { color: #555; background: #e7e7e7; font-size: 11px; }
.studio-queue-manage { color: #888; font-size: 11px; }
.studio-queue-summary { color: #777; font-size: 13px; }
.studio-menu { top: 55px; right: 13px; width: 252px; padding: 6px; border: 1px solid #e8e8e8; border-radius: 17px; box-shadow: 0 10px 35px #0002; }
.studio-menu>button, .studio-menu-link { display: flex; align-items: center; gap: 12px; width: 100%; color: #252525; padding: 12px; min-height: 47px; border-radius: 10px; font-size: 14px; background: transparent; }
.studio-menu>button:hover, .studio-menu-link:hover { background: #f3f3f3; }
.studio-menu .menu-icon { color: #777; }
.studio-menu .icon { width: 19px; height: 19px; }
.studio-menu small { color: #999; font-size: 11px; margin-top: 4px; }
.studio-menu-divider { background: #ededed; margin: 4px 9px; }
.menu-count { color: #888; background: #f2f2f2; font-size: 11px; }
.studio-subheading { padding: 7px 13px 8px; gap: 6px; }
.studio-subheading .icon-button { width: 40px; height: 44px; }
.studio-subheading h2 { color: #242424; font-size: 20px; font-weight: 600; }
.studio-detail-content { padding: 6px 22px 25px; scrollbar-color: #ddd transparent; }
.studio-detail-intro { color: #878787; font-size: 13px; line-height: 1.8; margin-bottom: 23px; }
.studio-new-session { min-height: 46px; margin-bottom: 15px; }
.studio-session-list { gap: 3px; margin: 7px -9px 0; }
.studio-session-card { padding: 14px 12px; gap: 0; border: 0; border-radius: 12px; background: transparent; }
.studio-session-card:hover { background: #f7f7f7; }
.studio-session-card.is-current { background: #f0f0f0; border: 0; }
.studio-session-symbol, .studio-session-card>.icon { display: none; }
.studio-session-heading { gap: 10px; }
.studio-session-heading strong { color: #292929; font-size: 15px; font-weight: 500; }
.studio-session-heading em, .studio-session-card:not(.is-current) em { background: transparent; color: #898989; font-size: 11px; padding: 0; }
.studio-session-excerpt { color: #838383; font-size: 13px; margin: 7px 0; }
.studio-session-copy small { color: #aaa; font-size: 11px; }
.studio-save-cta { background: #f4f4f4; border: 0; border-radius: 15px; color: #333; min-height: 73px; }
.studio-save-cta>span { font-size: 15px; }
.studio-save-cta small { color: #919191; font-size: 12px; }
.studio-save-cta>.icon:last-child { color: #999; }
.studio-saved-list { gap: 0; margin-top: 20px; }
.studio-saved-card { border: 0; border-bottom: 1px solid #eee; padding: 17px 0; border-radius: 0; gap: 15px; }
.studio-save-thumb { height: 65px; width: 65px; border-radius: 13px; }
.studio-saved-copy h3 { color: #333; font-size: 15px; }
.studio-saved-copy p { color: #999; font-size: 12px; }
.studio-saved-copy button { color: #333; font-size: 13px; min-height: 40px; }
.studio-saved-current { color: #777; font-size: 12px; margin-top: 8px; }
.studio-detail-footnote { color: #888; font-size: 12px; }
.studio-version-state { margin: 0 0 18px; padding: 0 2px; }
.studio-version-state strong { display: block; color: #333; font-size: 14px; font-weight: 500; line-height: 1.6; }
.studio-version-state p { color: #888; font-size: 12px; line-height: 1.8; margin-top: 6px; }
.studio-version-state .studio-workspace-summary { color: #666; font-size: 13px; }
.studio-version-state>button { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 5px 0 0; background: transparent; color: #333; font-size: 13px; }
.studio-version-state>button .icon { width: 14px; height: 14px; }
.studio-saved-copy .studio-save-summary { color: #777; margin-top: 7px; font-size: 13px; line-height: 1.7; }
.studio-workspace-summary, .studio-save-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.studio-version-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.studio-version-tags>span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 5px; background: #f5f5f5; color: #777; font-size: 11px; line-height: 1.5; }
.studio-version-tags .icon { width: 12px; height: 12px; }
.studio-save-unfinished { display: grid; place-items: center; background: #f4f4f4; color: #999; }
.studio-save-unfinished .icon { width: 24px; height: 24px; }
.studio-menu>button:disabled { opacity: .6; cursor: default; background: transparent; }
.studio-save-cta:disabled { color: #777; cursor: default; background: #f7f7f7; }
.studio-save-cta:disabled>.icon { color: #aaa; }
.studio-saved-copy button:disabled { color: #aaa; cursor: default; }
.studio-restore-warning { margin-bottom: 16px; }
.studio-restore-actions { display: grid; gap: 9px; margin-top: 25px; }
.studio-restore-actions>.button { width: 100%; min-height: 46px; font-size: 14px; }
.studio-restore-cancel { background: transparent; color: #888; }
.studio-empty { padding: 45px 15px 30px; }
.studio-empty>span { color: #888; background: #f2f2f2; border-radius: 50%; }
.studio-empty h3 { color: #444; font-size: 17px; }
.studio-empty p { color: #999; font-size: 14px; }
.studio-queue-card { border: 0; background: #f5f5f5; border-radius: 15px; padding: 12px 16px 17px; }
.studio-queue-card-heading>span { color: #8b8b8b; font-size: 12px; }
.studio-queue-card-heading .icon-button { color: #777; }
.studio-queue-card p { color: #333; font-size: 15px; }
.studio-modal-hint { color: #999 !important; font-size: 12px !important; }
.studio-page .toast { bottom: 160px; }

@media (min-width: 768px) {
  [data-page=home] .app-header { display: none; }
}
@media (max-width: 1099px) {
  .game-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 767px) {
  .app-content { margin-left: 0; }
  .app-header { height: 64px; padding: 0 12px; }
  .header-leading { gap: 5px; }
  .header-brand { font-size: 20px; }
  .nav-toggle, .nav-close { display: inline-flex; }
  .sidebar { display: flex; width: min(310px,86vw); z-index: 30; padding-top: max(16px,env(safe-area-inset-top)); padding-bottom: max(12px,env(safe-area-inset-bottom)); transform: translateX(-100%); visibility: hidden; transition: transform .22s, visibility .22s; }
  .nav-open { overflow: hidden; }
  .nav-open .sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-top { margin-bottom: 20px; padding-left: 13px; }
  .sidebar-create, .nav-item, .sidebar-recents a { font-size: 15px; min-height: 47px; }
  .account-copy strong { font-size: 15px; }
  .workspace-main { padding: 0 20px calc(24px + env(safe-area-inset-bottom)); }
  .creation-section { margin: 30px auto 38px; scroll-margin-top: 80px; }
  .creation-section h1 { font-size: 28px; letter-spacing: -.7px; }
  .hero-description { font-size: 14px; margin-top: 8px; }
  .idea-suggestions { gap: 7px; margin-top: 12px; flex-wrap: nowrap; }
  .idea-suggestions button { font-size: 12px; padding: 10px; min-height: 44px; gap: 6px; white-space: nowrap; }
  .idea-suggestions button .icon { width: 15px; height: 15px; }
  .section-heading { margin-bottom: 8px; }
  .section-heading h2 { font-size: 18px; }
  .project-toolbar { margin-bottom: 14px; gap: 10px; }
  .project-sort-note { font-size: 11px; }
  .filter-tabs { gap: 2px; }
  .filter-tabs button { font-size: 12px; padding: 9px 14px; min-height: 44px; white-space: nowrap; }
  .search-field { width: 138px; height: 44px; padding: 0 12px; gap: 7px; }
  .search-field input { font-size: 16px; }
  .search-field input::placeholder { font-size: 12px; }
  .search-field .icon { width: 15px; height: 15px; }
  .game-grid { gap: 23px 14px; }
  .cover-link { border-radius: 14px; }
  .game-card-info { padding-top: 10px; }
  .game-card-copy h3 { font-size: 14px; }
  .game-card-copy p { font-size: 11px; }
  .dimension-tag { top: 10px; left: 10px; font-size: 10px; }
  .project-task-badge { bottom: 8px; left: 8px; font-size: 10px; }
  .game-card:nth-child(2n+1) .project-menu { left: 0; right: auto; }
  .prompt-composer { margin-top: 22px; padding: 16px 14px 10px; border-radius: 24px; }
  .prompt-composer textarea { font-size: 16px; }
  .home-preview-note { margin-top: 36px; font-size: 10px; }
  .profile-main { padding: 27px 20px 40px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading>p:last-child { font-size: 14px; }
  .profile-card { padding: 21px; }
  .setting-row { padding: 19px 15px; }
  .settings-section .setting-copy>span { font-size: 12px; }
  .app-dialog { margin: auto 0 0; width: 100%; max-height: calc(100dvh - 20px); border-radius: 24px 24px 0 0; }
  .modal-header { padding-top: 22px; }
  .toast { font-size: 12px; bottom: 180px; max-width: calc(100vw - 40px); }
  .studio-page .ai-panel { left: 0; right: 0; bottom: 0; width: 100%; height: 76dvh; min-height: 390px; max-height: 100dvh; border: 0; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .studio-page.panel-expanded .ai-panel { width: 100%; height: 100dvh; bottom: 0; border-radius: 0; padding-top: env(safe-area-inset-top); }
  .studio-grip { height: 19px; min-height: 19px; }
  .studio-toolbar { min-height: 51px; padding: 0 8px 5px; gap: 4px; }
  .studio-tools .icon-button, .studio-conversations { width: 39px; height: 44px; }
  .studio-tools .studio-expand { display: none; }
  .studio-project-name { font-size: 16px; padding-left: 3px; }
  .studio-context-line { padding: 0 21px; min-height: 32px; }
  [data-session-title] { max-width: 290px; }
  .studio-page .conversation { padding: 23px 20px; gap: 27px; }
  .studio-page .assistant-message p, .studio-page .user-message p { font-size: 16px; line-height: 1.75; }
  .studio-welcome { padding: 30px 5px; }
  .studio-welcome h2 { font-size: 22px; }
  .studio-welcome p { font-size: 14px; }
  .studio-compose-area { padding: 0 11px; }
  .studio-composer { border-radius: 26px; padding: 13px 13px 8px; }
  .studio-composer textarea { font-size: 16px; min-height: 30px; }
  .studio-composer .send-button { width: 37px; height: 37px; }
  .studio-prototype-note { font-size: 10px; padding: 7px 8px 9px; }
  .studio-menu { top: 65px; right: 13px; }
  .studio-detail-content { padding: 7px 22px 24px; }
  .studio-detail-intro { font-size: 13px; }
  .studio-subheading { padding-top: 5px; }
  .studio-work-status { min-height: 40px; margin-bottom: 8px; }
  .studio-work-status>button { min-height: 36px; }
}
@media (max-width: 370px) {
  .workspace-main { padding-left: 16px; padding-right: 16px; }
  .creation-section h1 { font-size: 26px; }
  .hero-description { font-size: 13px; }
  .idea-suggestions { gap: 5px; }
  .idea-suggestions button { padding: 8px 8px; font-size: 11px; gap: 4px; }
  .idea-suggestions button .icon { width: 13px; height: 13px; }
  .filter-tabs { width: auto; }
  .filter-tabs button { padding: 9px 12px; }
  .search-field { width: 122px; }
  .game-card-copy h3 { font-size: 13px; }
  .studio-project-name { font-size: 15px; }
  .studio-page .conversation { padding-left: 17px; padding-right: 17px; }
  .studio-work-copy { font-size: 12px; }
  .studio-send-hint { font-size: 10px; }
}
@media (max-height: 620px) {
  .creation-section { margin-top: 20px; }
  .studio-page .ai-panel, .studio-page.panel-expanded .ai-panel { height: calc(100dvh - 12px); min-height: 0; bottom: 0; }
  .studio-grip { display: none; }
  .studio-toolbar { min-height: 46px; padding-top: 0; padding-bottom: 0; }
  .studio-context-line { min-height: 27px; }
  .studio-context-line>button { min-height: 27px; }
  .studio-suggestions, .studio-prototype-note { display: none; }
  .studio-compose-area { padding-bottom: 8px; }
  .studio-menu { top: 44px; max-height: calc(100dvh - 70px); overflow-y: auto; }
  .studio-work-status { min-height: 33px; }
  .studio-page .conversation { padding-top: 14px; padding-bottom: 14px; }
}
@media (max-height: 500px) and (min-width: 600px) {
  .studio-page .ai-panel, .studio-page.panel-expanded .ai-panel { width: 430px; left: auto; right: 12px; bottom: 6px; border-radius: 18px; padding-top: 0; }
  .app-dialog { width: min(440px,calc(100vw - 36px)); margin: auto; border-radius: 20px; }
}
.studio-page.keyboard-open .ai-panel { bottom: var(--keyboard-inset,0px); height: var(--visual-height,100dvh); min-height: 0; max-height: none; padding-top: 0; padding-bottom: 0; border-radius: 0; }
.keyboard-open .studio-toolbar { min-height: 46px; }
.keyboard-open .studio-context-line { min-height: 27px; }
.keyboard-open .studio-context-line>button { min-height: 27px; }
.keyboard-open .studio-prototype-note { display: none; }
.keyboard-open .studio-compose-area { padding-bottom: 8px; }
.keyboard-open .studio-menu { top: 44px; max-height: calc(var(--visual-height,100dvh) - 60px); overflow-y: auto; }

/* Conversation behavior: a continuous chat, with history in a left drawer. */
.studio-main { position: relative; display: flex; flex-direction: column; flex: 1; width: 100%; min-height: 0; }
.studio-chat-scroll { position: relative; display: flex; flex: 1; min-height: 0; }
.studio-page .conversation { width: 100%; gap: 24px; padding-top: 22px; padding-bottom: 26px; overflow-anchor: none; }
.studio-page .conversation.is-empty { justify-content: center; }
.studio-page .studio-welcome { padding: 20px 0 35px; }
.studio-welcome h2 { font-size: 25px; letter-spacing: -.6px; margin-bottom: 12px; }
.studio-welcome p { font-size: 14px; color: #888; }
.studio-empty-suggestions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 28px 0 0; }
.studio-empty-suggestions button { display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #e9e9e9; border-radius: 24px; padding: 12px 17px; background: #fff; color: #666; font-size: 14px; min-height: 44px; }
.studio-empty-suggestions button:hover { background: #f7f7f7; }
.studio-empty-suggestions .icon { width: 16px; height: 16px; color: #999; }
.studio-page .assistant-message .studio-reply-text, .studio-page .assistant-message .studio-stream-text { white-space: normal; font-size: 16px; line-height: 1.8; }
.studio-stream-message { min-height: 45px; padding-bottom: 24px; }
.studio-thinking { display: flex; align-items: center; gap: 10px; height: 38px; color: #888; font-size: 15px; }
.studio-thinking>span { display: block; width: 10px; height: 10px; border-radius: 50%; background: #333; animation: chat-breathe 1.3s ease-in-out infinite; }
.studio-stream-text:empty { display: none; }
.studio-stream-message.has-text .studio-stream-text:after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #222; margin: 0 0 2px 5px; animation: chat-breathe 1s ease-in-out infinite; }
.studio-message-actions { display: flex; align-items: center; gap: 1px; margin: 8px 0 0 -8px; color: #777; }
.studio-message-actions>button, .studio-reply-versions>button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; background: transparent; color: #777; border-radius: 9px; }
.studio-message-actions button:hover { background: #f3f3f3; color: #222; }
.studio-message-actions button:disabled { opacity: .3; cursor: default; background: transparent; }
.studio-message-actions .icon { width: 18px; height: 18px; }
.studio-user-block { gap: 0; }
.studio-user-actions { margin: 3px -5px -12px 0; }
.studio-user-actions>button { width: 32px; height: 32px; color: #999; }
.studio-user-actions .icon { width: 16px; height: 16px; }
.studio-user-actions>[data-edit-message] { width: 40px; height: 40px; }
.studio-page .studio-user-block.is-editing { align-self: stretch; width: 100%; }
.studio-message-edit { box-sizing: border-box; align-self: stretch; width: 100%; padding: 16px; border-radius: 20px; background: #f3f3f3; color: #222; }
.studio-message-edit textarea { display: block; box-sizing: border-box; width: 100%; min-height: 104px; max-height: 42dvh; padding: 0; border: 0; outline: none; resize: vertical; background: transparent; color: inherit; font: inherit; font-size: 16px; line-height: 1.65; }
.studio-message-edit:focus-within { box-shadow: 0 0 0 1px #ccc; }
.studio-message-edit-note { margin: 12px 0; color: #777; font-size: 12px; line-height: 1.6; }
.studio-message-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.studio-message-edit-actions button { min-height: 44px; padding: 10px 16px; border-radius: 24px; background: #fff; color: #333; font-size: 14px; white-space: nowrap; }
.studio-message-edit-actions [data-resend-message] { background: #252525; color: #fff; }
.studio-message-edit-actions button:disabled { opacity: .4; cursor: default; }
.studio-reply-versions { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.studio-reply-versions>button { width: 28px; }
.studio-stopped-label { display: block; color: #8b8b8b; font-size: 13px; margin-top: 9px; }
.studio-play-reply { display: inline-flex; align-items: center; gap: 8px; min-height: 43px; padding: 9px 16px; margin-top: 16px; border: 1px solid #dedede; border-radius: 24px; background: #fff; color: #222; font-size: 14px; }
.studio-play-reply:hover { background: #f5f5f5; }
.studio-play-reply .icon { height: 16px; width: 16px; }
.studio-page .assistant-message .studio-update-note { margin-top: 8px; font-size: 12px; line-height: 1.6; color: #999; }
.studio-preview-status .studio-work-copy { min-width: 0; }
.studio-preview-status>button { flex-shrink: 0; color: #222; }
.studio-first-preview { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; background: #fafafa; text-align: center; }
.studio-first-preview-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 22px; border: 1px solid #e7e7e7; border-radius: 16px; background: #fff; color: #777; }
.studio-first-preview-mark .icon { width: 24px; height: 24px; }
.studio-first-preview h1 { font-size: 22px; font-weight: 500; color: #333; }
.studio-first-preview p { margin-top: 12px; font-size: 14px; line-height: 1.8; color: #888; }
.studio-playing-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #8a8a8a; margin-top: 13px; }
.studio-playing-label .icon { width: 14px; height: 14px; }
.studio-jump-latest { position: absolute; left: calc(50% - 19px); bottom: 12px; height: 38px; width: 38px; display: grid; place-items: center; background: #fff; border: 1px solid #e2e2e2; border-radius: 50%; box-shadow: 0 2px 8px #0001; color: #333; z-index: 2; }
.studio-jump-latest .icon { height: 18px; width: 18px; transform: rotate(180deg); }
.studio-compose-area { position: relative; background: #fff; }
.studio-attach-menu { position: absolute; left: 14px; bottom: calc(100% + 7px); padding: 7px; background: #fff; border: 1px solid #e8e8e8; box-shadow: 0 5px 25px #0002; border-radius: 17px; z-index: 6; }
.studio-attach-menu button { display: flex; gap: 12px; align-items: center; min-height: 45px; padding: 10px 13px; background: transparent; color: #333; font-size: 14px; border-radius: 10px; }
.studio-attach-menu button:hover { background: #f5f5f5; }
.studio-attach-menu .icon { height: 21px; width: 21px; }
.studio-attach-menu button:disabled { opacity: .4; cursor: default; }
.studio-page .studio-attach-menu > p { margin: 7px 13px 5px; color: #999; font-size: 11px; line-height: 1.5; }
.studio-draft-images { display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; max-width: 100%; padding: 5px 2px 10px; }
.studio-draft-images[hidden] { display: none; }
.studio-draft-image { position: relative; flex: 0 0 82px; min-width: 0; }
.studio-draft-preview { position: relative; display: grid; place-items: center; width: 82px; height: 82px; padding: 0; border: 1px solid #dedede; border-radius: 13px; overflow: hidden; background: #fff; color: #888; }
button.studio-draft-preview { cursor: zoom-in; }
.studio-draft-preview > img { width: 100%; height: 100%; object-fit: cover; }
.studio-draft-image > span { display: block; color: #888; font-size: 11px; line-height: 1.5; padding: 5px 2px 0; }
.studio-remove-image { position: absolute; z-index: 1; top: -5px; right: -5px; display: grid; place-items: center; width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: transparent; }
.studio-remove-image .icon { width: 22px; height: 22px; padding: 3px; border: 1px solid #e5e5e5; border-radius: 50%; background: #fff; color: #666; }
.studio-upload-state { position: absolute; inset: 0; display: grid; place-items: center; background: #ffffffd9; color: #777; font-size: 12px; }
.studio-upload-state > button { padding: 10px; border-radius: 8px; background: transparent; color: #444; text-decoration: underline; text-underline-offset: 3px; }
.studio-draft-image.has-error > span { color: #a34b45; }
.studio-draft-images button:focus-visible { outline: 2px solid #555; outline-offset: 2px; }
.studio-user-block > .studio-generated-images { justify-content: flex-end; margin: 0 0 10px; }
.studio-user-block > .studio-generated-images .studio-generated-image { width: min(100%, 220px); }
.studio-user-block > .studio-generated-images.has-many { width: min(100%, 320px); gap: 10px; }
.studio-user-block > .studio-generated-images.has-many .studio-generated-image { width: calc(50% - 5px); }
.studio-user-block > .studio-generated-images.has-many .studio-image-thumb { height: 160px; }
.studio-user-block > .studio-generated-images.has-many .studio-image-thumb img { max-height: 160px; }
.studio-pending-item .studio-generated-images { margin: 8px 0; gap: 8px; }
.studio-pending-item .studio-generated-image { width: 68px; }
.studio-pending-item .studio-image-thumb { min-height: 68px; height: 68px; }
.studio-pending-item .studio-image-thumb img { height: 100%; object-fit: cover; }
.studio-pending-item figcaption, .studio-pending-item .studio-image-expand { display: none; }
.studio-composer .send-button { width: 40px; height: 40px; }
.studio-composer .send-button.is-stopping:hover { background: #444; }
.studio-work-status { margin-bottom: 3px; padding: 0 6px; }
.studio-drawer-backdrop { position: absolute; inset: 0; z-index: 10; background: #0005; padding: 0; }
.studio-session-drawer { display: flex; flex-direction: column; position: absolute; inset: 0 auto 0 0; width: min(300px,calc(100% - 48px)); padding: 14px 12px 12px; background: #f9f9f9; z-index: 11; transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility .22s; }
.history-open .studio-session-drawer { transform: translateX(0); visibility: visible; }
.studio-drawer-heading { display: flex; align-items: center; justify-content: space-between; min-height: 42px; margin: 0 4px 8px 12px; }
.studio-drawer-heading>span { font-size: 18px; font-weight: 600; }
.studio-drawer-heading .icon-button { width: 42px; height: 42px; color: #333; }
.studio-drawer-new, .studio-drawer-footer>a, .studio-drawer-footer>button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; min-height: 47px; background: transparent; border-radius: 11px; color: #292929; font-size: 15px; text-align: left; }
.studio-drawer-new:hover, .studio-drawer-footer>a:hover, .studio-drawer-footer>button:hover { background: #ededed; }
.studio-drawer-new .icon, .studio-drawer-footer .icon { width: 20px; height: 20px; }
.studio-session-search { display: flex; align-items: center; gap: 9px; padding: 10px 13px; background: #eee; border-radius: 24px; min-height: 43px; margin: 10px 2px 5px; flex-shrink: 0; }
.studio-session-search .icon { width: 18px; height: 18px; color: #888; }
.studio-session-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #333; font-size: 16px; }
.studio-session-search input::placeholder { font-size: 14px; color: #999; }
.studio-history { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 16px; scrollbar-width: thin; }
.studio-history-group { font-size: 12px; color: #8b8b8b; padding: 14px 12px 6px; }
.studio-history-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 47px; padding: 12px; background: transparent; border-radius: 11px; text-align: left; color: #333; font-size: 15px; }
.studio-history-item>span:first-child { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-history-item:hover { background: #efefef; }
.studio-history-item.is-current { background: #e9e9e9; }
.studio-history-item>small { color: #999; font-size: 11px; }
.studio-history-working { height: 7px; width: 7px; background: #444; border-radius: 50%; animation: chat-breathe 1.3s ease-in-out infinite; }
.studio-history-empty { color: #999; padding: 35px 12px; font-size: 14px; text-align: center; }
.studio-drawer-footer { border-top: 1px solid #e9e9e9; padding-top: 7px; flex-shrink: 0; }
@keyframes chat-breathe { 50% { opacity: .35; } }
@media (max-width: 767px) {
  .studio-page .ai-panel, .studio-page.panel-expanded .ai-panel { height: 100dvh; max-height: 100dvh; min-height: 0; width: 100%; left: 0; right: 0; bottom: 0; border-radius: 0; padding-top: env(safe-area-inset-top); }
  .studio-grip, .studio-menu>.studio-expand { display: none; }
  .studio-toolbar { min-height: 57px; padding: 4px 7px; }
  .studio-project-name { font-size: 16px; }
  .studio-page .conversation { gap: 23px; padding: 22px 20px 25px; }
  .studio-page .studio-welcome { padding-bottom: 55px; }
  .studio-welcome h2 { font-size: 25px; }
  .studio-menu { top: 53px; }
  .studio-session-drawer { padding-top: max(14px,env(safe-area-inset-top)); padding-bottom: max(12px,env(safe-area-inset-bottom)); }
  .studio-prototype-note { padding-bottom: 9px; }
}
@media (max-width: 370px) {
  .studio-page .conversation { padding-left: 16px; padding-right: 16px; }
  .studio-project-name { font-size: 14px; }
  .studio-tools .icon-button, .studio-conversations { width: 36px; }
  .studio-welcome h2 { font-size: 23px; }
  .studio-send-hint { font-size: 10px; }
}
@media (max-height: 620px) {
  .studio-toolbar { min-height: 48px; padding-top: 0; padding-bottom: 0; }
  .studio-empty-suggestions { display: none; }
  .studio-page .studio-welcome { padding: 10px 0; }
}
.studio-page.keyboard-open .ai-panel { height: var(--visual-height,100dvh); bottom: var(--keyboard-inset,0px); padding-top: 0; }
@media (prefers-reduced-motion: reduce) {
  .studio-session-drawer { transition: none; }
  .studio-thinking>span, .studio-stream-message.has-text .studio-stream-text:after, .studio-history-working { animation: none; }
}
.reduced-motion .studio-thinking>span, .reduced-motion .studio-stream-message.has-text .studio-stream-text:after, .reduced-motion .studio-history-working { animation: none; }

/* Agent tasks keep the conversation simple, with optional progress and queued follow-ups. */
.studio-agent-activity { margin: 0 0 16px; color: #777; }
.studio-agent-activity>summary { display: flex; align-items: center; gap: 9px; width: fit-content; min-height: 42px; font-size: 14px; cursor: pointer; list-style: none; }
.studio-agent-activity>summary::-webkit-details-marker { display: none; }
.studio-agent-activity>summary>.icon { width: 15px; height: 15px; color: #999; transition: transform .15s; }
.studio-agent-activity[open]>summary>.icon { transform: rotate(180deg); }
.studio-activity-symbol { display: grid; place-items: center; width: 20px; height: 20px; color: #777; }
.studio-activity-symbol>.icon { width: 17px; height: 17px; }
.studio-activity-symbol>i { width: 8px; height: 8px; border-radius: 50%; background: #333; animation: chat-breathe 1.3s ease-in-out infinite; }
.studio-agent-activity ol { list-style: none; display: grid; gap: 4px; padding: 4px 0 7px 2px; margin: 0; }
.studio-agent-activity li { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 13px; color: #aaa; }
.studio-agent-activity li.is-done { color: #858585; }
.studio-agent-activity li.is-current { color: #333; }
.studio-agent-activity [data-step-mark] { display: grid; place-items: center; width: 17px; height: 17px; }
.studio-agent-activity [data-step-mark]>.icon { width: 13px; height: 13px; }
.studio-agent-activity [data-step-mark]>i { width: 5px; height: 5px; border-radius: 50%; background: #ccc; }
.studio-agent-activity .is-current [data-step-mark]>i { background: #444; }
.studio-page .assistant-message .studio-activity-note { font-size: 12px; color: #999; padding: 4px 0 5px 29px; }
.studio-stream-message { min-height: 58px; padding-bottom: 0; }
.studio-stream-message .studio-agent-activity { margin-bottom: 10px; }
.studio-steering-note { font-size: 11px; color: #999; }
.studio-message-actions>.studio-resume-task { width: auto; padding: 0 9px; font-size: 12px; }
.studio-pending { border: 1px solid #e7e7e7; border-radius: 18px; background: #fafafa; padding: 4px 12px 6px; margin: 0 1px 10px; }
.studio-pending-heading { display: flex; align-items: center; justify-content: space-between; min-height: 32px; gap: 10px; font-size: 12px; color: #777; }
.studio-pending-heading>small { color: #aaa; font-size: 11px; }
.studio-pending-heading>button { font-size: 12px; color: #333; background: transparent; min-height: 34px; padding: 3px 2px; }
.studio-pending-list { max-height: 144px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.studio-pending-item+.studio-pending-item { border-top: 1px solid #e9e9e9; padding-top: 7px; }
.studio-pending-item>p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 1.8; color: #444; }
.studio-pending-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; min-height: 34px; }
.studio-pending-actions>button { display: flex; align-items: center; justify-content: center; width: 32px; height: 34px; padding: 0; border-radius: 8px; background: transparent; color: #888; }
.studio-pending-actions>button:hover { background: #eee; color: #222; }
.studio-pending-actions .icon { width: 16px; height: 16px; }
.studio-pending-actions>.studio-steer-button { width: auto; gap: 3px; padding: 0 6px 0 0; margin-right: auto; color: #555; font-size: 12px; }
.studio-pending-actions>span { margin-right: auto; color: #999; font-size: 11px; }
.studio-stop-task { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: #e9e9e9; color: #222; flex-shrink: 0; }
.studio-stop-task:hover { background: #dedede; }
.studio-stop-task .icon { width: 21px; height: 21px; }
.studio-compose-actions .send-button { margin-left: 0; }
.studio-send-hint { min-width: 0; }
.conversation:focus-visible { outline: 2px solid #bbb; outline-offset: -2px; }
@media (max-width: 767px) {
  .studio-agent-activity>summary { min-height: 44px; }
  .studio-pending-actions>button { width: 38px; height: 38px; }
  .studio-pending-actions>.studio-steer-button { width: auto; }
  .studio-pending-list { max-height: 150px; }
}
@media (max-height: 620px) { .studio-pending-list { max-height: 70px; } }
@media (prefers-reduced-motion: reduce) { .studio-activity-symbol>i { animation: none; } }
.reduced-motion .studio-activity-symbol>i { animation: none; }

/* Interrupted tasks and lost connections have separate recovery paths. */
.studio-connection { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 11px 20px; border-bottom: 1px solid #ebe7df; background: #faf8f4; }
.studio-connection>div { min-width: 0; }
.studio-connection strong { display: block; color: #4f4a40; font-size: 13px; font-weight: 550; }
.studio-connection p { margin: 4px 0 0; color: #807a70; font-size: 12px; line-height: 1.6; }
.studio-connection>button { flex-shrink: 0; min-height: 40px; padding: 0 10px; border-radius: 10px; background: #eeeae3; color: #4f4a40; font-size: 12px; }
.studio-connection>button:hover { background: #e5e0d6; }
.studio-activity-symbol.is-failed { color: #a35f54; }
.studio-message-actions>.studio-retry-task { width: auto; min-height: 40px; padding: 0 12px; border: 1px solid #e6e6e6; border-radius: 20px; color: #444; font-size: 13px; }
.studio-retried-label { padding: 0 5px; color: #999; font-size: 12px; }
.studio-connection>button:disabled, .studio-pending button:disabled, .studio-stop-task:disabled, .studio-message-actions>button:disabled { opacity: .4; cursor: default; }
.ai-panel[data-connection="offline"] .studio-stream-text:after, .ai-panel[data-connection="syncing"] .studio-stream-text:after { display: none; }

/* Markdown shares the quiet chat typography, with overflow contained per block. */
.studio-generated-images { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0 8px; }
.studio-generated-image { width: min(100%, 256px); min-width: 0; margin: 0; }
.studio-generated-image > button { display: block; width: 100%; padding: 0; border: 1px solid #e9e9e9; border-radius: 16px; overflow: hidden; background: #fafafa; cursor: zoom-in; }
.studio-image-thumb, .studio-image-stage { background-color: #fafafa; background-image: conic-gradient(#ededed 25%, transparent 0 50%, #ededed 0 75%, transparent 0); background-size: 20px 20px; }
.studio-image-thumb { position: relative; display: flex; align-items: center; justify-content: center; min-height: 128px; }
.studio-image-thumb img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.studio-image-thumb img[hidden], .studio-image-stage img[hidden] { display: none; }
.studio-image-expand { position: absolute; right: 9px; bottom: 9px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #ffffffeb; color: #666; }
.studio-image-expand .icon { width: 16px; height: 16px; }
.studio-generated-image figcaption { padding: 9px 2px 0; color: #888; font-size: 12px; line-height: 1.5; }
.studio-image-viewer { width: min(900px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; border-radius: 20px; background: #fff; color: #303030; box-shadow: 0 20px 80px #0003; overflow: auto; overscroll-behavior: contain; }
.studio-image-viewer::backdrop { background: #0009; }
.studio-image-viewer > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 12px 8px 20px; font-size: 15px; }
.studio-image-viewer [data-close-image] { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #f5f5f5; color: #555; }
.studio-image-stage { display: flex; justify-content: center; align-items: center; min-height: 160px; margin: 0 16px; border: 1px solid #eee; border-radius: 10px; overflow: hidden; }
.studio-image-stage img { display: block; max-width: 100%; max-height: calc(100dvh - 178px); width: auto; height: auto; object-fit: contain; }
.studio-page .studio-image-viewer > p { margin: 14px 20px 18px; font-size: 13px; line-height: 1.5; color: #888; text-align: center; }
.studio-image-error { padding: 24px; color: #777; font-size: 13px; line-height: 1.7; text-align: center; }
.studio-generated-image > button:focus-visible, .studio-image-viewer button:focus-visible { outline: 2px solid #555; outline-offset: 3px; }
.studio-page .assistant-message, .studio-page .studio-user-block, .studio-page .user-message { min-width: 0; max-width: 100%; }
.studio-page .studio-markdown { min-width: 0; max-width: 100%; color: #242424; font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; white-space: normal; }
.studio-page .studio-markdown p { font-size: inherit; line-height: inherit; white-space: normal; margin: 0 0 .85em; }
.studio-markdown > :first-child { margin-top: 0; }
.studio-markdown > :last-child { margin-bottom: 0; }
.studio-markdown h1, .studio-markdown h2, .studio-markdown h3, .studio-markdown h4, .studio-markdown h5, .studio-markdown h6 { margin: 1.25em 0 .55em; line-height: 1.45; font-weight: 650; letter-spacing: -.2px; }
.studio-markdown h1 { font-size: 23px; }
.studio-markdown h2 { font-size: 21px; }
.studio-markdown h3 { font-size: 18px; }
.studio-markdown h4, .studio-markdown h5, .studio-markdown h6 { font-size: 16px; }
.studio-markdown strong { font-weight: 650; }
.studio-markdown em { font-style: italic; }
.studio-markdown ul, .studio-markdown ol { margin: .65em 0 1em; padding-left: 1.5em; }
.studio-markdown ul { list-style: disc outside; }
.studio-markdown ol { list-style: decimal outside; }
.studio-markdown ul ul { list-style-type: circle; }
.studio-markdown li { padding-left: .15em; margin: .25em 0; }
.studio-markdown li > ul, .studio-markdown li > ol { margin: .35em 0; }
.studio-page .studio-markdown li > p { margin: .35em 0; }
.studio-markdown blockquote { margin: 1em 0; padding: .1em 0 .1em 14px; border-left: 3px solid #d6d6d6; color: #666; }
.studio-page .studio-markdown blockquote p { color: inherit; }
.studio-markdown blockquote > :last-child { margin-bottom: 0; }
.studio-markdown hr { margin: 1.4em 0; border: 0; border-top: 1px solid #e5e5e5; }
.studio-markdown a { color: #315f9b; text-decoration: underline; text-underline-offset: 3px; }
.studio-markdown a:focus-visible, .studio-code-toolbar button:focus-visible { outline: 2px solid #777; outline-offset: 3px; border-radius: 3px; }
.studio-markdown code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; padding: .12em .35em; border-radius: 5px; background: #f0f0f0; overflow-wrap: anywhere; }
.studio-code-block { margin: 1em 0; max-width: 100%; overflow: hidden; border: 1px solid #e7e7e7; border-radius: 12px; background: #f8f8f8; }
.studio-code-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; padding-left: 14px; background: #f1f1f1; border-bottom: 1px solid #e7e7e7; color: #666; font-size: 12px; }
.studio-code-toolbar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-code-toolbar button { min-height: 40px; flex-shrink: 0; padding: 0 14px; border: 0; background: transparent; color: #555; font-size: 12px; }
.studio-code-toolbar button:hover { background: #e7e7e7; }
.studio-code-block pre { display: block; max-width: 100%; margin: 0; padding: 14px; overflow-x: auto; overscroll-behavior-x: contain; white-space: pre; line-height: 1.65; tab-size: 2; }
.studio-code-block pre code { display: block; width: max-content; min-width: 100%; padding: 0; border-radius: 0; background: transparent; font-size: 13px; white-space: pre; overflow-wrap: normal; word-break: normal; }
.studio-md-table { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin: 1em 0; }
.studio-md-table table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 14px; }
.studio-md-table th, .studio-md-table td { padding: 9px 13px; border: 1px solid #e3e3e3; text-align: left; white-space: nowrap; }
.studio-md-table th { font-weight: 600; background: #f6f6f6; }
.studio-user-block .studio-code-block { background: #fff; }
.studio-user-block .studio-markdown code { background: #e6e6e6; }
.studio-user-block .studio-code-block code { background: transparent; }
.studio-prototype-note { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding-top: 2px; padding-bottom: 5px; }
.studio-prototype-note>button { min-height: 32px; padding: 0 3px; color: #888; background: transparent; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.studio-prototype-note>button:hover { color: #333; }
.studio-demo-intro { margin: 0 0 18px; color: #888; font-size: 13px; }
.studio-demo-actions { display: grid; gap: 10px; }
.studio-demo-action { display: grid; gap: 6px; width: 100%; min-height: 78px; padding: 14px 16px; text-align: left; border: 1px solid #e7e7e7; border-radius: 14px; background: #fff; color: #333; }
.studio-demo-action strong { font-size: 14px; font-weight: 550; }
.studio-demo-action small { font-size: 12px; color: #888; }
.studio-demo-action:hover { background: #f7f7f7; }
.studio-demo-action:disabled { opacity: .4; cursor: default; }
@media (max-width: 767px) { .studio-connection { padding: 10px 16px; } }
@media (max-height: 620px) { .studio-prototype-note { display: none; } }
