:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #f2f2ef;
  --text: #20201e;
  --muted: #757570;
  --line: #e4e4df;
  --line-strong: #d6d6d0;
  --accent: #292927;
  --success: #228155;
  --danger: #c64a45;
  --shadow: 0 18px 60px rgba(31, 31, 27, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-width: 320px;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
textarea { resize: vertical; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 248, .9);
  backdrop-filter: blur(18px);
  z-index: 10;
}
.brand-block { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; color: #fff; background: #242422; font-size: 18px;
}
.brand-block strong, .brand-block small { display: block; }
.brand-block strong { font-size: 15px; font-weight: 680; letter-spacing: 0; }
.brand-block small { margin-top: -2px; color: var(--muted); font-size: 10px; letter-spacing: 0; text-transform: uppercase; }
.view-switch { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 11px; background: #ecece8; }
.view-tab {
  min-height: 34px; display: flex; align-items: center; gap: 7px;
  padding: 0 14px; border: 0; border-radius: 8px; color: #6f6f69; background: transparent; font-size: 13px;
}
.view-tab.active { color: var(--text); background: #fff; box-shadow: 0 1px 4px rgba(30,30,26,.09); font-weight: 650; }
.view-badge { min-width: 18px; padding: 1px 5px; border-radius: 99px; color: #696963; background: #e9e9e5; font-size: 10px; text-align: center; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 11px; min-width: 0; }
.core-status { display: flex; align-items: center; gap: 7px; min-width: 0; color: #686863; font-size: 12px; }
.core-status i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #35a46f; box-shadow: 0 0 0 3px rgba(53,164,111,.11); }
.core-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button {
  min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: #555550; background: #fff;
}
.settings-button span { font-size: 13px; }

.app-view { min-height: 0; flex: 1; }
.chat-view { overflow: hidden; }
.conversation-shell {
  width: min(100%, 940px); height: calc(100vh - 64px); margin: 0 auto;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 0 28px;
}
.conversation-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 30px 4px 16px; }
.eyebrow { display: block; margin-bottom: 5px; color: #999990; font-size: 10px; font-weight: 700; letter-spacing: 0; }
.conversation-head h1, .tasks-header h1 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: 0; font-weight: 680; }
.quiet-button { padding: 7px 10px; border: 0; border-radius: 8px; color: #73736e; background: transparent; font-size: 12px; }
.quiet-button:hover { color: var(--text); background: #ecece8; }
.brain-chat-log { min-height: 0; overflow-y: auto; padding: 18px 4px 34px; scroll-behavior: smooth; }
.brain-welcome { width: min(680px, 100%); margin: max(7vh, 32px) auto 0; text-align: center; }
.welcome-mark {
  width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 18px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 20px rgba(31,31,27,.06); font-size: 21px;
}
.brain-welcome h2 { margin: 0; font-size: 34px; letter-spacing: 0; font-weight: 630; }
.brain-welcome p { width: min(560px, 100%); margin: 14px auto 24px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.suggestion-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.suggestion-list button {
  min-height: 72px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px;
  color: #565651; background: rgba(255,255,255,.78); font-size: 13px; line-height: 1.45; text-align: left;
}
.suggestion-list button:hover { border-color: var(--line-strong); background: #fff; transform: translateY(-1px); }
.brain-message { width: fit-content; max-width: min(78%, 700px); margin: 0 0 20px; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.75; }
.brain-message.user { margin-left: auto; padding: 10px 15px; border-radius: 16px 16px 4px 16px; color: #fff; background: #292927; }
.brain-message.assistant { margin-right: auto; padding: 0 4px 0 16px; border-left: 2px solid #d7d7d1; color: #353532; }
.composer-dock { position: relative; padding: 8px 4px 18px; background: linear-gradient(180deg, rgba(247,247,245,0), var(--bg) 17%); }
.active-config-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 8px; }
.active-config-strip button { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0; border: 0; color: #696964; background: transparent; font-size: 11px; }
.active-config-strip button i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #35a46f; }
.active-config-strip button span, .active-config-strip button b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-config-strip button b { color: #4b4b47; font-weight: 650; }
.sync-status { color: #8a8a84; font-size: 11px; white-space: nowrap; }
.sync-status.syncing { color: #956f25; }
.sync-status.success { color: var(--success); }
.sync-status.fail { color: var(--danger); }
.composer { padding: 13px 13px 9px 16px; border: 1px solid #d9d9d3; border-radius: 18px; background: #fff; box-shadow: 0 10px 34px rgba(31,31,27,.08); }
.composer:focus-within { border-color: #aaa9a2; box-shadow: 0 10px 38px rgba(31,31,27,.11), 0 0 0 3px rgba(50,50,45,.04); }
.composer textarea { width: 100%; min-height: 56px; max-height: 190px; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; line-height: 1.65; }
.composer textarea::placeholder { color: #aaa9a3; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 3px; }
.composer-foot > span { color: #9a9a94; font-size: 10px; }
.send-button { width: 36px; height: 36px; border: 0; border-radius: 11px; color: #fff; background: #282826; font-size: 19px; font-weight: 700; }
.send-button:disabled { opacity: .45; cursor: wait; }
.storage-note { margin: 7px 0 0; color: #9a9a94; font-size: 10px; text-align: center; }

.tasks-view { height: calc(100vh - 64px); overflow-y: auto; padding: 34px 28px 70px; }
.tasks-shell { width: min(1100px, 100%); margin: 0 auto; }
.tasks-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.tasks-header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.empty-result {
  min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px dashed #dadad4; border-radius: 20px; color: var(--muted); background: rgba(255,255,255,.55); text-align: center;
}
.empty-icon { margin-bottom: 16px; color: #aaa9a3; font-size: 32px; }
.empty-result strong { color: #555550; font-size: 16px; }
.empty-result small { margin-top: 6px; font-size: 12px; }
.task-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 15px; }
.task-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(31,31,27,.035); }
.task-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 16px; border-bottom: 1px solid #eeeeea; background: #fbfbfa; }
.task-card-title { min-width: 0; }
.task-card-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.task-card-title span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.task-card-side { display: flex; align-items: center; gap: 8px; }
.task-card-side button { border: 0; color: #898983; background: transparent; font-size: 11px; }
.task-status { padding: 4px 8px; border-radius: 99px; color: #966a16; background: #fff2cd; font-size: 10px; font-weight: 700; }
.task-status.success { color: #19784c; background: #e5f6ed; }
.task-status.failed { color: #a13d39; background: #feeceb; }
.task-prompt { padding: 12px 16px; border-bottom: 1px solid #f0f0ed; color: #62625d; font-size: 12px; line-height: 1.6; }
.task-progress { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; color: var(--muted); font-size: 12px; }
.task-spinner { width: 25px; height: 25px; border: 3px solid #e5e5e0; border-top-color: #343431; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.task-images { display: grid; gap: 10px; padding: 11px; }
.task-image { overflow: hidden; border-radius: 11px; background: #f4f4f1; }
.task-image img { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; }
.task-image a { display: block; margin: 8px; padding: 8px; border-radius: 8px; color: #fff; background: #292927; font-size: 12px; text-align: center; text-decoration: none; }
.task-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 15px; color: #93938d; font-size: 10px; }
.task-error, .error-box { white-space: pre-wrap; word-break: break-word; border: 1px solid #efcfcc; border-radius: 10px; color: #9f3d39; background: #fff4f3; font-size: 12px; }
.task-error { margin: 13px; padding: 12px; }
.error-box { margin: 18px 0; padding: 14px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(29,29,26,.24); backdrop-filter: blur(2px); }
.settings-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(480px, calc(100vw - 24px));
  display: grid; grid-template-rows: auto auto minmax(0,1fr); border-left: 1px solid var(--line); background: #fbfbfa; box-shadow: var(--shadow);
  transform: translateX(102%); transition: transform .22s ease;
}
.settings-drawer.open { transform: translateX(0); }
.drawer-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.drawer-header .eyebrow { margin-bottom: 1px; }
.drawer-header h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.drawer-header .icon-button { padding: 0; font-size: 23px; }
.settings-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.settings-tab { min-height: 36px; border: 0; border-radius: 8px; color: #777771; background: transparent; font-size: 12px; }
.settings-tab.active { color: #fff; background: #30302d; font-weight: 650; }
.drawer-scroll { min-height: 0; overflow-y: auto; padding: 22px 20px 38px; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.panel-intro { margin-bottom: 18px; }
.panel-intro h3 { margin: 0; font-size: 17px; }
.panel-intro p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.profile-toolbar { display: grid; grid-template-columns: 1fr 43px; gap: 8px; }
.panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 3px 2px 7px; }
.panel-actions span { color: #8c8c86; font-size: 10px; }
.panel-actions button { padding: 5px 6px; border: 0; color: #6f6f69; background: transparent; font-size: 11px; }
.danger-text { color: var(--danger) !important; }
.square-button { border: 1px solid var(--line-strong); border-radius: 10px; color: #494944; background: #fff; font-size: 20px; }
input, select, textarea { width: 100%; border: 1px solid #dcdcd6; border-radius: 10px; padding: 11px 12px; color: var(--text); background: #fff; outline: 0; font-size: 14px; transition: .16s; }
input:focus, select:focus, textarea:focus { border-color: #aaa9a2; box-shadow: 0 0 0 3px rgba(50,50,45,.05); }
.form-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.form-card > label { display: block; margin-top: 13px; }
.form-card > label:first-child { margin-top: 0; }
label > span, .field-label, .setting-label { display: block; margin: 0 0 6px; color: #4d4d48; font-size: 12px; font-weight: 650; }
.key-row { display: flex; align-items: center; gap: 7px; }
.key-row input { min-width: 0; flex: 1; }
.inline-button { height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: #666660; background: #fff; font-size: 11px; }
.remember { display: flex !important; align-items: center; gap: 7px; color: var(--muted); }
.remember input { width: 14px; accent-color: #30302d; }
.remember span { margin: 0; font-size: 11px; font-weight: 400; }
.action-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-top: 14px; }
.soft-button, .primary-button, .direct-generate-button { min-height: 42px; border-radius: 9px; font-size: 12px; font-weight: 650; }
.soft-button { border: 1px solid var(--line); color: #555550; background: #fff; }
.primary-button, .direct-generate-button { border: 0; color: #fff; background: #2e2e2b; }
.full-button, .direct-generate-button { width: 100%; }
.direct-generate-button { min-height: 48px; margin-top: 16px; font-size: 14px; }
.connection-status { display: block; margin-top: 9px; color: #91918b; font-size: 10px; }
.connection-status.success { color: var(--success); }
.connection-status.fail { color: var(--danger); }
.section-block { margin-top: 22px; }
.model-picker { scroll-margin-top: 14px; }
.settings-section { position: relative; }
.model-input-row { display: grid; grid-template-columns: 1fr 45px; }
.model-input { border-radius: 10px 0 0 10px; font-weight: 650; }
.model-toggle { border: 1px solid #dcdcd6; border-left: 0; border-radius: 0 10px 10px 0; color: #5b5b56; background: #fff; font-size: 20px; }
.model-dropdown { position: static; margin-top: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 6px 18px rgba(30,30,26,.06); }
.model-dropdown-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 5px 8px; border-bottom: 1px solid #eeeeea; }
.model-dropdown-head strong { font-size: 12px; }
.model-dropdown-head button { border: 0; color: #686862; background: transparent; font-size: 10px; }
.model-list { max-height: 280px; overflow-y: auto; padding-top: 5px; }
.model-option { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; color: #3e3e3a; background: #fff; text-align: left; font-size: 13px; }
.model-option:hover, .model-option.active { background: #f1f1ee; }
.model-option.active { font-weight: 650; }
.model-option small { flex: 0 0 auto; color: #969690; font-size: 10px; }
.model-option.active small { color: var(--success); font-weight: 700; }
.model-empty { padding: 18px 6px; color: var(--muted); font-size: 11px; text-align: center; }
.upload-box { min-height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #cecec8; border-radius: 11px; color: #71716b; background: #fff; }
.upload-box input { display: none; }
.upload-box strong { font-size: 12px; font-weight: 550; }
.upload-box small { margin-top: 3px; color: #9b9b95; font-size: 9px; }
.upload-icon { margin-bottom: 3px; font-size: 23px; }
.upload-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 7px; }
.upload-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
#prompt, #systemPrompt { min-height: 130px; line-height: 1.65; }
.prompt-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.prompt-tags button { padding: 5px 8px; border: 0; border-radius: 6px; color: #62625c; background: #eeeeea; font-size: 10px; }
.settings-summary { width: 100%; min-height: 48px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1.25fr; align-items: center; border: 0; border-radius: 10px; color: #464641; background: #eeeeea; font-size: 11px; }
.settings-summary i { width: 1px; height: 18px; background: #d7d7d1; }
.settings-summary b { font-weight: 500; }
.settings-popover { position: absolute; left: 0; right: 0; bottom: 58px; z-index: 13; max-height: 70vh; overflow-y: auto; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 16px 42px rgba(30,30,26,.15); }
.popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.popover-head button { border: 0; color: #777771; background: transparent; font-size: 21px; }
.setting-block { margin-top: 14px; }
.setting-block:first-of-type { margin-top: 0; }
.option-grid { display: grid; gap: 7px; }
.option-grid.ratios { grid-template-columns: repeat(4, 1fr); }
.option-grid.compact.three { grid-template-columns: repeat(3, 1fr); }
.option-grid.compact.four { grid-template-columns: repeat(4, 1fr); }
.option-grid.compact.six { grid-template-columns: repeat(3, 1fr); }
.choice { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 9px; color: #53534e; background: #fff; font-size: 11px; }
.choice.active { border-color: #363633; box-shadow: inset 0 0 0 1px #363633; color: #242422; }
.choice i { width: calc(12px * var(--r)); max-width: 22px; height: 12px; display: inline-block; border: 1px solid currentColor; border-radius: 3px; }
.computed { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.computed.invalid { color: var(--danger); }
.custom-size { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.custom-size label { font-size: 11px; }
.custom-size label input { width: auto; }
.custom-size > div { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.custom-size > div input { width: 104px; }
.builtin-skill, .skill-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.builtin-skill strong, .skill-item strong { display: block; font-size: 12px; }
.builtin-skill small, .skill-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.builtin-skill > span { color: var(--success); font-size: 10px; font-weight: 650; }
.skill-import-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 9px; }
.skill-import-row button { padding: 0 13px; border: 0; border-radius: 9px; color: #fff; background: #30302d; font-size: 11px; }
.skill-list { display: grid; gap: 7px; margin-top: 8px; }
.skill-item > div { min-width: 0; }
.skill-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-item-actions button { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: #686862; background: #fff; font-size: 9px; }
.skill-runtime-status { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; color: #24734d; background: #e9f5ed; font-size: 11px; font-weight: 700; }
.drawer-footer { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-outline-button { width: 100%; min-height: 42px; border: 1px solid #ebcecb; border-radius: 9px; color: var(--danger); background: #fff; font-size: 11px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; max-width: min(380px, calc(100vw - 32px)); padding: 11px 14px; border-radius: 9px; color: #fff; background: #292927; box-shadow: 0 10px 32px rgba(0,0,0,.18); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s; font-size: 12px; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .app-header { height: 58px; flex-basis: 58px; grid-template-columns: auto 1fr auto; padding: 0 12px; gap: 8px; }
  .brand-block small, .core-status, .settings-button span { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-block strong { font-size: 13px; }
  .view-switch { justify-self: center; }
  .view-tab { min-height: 32px; padding: 0 10px; font-size: 12px; }
  .icon-button { min-width: 35px; height: 35px; padding: 0; }
  .conversation-shell { height: calc(100vh - 58px); padding: 0 13px; }
  .conversation-head { padding: 18px 3px 9px; }
  .conversation-head h1 { font-size: 18px; }
  .conversation-head .eyebrow { display: none; }
  .brain-chat-log { padding-top: 8px; }
  .brain-welcome { margin-top: 5vh; }
  .brain-welcome h2 { font-size: 25px; }
  .brain-welcome p { font-size: 14px; }
  .suggestion-list { grid-template-columns: 1fr; }
  .suggestion-list button { min-height: 50px; text-align: center; }
  .brain-message { max-width: 90%; }
  .active-config-strip { display: block; }
  .sync-status { display: block; margin: 4px 0 0 13px; }
  .storage-note { display: none; }
  .composer-dock { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .tasks-view { height: calc(100vh - 58px); padding: 23px 13px 50px; }
  .task-queue { grid-template-columns: 1fr; }
  .settings-drawer { width: 100vw; }
  .drawer-scroll { padding: 18px 15px 32px; }
  .option-grid.ratios { grid-template-columns: repeat(3, 1fr); }
  .settings-popover { position: fixed; left: 10px; right: 10px; bottom: 12px; max-height: 82vh; }
}

/* 2026-07-29 final product theme — quiet creative workspace */
:root {
  --canvas: #f3f4f0;
  --canvas-deep: #eceee8;
  --panel: #fbfcfa;
  --panel-raised: #ffffff;
  --panel-sunken: #eef0eb;
  --ink: #191b18;
  --ink-muted: #62675f;
  --ink-subtle: #8a9087;
  --hairline: #d8ddd5;
  --hairline-strong: #bdc5ba;
  --brand: #24392d;
  --brand-hover: #17291f;
  --brand-soft: #e5eee7;
  --focus: #4e8062;
  --good: #278154;
  --warning-soft: #fbf2d8;
  --danger: #b7453d;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --overlay-shadow: 0 28px 80px rgba(22, 27, 22, .18);
  --floating-shadow: 0 16px 44px rgba(28, 35, 28, .10);
}

html { background: var(--canvas); }
body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(35, 57, 45, .025) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(rgba(35, 57, 45, .018) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--canvas);
  font-size: 17px;
}
button, input, select, textarea { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(78, 128, 98, .25);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .52; }

.app-header {
  height: 68px;
  flex-basis: 68px;
  padding: 0 clamp(18px, 2.6vw, 38px);
  border-color: rgba(193, 199, 190, .72);
  background: rgba(250, 251, 248, .9);
  box-shadow: 0 1px 0 rgba(255,255,255,.8);
}
.brand-block { gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border: 0; border-radius: 11px;
  color: #fff; background: var(--ink); box-shadow: 0 7px 20px rgba(18, 21, 18, .16);
}
.brand-mark svg { width: 19px; height: 19px; fill: currentColor; }
.brand-block strong { font-size: 17px; letter-spacing: 0; }
.brand-block small { color: var(--ink-subtle); font-size: 10px; letter-spacing: 0; }
.view-switch { padding: 4px; border-color: var(--hairline); border-radius: 12px; background: var(--panel-sunken); }
.view-tab { min-height: 38px; padding: 0 18px; border-radius: 9px; color: var(--ink-muted); font-size: 14px; font-weight: 590; }
.view-tab.active { color: var(--ink); background: var(--panel-raised); box-shadow: 0 2px 8px rgba(29,33,28,.08); }
.view-badge { background: #dde1da; color: var(--ink-muted); }
.core-status { color: var(--ink-muted); font-size: 13px; }
.core-status i { background: #39a96f; box-shadow: 0 0 0 4px rgba(57,169,111,.10); }
.icon-button { min-width: 44px; height: 44px; border-color: var(--hairline); border-radius: 11px; background: rgba(255,255,255,.74); }
.settings-button { gap: 7px; }
.settings-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.settings-button span { font-size: 14px; }

.chat-view { background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 30%); }
.conversation-shell { width: min(100%, 1040px); height: calc(100vh - 68px); padding: 0 28px; }
.conversation-head { min-height: 74px; padding: 20px 4px 12px; }
.conversation-head .eyebrow { display: none; }
.conversation-head h1 { font-size: 21px; letter-spacing: 0; }
.conversation-head .quiet-button { color: var(--ink-muted); }
.brain-chat-log { padding: 12px 4px 26px; scrollbar-gutter: stable; }
.brain-welcome {
  width: min(760px, 100%); margin: clamp(18px, 4vh, 46px) auto 20px; padding: 24px 28px 20px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.welcome-mark {
  width: 44px; height: 44px; margin-bottom: 16px; border: 1px solid var(--hairline); border-radius: 13px;
  color: var(--brand); background: var(--panel-raised); box-shadow: none;
}
.welcome-mark svg { width: 21px; height: 21px; fill: currentColor; }
.brain-welcome h2 { font-size: 38px; line-height: 1.16; letter-spacing: 0; }
.brain-welcome p { width: min(590px,100%); margin: 13px auto 22px; color: var(--ink-muted); font-size: 16px; line-height: 1.7; }
.suggestion-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.suggestion-list button {
  min-height: 68px; padding: 14px 34px 14px 15px; border: 1px solid var(--hairline); border-radius: 12px;
  color: #3d433d; background: rgba(255,255,255,.82); box-shadow: none; font-size: 14px; line-height: 1.45;
}
.suggestion-list button::after { top: 13px; right: 14px; color: #929a90; }
.suggestion-list button:hover { border-color: var(--hairline-strong); background: #fff; box-shadow: 0 8px 20px rgba(26,32,26,.06); }
.brain-message { max-width: min(86%, 760px); margin-bottom: 22px; font-size: 17px; line-height: 1.76; }
.brain-message.user { padding: 12px 17px; border-radius: 17px 17px 5px 17px; background: var(--ink); }
.brain-message.assistant { padding-left: 18px; border-left: 2px solid #b9c5ba; color: #2d302d; }
.generated-image-message { width: min(100%, 760px); }
.chat-result-images { grid-template-columns: repeat(auto-fill,minmax(112px,148px)) !important; }
.chat-result-image img { border: 1px solid var(--hairline); border-radius: 10px !important; }
.chat-result-image button { min-height: 36px; border-color: var(--hairline) !important; color: var(--ink-muted); }

.composer-dock { padding: 8px 4px max(17px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--canvas) 22%); }
.active-config-strip { min-height: 32px; padding: 0 7px 7px; }
.active-config-strip button { font-size: 13px; }
.active-config-strip button b { color: #303630; font-weight: 680; }
.sync-status { color: var(--ink-subtle); font-size: 12px; }
.composer {
  padding: 14px 14px 11px 17px; border: 1px solid var(--hairline-strong); border-radius: 17px;
  background: var(--panel-raised); box-shadow: var(--floating-shadow);
}
.composer:focus-within { border-color: #819386; box-shadow: 0 18px 50px rgba(29,37,30,.12), 0 0 0 3px rgba(78,128,98,.08); }
.composer textarea { min-height: 56px; max-height: 180px; color: var(--ink); font-size: 17px; line-height: 1.6; }
.composer textarea::placeholder { color: #9a9f98; }
.composer-foot { align-items: end; gap: 12px; }
.composer-tools { gap: 7px; }
.composer-tools button { min-height: 38px; border-color: var(--hairline); border-radius: 9px; background: #f7f8f5; font-size: 13px; }
.composer-tools > span { color: var(--ink-subtle); font-size: 12px; }
.send-button { width: 42px; height: 42px; border-radius: 11px; background: var(--brand); box-shadow: 0 7px 18px rgba(25,46,34,.18); }
.send-button:hover:not(:disabled) { background: var(--brand-hover); }
.storage-note { color: var(--ink-subtle); font-size: 11px; }

.tasks-view { height: calc(100vh - 68px); padding: 38px clamp(20px,4vw,56px) 70px; }
.tasks-shell { width: min(1240px,100%); }
.tasks-header { margin-bottom: 24px; }
.tasks-header h1 { font-size: 28px; letter-spacing: 0; }
.tasks-header p { color: var(--ink-muted); }
.task-queue { grid-template-columns: repeat(auto-fill,minmax(min(100%,340px),1fr)); gap: 16px; }
.task-card { border-color: var(--hairline); border-radius: var(--radius-md); background: var(--panel-raised); box-shadow: 0 7px 24px rgba(27,33,27,.045); }
.task-card-head { padding: 15px 16px; }
.task-card-title strong { font-size: 15px; }
.task-card-title span { color: var(--ink-muted); font-size: 12px; }
.task-card-side button { min-height: 34px; padding: 0 7px; }
.task-status { font-size: 11px; }
.task-prompt { padding: 12px 16px; color: var(--ink-muted); font-size: 13px; line-height: 1.58; }
.task-prompt-text.collapsed { -webkit-line-clamp: 3; }
.task-images { grid-template-columns: repeat(auto-fill,minmax(92px,124px)); gap: 9px; padding: 12px; }
.task-image { border-color: var(--hairline); border-radius: 10px; background: var(--panel-sunken); }
.task-image img { aspect-ratio: 1; object-fit: cover; }
.task-image-actions { gap: 5px; padding: 5px; }
.task-image-actions button, .task-image-actions a { min-height: 34px; font-size: 11px; }
.task-foot { border-color: #eceee9; color: var(--ink-subtle); }
.empty-result { min-height: 360px; border-color: var(--hairline); border-radius: var(--radius-lg); background: rgba(251,252,250,.65); }

.drawer-backdrop { background: rgba(19,24,20,.30); backdrop-filter: blur(4px); }
.settings-drawer { width: min(540px, calc(100vw - 22px)); border-left: 1px solid rgba(255,255,255,.8); background: var(--canvas); box-shadow: var(--overlay-shadow); }
.drawer-header { min-height: 74px; padding: 16px 21px; border-color: var(--hairline); background: rgba(250,251,248,.92); }
.drawer-header .eyebrow { display: none; }
.drawer-header h2 { font-size: 23px; letter-spacing: 0; }
.settings-tabs { position: sticky; top: 0; z-index: 2; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; padding: 10px 14px; border-color: var(--hairline); background: rgba(250,251,248,.94); backdrop-filter: blur(12px); }
.settings-tab { min-height: 42px; border-radius: 9px; color: var(--ink-muted); font-size: 13px; }
.settings-tab.active { color: #fff; background: var(--brand); }
.drawer-scroll { padding: 24px 22px 42px; }
.panel-intro h3 { font-size: 20px; letter-spacing: 0; }
.panel-intro p { color: var(--ink-muted); font-size: 13px; }
.profile-toolbar { grid-template-columns: minmax(0,1fr) 46px; }
.profile-toolbar select, input, select, textarea { border-color: var(--hairline-strong); border-radius: 10px; background: var(--panel-raised); font-size: 15px; }
.form-card { padding: 17px; border-color: var(--hairline); border-radius: var(--radius-md); background: rgba(251,252,250,.86); box-shadow: none; }
label > span, .field-label, .setting-label { color: #4d534c; font-size: 13px; font-weight: 650; }
.soft-button, .primary-button, .direct-generate-button { min-height: 46px; border-radius: 10px; }
.primary-button, .direct-generate-button { background: var(--brand); }
.primary-button:hover, .direct-generate-button:hover { background: var(--brand-hover); }
.connection-status { font-size: 12px; }
.model-dropdown { border-color: var(--hairline); border-radius: 12px; box-shadow: 0 12px 30px rgba(27,33,27,.08); }
.model-option { min-height: 48px; font-size: 14px; }
.model-option:hover, .model-option.active { background: var(--brand-soft); }
.settings-summary { min-height: 52px; border: 1px solid var(--hairline); border-radius: 11px; background: var(--panel-sunken); font-size: 13px; }
.settings-popover { border-color: var(--hairline); border-radius: var(--radius-md); box-shadow: var(--overlay-shadow); }
.choice { min-height: 46px; border-color: var(--hairline); border-radius: 9px; }
.choice.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.upload-box { border-color: var(--hairline-strong); background: rgba(251,252,250,.65); }
.asset-dialog { border-color: rgba(255,255,255,.8); background: var(--canvas); }
.history-image-grid { grid-template-columns: repeat(auto-fill,minmax(116px,1fr)); gap: 10px; }
.history-image-option { border-color: var(--hairline); border-radius: 11px; box-shadow: none; }
.history-image-option span { padding: 8px 9px; font-size: 12px; }

@media (max-height: 760px) and (min-width: 901px) {
  .conversation-head { min-height: 58px; padding-top: 13px; padding-bottom: 7px; }
  .brain-welcome { margin-top: 2px; padding: 22px 30px 20px; }
  .welcome-mark { width: 38px; height: 38px; margin-bottom: 10px; }
  .brain-welcome p { margin: 9px auto 15px; }
  .suggestion-list button { min-height: 56px; }
}

@media (max-width: 900px) {
  body { background: var(--canvas); }
  .app-header { height: 60px; flex-basis: 60px; grid-template-columns: auto minmax(0,1fr) auto; gap: 7px; padding: 0 10px; }
  .brand-block { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-block strong { font-size: 15px; }
  .brand-block small { display: none; }
  .view-switch { justify-self: stretch; min-width: 0; }
  .view-tab { min-width: 0; min-height: 36px; padding: 0 10px; font-size: 13px; }
  .header-actions { gap: 0; }
  .settings-button { width: 38px; min-width: 38px; height: 38px; padding: 0; }
  .settings-button span, .core-status { display: none; }
  .conversation-shell { width: 100%; height: calc(100dvh - 60px); padding: 0 14px; }
  .conversation-head { min-height: 61px; padding: 15px 3px 9px; }
  .conversation-head h1 { font-size: 18px; }
  .conversation-head .quiet-button { min-height: 40px; padding: 7px 9px; font-size: 12px; }
  .brain-chat-log { padding: 6px 2px 20px; }
  .brain-welcome { margin: 4px auto 14px; padding: 18px 6px 14px; }
  .welcome-mark { width: 40px; height: 40px; margin-bottom: 12px; border-radius: 11px; }
  .brain-welcome h2 { font-size: 27px; }
  .brain-welcome p { margin: 10px auto 16px; font-size: 14px; line-height: 1.65; }
  .suggestion-list { grid-template-columns: 1fr; gap: 7px; }
  .suggestion-list button { min-height: 48px; padding: 11px 34px 11px 13px; font-size: 13px; }
  .suggestion-list button::after { top: 10px; }
  .brain-message { max-width: 92%; margin-bottom: 17px; font-size: 16px; line-height: 1.68; }
  .brain-message.assistant { padding-left: 14px; }
  .composer-dock { padding: 6px 0 max(9px,env(safe-area-inset-bottom)); }
  .active-config-strip { display: grid; grid-template-columns: minmax(0,1fr); gap: 2px; min-height: 0; padding: 0 5px 7px; }
  .sync-status { margin: 0 0 0 14px; font-size: 11px; }
  .composer { padding: 12px 11px 10px 13px; border-radius: 15px; }
  .composer textarea { min-height: 48px; font-size: 16px; }
  .composer-tools { gap: 6px; }
  .composer-tools button { min-height: 36px; padding: 0 9px; font-size: 12px; }
  .composer-tools > span { display: none; }
  .send-button { width: 40px; height: 40px; }
  .storage-note { display: none; }
  .tasks-view { height: calc(100dvh - 60px); padding: 24px 13px 54px; }
  .tasks-header h1 { font-size: 24px; }
  .task-queue { grid-template-columns: 1fr; }
  .task-images { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .settings-drawer { width: 100vw; }
  .drawer-header { min-height: 66px; padding: 12px 15px; }
  .settings-tabs { overflow-x: auto; padding: 8px 10px; }
  .settings-tab { min-width: 70px; min-height: 40px; }
  .drawer-scroll { padding: 19px 14px 34px; }
  .form-card { padding: 15px; }
  input, select, textarea { font-size: 16px; }
  .dialog-layer { padding: 10px; }
  .asset-dialog { padding: 17px; }
}

@media (max-width: 560px) {
  .app-header { grid-template-columns: 38px minmax(0,1fr) 38px; }
  .app-header > *, .brand-block, .view-switch, .header-actions { min-width: 0; }
  .brand-block > div { display: none; }
  .view-switch { width: 100%; }
  .view-tab { flex: 1 1 0; justify-content: center; padding-inline: 7px; }
  .view-badge { min-width: 19px; padding-inline: 5px; }
  .settings-button { display: grid; place-items: center; }
  .conversation-shell, .app-view, .app-shell { min-width: 0; max-width: 100vw; }
  .conversation-head, .brain-chat-log, .composer-dock { min-width: 0; }
  .brain-welcome, .suggestion-list, .suggestion-list button { min-width: 0; max-width: 100%; }
  .composer-foot { min-width: 0; }
  .composer-tools { min-width: 0; }
}

@media (max-width: 420px) {
  .brand-block > div { display: none; }
  .app-header { grid-template-columns: 38px minmax(0,1fr) 38px; }
  .view-tab { padding-inline: 8px; }
  .conversation-head h1 { font-size: 17px; }
  .brain-welcome h2 { font-size: 25px; }
}

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

@media (forced-colors: active) {
  button, input, select, textarea, .task-card, .brain-welcome, .composer { border: 1px solid CanvasText; }
}

@media (max-width: 420px) {
  .brand-block > div { display: none; }
  .conversation-head { align-items: center; }
  .conversation-head h1 { font-size: 16px; }
  .tasks-header { align-items: center; }
}

/* 2026-07-29 visual scale and layout refresh */
:root {
  --bg: #f4f5f2;
  --surface-soft: #eef0ec;
  --text: #1c1d1b;
  --muted: #686b65;
  --line: #dfe2dc;
  --line-strong: #c9cec6;
  --accent: #232522;
  --success: #20845a;
  --shadow: 0 24px 80px rgba(27, 31, 27, .14);
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(126, 153, 127, .08), transparent 28%),
    radial-gradient(circle at 86% 78%, rgba(124, 125, 166, .06), transparent 30%),
    var(--bg);
  font-size: 17px;
}

button { transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
button:not(:disabled):active { transform: translateY(1px); }

.app-header {
  height: 72px;
  flex-basis: 72px;
  padding: 0 30px;
  border-bottom-color: rgba(208, 212, 205, .8);
  background: rgba(249, 250, 247, .88);
}
.brand-block { gap: 13px; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #292b28, #111210);
  box-shadow: 0 7px 18px rgba(26, 29, 25, .18);
  font-size: 20px;
}
.brand-block strong { font-size: 17px; font-weight: 720; }
.brand-block small { margin-top: 0; font-size: 11px; letter-spacing: 0; }
.view-switch { gap: 5px; padding: 5px; border: 1px solid rgba(215, 218, 212, .9); border-radius: 14px; background: #ebece8; }
.view-tab { min-height: 40px; padding: 0 19px; border-radius: 10px; font-size: 15px; }
.view-tab.active { box-shadow: 0 2px 8px rgba(28, 30, 27, .1); }
.view-badge { min-width: 22px; padding: 2px 6px; font-size: 12px; }
.header-actions { gap: 15px; }
.core-status { gap: 9px; font-size: 14px; }
.core-status i { width: 8px; height: 8px; }
.icon-button { min-width: 43px; height: 43px; padding: 0 14px; border-radius: 12px; font-size: 16px; }
.icon-button:hover { border-color: var(--line-strong); background: #f8f9f7; box-shadow: 0 5px 14px rgba(28, 30, 27, .07); }
.settings-button span { font-size: 15px; }

.conversation-shell {
  width: min(100%, 1120px);
  height: calc(100vh - 72px);
  padding: 0 38px;
}
.conversation-head { padding: 31px 6px 18px; }
.eyebrow { margin-bottom: 7px; font-size: 11px; letter-spacing: 0; }
.conversation-head h1, .tasks-header h1 { font-size: 27px; font-weight: 720; }
.quiet-button { padding: 10px 14px; border: 1px solid transparent; border-radius: 11px; font-size: 14px; }
.quiet-button:hover { border-color: var(--line); background: rgba(255, 255, 255, .78); }
.brain-chat-log { padding: 20px 6px 38px; }
.brain-welcome {
  width: min(850px, 100%);
  margin: clamp(26px, 5.2vh, 64px) auto 24px;
  padding: clamp(34px, 4vw, 52px);
  border: 1px solid rgba(216, 220, 213, .94);
  border-radius: 28px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .96), rgba(249, 250, 247, .79)),
    radial-gradient(circle at 10% 10%, rgba(87, 128, 96, .11), transparent 42%);
  box-shadow: 0 20px 70px rgba(31, 36, 30, .075);
}
.welcome-mark {
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border-radius: 17px;
  border-color: #d8dcd5;
  background: linear-gradient(145deg, #fff, #eef2ed);
  box-shadow: 0 10px 26px rgba(31, 36, 30, .1);
  font-size: 25px;
}
.brain-welcome h2 { font-size: 46px; line-height: 1.18; font-weight: 710; }
.brain-welcome p { width: min(650px, 100%); margin: 18px auto 31px; font-size: 17px; line-height: 1.8; }
.suggestion-list { gap: 13px; }
.suggestion-list button {
  position: relative;
  min-height: 92px;
  padding: 18px 42px 18px 19px;
  border-color: #dcded9;
  border-radius: 16px;
  color: #444841;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 5px 18px rgba(34, 38, 33, .035);
  font-size: 15px;
  font-weight: 610;
}
.suggestion-list button::after { content: "↗"; position: absolute; top: 17px; right: 17px; color: #a0a59d; font-size: 16px; }
.suggestion-list button:hover { border-color: #bfc5bc; box-shadow: 0 12px 25px rgba(34, 38, 33, .08); transform: translateY(-2px); }
.brain-message { max-width: min(82%, 820px); margin-bottom: 25px; font-size: 17px; line-height: 1.82; }
.brain-message.user { padding: 13px 18px; border-radius: 19px 19px 5px 19px; }
.brain-message.assistant { padding-left: 20px; border-left-width: 3px; border-left-color: #c8cec5; }
.context-status-message {
  padding: 12px 16px 12px 18px !important;
  border: 1px solid #d8d3c8;
  border-left-width: 3px;
  border-radius: 14px;
  color: #5a554b !important;
  background: #f7f4ed;
  font-size: 15px;
  line-height: 1.65;
}
.context-status-message[data-status="completed"] { border-color: #b8d8c2; color: #25613a !important; background: #f0f8f2; }
.context-status-message[data-status="failed"] { border-color: #e3b9b2; color: #8c3025 !important; background: #fff3f1; }

.composer-dock { padding: 13px 6px 22px; background: linear-gradient(180deg, rgba(244,245,242,0), rgba(244,245,242,.94) 16%, var(--bg) 32%); }
.active-config-strip { padding: 0 7px 10px; }
.active-config-strip button { gap: 9px; font-size: 14px; }
.active-config-strip button i { width: 8px; height: 8px; box-shadow: 0 0 0 4px rgba(53,164,111,.1); }
.agent-autonomy-status { display: flex; min-width: 0; align-items: center; gap: 9px; color: #4e554f; font-size: 14px; }
.agent-autonomy-status i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #35a46f; box-shadow: 0 0 0 4px rgba(53,164,111,.1); }
.agent-autonomy-status span, .agent-autonomy-status b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-autonomy-status b { color: #27302a; font-weight: 720; }
.sync-status { font-size: 13px; }
.composer {
  padding: 17px 17px 13px 20px;
  border-color: #cfd4cc;
  border-radius: 22px;
  box-shadow: 0 16px 45px rgba(31, 36, 30, .1);
}
.composer:focus-within { border-color: #929b90; box-shadow: 0 18px 54px rgba(31, 36, 30, .13), 0 0 0 4px rgba(70, 89, 72, .06); }
.composer textarea { min-height: 66px; max-height: 230px; font-size: 18px; line-height: 1.7; }
.composer-foot { margin-top: 7px; }
.composer-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.composer-tools button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #d4d8d1;
  border-radius: 10px;
  color: #4e534c;
  background: #f9faf8;
  font-size: 14px;
  font-weight: 610;
}
.composer-tools button:hover { border-color: #bac1b7; background: #f0f3ef; }
.composer-foot > span { font-size: 13px; }
.send-button { width: 43px; height: 43px; border-radius: 13px; box-shadow: 0 7px 18px rgba(28, 30, 27, .2); font-size: 22px; }
.send-button:hover:not(:disabled) { background: #111310; box-shadow: 0 9px 22px rgba(28, 30, 27, .25); transform: translateY(-1px); }
.storage-note { margin-top: 10px; font-size: 12px; }

.chat-drop-zone { margin-bottom: 10px; padding: 14px; border: 1px dashed #8fa08e; border-radius: 13px; color: #3f694f; background: #eef7f0; font-size: 14px; font-weight: 650; text-align: center; }
.chat-attachment-tray { display: flex; gap: 10px; overflow-x: auto; padding: 2px 1px 13px; }
.chat-attachment { position: relative; flex: 0 0 82px; height: 82px; overflow: visible; }
.chat-attachment img { width: 100%; height: 100%; display: block; object-fit: cover; border: 1px solid #d5d9d2; border-radius: 13px; cursor: zoom-in; }
.chat-attachment button { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; padding: 0; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #252824; box-shadow: 0 3px 9px rgba(0,0,0,.17); font-size: 16px; line-height: 18px; }

.tasks-view { height: calc(100vh - 72px); padding: 44px 36px 80px; }
.tasks-shell { width: min(1320px, 100%); }
.tasks-header { margin-bottom: 30px; }
.tasks-header p { font-size: 15px; }
.empty-result { min-height: 480px; border-radius: 25px; font-size: 16px; }
.empty-icon { font-size: 40px; }
.empty-result strong { font-size: 19px; }
.empty-result small { font-size: 14px; }
.task-queue { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; }
.task-card { border-radius: 20px; box-shadow: 0 10px 30px rgba(31, 36, 30, .055); }
.task-card-head { padding: 18px 20px; }
.task-card-title strong { font-size: 16px; }
.task-card-title span, .task-card-side button { font-size: 13px; }
.task-status { padding: 5px 10px; font-size: 12px; }
.task-prompt { padding: 15px 20px; font-size: 14px; }
.task-prompt-text { white-space: pre-wrap; word-break: break-word; }
.task-prompt-text.collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.task-prompt-text.collapsed.expanded { display: block; overflow: visible; }
.task-prompt-toggle { min-height: 32px; margin-top: 8px; padding: 4px 9px; border: 1px solid #d9ddd6; border-radius: 8px; color: #5d625b; background: #f8f9f7; font-size: 12px; }
.task-prompt-toggle:hover { border-color: #bbc1b8; background: #eef1ed; }
.task-progress { font-size: 14px; }
.task-images { grid-template-columns: repeat(auto-fill, minmax(96px, 132px)); align-items: start; gap: 11px; padding: 14px; }
.task-image { position: relative; border: 1px solid #e2e5df; border-radius: 14px; }
.task-image img { aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }
.task-image-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 7px; background: #fff; }
.task-image-actions button, .task-image-actions a, .task-image > a { margin: 0; min-height: 32px; padding: 6px 8px; border: 0; border-radius: 8px; font-size: 11px; font-weight: 650; text-decoration: none; }
.task-image-actions button { color: #4c524a; background: #edf0eb; }
.task-image-actions a, .task-image > a { display: grid; place-items: center; color: #fff; background: #292c28; }
.task-foot { padding: 12px 18px; font-size: 12px; }
.task-error, .error-box { font-size: 14px; }

.settings-drawer { width: min(560px, calc(100vw - 28px)); background: #f7f8f5; }
.drawer-header { min-height: 82px; padding: 18px 25px; }
.drawer-header h2 { font-size: 24px; }
.settings-tabs { gap: 7px; padding: 12px 18px; }
.settings-tab { min-height: 43px; border-radius: 11px; font-size: 14px; }
.drawer-scroll { padding: 27px 25px 44px; }
.panel-intro { margin-bottom: 22px; }
.panel-intro h3 { font-size: 21px; }
.panel-intro p { margin-top: 7px; font-size: 14px; line-height: 1.7; }
.profile-toolbar { grid-template-columns: 1fr 48px; gap: 10px; }
.panel-actions { min-height: 42px; padding: 5px 3px 9px; }
.panel-actions span, .panel-actions button { font-size: 13px; }
.square-button { font-size: 23px; }
input, select, textarea { padding: 13px 14px; border-radius: 12px; font-size: 16px; }
.form-card { padding: 19px; border-radius: 17px; box-shadow: 0 5px 18px rgba(31,36,30,.03); }
.form-card > label { margin-top: 17px; }
label > span, .field-label, .setting-label { margin-bottom: 8px; font-size: 14px; }
.inline-button { height: 49px; padding: 0 15px; border-radius: 11px; font-size: 13px; }
.remember input { width: 17px; height: 17px; }
.remember span { font-size: 13px; }
.action-row { gap: 10px; margin-top: 18px; }
.soft-button, .primary-button, .direct-generate-button { min-height: 48px; border-radius: 12px; font-size: 14px; }
.soft-button:hover { border-color: var(--line-strong); background: #f7f8f6; }
.primary-button:hover, .direct-generate-button:hover { background: #171916; box-shadow: 0 8px 18px rgba(27,30,26,.16); }
.direct-generate-button { min-height: 54px; margin-top: 21px; font-size: 16px; }
.connection-status { margin-top: 12px; font-size: 13px; }
.section-block { margin-top: 27px; }
.model-input-row { grid-template-columns: 1fr 50px; }
.model-dropdown { margin-top: 10px; padding: 11px; border-radius: 15px; box-shadow: 0 10px 28px rgba(30,35,29,.08); }
.model-dropdown-head { padding: 5px 7px 10px; }
.model-dropdown-head strong { font-size: 15px; }
.model-dropdown-head button, .model-option small { font-size: 12px; }
.model-option { min-height: 51px; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.model-empty { padding: 22px 8px; font-size: 13px; }
.upload-box { min-height: 138px; border-radius: 14px; }
.upload-box strong { font-size: 15px; }
.upload-box small { font-size: 12px; }
.upload-icon { font-size: 28px; }
.prompt-tags { gap: 7px; margin-top: 10px; }
.prompt-tags button { padding: 7px 11px; border-radius: 8px; font-size: 12px; }
.settings-summary { min-height: 56px; border-radius: 13px; font-size: 14px; }
.settings-popover { bottom: 66px; padding: 21px; border-radius: 17px; }
.popover-head { margin-bottom: 16px; font-size: 16px; }
.setting-block { margin-top: 18px; }
.option-grid { gap: 9px; }
.choice { min-height: 48px; border-radius: 11px; font-size: 13px; }
.computed { margin-top: 8px; font-size: 12px; }
.custom-size label { font-size: 13px; }
.builtin-skill, .skill-item { padding: 15px; border-radius: 13px; }
.builtin-skill strong, .skill-item strong { font-size: 14px; }
.builtin-skill small, .skill-item small { font-size: 12px; }
.builtin-skill > span { font-size: 12px; }
.skill-import-row button { padding: 0 17px; border-radius: 11px; font-size: 13px; }
.danger-outline-button { min-height: 48px; border-radius: 11px; font-size: 13px; }
.toast { right: 28px; bottom: 28px; padding: 14px 18px; border-radius: 12px; font-size: 14px; }

.dialog-layer { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 28px; background: rgba(20, 23, 20, .5); backdrop-filter: blur(9px); }
.asset-dialog { width: min(920px, 100%); max-height: min(780px, calc(100vh - 56px)); overflow-y: auto; padding: 26px; border: 1px solid rgba(255,255,255,.7); border-radius: 24px; background: #f9faf8; box-shadow: 0 28px 90px rgba(0,0,0,.25); }
.asset-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.asset-dialog h2 { margin: 0; font-size: 25px; }
.asset-dialog > p { margin: 12px 0 22px; color: var(--muted); font-size: 15px; }
.history-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 13px; }
.history-image-option { overflow: hidden; padding: 0; border: 1px solid #dce0d9; border-radius: 15px; color: #4d524b; background: #fff; box-shadow: 0 6px 18px rgba(30,35,29,.05); text-align: left; }
.history-image-option:hover { border-color: #aeb8ac; box-shadow: 0 12px 26px rgba(30,35,29,.1); transform: translateY(-2px); }
.history-image-option img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; }
.history-image-option span { display: block; overflow: hidden; padding: 10px 11px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.lightbox { padding: 50px; background: rgba(12, 14, 12, .84); }
.lightbox img { max-width: 96vw; max-height: 90vh; object-fit: contain; border-radius: 12px; box-shadow: 0 25px 90px rgba(0,0,0,.45); }
.lightbox-close { position: fixed; top: 22px; right: 25px; z-index: 2; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.3); border-radius: 14px; color: #fff; background: rgba(30,32,29,.66); font-size: 26px; }
@media (max-height: 820px) and (min-width: 901px) {
  .conversation-head { padding-top: 20px; padding-bottom: 11px; }
  .brain-welcome { margin-top: 15px; padding-top: 30px; padding-bottom: 30px; }
  .welcome-mark { margin-bottom: 14px; }
  .brain-welcome p { margin-top: 11px; margin-bottom: 20px; }
  .suggestion-list button { min-height: 72px; }
  .composer textarea { min-height: 50px; }
}

@media (max-width: 900px) {
  .conversation-shell { padding: 0 22px; }
  .brain-welcome { padding: 34px 28px; }
  .suggestion-list { grid-template-columns: 1fr; }
  .suggestion-list button { min-height: 62px; }
}

@media (max-width: 900px) {
  body { font-size: 16px; }
  .app-header { height: 62px; flex-basis: 62px; padding: 0 13px; }
  .conversation-shell { height: calc(100vh - 62px); padding: 0 14px; }
  .conversation-head { padding: 17px 4px 10px; }
  .conversation-head h1 { font-size: 20px; }
  .brain-welcome { margin-top: 16px; padding: 28px 19px; border-radius: 21px; }
  .brain-welcome h2 { font-size: 29px; }
  .brain-welcome p { margin: 13px auto 21px; font-size: 15px; }
  .welcome-mark { width: 47px; height: 47px; margin-bottom: 17px; }
  .suggestion-list { gap: 9px; }
  .suggestion-list button { padding: 14px 38px 14px 15px; font-size: 14px; text-align: left; }
  .composer { padding: 14px 13px 11px 15px; border-radius: 18px; }
  .composer textarea { min-height: 54px; font-size: 16px; }
  .composer-tools button { min-height: 36px; padding: 0 10px; font-size: 13px; }
  .composer-foot > span { display: none; }
  .send-button { width: 40px; height: 40px; }
  .tasks-view { height: calc(100vh - 62px); padding: 26px 14px 55px; }
  .task-queue { grid-template-columns: 1fr; }
  .settings-drawer { width: 100vw; }
  .drawer-header { min-height: 70px; padding: 14px 17px; }
  .drawer-scroll { padding: 20px 16px 36px; }
  .settings-tabs { padding: 9px 11px; }
  .settings-tab { min-height: 39px; font-size: 13px; }
  .dialog-layer { padding: 12px; }
  .asset-dialog { max-height: calc(100vh - 24px); padding: 19px; border-radius: 19px; }
  .history-image-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .lightbox { padding: 52px 12px 12px; }
}

/* Final cascade lock: keep the product theme after every legacy refresh block. */
:root {
  --bg: #f3f4f0;
  --surface: #ffffff;
  --surface-soft: #eef0eb;
  --text: #191b18;
  --muted: #62675f;
  --line: #d8ddd5;
  --line-strong: #bdc5ba;
  --accent: #24392d;
  --success: #278154;
  --danger: #b7453d;
  --shadow: 0 28px 80px rgba(22,27,22,.18);
}
body {
  color: var(--text);
  background:
    linear-gradient(90deg,rgba(35,57,45,.025) 1px,transparent 1px) 0 0/56px 56px,
    linear-gradient(rgba(35,57,45,.018) 1px,transparent 1px) 0 0/56px 56px,
    var(--bg);
  font-size: 17px;
}
.app-header {
  height: 68px; flex-basis: 68px; padding: 0 clamp(18px,2.6vw,38px);
  border-bottom-color: rgba(193,199,190,.72); background: rgba(250,251,248,.92);
}
.brand-block { gap: 12px; }
.brand-mark { width: 38px; height: 38px; border: 0; border-radius: 11px; color: #fff; background: #191b18; box-shadow: 0 7px 20px rgba(18,21,18,.16); }
.brand-mark svg { width: 19px; height: 19px; fill: currentColor; }
.brand-block strong { font-size: 17px; font-weight: 720; }
.brand-block small { margin-top: -2px; color: #8a9087; font-size: 10px; }
.view-switch { gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.view-tab { min-height: 38px; padding: 0 18px; border-radius: 9px; color: var(--muted); font-size: 14px; }
.view-tab.active { color: var(--text); background: #fff; box-shadow: 0 2px 8px rgba(29,33,28,.08); }
.view-badge { min-width: 20px; padding: 1px 5px; color: var(--muted); background: #dde1da; font-size: 11px; }
.header-actions { gap: 12px; }
.core-status { gap: 8px; color: var(--muted); font-size: 13px; }
.icon-button { min-width: 44px; height: 44px; padding: 0 13px; border-color: var(--line); border-radius: 11px; background: rgba(255,255,255,.76); }
.settings-button { gap: 7px; }
.settings-button svg { width: 17px; height: 17px; }
.settings-button span { font-size: 14px; }

.conversation-shell { width: min(100%,1040px); height: calc(100vh - 68px); padding: 0 28px; }
.conversation-head { min-height: 74px; padding: 20px 4px 12px; }
.conversation-head .eyebrow { display: none; }
.conversation-head h1 { font-size: 21px; font-weight: 720; }
.conversation-head .quiet-button { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.brain-chat-log { padding: 12px 4px 26px; }
.brain-welcome {
  width: min(760px,100%); margin: clamp(18px,4vh,46px) auto 20px; padding: 24px 28px 20px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.welcome-mark { width: 44px; height: 44px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: none; }
.welcome-mark svg { width: 21px; height: 21px; fill: #24392d; }
.brain-welcome h2 { font-size: 38px; line-height: 1.16; font-weight: 710; }
.brain-welcome p { width: min(590px,100%); margin: 13px auto 22px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.suggestion-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.suggestion-list button { min-height: 68px; padding: 14px 34px 14px 15px; border-color: var(--line); border-radius: 12px; color: #3d433d; background: rgba(255,255,255,.82); box-shadow: none; font-size: 14px; }
.suggestion-list button::after { top: 13px; right: 14px; }
.brain-message { max-width: min(86%,760px); margin-bottom: 22px; font-size: 17px; line-height: 1.76; }
.brain-message.user { padding: 12px 17px; border-radius: 17px 17px 5px 17px; background: #191b18; }
.brain-message.assistant { padding-left: 18px; border-left: 2px solid #b9c5ba; }
.chat-result-images { grid-template-columns: repeat(auto-fill,minmax(112px,148px)) !important; }

.composer-dock { padding: 8px 4px max(17px,env(safe-area-inset-bottom)); background: linear-gradient(180deg,transparent,var(--bg) 22%); }
.active-config-strip { min-height: 32px; padding: 0 7px 7px; }
.active-config-strip button { font-size: 13px; }
.sync-status { color: #8a9087; font-size: 12px; }
.composer { padding: 14px 14px 11px 17px; border: 1px solid var(--line-strong); border-radius: 17px; background: #fff; box-shadow: 0 16px 44px rgba(28,35,28,.10); }
.composer textarea { min-height: 56px; max-height: 180px; font-size: 17px; line-height: 1.6; }
.composer-tools { gap: 7px; }
.composer-tools button { min-height: 38px; padding: 0 11px; border-color: var(--line); border-radius: 9px; background: #f7f8f5; font-size: 13px; }
.composer-tools > span { color: #8a9087; font-size: 12px; }
.send-button { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 11px; background: #24392d; box-shadow: 0 7px 18px rgba(25,46,34,.18); }
.storage-note { font-size: 11px; }

.tasks-view { height: calc(100vh - 68px); padding: 38px clamp(20px,4vw,56px) 70px; }
.tasks-shell { width: min(1240px,100%); }
.tasks-header { margin-bottom: 24px; }
.tasks-header h1 { font-size: 28px; }
.task-queue { grid-template-columns: repeat(auto-fill,minmax(min(100%,340px),1fr)); gap: 16px; }
.task-card { border-color: var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 24px rgba(27,33,27,.045); }
.task-card-head { padding: 15px 16px; }
.task-card-title strong { font-size: 15px; }
.task-card-title span { font-size: 12px; }
.task-prompt { padding: 12px 16px; font-size: 13px; line-height: 1.58; }
.task-prompt-text.collapsed { -webkit-line-clamp: 3; }
.task-images { grid-template-columns: repeat(auto-fill,minmax(92px,124px)); gap: 9px; padding: 12px; }
.task-image { border-color: var(--line); border-radius: 10px; }
.task-image-actions { gap: 5px; padding: 5px; }
.task-foot { padding: 10px 15px; font-size: 11px; }
.empty-result { min-height: 360px; border-color: var(--line); border-radius: 20px; background: rgba(251,252,250,.65); }

.settings-drawer { width: min(540px,calc(100vw - 22px)); background: var(--bg); box-shadow: var(--shadow); }
.drawer-header { min-height: 74px; padding: 16px 21px; border-color: var(--line); background: rgba(250,251,248,.94); }
.drawer-header .eyebrow { display: none; }
.drawer-header h2 { font-size: 23px; }
.settings-tabs { gap: 6px; padding: 10px 14px; border-color: var(--line); background: rgba(250,251,248,.96); }
.settings-tab { min-height: 42px; border-radius: 9px; color: var(--muted); font-size: 13px; }
.settings-tab.active { color: #fff; background: #24392d; }
.drawer-scroll { padding: 24px 22px 42px; }
.panel-intro h3 { font-size: 20px; }
.panel-intro p { font-size: 13px; }
.form-card { padding: 17px; border-color: var(--line); border-radius: 14px; background: rgba(251,252,250,.88); box-shadow: none; }
input, select, textarea { padding: 12px 13px; border-color: var(--line-strong); border-radius: 10px; font-size: 15px; }
label > span, .field-label, .setting-label { margin-bottom: 7px; font-size: 13px; }
.soft-button, .primary-button, .direct-generate-button { min-height: 46px; border-radius: 10px; font-size: 14px; }
.primary-button, .direct-generate-button { background: #24392d; }
.model-dropdown { border-color: var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(27,33,27,.08); }
.model-option { min-height: 48px; font-size: 14px; }
.model-option:hover, .model-option.active { background: #e5eee7; }
.settings-summary { min-height: 52px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); font-size: 13px; }
.choice { min-height: 46px; border-radius: 9px; }
.choice.active { border-color: #24392d; color: #24392d; background: #e5eee7; }
.history-image-grid { grid-template-columns: repeat(auto-fill,minmax(116px,1fr)); gap: 10px; }
.history-image-option { border-color: var(--line); border-radius: 11px; box-shadow: none; }

@media (max-width: 900px) {
  .conversation-shell { padding: 0 22px; }
  .brain-welcome { padding: 20px 12px 16px; }
  .suggestion-list { grid-template-columns: 1fr; }
  .suggestion-list button { min-height: 52px; }
}
@media (max-width: 900px) {
  body { font-size: 16px; overflow-x: hidden; }
  .app-header { height: 60px; flex-basis: 60px; grid-template-columns: 38px minmax(0,1fr) 38px; gap: 7px; padding: 0 10px; }
  .app-header > *, .brand-block, .view-switch, .header-actions { min-width: 0; }
  .brand-block > div, .core-status, .settings-button span { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .view-switch { width: 100%; justify-self: stretch; }
  .view-tab { flex: 1 1 0; min-width: 0; min-height: 36px; justify-content: center; padding: 0 7px; font-size: 13px; }
  .view-badge { min-width: 18px; padding-inline: 4px; }
  .header-actions { gap: 0; }
  .settings-button { display: grid; place-items: center; width: 38px; min-width: 38px; height: 38px; padding: 0; }
  .conversation-shell { width: 100%; height: calc(100dvh - 60px); padding: 0 14px; }
  .conversation-head { min-height: 61px; padding: 15px 3px 9px; }
  .conversation-head h1 { font-size: 18px; }
  .conversation-head .quiet-button { min-height: 40px; padding: 7px 9px; font-size: 12px; }
  .brain-chat-log { padding: 6px 2px 20px; }
  .brain-welcome { margin: 4px auto 14px; padding: 18px 6px 14px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .welcome-mark { width: 40px; height: 40px; margin-bottom: 12px; }
  .brain-welcome h2 { font-size: 27px; }
  .brain-welcome p { margin: 10px auto 16px; font-size: 14px; }
  .suggestion-list { gap: 7px; }
  .suggestion-list button { min-height: 48px; padding: 11px 34px 11px 13px; font-size: 13px; }
  .brain-message { max-width: 92%; margin-bottom: 17px; font-size: 16px; }
  .composer-dock { padding: 6px 0 max(9px,env(safe-area-inset-bottom)); }
  .active-config-strip { display: grid; grid-template-columns: minmax(0,1fr); gap: 2px; min-height: 0; padding: 0 5px 7px; }
  .sync-status { margin: 0 0 0 14px; font-size: 11px; }
  .composer { min-width: 0; padding: 12px 11px 10px 13px; border-radius: 15px; }
  .composer textarea { min-width: 0; min-height: 48px; font-size: 16px; }
  .composer-foot { min-width: 0; gap: 8px; }
  .composer-tools { min-width: 0; flex: 1 1 auto; flex-wrap: wrap; gap: 6px; }
  .composer-tools button { min-height: 36px; padding: 0 9px; font-size: 12px; }
  .composer-tools > span { display: none; }
  .send-button { display: grid; flex: 0 0 40px; width: 40px; height: 40px; }
  .storage-note { display: none; }
  .tasks-view { height: calc(100dvh - 60px); padding: 24px 13px 54px; }
  .tasks-header h1 { font-size: 24px; }
  .task-queue { grid-template-columns: 1fr; }
  .task-images { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .settings-drawer { width: 100vw; }
  .drawer-header { min-height: 66px; padding: 12px 15px; }
  .settings-tabs { overflow-x: auto; padding: 8px 10px; }
  .settings-tab { min-width: 70px; min-height: 40px; }
  .drawer-scroll { padding: 19px 14px 34px; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 420px) {
  .view-tab { padding-inline: 5px; }
  .conversation-head h1 { font-size: 17px; }
  .brain-welcome h2 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Release-candidate polish: quieter empty state and stronger task hierarchy. */
.tasks-header .eyebrow { color: #7c877d; font-size: 10px; letter-spacing: 0; }
.empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: #637267;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 36, 29, .06);
}
.empty-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty-result strong { color: var(--text); font-size: 18px; }
.empty-result small { max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.65; }

@media (max-width: 900px) {
  .tasks-header .eyebrow { display: none; }
  .tasks-header { align-items: center; margin-bottom: 22px; }
  .empty-result { min-height: 360px; padding: 30px 20px; }
  .empty-result strong { font-size: 18px; }
  .empty-result small { font-size: 13px; }
}

/* AI image studio — Agent left, shared creative workspace right. */
:root {
  --studio-canvas: #f2f3ef;
  --studio-surface: #fbfcf9;
  --studio-raised: #ffffff;
  --studio-ink: #20241f;
  --studio-muted: #687067;
  --studio-line: #dfe3dc;
  --studio-line-strong: #cbd2c9;
  --studio-accent: #294d39;
  --studio-accent-soft: #e6eee8;
}
body { background: var(--studio-canvas); color: var(--studio-ink); }
.studio-app { height: 100dvh; overflow: hidden; }
.studio-app .app-header {
  position: relative; z-index: 20; height: 68px; flex-basis: 68px;
  grid-template-columns: minmax(250px, 38fr) minmax(420px, 62fr) auto;
  padding: 0 18px 0 20px; border-bottom: 1px solid var(--studio-line);
  background: rgba(248,249,246,.96); backdrop-filter: blur(12px);
}
.studio-app .brand-block strong { font-size: 17px; letter-spacing: 0; }
.studio-app .brand-block small { font-size: 11px; }
.mobile-view-switch { visibility: hidden; pointer-events: none; }
.studio-shell {
  display: grid; grid-template-columns: minmax(380px,38fr) minmax(560px,62fr);
  min-height: 0; height: calc(100dvh - 68px);
}
.studio-shell > .app-view { display: block; min-width: 0; min-height: 0; height: 100%; }
.studio-chat-pane { border-right: 1px solid var(--studio-line-strong); background: var(--studio-surface); }
.studio-chat-pane .conversation-shell { width: 100%; height: 100%; padding: 0 22px; }
.studio-chat-pane .conversation-head { min-height: 72px; padding: 16px 2px 11px; }
.studio-chat-pane .conversation-head h1 { font-size: 22px; }
.studio-chat-pane .brain-chat-log { padding: 8px 2px 20px; }
.studio-chat-pane .brain-welcome { margin: clamp(16px,3vh,34px) auto 18px; padding-inline: 8px; }
.studio-chat-pane .brain-welcome h2 { font-size: 36px; }
.studio-chat-pane .brain-welcome p { font-size: 15px; }
.studio-chat-pane .suggestion-list { grid-template-columns: 1fr; }
.studio-chat-pane .suggestion-list button { min-height: 52px; }
.studio-chat-pane .brain-message { max-width: 92%; font-size: 16px; }
.studio-chat-pane .composer-dock { padding-inline: 0; }
.studio-chat-pane .composer textarea { font-size: 16px; }
.studio-workspace-pane {
  display: grid !important; grid-template-rows: auto auto minmax(0,1fr);
  padding: 0; overflow: hidden; background: var(--studio-canvas);
}
.workspace-commandbar {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 11px 24px; border-bottom: 1px solid var(--studio-line); background: var(--studio-surface);
}
.workspace-project-context { min-width: 0; }
.workspace-project-context .eyebrow { display: block; margin-bottom: 3px; color: #778076; font-size: 9px; letter-spacing: 0; }
.workspace-project-context > div { display: flex; align-items: baseline; gap: 12px; }
.workspace-project-context h1 { overflow: hidden; margin: 0; color: var(--studio-ink); font-size: 21px; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.workspace-project-context span { color: var(--studio-muted); font-size: 12px; white-space: nowrap; }
.workspace-project-context b { color: var(--studio-accent); }
.workspace-project-actions { display: flex; align-items: center; gap: 8px; }
.workspace-project-actions select { width: min(220px,22vw); min-height: 44px; border-color: var(--studio-line-strong); background: var(--studio-raised); font-size: 14px; }
.workspace-project-actions button { min-height: 44px; white-space: nowrap; }
.workspace-tabs {
  display: flex; min-width: 0; min-height: 51px; align-items: end; gap: 4px; padding: 0 20px;
  border-bottom: 1px solid var(--studio-line); background: var(--studio-surface); overflow-x: auto;
}
.workspace-tabs button {
  position: relative; min-width: 78px; min-height: 50px; padding: 0 14px; border: 0; color: var(--studio-muted);
  background: transparent; font: inherit; font-size: 14px; font-weight: 620; cursor: pointer;
}
.workspace-tabs button::after { content: ""; position: absolute; right: 14px; bottom: -1px; left: 14px; height: 2px; border-radius: 2px; background: transparent; }
.workspace-tabs button:hover { color: var(--studio-ink); background: #f2f5f0; }
.workspace-tabs button.active { color: var(--studio-accent); }
.workspace-tabs button.active::after { background: var(--studio-accent); }
.workspace-panels { min-width: 0; min-height: 0; overflow: hidden; }
.workspace-panel { display: none; width: 100%; height: 100%; overflow: auto; padding: 22px 24px 48px; }
.workspace-panel.active { display: block; }
.workspace-panel .tasks-header { margin-bottom: 18px; }
.workspace-panel .tasks-header h2, .workspace-section-head h2 { margin: 2px 0 4px; font-size: 24px; letter-spacing: 0; }
.workspace-panel .tasks-header p, .workspace-section-head p { margin: 0; color: var(--studio-muted); font-size: 13px; line-height: 1.55; }
.workspace-panel .task-queue { grid-template-columns: repeat(auto-fill,minmax(min(100%,290px),1fr)); gap: 13px; }
.workspace-panel .task-card { border-radius: 12px; box-shadow: 0 5px 18px rgba(28,35,29,.045); }
.workspace-panel .task-images { grid-template-columns: repeat(auto-fill,minmax(82px,110px)); }
.prompt-plan-shell {
  margin-bottom: 20px; overflow: hidden; border: 1px solid var(--studio-line-strong); border-radius: 14px;
  background: var(--studio-raised); box-shadow: 0 6px 20px rgba(28,35,29,.045);
}
.prompt-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 17px 18px 15px; border-bottom: 1px solid var(--studio-line); }
.prompt-plan-head h2 { margin: 2px 0 4px; font-size: 21px; letter-spacing: 0; }
.prompt-plan-head p { margin: 0; color: var(--studio-muted); font-size: 13px; line-height: 1.55; }
.prompt-plan-badge { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: #737b72; background: #f0f2ee; font-size: 11px; font-weight: 650; }
.prompt-plan-badge.ready { color: var(--studio-accent); background: var(--studio-accent-soft); }
.prompt-plan-empty { padding: 17px 18px; color: var(--studio-muted); font-size: 13px; line-height: 1.65; }
.prompt-plan-content { display: grid; gap: 10px; padding: 12px; }
.prompt-plan-compare { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 10px; }
.prompt-plan-notes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.prompt-plan-block { min-width: 0; border: 1px solid var(--studio-line); border-radius: 10px; background: #fafbf8; }
.prompt-plan-block.featured { border-color: #b7c8b9; background: #f5f9f5; }
.prompt-plan-block summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; color: var(--studio-ink); cursor: pointer; list-style: none; }
.prompt-plan-block summary::-webkit-details-marker { display: none; }
.prompt-plan-block summary::after { content: "+"; flex: 0 0 auto; color: var(--studio-muted); font-size: 18px; line-height: 1; }
.prompt-plan-block[open] summary::after { content: "−"; }
.prompt-plan-block summary span { min-width: 0; font-size: 13px; font-weight: 680; }
.prompt-plan-block summary small { margin-left: auto; color: var(--studio-muted); font-size: 10px; white-space: nowrap; }
.prompt-plan-block > p, .prompt-plan-block > ul, .prompt-plan-block > ol { margin: 0; padding: 0 12px 13px; color: #4e574f; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.prompt-plan-block > ul { padding-left: 30px; }
.storyboard-block > ol { display: grid; gap: 8px; padding-left: 12px; list-style: none; }
.storyboard-block li { padding: 10px 11px; border-left: 3px solid #9bb09f; border-radius: 7px; background: #fff; }
.storyboard-block li strong { display: block; margin-bottom: 4px; color: var(--studio-ink); font-size: 12px; }
.storyboard-block li p { margin: 0; color: #4e574f; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.prompt-plan-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.prompt-plan-actions button { min-height: 44px; padding-inline: 14px; }
.prompt-plan-actions button:disabled { cursor: not-allowed; opacity: .48; }
.prompt-plan-block summary:focus-visible, .prompt-plan-actions button:focus-visible { outline: 3px solid rgba(47,93,65,.22); outline-offset: 2px; }
.project-hidden { display: none !important; }
.workspace-panel .empty-result { min-height: 330px; border-style: dashed; background: rgba(251,252,249,.72); }
.workspace-section-head { margin-bottom: 20px; }
.workspace-section-head.split { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.workspace-filter-row { display: flex; gap: 8px; }
.workspace-filter-row select { min-width: 150px; min-height: 44px; background: var(--studio-raised); }
.workspace-filter-row button { min-height: 44px; }
.workflow-queue { display: grid; gap: 8px; }
.workflow-row {
  display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 15px; border: 1px solid var(--studio-line); border-left: 3px solid #9da79f; border-radius: 10px; background: var(--studio-raised);
}
.workflow-row.running { border-left-color: #b47b28; }
.workflow-row.success { border-left-color: #3d7955; }
.workflow-row.failed { border-left-color: #a84949; }
.workflow-row div { display: grid; gap: 4px; min-width: 0; }
.workflow-row strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-row small { color: var(--studio-muted); font-size: 12px; }
.workflow-row > span { flex: 0 0 auto; padding: 5px 8px; border-radius: 6px; color: var(--studio-muted); background: #f1f3ef; font-size: 11px; }
.asset-workspace-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 14px; }
.asset-tile { min-width: 0; overflow: hidden; border: 1px solid var(--studio-line); border-radius: 11px; background: var(--studio-raised); }
.asset-tile > img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; background: #e9ece7; }
.asset-tile > div:not(.asset-tile-actions) { display: grid; gap: 7px; padding: 10px 10px 7px; }
.asset-tile strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.asset-tile select { width: 100%; min-height: 34px; padding: 0 8px; border-radius: 7px; font-size: 12px; }
.asset-tile-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 0 10px 10px; }
.asset-tile-actions button { min-height: 36px; border: 1px solid var(--studio-line); border-radius: 7px; color: var(--studio-muted); background: #f7f8f5; cursor: pointer; }
.workspace-empty { grid-column: 1/-1; display: grid; min-height: 190px; place-items: center; padding: 28px; border: 1px dashed var(--studio-line-strong); border-radius: 12px; color: var(--studio-muted); background: rgba(251,252,249,.65); font-size: 14px; line-height: 1.65; text-align: center; }
.project-management-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 16px; }
.project-management-grid > section { min-width: 0; padding: 16px; border: 1px solid var(--studio-line); border-radius: 12px; background: var(--studio-raised); }
.management-title { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.management-title h3 { margin: 0; font-size: 16px; }
.management-title button, .category-row button { min-height: 36px; border: 1px solid var(--studio-line); border-radius: 7px; color: var(--studio-muted); background: #f7f8f5; cursor: pointer; }
.project-workspace-list, .category-workspace-list { display: grid; gap: 7px; }
.project-row, .category-row { display: flex; width: 100%; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--studio-line); border-radius: 9px; color: var(--studio-ink); background: #fafbf8; text-align: left; }
.project-row { cursor: pointer; }
.project-row:hover, .project-row.active { border-color: #a8b8aa; background: var(--studio-accent-soft); }
.project-row > span, .category-row > span { display: grid; min-width: 0; gap: 3px; }
.project-row strong, .category-row strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.project-row small, .category-row small { color: var(--studio-muted); font-size: 11px; }
.project-row i { color: var(--studio-accent); font-size: 11px; font-style: normal; }
.category-row > div { display: flex; gap: 5px; }
.category-row button { padding-inline: 8px; font-size: 11px; }
.workspace-tabs button:focus-visible, .asset-tile button:focus-visible, .project-row:focus-visible, .category-row button:focus-visible { outline: 3px solid rgba(47,93,65,.22); outline-offset: 1px; }

@media (max-width: 1050px) and (min-width: 901px) {
  .studio-shell { grid-template-columns: minmax(330px,42fr) minmax(430px,58fr); }
  .studio-chat-pane .conversation-shell { padding-inline: 15px; }
  .workspace-commandbar { padding-inline: 16px; }
  .workspace-panel { padding-inline: 17px; }
  .workspace-project-context > div { display: grid; gap: 1px; }
  .project-management-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .studio-app .app-header { height: 60px; flex-basis: 60px; grid-template-columns: 38px minmax(0,1fr) 38px; padding: 0 10px; }
  .mobile-view-switch { visibility: visible; pointer-events: auto; }
  .studio-shell { display: block; height: calc(100dvh - 60px); }
  .studio-shell > .app-view { width: 100%; height: 100%; }
  body[data-mobile-view="workspace"] .studio-chat-pane { display: none; }
  body:not([data-mobile-view="workspace"]) .studio-workspace-pane { display: none !important; }
  .studio-chat-pane { border-right: 0; }
  .studio-chat-pane .conversation-shell { height: 100%; padding-inline: 13px; }
  .studio-chat-pane .conversation-head { min-height: 60px; }
  .studio-chat-pane .brain-welcome h2 { font-size: 27px; }
  .studio-workspace-pane { grid-template-rows: auto auto minmax(0,1fr); }
  .workspace-commandbar { min-height: 68px; padding: 10px 12px; }
  .workspace-project-context .eyebrow, .workspace-project-context > div > span { display: none; }
  .workspace-project-context h1 { max-width: 130px; font-size: 18px; }
  .workspace-project-actions { gap: 6px; }
  .workspace-project-actions select { width: 116px; min-height: 44px; font-size: 13px; }
  .workspace-project-actions button { width: 44px; min-width: 44px; padding: 0; overflow: hidden; font-size: 0; }
  .workspace-project-actions button::after { content: "+"; font-size: 22px; }
  .workspace-tabs { min-height: 50px; padding: 0 8px; }
  .workspace-tabs button { flex: 1 0 72px; min-width: 72px; padding-inline: 8px; }
  .workspace-panel { padding: 17px 12px 36px; }
  .workspace-panel .tasks-header h2, .workspace-section-head h2 { font-size: 21px; }
  .workspace-section-head.split { display: grid; align-items: start; }
  .workspace-filter-row { width: 100%; }
  .workspace-filter-row select { flex: 1; min-width: 0; }
  .asset-workspace-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .asset-tile > div:not(.asset-tile-actions) { padding: 8px 8px 6px; }
  .asset-tile-actions { padding: 0 8px 8px; }
  .project-management-grid { grid-template-columns: 1fr; }
  .workspace-panel .task-queue { grid-template-columns: 1fr; }
  .workspace-panel .task-images { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .prompt-plan-shell { margin-bottom: 17px; border-radius: 12px; }
  .prompt-plan-head { padding: 14px; }
  .prompt-plan-head h2 { font-size: 19px; }
  .prompt-plan-head p { font-size: 12px; }
  .prompt-plan-badge { display: none; }
  .prompt-plan-content { padding: 9px; }
  .prompt-plan-compare, .prompt-plan-notes { grid-template-columns: 1fr; }
  .prompt-plan-actions { display: grid; grid-template-columns: 1fr; }
  .prompt-plan-actions button { width: 100%; min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-tabs button, .asset-tile, .project-row { transition: none !important; }
}

/* Node canvas workspace — white production canvas inspired by modern visual editors. */
.canvas-workspace-panel { padding: 0 !important; overflow: hidden !important; }
.canvas-studio { position: relative; display: grid; grid-template-rows: 54px minmax(0,1fr); width: 100%; height: 100%; min-height: 0; }
.canvas-command-strip {
  position: relative; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 16px; border-bottom: 1px solid var(--studio-line); background: rgba(255,255,255,.94);
}
.canvas-command-strip > div:first-child { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.canvas-command-strip .eyebrow { font-size: 9px; }
.canvas-command-strip strong { font-size: 15px; white-space: nowrap; }
.canvas-command-strip small { overflow: hidden; color: var(--studio-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.canvas-command-actions { display: flex; gap: 7px; }
.canvas-command-actions button { min-height: 38px; }
.prompt-plan-popover {
  position: absolute; z-index: 20; top: 62px; right: 16px; width: min(680px,calc(100% - 32px)); max-height: calc(100% - 78px); margin: 0; overflow: auto;
  border-color: #c7cec7; background: #fff; box-shadow: 0 18px 48px rgba(28,35,29,.16);
}
.prompt-plan-head-actions { display: flex; align-items: center; gap: 8px; }
.prompt-plan-head-actions button { width: 36px; height: 36px; padding: 0; border: 1px solid #d7ddd7; border-radius: 9px; color: #4e5951; background: #f7f9f6; font-size: 22px; cursor: pointer; }
.prompt-plan-head-actions button:hover { background: #edf1ec; }
.canvas-viewport {
  position: relative; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; outline: none;
  background-color: #f5f6f3;
  cursor: grab; scrollbar-width: thin;
}
.canvas-viewport:active { cursor: grabbing; }
.canvas-space-pan .canvas-viewport, .canvas-space-pan .canvas-viewport * { cursor: grabbing !important; }
.canvas-viewport:focus-visible { box-shadow: inset 0 0 0 3px rgba(47,93,65,.18); }
.canvas-sizer { position: relative; width: 12000px; height: 8000px; }
.canvas-scene { position: absolute; inset: 0; width: 12000px; height: 8000px; transform-origin: 0 0; background-image: radial-gradient(circle,#c9cec7 .9px,transparent 1.1px); background-size: 18px 18px; }
.canvas-connections { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.canvas-connections path { fill: none; stroke: #89968c; stroke-width: 2; stroke-linecap: round; opacity: .82; vector-effect: non-scaling-stroke; }
.canvas-connections circle { fill: #fff; stroke: #58685d; stroke-width: 2; vector-effect: non-scaling-stroke; }
.canvas-empty-state {
  position: sticky; z-index: 1; top: 50%; left: 50%; width: min(390px,calc(100% - 40px)); min-height: 0; margin: 0; padding: 28px 30px;
  border: 1px dashed rgba(154,164,155,.55); border-radius: 22px; background: rgba(255,255,255,.58); box-shadow: none;
  transform: translate(-50%,-50%); pointer-events: none; user-select: none; backdrop-filter: blur(3px);
}
.canvas-empty-state .empty-icon { width: 48px; height: 48px; margin-bottom: 14px; }
.canvas-empty-state strong { font-size: 20px; }
.canvas-empty-state small { max-width: 320px; font-size: 13px; }
.canvas-scene .task-queue { position: absolute; inset: 0; z-index: 2; display: block; pointer-events: none; }
.canvas-scene .task-card {
  position: absolute; width: 286px; max-height: 470px; overflow-x: hidden; overflow-y: auto; pointer-events: auto;
  border-color: #c5ccc5; border-radius: 14px; background: rgba(255,255,255,.98); box-shadow: 0 11px 28px rgba(31,37,32,.09);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.canvas-scene .task-card::before { content: ''; position: absolute; z-index: 3; top: 41px; left: -7px; width: 11px; height: 11px; border: 2px solid #64726a; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px #f5f6f3; }
.canvas-scene .task-card:hover { border-color: #9faa9f; box-shadow: 0 15px 34px rgba(31,37,32,.12); }
.canvas-scene .task-card.canvas-selected { border-color: #397553; box-shadow: 0 0 0 3px rgba(57,117,83,.18),0 15px 34px rgba(31,37,32,.13); }
.canvas-node-port {
  position: absolute; z-index: 7; top: 38px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: crosshair;
}
.canvas-node-port::after { content: ""; position: absolute; inset: 7px; border: 2px solid #5e7064; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(247,248,246,.92); }
.canvas-node-port.input { left: -13px; }
.canvas-node-port.output { right: -13px; }
.canvas-node-port:hover::after, .canvas-node-port:focus-visible::after { border-color: #245f3f; background: #dcebe0; transform: scale(1.12); }
.canvas-node-port:focus-visible { outline: 3px solid rgba(47,93,65,.26); outline-offset: 1px; }
.canvas-connection-pending .canvas-node-port.input::after { border-color: #245f3f; background: #dcebe0; animation: canvas-port-pulse 1.2s ease-in-out infinite; }
.canvas-connections path.generated { stroke: #46795b; stroke-width: 2.4; }
.canvas-node-kind { display: block; margin-bottom: 2px; color: #768078; font-size: 9px; font-weight: 760; letter-spacing: 0; text-transform: uppercase; }
.canvas-node-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 12px 11px; border-top: 1px solid #e5e8e3; }
.canvas-node-actions button { min-height: 32px; padding: 5px 9px; border: 1px solid #d7dcd6; border-radius: 8px; color: #4f5a52; background: #f8f9f7; cursor: pointer; }
.canvas-free-node [contenteditable="true"] { cursor: text; border-radius: 5px; outline: none; }
.canvas-free-node [contenteditable="true"]:focus { background: #f0f6f1; box-shadow: 0 0 0 2px rgba(57,117,83,.16); }
.canvas-scene .task-card[data-canvas-node-type="image"].canvas-empty-image-node { display: block; height: auto; min-height: 0; max-height: none; overflow: visible; box-sizing: border-box; border-color: #c8ccc8; border-radius: 20px; background: #fafafa; box-shadow: 0 7px 18px rgba(31,37,32,.08); aspect-ratio: var(--empty-node-aspect,1); }
.canvas-empty-image-node::before { display: none; }
.canvas-empty-image-node .task-card-head { position: absolute; bottom: 100%; min-height: 22px; padding: 0 2px 4px; border: 0 !important; background: transparent; cursor: grab; }
.canvas-empty-image-node .task-card-head strong { display: none; }
.canvas-empty-image-node .canvas-node-kind { margin: 0; color: #929894; font-size: 10px; letter-spacing: 0; text-transform: none; }
.canvas-empty-image-body { position: absolute; inset: 0; display: grid; height: auto; min-height: 0; padding: 0; place-items: center; color: #d7dbd8; background: #fafafa; border-radius: inherit; }
.canvas-empty-image-body span { font-size: 28px; }
.canvas-empty-image-body small { display: none; }
.canvas-empty-image-node:not(.canvas-selected) > .canvas-node-actions { display: none; }
.canvas-empty-image-node.canvas-selected > .canvas-node-actions { position: absolute !important; top: calc(100% + 8px); right: 0; bottom: auto !important; left: auto; width: max-content; padding: 6px; border: 1px solid #dfe4de; border-radius: 11px; background: rgba(251,252,250,.97); box-shadow: 0 8px 20px rgba(31,37,32,.09); }
.canvas-empty-image-node > .canvas-node-port { top: calc(50% - 13px); }
.canvas-scene .task-card[data-canvas-node-type="image"].canvas-empty-image-node:not(.canvas-selected) { border: 1px solid #d7dad7; background: #fafafa; box-shadow: 0 7px 18px rgba(31,37,32,.08); }
.canvas-scene .task-card[data-canvas-node-type="image"].canvas-empty-image-node:not(.canvas-selected) > .canvas-empty-image-body { display: grid; padding: 0; }
.task-result-summary { padding: 12px 14px; color: #3d6c4f; background: #eff6f0; font-size: 12px; line-height: 1.55; }
@keyframes canvas-port-pulse { 50% { box-shadow: 0 0 0 7px rgba(57,117,83,.16); } }
.canvas-scene .task-card[data-canvas-node-type="task"] .task-card-head { border-top: 3px solid #8a958d; }
.canvas-scene .task-card[data-canvas-node-type="image"] { width: 238px; max-height: 360px; }
.canvas-scene .task-card[data-canvas-node-type="image"] .task-card-head { border-top: 3px solid #3d7655; }
.canvas-scene .task-card[data-canvas-node-type="image"] .task-images { grid-template-columns: 1fr; padding: 8px; }
.canvas-scene .task-card[data-canvas-node-type="image"] .task-image { border-radius: 9px; }
.canvas-scene .task-card[data-canvas-node-type="image"]:not(.canvas-selected) {
  overflow: visible; border-color: transparent; background: transparent; box-shadow: none;
}
.canvas-scene .task-card[data-canvas-node-type="image"]:not(.canvas-selected):hover { border-color: transparent; box-shadow: none; }
.canvas-scene .task-card[data-canvas-node-type="image"]:not(.canvas-selected)::before,
.canvas-scene .task-card[data-canvas-node-type="image"]:not(.canvas-selected) > .canvas-node-port,
.canvas-scene .task-card[data-canvas-node-type="image"]:not(.canvas-selected) > .task-card-head,
.canvas-scene .task-card[data-canvas-node-type="image"]:not(.canvas-selected) > .canvas-node-actions { display: none; }
.canvas-scene .task-card[data-canvas-node-type="image"]:not(.canvas-selected) > .task-images { padding: 0; }
.canvas-scene .task-card[data-canvas-node-type="image"]:not(.canvas-selected) .task-image { border-radius: 14px; box-shadow: 0 10px 28px rgba(31,37,32,.11); }
.canvas-scene .task-card[data-canvas-node-type="image"].canvas-selected > .canvas-node-actions {
  position: sticky; z-index: 8; bottom: 0; display: flex; background: rgba(251,252,250,.97); backdrop-filter: blur(8px);
}
.canvas-scene .task-card[data-canvas-node-type="asset"] .task-card-head { border-top: 3px solid #a47432; }
.canvas-scene .task-card[data-canvas-node-type="text"] .task-card-head,
.canvas-scene .task-card[data-canvas-node-type="prompt"] .task-card-head { border-top: 3px solid #657589; }
.canvas-scene .task-card:has(.task-status.success) { border-color: #b7c8bc; }
.canvas-scene .task-card:has(.task-status.failed) { border-color: #d3abab; }
.canvas-scene .task-card:has(.task-spinner) { animation: canvas-node-pulse 1.8s ease-in-out infinite; }
.canvas-scene .task-card[data-preview-ratio] .task-progress {
  width: 100%; min-height: 0; aspect-ratio: var(--task-aspect,1); padding: 18px; box-sizing: border-box;
}
.canvas-scene .task-card-head { min-height: 52px; align-items: center; padding: 12px 14px; background: #fbfcfa; }
.canvas-scene .task-card-title strong { font-size: 14px; }
.canvas-scene .task-card-title span { font-size: 11px; }
.canvas-scene .task-prompt { padding: 12px 14px; }
.canvas-scene .task-prompt-text { font-size: 12px; line-height: 1.58; }
.canvas-scene .task-foot { padding: 10px 14px; }
.canvas-scene .task-card-head { cursor: grab; }
.canvas-scene .task-card-head:active { cursor: grabbing; }
.canvas-scene .task-images { grid-template-columns: repeat(2,minmax(0,1fr)); }
.canvas-scene .task-image img { aspect-ratio: 1; object-fit: cover; }
.canvas-tool-rail {
  position: absolute; z-index: 30; bottom: 24px; left: 16px; display: grid; width: 52px; gap: 5px; margin: 0;
  padding: 6px; border: 1px solid #d4d8d2; border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 10px 28px rgba(30,35,31,.12);
}
.canvas-tool-rail::after { content: '画布'; display: block; padding: 3px 0 5px; color: #737c75; font-size: 9px; font-weight: 700; letter-spacing: 0; text-align: center; }
.canvas-tool-rail button, .canvas-zoom-controls button { min-width: 40px; min-height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 20px; cursor: pointer; }
.canvas-tool-rail button:first-child { color: #fff; background: #1f2420; font-size: 25px; }
.canvas-tool-rail button:hover, .canvas-zoom-controls button:hover { background: #edf0ec; }
.canvas-tool-rail button:first-child:hover { background: #343a35; }
.canvas-add-menu { position: absolute; z-index: 40; bottom: 0; left: calc(100% + 10px); display: grid; width: 264px; gap: 4px; padding: 10px; border: 1px solid #d8dcd7; border-radius: 18px; background: rgba(255,255,255,.98); box-shadow: 0 18px 46px rgba(30,35,31,.16); pointer-events: auto; }
.canvas-add-menu.hidden { display: none; }
.canvas-add-menu button { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; min-height: 58px; padding: 9px 12px; border: 0; border-radius: 12px; color: #303732; background: transparent; text-align: left; cursor: pointer; }
.canvas-add-menu button:hover { background: #f0f2ef; }
.canvas-add-menu button:disabled { color: #a9afaa; cursor: not-allowed; }
.canvas-add-menu button span { grid-row: 1/3; align-self: center; font-size: 22px; }
.canvas-add-menu button b { font-size: 14px; }
.canvas-add-menu button small { font-size: 11px; }
.canvas-zoom-controls {
  position: absolute; z-index: 30; bottom: 24px; left: 82px; display: flex; width: max-content; align-items: center; gap: 2px; margin: 0;
  border: 1px solid #d4d8d2; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 8px 24px rgba(30,35,31,.09);
}
.canvas-zoom-controls output { min-width: 50px; color: #505850; font-size: 12px; text-align: center; }
.canvas-composer {
  position: absolute; z-index: 10; top: 0; left: 0; width: 440px; max-width: 620px; margin: 0; container-type: inline-size;
  padding: 16px 20px 14px; border: 1px solid #d5d8d4; border-radius: 26px; background: rgba(255,255,255,.98); box-shadow: 0 18px 52px rgba(30,35,31,.15);
}
.canvas-composer.hidden { display: none; }
.canvas-composer-context { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #edf0ec; }
.canvas-composer-context strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.canvas-composer-context small { flex: 0 0 auto; color: #6c776f; font-size: 11px; }
.canvas-reference-tray { display: flex; gap: 8px; min-height: 62px; padding: 10px 0 2px; overflow-x: auto; }
.canvas-reference-tray.hidden { display: none; }
.canvas-reference-item { position: relative; flex: 0 0 auto; width: 58px; height: 58px; }
.canvas-reference-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; cursor: zoom-in; }
.canvas-reference-item button { position: absolute; top: -5px; right: -5px; width: 22px; min-height: 22px; padding: 0; border-radius: 50%; color: #fff; border: 2px solid #fff; background: #555b57; }
.canvas-composer textarea { width: 100%; min-height: 118px; max-height: 250px; resize: vertical; padding: 16px 0; border: 0; outline: 0; color: var(--studio-ink); background: transparent; font: inherit; font-size: 17px; line-height: 1.62; }
.canvas-composer > div { display: flex; align-items: center; gap: 8px; }
.canvas-composer-toolbar { flex-wrap: nowrap; border-top: 1px solid #eff1ee; padding-top: 10px; }
.canvas-composer button { flex: 0 0 auto; min-height: 38px; padding-inline: 10px; border: 1px solid #d9ddd7; border-radius: 10px; background: #f7f8f6; white-space: nowrap; cursor: pointer; }
.canvas-composer #canvasOpenImageSettings { flex: 1 1 120px; min-width: 88px; max-width: 260px; overflow: hidden; }
.canvas-composer #canvasConfigSummary { display: block; overflow: hidden; color: #626b64; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.canvas-composer .canvas-media-placeholder { color: #a3aaa5; opacity: .72; cursor: not-allowed; }
.canvas-composer .canvas-agent-note { min-width: 70px; margin-left: auto; color: #7a837c; font-size: 12px; text-align: right; }
.canvas-composer .canvas-send-button { width: 40px; color: #fff; border-color: #29312b; background: #29312b; font-size: 20px; }
@container (max-width: 520px) {
  .canvas-composer .canvas-agent-note, .canvas-composer .canvas-media-placeholder { display: none; }
}
.canvas-parameter-popover { position: absolute; z-index: 35; right: 18px; bottom: calc(100% + 10px); left: 18px; display: grid; gap: 13px; max-height: min(560px,calc(100vh - 190px)); padding: 16px; overflow: auto; border: 1px solid #d3d9d2; border-radius: 18px; background: rgba(255,255,255,.99); box-shadow: 0 22px 60px rgba(27,34,29,.18); }
.canvas-parameter-popover.hidden { display: none; }
.canvas-parameter-popover header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.canvas-parameter-popover header div { display: grid; gap: 2px; }
.canvas-parameter-popover header strong { font-size: 15px; }
.canvas-parameter-popover header small { color: #778078; font-size: 11px; }
.canvas-parameter-popover header button { width: 34px; min-height: 34px; padding: 0; font-size: 20px; }
.canvas-parameter-model, .canvas-parameter-group { display: grid; gap: 7px; }
.canvas-parameter-model > span, .canvas-parameter-group > span { color: #687169; font-size: 11px; font-weight: 720; }
.canvas-parameter-model select { width: 100%; min-height: 40px; padding-inline: 10px; border: 1px solid #d7ddd6; border-radius: 10px; background: #f8faf7; }
.canvas-parameter-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.canvas-parameter-choices button { min-width: 54px; min-height: 36px; padding: 5px 10px; }
.canvas-parameter-choices button.active { color: #1f5b3a; border-color: #9bb8a4; background: #eaf4ec; box-shadow: inset 0 0 0 1px #c6d9ca; }
.canvas-composer:focus-within { border-color: #829489; box-shadow: 0 0 0 3px rgba(57,117,83,.12),0 16px 42px rgba(30,35,31,.14); }
.canvas-command-actions button:hover, .canvas-composer button:hover { border-color: #bcc5bd; background: #edf1ec; }
.canvas-tool-rail button:focus-visible, .canvas-zoom-controls button:focus-visible, .canvas-composer button:focus-visible, .canvas-composer textarea:focus-visible { outline: 3px solid rgba(47,93,65,.24); outline-offset: 2px; }
@keyframes canvas-node-pulse { 0%,100% { box-shadow: 0 11px 28px rgba(31,37,32,.09); } 50% { box-shadow: 0 11px 32px rgba(70,117,83,.18); } }
@media (max-width: 1050px) and (min-width: 901px) {
  .canvas-command-strip small { max-width: 190px; }
}
@media (max-width: 900px) {
  .canvas-studio { grid-template-rows: 48px minmax(0,1fr); }
  .canvas-command-strip { padding-inline: 10px; }
  .canvas-command-strip .eyebrow, .canvas-command-strip small { display: none; }
  .canvas-command-actions button { min-height: 36px; padding-inline: 9px; }
  .prompt-plan-popover { top: 56px; right: 8px; width: calc(100% - 16px); max-height: calc(100% - 66px); }
  .canvas-composer { min-width: 276px; padding: 10px 11px 9px; border-radius: 16px; }
  .canvas-composer textarea { min-height: 52px; max-height: 112px; font-size: 16px; }
  .canvas-composer > div { gap: 6px; }
  .canvas-composer button { min-height: 42px; }
  .canvas-composer .canvas-agent-note, .canvas-composer .canvas-media-placeholder { display: none; }
  .canvas-zoom-controls { left: 68px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .canvas-tool-rail { left: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .canvas-tool-rail button { min-width: 42px; min-height: 42px; }
  .canvas-scene .task-card { max-height: 410px; }
  .canvas-add-menu { left: calc(100% + 8px); bottom: 0; width: min(230px,calc(100vw - 78px)); }
  .canvas-parameter-popover { right: 8px; left: 8px; max-height: calc(100vh - 150px); padding: 13px; border-radius: 15px; }
}
@media (max-width: 390px) {
  .canvas-command-strip strong { font-size: 14px; }
  .canvas-command-actions button { min-width: 44px; font-size: 12px; }
  .canvas-composer { min-width: 0; }
  .canvas-composer #canvasAttachHistory { width: 48px; overflow: hidden; padding-inline: 8px; white-space: nowrap; }
}
@media (hover: none) { .canvas-scene .task-card:hover { border-color: #c5ccc5; box-shadow: 0 11px 28px rgba(31,37,32,.09); } }
@media (prefers-reduced-motion: reduce) { .canvas-scene, .canvas-scene .task-card { transition: none !important; animation: none !important; } }
@media (forced-colors: active) { .canvas-scene .task-card.canvas-selected { outline: 3px solid Highlight; } .canvas-connections path { stroke: CanvasText; } }

/* Canvas-first studio shell: compact chrome, resizable panes and full-bleed workspace. */
@media (min-width: 901px) {
  .studio-app .app-header {
    height: 56px; flex-basis: 56px; padding-inline: 16px;
    grid-template-columns: minmax(180px,1fr) auto;
  }
  .studio-app .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .studio-app .brand-block small { display: none; }
  .studio-app .mobile-view-switch { display: none; }
  .studio-app .header-actions { grid-column: 2; }
  .studio-app .settings-button { min-height: 40px; height: 40px; }

  .studio-shell {
    --chat-pane-width: 38%;
    position: relative;
    display: grid;
    grid-template-columns: minmax(300px,var(--chat-pane-width)) 9px minmax(420px,1fr);
    height: calc(100dvh - 56px);
    min-height: 0;
  }
  .studio-chat-pane { border-right: 0; }
  .studio-chat-pane .conversation-head { min-height: 58px; padding-top: 10px; padding-bottom: 8px; }
  .studio-chat-pane .conversation-shell { padding-inline: clamp(14px,1.7vw,24px); }
  .studio-chat-pane .brain-welcome { margin-top: clamp(8px,2vh,22px); }

  .studio-splitter {
    position: relative; z-index: 30; width: 9px; height: 100%; touch-action: none; cursor: col-resize;
    background: var(--studio-surface); border-inline: 1px solid var(--studio-line); outline: 0;
  }
  .studio-splitter::before {
    content: ""; position: absolute; inset: 0 -5px;
  }
  .studio-splitter span {
    position: absolute; top: 50%; left: 50%; width: 3px; height: 42px;
    border-radius: 999px; background: #b8c0b7; transform: translate(-50%,-50%); opacity: .64;
    transition: height 150ms ease, background 150ms ease, opacity 150ms ease;
  }
  .studio-splitter:hover span, .studio-splitter:focus-visible span, .studio-splitter.dragging span { height: 68px; background: var(--studio-accent); opacity: 1; }
  .studio-splitter:focus-visible { box-shadow: inset 0 0 0 2px rgba(47,93,65,.25); }
  body.resizing-studio, body.resizing-studio * { cursor: col-resize !important; user-select: none !important; }

  .studio-workspace-pane {
    position: relative; container-type: inline-size; display: grid !important; grid-template-rows: minmax(0,1fr);
  }
  .workspace-panels { grid-area: 1/1; width: 100%; height: 100%; }
  .workspace-panel { padding-top: 86px; }
  .canvas-workspace-panel { padding-top: 0 !important; }

  .workspace-commandbar {
    position: absolute; z-index: 16; top: 12px; right: 12px; min-height: 46px; width: auto;
    padding: 5px; border: 1px solid rgba(195,202,193,.92); border-radius: 13px;
    background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(30,35,31,.09); backdrop-filter: blur(14px);
  }
  .workspace-project-context { display: none; }
  .workspace-project-actions { gap: 4px; }
  .workspace-project-actions select { width: clamp(136px,14vw,196px); min-height: 36px; padding-block: 6px; border: 0; background: transparent; font-size: 13px; }
  .workspace-project-actions button { min-width: 38px; min-height: 36px; padding-inline: 9px; border: 0; }

  .workspace-tabs {
    position: absolute; z-index: 16; top: 12px; left: 12px; min-height: 46px; width: max-content; max-width: calc(100% - 250px);
    align-items: center; gap: 2px; padding: 4px; border: 1px solid rgba(195,202,193,.92); border-radius: 13px;
    background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(30,35,31,.09); backdrop-filter: blur(14px);
  }
  .workspace-tabs button { min-width: 64px; min-height: 36px; padding-inline: 11px; border-radius: 9px; font-size: 13px; }
  .workspace-tabs button::after { display: none; }
  .workspace-tabs button:hover { background: #f0f3ef; }
  .workspace-tabs button.active { color: var(--studio-accent); background: var(--studio-accent-soft); box-shadow: inset 0 0 0 1px #cad8cd; }

  .canvas-studio { display: block; height: 100%; }
  .canvas-viewport { position: absolute; inset: 0; width: 100%; height: 100%; }
  .canvas-command-strip {
    position: absolute; z-index: 15; top: 70px; right: 12px; left: auto; width: auto; min-height: 42px;
    padding: 4px; border: 1px solid rgba(195,202,193,.9); border-radius: 12px;
    background: rgba(255,255,255,.92); box-shadow: 0 8px 22px rgba(30,35,31,.08); backdrop-filter: blur(12px);
  }
  .canvas-command-strip > div:first-child { display: none; }
  .canvas-command-actions { gap: 2px; }
  .canvas-command-actions button { min-height: 34px; padding: 5px 9px; border: 0; border-radius: 8px; font-size: 12px; }
  .prompt-plan-popover { top: 120px; max-height: calc(100% - 136px); }
}

@container (max-width: 660px) {
  .workspace-commandbar { top: 66px; }
  .workspace-tabs { max-width: calc(100% - 24px); overflow-x: auto; }
  .canvas-command-strip { top: 120px; }
  .prompt-plan-popover { top: 170px; max-height: calc(100% - 186px); }
  .workspace-panel:not(.canvas-workspace-panel) { padding-top: 136px; }
}

.brain-activity-indicator {
  display: flex; width: fit-content; align-items: center; gap: 9px; margin: 0 0 18px 4px; padding: 9px 12px;
  border: 1px solid #dbe0d9; border-radius: 11px; color: #526057; background: rgba(255,255,255,.78);
  font-size: 13px; box-shadow: 0 4px 14px rgba(31,37,32,.045);
}
.brain-activity-dots { display: inline-flex; align-items: center; gap: 3px; }
.brain-activity-dots i { width: 5px; height: 5px; border-radius: 50%; background: #4d755c; animation: brain-dot 1.15s ease-in-out infinite; }
.brain-activity-dots i:nth-child(2) { animation-delay: 140ms; }
.brain-activity-dots i:nth-child(3) { animation-delay: 280ms; }
@keyframes brain-dot { 0%,70%,100% { opacity: .28; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 900px) {
  .studio-splitter { display: none; }
  .workspace-commandbar, .workspace-tabs { position: static; }
  .canvas-viewport { position: relative; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-splitter span, .brain-activity-dots i { transition: none !important; animation: none !important; }
  .brain-activity-dots i { opacity: .75; }
}

/* Canvas organization controls: quiet grouping, compact HUDs and explicit states. */
.canvas-groups {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.canvas-group-frame {
  --canvas-group-fill: rgba(105, 139, 116, .11);
  --canvas-group-line: rgba(72, 112, 86, .42);
  position: absolute;
  box-sizing: border-box;
  border: 1px solid var(--canvas-group-line);
  border-radius: 8px;
  background: var(--canvas-group-fill);
  pointer-events: none;
}
.canvas-group-frame[data-color="rose"] { --canvas-group-fill: rgba(174, 112, 118, .11); --canvas-group-line: rgba(145, 78, 87, .4); }
.canvas-group-frame[data-color="amber"] { --canvas-group-fill: rgba(190, 145, 72, .12); --canvas-group-line: rgba(155, 112, 47, .42); }
.canvas-group-frame[data-color="blue"] { --canvas-group-fill: rgba(91, 128, 162, .11); --canvas-group-line: rgba(65, 103, 139, .4); }
.canvas-group-handle {
  position: absolute;
  top: 8px;
  left: 10px;
  display: block;
  max-width: calc(100% - 20px);
  min-height: 32px;
  overflow: hidden;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #3f4b43;
  background: rgba(255,255,255,.88);
  box-shadow: 0 2px 8px rgba(31,37,32,.06);
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}
.canvas-group-handle:hover { border-color: var(--canvas-group-line); background: #fff; }
.canvas-group-handle:active { background: #f2f4f1; box-shadow: none; cursor: grabbing; }
.canvas-group-handle:focus-visible { outline: 3px solid rgba(47,93,65,.24); outline-offset: 2px; }

.canvas-selection-toolbar {
  position: absolute;
  z-index: 34;
  display: flex;
  width: max-content;
  max-width: calc(100% - 20px);
  min-height: 44px;
  align-items: center;
  gap: 3px;
  padding: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--studio-line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30,35,31,.13);
  scrollbar-width: thin;
  white-space: nowrap;
}
.canvas-selection-toolbar.hidden { display: none; }
.canvas-selection-toolbar > span {
  flex: 0 0 auto;
  padding: 0 9px;
  color: var(--studio-muted);
  font-size: 12px;
}
.canvas-selection-toolbar > span b { color: var(--studio-ink); font-variant-numeric: tabular-nums; }
.canvas-selection-toolbar button,
.canvas-tool-rail button,
.canvas-zoom-controls button {
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #465048;
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.canvas-selection-toolbar button:hover,
.canvas-tool-rail button:hover,
.canvas-zoom-controls button:hover { color: #26312a; border-color: #d9ded8; background: #f0f3ef; }
.canvas-selection-toolbar button:active,
.canvas-tool-rail button:active,
.canvas-zoom-controls button:active { background: #e5eae4; box-shadow: inset 0 1px 2px rgba(31,37,32,.12); transform: translateY(1px); }
.canvas-selection-toolbar button:focus-visible,
.canvas-tool-rail button:focus-visible,
.canvas-zoom-controls button:focus-visible { outline: 3px solid rgba(47,93,65,.24); outline-offset: 2px; }
.canvas-selection-toolbar button:disabled,
.canvas-tool-rail button:disabled,
.canvas-zoom-controls button:disabled { color: #a3aaa4; background: transparent; box-shadow: none; cursor: not-allowed; opacity: .55; transform: none; }
.canvas-tool-rail button[aria-pressed="true"],
.canvas-zoom-controls button[aria-pressed="true"] {
  color: #204b32;
  border-color: #b9cdbd;
  background: #e5efe7;
  box-shadow: inset 0 0 0 1px rgba(62,105,76,.12);
}
.canvas-tool-rail button[aria-pressed="true"]:hover,
.canvas-zoom-controls button[aria-pressed="true"]:hover { background: #dbe9de; }
.group-color-button { width: 40px; padding: 0; }
.group-color-button i {
  display: block;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 1px solid rgba(50,70,57,.34);
  border-radius: 4px;
  background: #a9c0ae;
}
.canvas-selection-toolbar[data-color="rose"] .group-color-button i { background: #d7a9ad; }
.canvas-selection-toolbar[data-color="amber"] .group-color-button i { background: #d9bd87; }
.canvas-selection-toolbar[data-color="blue"] .group-color-button i { background: #a6bdd2; }

.canvas-connections.canvas-edges-hidden { opacity: 0; }
.canvas-connections { transition: opacity 120ms ease; }

.canvas-minimap {
  position: absolute;
  right: 14px;
  bottom: 18px;
  z-index: 31;
  width: 176px;
  height: 112px;
  overflow: hidden;
  border: 1px solid #cbd2ca;
  border-radius: 7px;
  background: #f9faf8;
  box-shadow: 0 8px 22px rgba(30,35,31,.11);
  cursor: crosshair;
  touch-action: none;
}
.canvas-minimap.hidden { display: none; }
.canvas-minimap:hover { border-color: #9daa9f; }
.canvas-minimap:active { background: #f3f5f2; }
.canvas-minimap:focus-visible { outline: 3px solid rgba(47,93,65,.24); outline-offset: 2px; }
.canvas-mini-nodes,
.canvas-mini-viewport { position: absolute; inset: 0; pointer-events: none; }
.canvas-mini-nodes i {
  position: absolute;
  min-width: 3px;
  min-height: 3px;
  border: 1px solid rgba(63,86,70,.32);
  border-radius: 1px;
  background: #8ba292;
}
.canvas-mini-viewport {
  inset: auto;
  box-sizing: border-box;
  border: 2px solid #2f6545;
  border-radius: 2px;
  background: rgba(255,255,255,.38);
  box-shadow: 0 0 0 1px rgba(255,255,255,.72);
}

/* Keep the canvas chrome opaque and compact; the canvas remains the dominant surface. */
.canvas-tool-rail,
.canvas-zoom-controls,
.canvas-composer,
.canvas-parameter-popover,
.canvas-add-menu,
.canvas-command-strip { background: #fff; backdrop-filter: none; }
.canvas-tool-rail { width: 50px; gap: 2px; padding: 5px; border-radius: 8px; }
.canvas-tool-rail::after { padding-block: 2px; }
.canvas-tool-rail button,
.canvas-zoom-controls button { font-size: 18px; }
.canvas-tool-rail button:first-child { color: #fff; border-color: #1f2420; background: #1f2420; }
.canvas-tool-rail button:first-child:hover { border-color: #343a35; background: #343a35; }
.canvas-zoom-controls { min-height: 44px; padding: 2px; border-radius: 8px; }
.canvas-command-actions { min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.canvas-command-actions button { flex: 0 0 auto; white-space: nowrap; }
.canvas-add-menu,
.canvas-composer,
.canvas-parameter-popover { border-radius: 8px; }
.canvas-add-menu button { border-radius: 6px; }
.canvas-composer button:active,
.canvas-command-actions button:active { background: #e4e9e3; box-shadow: inset 0 1px 2px rgba(31,37,32,.12); transform: translateY(1px); }
.canvas-command-actions button:focus-visible,
.canvas-add-menu button:focus-visible,
.canvas-parameter-popover button:focus-visible { outline: 3px solid rgba(47,93,65,.24); outline-offset: 2px; }
.canvas-command-actions button:disabled,
.canvas-add-menu button:disabled,
.canvas-parameter-popover button:disabled { color: #a3aaa4; box-shadow: none; cursor: not-allowed; opacity: .55; transform: none; }

@media (min-width: 901px) {
  .studio-shell[data-chat-dock="right"] { grid-template-columns: minmax(420px,1fr) 9px minmax(300px,var(--chat-pane-width)); }
  .studio-shell[data-chat-dock="right"] .studio-workspace-pane { grid-column: 1; grid-row: 1; }
  .studio-shell[data-chat-dock="right"] .studio-splitter { grid-column: 2; grid-row: 1; }
  .studio-shell[data-chat-dock="right"] .studio-chat-pane { grid-column: 3; grid-row: 1; border-left: 0; }
  .studio-shell[data-chat-dock="right"] .canvas-command-strip { right: auto; left: 12px; }
}

@media (max-width: 900px) {
  .canvas-command-strip { min-width: 0; padding: 4px 8px; }
  .canvas-command-strip > div:first-child { display: none; }
  .canvas-command-actions { width: 100%; gap: 2px; }
  .canvas-command-actions button { min-width: max-content; min-height: 44px; padding-inline: 10px; }
  .canvas-tool-rail { bottom: calc(8px + env(safe-area-inset-bottom)); left: max(8px,env(safe-area-inset-left)); grid-template-columns: repeat(8,44px); width: calc(100% - 16px); max-width: none; gap: 2px; overflow-x: hidden; overflow-y: hidden; }
  .canvas-tool-rail::after { display: none; }
  .canvas-tool-rail #canvasCenterView { display: none; }
  .canvas-tool-rail button,
  .canvas-zoom-controls button { min-width: 44px; min-height: 44px; }
  .canvas-zoom-controls { bottom: calc(68px + env(safe-area-inset-bottom)); left: max(8px,env(safe-area-inset-left)); }
  .canvas-minimap { right: max(8px,env(safe-area-inset-right)); bottom: calc(68px + env(safe-area-inset-bottom)); width: 148px; height: 94px; }
  .canvas-selection-toolbar { max-width: calc(100% - 16px); min-height: 48px; }
  .canvas-selection-toolbar button { min-width: 44px; min-height: 44px; }
}

@media (max-width: 390px) {
  .canvas-command-actions button { flex: 1 1 0; min-width: 0; padding-inline: 6px; }
  .canvas-minimap { width: 132px; height: 84px; }
  .canvas-selection-toolbar > span { padding-inline: 6px; }
  .canvas-selection-toolbar { right: 8px; left: 8px !important; width: auto; }
}

@media (hover: none) {
  .canvas-group-handle:hover,
  .canvas-minimap:hover { border-color: var(--studio-line-strong); }
  .canvas-selection-toolbar button:hover,
  .canvas-tool-rail button:hover,
  .canvas-zoom-controls button:hover { border-color: transparent; background: transparent; }
  .canvas-tool-rail button[aria-pressed="true"]:hover,
  .canvas-zoom-controls button[aria-pressed="true"]:hover { border-color: #b9cdbd; background: #e5efe7; }
}

@media (prefers-reduced-motion: reduce) {
  .canvas-connections,
  .canvas-group-handle,
  .canvas-selection-toolbar button,
  .canvas-tool-rail button,
  .canvas-zoom-controls button { transition: none !important; }
}

@media (forced-colors: active) {
  .canvas-group-frame,
  .canvas-selection-toolbar,
  .canvas-minimap { border-color: CanvasText; background: Canvas; }
  .canvas-group-handle,
  .canvas-mini-nodes i,
  .canvas-mini-viewport { forced-color-adjust: none; }
  .canvas-tool-rail button[aria-pressed="true"],
  .canvas-zoom-controls button[aria-pressed="true"] { outline: 2px solid Highlight; }
}
