.violet { background: #eeeafe; color: #6853c9; }
.ai-loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.ai-loading > span { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: #eeeafe; color: #6d5ce7; }
.ai-loading > span svg { width: 30px; height: 30px; }
.ai-loading h1 { margin: 22px 0 8px; font-size: clamp(25px, 4vw, 38px); }
.ai-loading p { margin: 0; color: var(--muted); }
.ai-tool-head { padding: 38px 0 28px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.ai-title-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 19px; background: linear-gradient(145deg, #7662ea, #5945bd); color: white; box-shadow: 0 14px 32px rgba(93,73,192,.2); }
.ai-title-mark svg { width: 30px; height: 30px; }
.ai-tool-head h1 { margin: 0; font-size: clamp(29px, 4vw, 42px); letter-spacing: -.04em; }
.ai-tool-head > div:nth-child(2) > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.ai-provider-badge { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 30px; background: #eff8f0; color: #356445; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ai-provider-badge i { width: 7px; height: 7px; border-radius: 50%; background: #57a76e; box-shadow: 0 0 0 4px rgba(87,167,110,.14); }
.ai-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.ai-guide-button { min-height: 38px; padding: 0 14px; border: 1px solid #cec7ef; border-radius: 20px; background: #f5f2ff; color: #5c49b6; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.ai-guide-button:hover { background: #eeeafe; }
.ai-shell { margin-bottom: 40px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); overflow: clip; }
.ai-nav { min-height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); display: flex; gap: 28px; align-items: stretch; }
.ai-nav button { padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.ai-nav button.active { color: #5d49c0; border-bottom-color: #6d5ce7; }
.ai-notice { margin: 20px 24px 0; padding: 12px 15px; border: 1px solid #eadfb7; border-radius: 12px; background: #fffbeb; display: flex; gap: 12px; align-items: center; color: #826a1e; font-size: 12px; line-height: 1.5; }
.ai-notice strong { flex: 0 0 auto; }
.ai-mode-bar { padding: 22px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.ai-segmented { padding: 4px; border-radius: 12px; background: #f0f1ed; display: inline-flex; flex-wrap: wrap; gap: 3px; }
.ai-segmented button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650; }
.ai-segmented button.active { background: white; color: #5d49c0; box-shadow: 0 3px 12px rgba(36,42,37,.08); }
.ai-secondary { min-height: 44px; padding: 0 15px; border: 1px solid #d8dcd4; border-radius: 10px; background: white; color: #3c443e; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.ai-secondary:hover { background: #f5f6f2; }
.ai-workspace-grid { padding: 0 24px 28px; display: grid; grid-template-columns: minmax(410px, .9fr) minmax(420px, 1.1fr); gap: 20px; align-items: start; }
.ai-compose-card, .ai-task-column { min-width: 0; border: 1px solid var(--line); border-radius: 17px; background: #fbfcf9; }
.ai-compose-card { overflow: hidden; }
.ai-card-heading, .ai-task-heading { min-height: 72px; padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ai-card-heading span, .ai-task-heading span, .ai-history-head span, .ai-settings-head span { display: block; margin-bottom: 3px; color: #8d938d; font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.ai-card-heading h2, .ai-task-heading h2, .ai-history-head h2, .ai-settings-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.ai-card-heading code { padding: 5px 8px; border-radius: 6px; background: #eeeafe; color: #6652c7; font-size: 11px; }
.ai-task-heading b, .ai-history-head b, .ai-settings-head b { color: #6d5ce7; font-size: 11px; }
.ai-compose-form { padding: 20px; }
.ai-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-field { display: block; margin-bottom: 16px; }
.ai-field > span { display: block; margin-bottom: 7px; color: #474d48; font-size: 12px; font-weight: 700; }
.ai-field input, .ai-field select, .ai-field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d7dbd4; border-radius: 10px; background: #fff; color: var(--ink); outline: none; resize: vertical; }
.ai-field textarea { line-height: 1.55; }
.ai-field input:focus, .ai-field select:focus, .ai-field textarea:focus { border-color: #7866dc; box-shadow: 0 0 0 3px rgba(109,92,231,.09); }
.ai-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.ai-field.compact { max-width: 360px; margin: 0; }
.ai-choice { margin: 0 0 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.ai-choice legend { padding: 0 6px; color: #474d48; font-size: 12px; font-weight: 700; }
.ai-choice label, .ai-rights, .ai-check { display: flex; align-items: center; gap: 8px; color: #515853; font-size: 12px; }
.ai-choice input, .ai-rights input, .ai-check input { width: 16px; height: 16px; accent-color: #6d5ce7; }
.ai-preset-summary { margin-bottom: 16px; padding: 12px 14px; border-radius: 11px; background: #f0edff; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; }
.ai-preset-summary span { padding: 4px 7px; border-radius: 6px; background: #fff; color: #6652c7; font-size: 10px; font-weight: 750; }
.ai-preset-summary strong { color: #443591; font-size: 12px; }
.ai-preset-summary small { grid-column: 2; color: #776db0; font-size: 10px; }
.ai-upload-section { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.ai-upload-head { padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ai-upload-head strong { display: block; font-size: 12px; }
.ai-upload-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.ai-upload-button { min-height: 44px; padding: 0 12px; border: 1px solid #cfc7f5; border-radius: 9px; display: inline-flex; align-items: center; color: #604cc0; background: #f4f1ff; font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.ai-upload-button input { display: none; }
.ai-upload-list { min-height: 50px; padding: 10px 13px; border-top: 1px solid #edf0ea; display: flex; gap: 9px; overflow-x: auto; }
.ai-upload-list > p { margin: auto 0; color: #9ba09b; font-size: 10px; }
.ai-upload-chip { width: 82px; flex: 0 0 82px; position: relative; }
.ai-upload-chip img { width: 82px; height: 62px; border-radius: 8px; object-fit: cover; background: #eef0ec; }
.ai-upload-chip span { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.ai-upload-chip button { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; position: absolute; right: -5px; top: -6px; background: #282d29; color: white; cursor: pointer; }
.ai-upload-chip.with-role { width: 138px; flex-basis: 138px; }
.ai-upload-chip.with-role img { width: 138px; height: 88px; }
.ai-upload-chip.with-role select { width: 100%; min-height: 36px; margin-top: 5px; padding: 0 7px; border: 1px solid #d9ddd6; border-radius: 8px; background: #fafbf8; color: #4e554f; font: inherit; font-size: 9px; }
.ai-structure-panel { margin: 0 0 16px; padding: 13px 14px; border: 1px solid #dde0da; border-radius: 12px; background: #f7f8f5; display: grid; gap: 12px; }
.ai-structure-panel.active { border-color: #cec5f4; background: linear-gradient(145deg, #faf9ff, #f4f5f1); }
.ai-structure-toggle { min-height: 48px; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.ai-structure-toggle input { width: 19px; height: 19px; margin-top: 2px; accent-color: #6d5ce7; }
.ai-structure-toggle span { display: grid; gap: 3px; }
.ai-structure-toggle strong { color: #3d433e; font-size: 11px; }
.ai-structure-toggle small { color: #858b85; font-size: 9px; line-height: 1.5; }
.ai-structure-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-structure-status { color: #8a908a; font-size: 9px; }
.ai-structure-confirmed { min-width: 180px; flex: 1 1 240px; padding: 9px 11px; border: 1px solid #c9e0cf; border-radius: 9px; background: #f0f8f2; display: grid; gap: 2px; }
.ai-structure-confirmed b { color: #34704a; font-size: 10px; }
.ai-structure-confirmed span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4f5b52; font-size: 9px; }
.ai-structure-confirmed small { color: #7a887e; font-size: 8px; }
.ai-structure-dialog { width: min(720px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow-y: auto; }
.ai-structure-dialog form { display: grid; gap: 11px; }
.ai-structure-dialog .ai-field { margin: 0; }
.ai-structure-warning { padding: 10px 12px; border: 1px solid #edd4a6; border-radius: 9px; background: #fff8ea; }
.ai-structure-warning strong { color: #916216; font-size: 10px; }
.ai-structure-warning p { margin: 4px 0 0; color: #7d6b4c; font-size: 9px; }
.ai-rights { margin: -3px 0 18px; align-items: flex-start; line-height: 1.45; }
.ai-helper { margin: 0 0 17px; padding: 10px 12px; border-radius: 9px; background: #f1f3ef; color: #6f766f; font-size: 10px; line-height: 1.55; }
.ai-primary { min-height: 46px; padding: 0 18px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #6f5ce4, #5945b9); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; box-shadow: 0 9px 20px rgba(93,73,192,.18); }
.ai-primary:hover { background: linear-gradient(135deg, #6552d6, #4f3cad); }
.ai-primary:disabled { opacity: .58; cursor: wait; }
.ai-compose-form > .ai-primary { width: 100%; }
.ai-task-column { background: #f6f7f3; }
.ai-task-grid { max-height: 1100px; padding: 14px; display: grid; gap: 13px; overflow-y: auto; }
.ai-job-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.ai-job-card.running { border-color: #cfc7f5; box-shadow: 0 7px 22px rgba(83,66,173,.08); }
.ai-job-card.failed { border-color: #efc7c2; }
.ai-job-summary { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.ai-job-summary:focus-visible { border-radius: 9px; outline: 3px solid rgba(109,92,231,.2); outline-offset: 4px; }
.ai-job-summary > header { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.ai-job-summary > header span { color: #8b918b; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.ai-job-summary > header h3 { margin: 3px 0 0; font-size: 14px; }
.ai-job-summary > header b { padding: 4px 8px; border-radius: 20px; background: #f1f3ef; color: #697069; font-size: 9px; }
.ai-job-reference { margin-top: 8px; display: flex; align-items: center; gap: 6px; color: #878d87; font-size: 9px; font-weight: 700; }
.ai-job-reference code { padding: 3px 6px; border-radius: 5px; background: #eeeafe; color: #6755c1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; letter-spacing: .04em; }
.ai-job-card.running .ai-job-summary > header b { background: #eeeafe; color: #604cc0; }
.ai-job-card.completed .ai-job-summary > header b { background: #e9f5eb; color: #39704a; }
.ai-job-card.failed .ai-job-summary > header b { background: #fceae7; color: #a34b40; }
.ai-job-open-hint { margin: 9px 0 1px; display: inline-flex; color: #6755c1; font-size: 10px; font-weight: 750; }
.ai-job-card.is-collapsed .ai-job-body { display: none; }
.ai-job-body { padding-top: 12px; border-top: 1px solid #eceee9; margin-top: 12px; }
.ai-job-body > .ai-output-grid { margin-top: 8px; }
.ai-job-body-toolbar { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.ai-job-body-toolbar button { min-height: 36px; }
.ai-failure-detail-button { padding: 0 12px; border: 1px solid #e7bdb7; border-radius: 9px; background: #fff7f6; color: #a3443c; font-size: 10px; font-weight: 750; cursor: pointer; }
.ai-task-pagination { padding: 6px 2px 0; display: flex; align-items: center; justify-content: center; gap: 12px; }
.ai-task-pagination button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #5f665f; cursor: pointer; }
.ai-task-pagination button:disabled { opacity: .45; cursor: default; }
.ai-task-pagination span { color: #7c827c; font-size: 10px; }
.ai-prompt-planning { margin: 10px 0 0; padding: 9px 11px; border-radius: 9px; background: #f4f1ff; color: #6655b4; font-size: 10px; }
.ai-job-prompts { margin-top: 11px; border: 1px solid #ddd8f5; border-radius: 10px; background: #faf9ff; overflow: hidden; }
.ai-job-prompts > summary { padding: 9px 11px; color: #5f50ae; font-size: 10px; font-weight: 800; cursor: pointer; list-style-position: inside; }
.ai-job-prompts > div { max-height: 300px; padding: 0 11px 11px; display: grid; gap: 8px; overflow-y: auto; }
.ai-job-prompts > div > p { margin: 0; color: #686f69; font-size: 10px; line-height: 1.55; }
.ai-job-prompts article { padding: 9px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px #ebe8f8; }
.ai-job-prompts article strong { color: #51459a; font-size: 9px; }
.ai-job-prompts article p { margin: 5px 0 0; color: #3f4540; font-size: 10px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-job-input { margin-top: 11px; border: 1px solid #dfe2dc; border-radius: 10px; background: #f9faf7; overflow: hidden; }
.ai-job-input > summary { padding: 9px 11px; color: #536059; font-size: 10px; font-weight: 800; cursor: pointer; list-style-position: inside; }
.ai-job-input > div { max-height: 320px; padding: 0 12px 12px; overflow-y: auto; }
.ai-job-input dl { margin: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 7px 10px; }
.ai-job-input dt { color: #858b85; font-size: 9px; font-weight: 750; }
.ai-job-input dd { margin: 0; color: #444b45; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 9px; line-height: 1.55; }
.ai-job-input section { margin-top: 10px; padding: 10px; border: 1px solid #d5cef4; border-radius: 9px; background: #f5f2ff; }
.ai-job-input section strong { color: #5a4baa; font-size: 10px; }
.ai-job-input section p { margin: 5px 0; color: #5e6260; font-size: 9px; line-height: 1.5; }
.ai-job-input section ul, .ai-job-input section ol { margin: 6px 0 0; padding-left: 20px; color: #4f5550; font-size: 9px; line-height: 1.6; }
.ai-job-card-actions { margin-top: 10px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.ai-reuse-link { padding: 7px 10px; border: 1px solid #d6cff5; border-radius: 8px; background: #faf9ff; color: #5d4eb0; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
.ai-reuse-link:hover { background: #f0edff; }
.ai-reuse-link:focus-visible { outline: 3px solid rgba(109,92,231,.18); outline-offset: 2px; }
.ai-reuse-link:disabled { opacity: .55; cursor: wait; }
.ai-danger-link { padding: 7px 10px; border: 1px solid #efc7c2; border-radius: 8px; background: #fff8f7; color: #a7463d; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
.ai-danger-link:hover { background: #fceae7; }
.ai-danger-link:focus-visible { outline: 3px solid rgba(199,75,68,.18); outline-offset: 2px; }
.ai-danger-link:disabled { opacity: .55; cursor: wait; }
.ai-job-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-job-meta span { padding: 3px 6px; border-radius: 5px; background: #f1f3ef; color: #747a74; font-size: 9px; }
.ai-progress { height: 4px; margin: 12px 0; border-radius: 3px; background: #ecefe9; overflow: hidden; }
.ai-progress i { height: 100%; display: block; background: linear-gradient(90deg, #7a68e2, #b079e8); transition: width .3s ease; }
.ai-job-wait, .ai-job-error { margin: 8px 0 0; color: #929792; font-size: 10px; line-height: 1.5; }
.ai-job-error { color: #a34b40; white-space: pre-line; overflow-wrap: anywhere; }
.ai-output-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ai-batch-toolbar { min-height: 46px; margin-top: 12px; padding: 7px 9px; border: 1px solid #dde0da; border-radius: 10px; background: #f8f9f6; display: flex; align-items: center; gap: 10px; }
.ai-batch-toolbar.compact { margin: 10px 0 8px; }
.ai-batch-toolbar label { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; color: #505751; font-size: 10px; font-weight: 750; cursor: pointer; }
.ai-batch-toolbar input { width: 17px; height: 17px; accent-color: #6d5ce7; }
.ai-batch-toolbar span { margin-right: auto; color: #7b827b; font-size: 9px; }
.ai-batch-toolbar button { min-height: 34px; padding: 0 10px; font-size: 10px; }
.ai-asset-card { min-width: 0; border: 2px solid transparent; border-radius: 10px; background: #fff; position: relative; overflow: hidden; box-shadow: 0 3px 12px rgba(28,34,29,.06); }
.ai-asset-media { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #eef0ec; }
.ai-asset-preview { width: 100%; height: 100%; padding: 0; border: 0; display: block; background: transparent; cursor: zoom-in; }
.ai-asset-preview > img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .18s ease; }
.ai-asset-preview:hover > img { transform: scale(1.018); }
.ai-asset-card.selectable { cursor: pointer; }
.ai-asset-card.selectable:focus-visible { outline: 3px solid rgba(109,92,231,.23); outline-offset: 2px; }
.ai-asset-card.selected { border-color: #6d5ce7; box-shadow: 0 0 0 2px rgba(109,92,231,.14); }
.ai-asset-card.batch-selected { border-color: #6d5ce7; }
.ai-asset-card.quality-failed { border-color: #d95850; background: #fff1ef; }
.ai-asset-card.quality-failed .ai-asset-preview > img { filter: saturate(.78); }
.ai-asset-card.quality-review_error { border-color: #d99b34; }
.ai-quality-badge, .ai-selected-target { min-height: 22px; padding: 0 7px; border-radius: 6px; position: absolute; top: 6px; z-index: 3; display: inline-flex; align-items: center; color: #fff; font-size: 8px; font-weight: 800; box-shadow: 0 3px 10px rgba(22,27,23,.18); }
.ai-quality-badge { left: 34px; background: #6d5ce7; }
.ai-quality-badge.passed { background: #378557; }
.ai-quality-badge.failed { background: #bf3e37; }
.ai-quality-badge.review_error { background: #a96c16; }
.ai-quality-badge.pending { background: #6754c9; }
.ai-quality-badge.pending::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border: 1px solid rgba(255,255,255,.55); border-top-color: #fff; border-radius: 50%; animation: ai-spin .8s linear infinite; }
.ai-selected-target { right: 6px; background: rgba(37,31,75,.9); }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-asset-checkbox { width: 26px; height: 26px; position: absolute; left: 6px; top: 6px; z-index: 5; display: grid; place-items: center; cursor: pointer; }
.ai-asset-checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.ai-asset-checkbox span { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.95); border-radius: 5px; background: rgba(25,31,27,.5); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.ai-asset-checkbox input:checked + span { border-color: #6d5ce7; background: #6d5ce7; }
.ai-asset-checkbox input:checked + span::after { content: "✓"; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 900; }
.ai-asset-actions { min-height: 42px; padding: 5px 6px; border-top: 1px solid #eceee9; display: flex; align-items: center; gap: 4px; }
.ai-asset-actions span { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #656c66; font-size: 8px; font-weight: 750; }
.ai-asset-actions button { min-height: 32px; padding: 0 7px; border: 1px solid #dedfdc; border-radius: 7px; background: #f8f9f6; color: #555d56; font-size: 8px; font-weight: 750; cursor: pointer; }
.ai-asset-actions button:hover { border-color: #cfc7f5; background: #f2efff; color: #5c4dac; }
.ai-video-confirm { min-height: 34px; margin: 0 6px 6px; padding: 0 7px; border: 0; border-radius: 7px; background: #f1effd; color: #5945b9; font-size: 8px; font-weight: 750; cursor: pointer; }
.ai-empty { min-height: 240px; display: grid; place-content: center; justify-items: center; text-align: center; color: #979d97; }
.ai-empty > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: #eeeafe; color: #6d5ce7; }
.ai-empty h3 { margin: 14px 0 5px; color: #626963; font-size: 15px; }
.ai-empty p { max-width: 340px; margin: 0; font-size: 11px; line-height: 1.6; }
.asset-menu { width: 210px; padding: 6px; border: 1px solid #d9ddd6; border-radius: 11px; position: fixed; z-index: 100; background: #fff; box-shadow: 0 16px 42px rgba(20,27,22,.2); }
.asset-menu[hidden] { display: none; }
.asset-menu button { width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; color: #373e39; cursor: pointer; font-size: 12px; }
.asset-menu button:hover { background: #f1f3ef; }
.asset-menu button.danger { color: #a5453b; }
.ai-dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 17px; color: var(--ink); box-shadow: 0 28px 80px rgba(18,24,20,.28); }
.ai-dialog::backdrop { background: rgba(17,23,19,.55); backdrop-filter: blur(3px); }
.ai-dialog form { padding: 28px; }
.ai-dialog-kicker { color: #6d5ce7; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.ai-dialog h2 { margin: 7px 0; font-size: 24px; }
.ai-dialog p { margin: 0 0 17px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.ai-dialog textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; font: inherit; line-height: 1.6; }
.ai-dialog-loading { min-height: 230px; padding: 32px; display: grid; place-items: center; align-content: center; text-align: center; }
.ai-dialog-loading > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: #eeeafe; color: #6d5ce7; animation: ai-dialog-pulse 1.2s ease-in-out infinite; }
.ai-dialog-loading h2 { margin-top: 16px; }
.ai-dialog-loading p { max-width: 360px; }
.ai-archive-dialog { width: min(440px, calc(100% - 28px)); }
.ai-archive-progress-content { padding: 30px; }
.ai-archive-progress-content h2 { margin: 8px 0; }
.ai-archive-progress-content > p { min-height: 20px; }
.ai-archive-progress { height: 9px; margin: 24px 0 18px; border-radius: 999px; background: #ecefe9; overflow: hidden; }
.ai-archive-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d5ce7, #aa78e8); transition: width .28s ease; }
.ai-archive-progress i.failed { background: #c65345; }
.ai-archive-progress-content > button { width: 100%; }
@keyframes ai-dialog-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 9px rgba(109,92,231,.08); } }
.ai-dialog .ai-check { min-height: 40px; padding: 0 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; }
.ai-dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
.ai-asset-lightbox { width: min(1500px, calc(100% - 24px)); height: min(960px, calc(100% - 24px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 20px; background: #101411; color: #fff; overflow: hidden; box-shadow: 0 34px 110px rgba(0,0,0,.55); }
.ai-asset-lightbox::backdrop { background: rgba(5,8,6,.82); backdrop-filter: blur(7px); }
.ai-lightbox-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.ai-lightbox-shell > header { min-height: 64px; padding: 10px 16px 10px 22px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; align-items: center; }
.ai-lightbox-shell > header > div { display: grid; gap: 3px; }
.ai-lightbox-shell > header span { font-size: 13px; font-weight: 800; }
.ai-lightbox-shell > header small { color: rgba(255,255,255,.6); font-size: 10px; }
.ai-lightbox-shell > header button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; font-size: 27px; cursor: pointer; }
.ai-lightbox-shell > main { min-height: 0; padding: 14px 68px; position: relative; display: grid; place-items: center; overflow: hidden; }
.ai-lightbox-shell > main > img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 7px; box-shadow: 0 18px 60px rgba(0,0,0,.35); }
.ai-lightbox-nav { width: 48px; height: 72px; border: 0; border-radius: 13px; position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); color: #fff; font-size: 42px; line-height: 1; cursor: pointer; }
.ai-lightbox-nav.prev { left: 12px; }
.ai-lightbox-nav.next { right: 12px; }
.ai-lightbox-nav:disabled { opacity: .25; cursor: default; }
.ai-lightbox-shell > footer { min-height: 72px; padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.ai-lightbox-shell > footer .ai-secondary { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; }
.ai-lightbox-shell > footer .ai-danger-link { min-height: 44px; background: rgba(199,75,68,.18); }
.ai-session-dialog { width: min(1120px, calc(100% - 28px)); height: min(880px, calc(100% - 28px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 20px; background: #f5f6f3; color: var(--ink); overflow: hidden; box-shadow: 0 32px 100px rgba(16,21,18,.34); }
.ai-session-dialog::backdrop { background: rgba(15,20,17,.62); backdrop-filter: blur(5px); }
.ai-session-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.ai-session-head { min-height: 78px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ai-session-head > div:first-child { min-width: 0; }
.ai-session-head span { color: #7969c9; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.ai-session-head h2 { margin: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; }
.ai-session-head h2 small { margin-left: 7px; padding: 3px 6px; border-radius: 5px; background: #eeeafe; color: #6755c1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; vertical-align: middle; }
.ai-session-head p { margin: 0; color: #858b85; font-size: 10px; }
.ai-session-head-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.ai-session-head-actions b { min-height: 27px; padding: 0 9px; border-radius: 14px; background: #eeeafe; display: inline-flex; align-items: center; color: #5e4cba; font-size: 9px; }
.ai-session-head-actions b.idle { background: #e9f5eb; color: #39704a; }
.ai-session-head-actions b.failed { background: #fceae7; color: #a34b40; }
.ai-session-head-actions button, .ai-session-loading > [data-session-close] { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: #f0f1ed; color: #555c56; font-size: 24px; cursor: pointer; }
.ai-session-timeline { min-height: 0; padding: 24px clamp(14px, 3vw, 36px); overflow-y: auto; overscroll-behavior: contain; }
.ai-session-events { width: min(860px, 100%); margin: 0 auto; display: grid; gap: 17px; }
.ai-session-message { max-width: min(680px, 84%); padding: 12px 15px; border: 1px solid #dad5f4; border-radius: 15px 15px 15px 4px; background: #f1effd; justify-self: start; }
.ai-session-message.user { border-color: #c9c0f5; border-radius: 15px 15px 4px 15px; background: #6d5ce7; color: #fff; justify-self: end; }
.ai-session-message.purged { border-style: dashed; background: #f0f1ed; color: #767d77; }
.ai-session-message > div { display: flex; justify-content: space-between; gap: 20px; }
.ai-session-message span, .ai-session-message time, .ai-session-message small { font-size: 9px; }
.ai-session-message span { font-weight: 800; }
.ai-session-message time { color: #8e879f; }
.ai-session-message.user time, .ai-session-message.user small { color: rgba(255,255,255,.72); }
.ai-session-message p { margin: 7px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.65; }
.ai-session-message small { margin-top: 7px; display: block; }
.ai-session-job { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
.ai-session-job-marker { display: flex; justify-content: center; position: relative; }
.ai-session-job-marker::after { content: ""; width: 1px; position: absolute; top: 19px; bottom: -27px; background: #d8dbd5; }
.ai-session-job:last-child .ai-session-job-marker::after { display: none; }
.ai-session-job-marker i { width: 10px; height: 10px; margin-top: 12px; border: 3px solid #f5f6f3; border-radius: 50%; background: #6d5ce7; position: relative; z-index: 1; box-shadow: 0 0 0 2px #cfc7f5; }
.ai-session-job.completed .ai-session-job-marker i { background: #479062; box-shadow: 0 0 0 2px #bfddc8; }
.ai-session-job.failed .ai-session-job-marker i { background: #c74b44; box-shadow: 0 0 0 2px #efc7c2; }
.ai-session-job-content { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 17px rgba(32,39,34,.04); }
.ai-session-job-content > header { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.ai-session-job-content > header > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ai-session-job-content > header span { color: #4f5650; font-size: 11px; font-weight: 800; }
.ai-session-job-content > header time { color: #929792; font-size: 9px; }
.ai-session-job-content > header b { padding: 4px 8px; border-radius: 12px; background: #f0f1ed; color: #676e68; font-size: 9px; }
.ai-session-job.running .ai-session-job-content > header b, .ai-session-job.queued .ai-session-job-content > header b { background: #eeeafe; color: #604cc0; }
.ai-session-job.failed .ai-session-job-content > header b { background: #fceae7; color: #a34b40; }
.ai-session-gate { margin: 9px 0 12px; padding: 7px 9px; border-radius: 8px; background: #f1f3ef; color: #777e77; font-size: 9px; line-height: 1.45; }
.ai-session-gate.enabled { background: #f1effd; color: #62549f; }
.ai-session-assets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.ai-session-asset-item { min-width: 0; display: grid; align-content: start; gap: 5px; }
.ai-quality-summary { width: 100%; min-height: 32px; padding: 6px 8px; border: 1px solid #efc7c2; border-radius: 8px; background: #fff3f1; color: #a34b40; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font: inherit; font-size: 8px; line-height: 1.4; cursor: pointer; }
.ai-quality-summary.expanded { white-space: normal; overflow-wrap: anywhere; }
.ai-session-stage { min-height: 52px; padding: 0 12px; border-radius: 9px; background: #f5f6f2; display: flex; align-items: center; gap: 9px; color: #747a74; font-size: 10px; }
.ai-session-stage.failed { background: #fceae7; color: #a34b40; }
.ai-session-stage i { width: 13px; height: 13px; border: 2px solid #cbc5ed; border-top-color: #6d5ce7; border-radius: 50%; animation: ai-spin .8s linear infinite; }
.ai-session-composer { padding: 14px 18px 16px; border-top: 1px solid var(--line); background: rgba(255,255,255,.98); display: grid; grid-template-columns: minmax(150px, .55fr) auto minmax(300px, 1.45fr); gap: 12px 16px; align-items: center; box-shadow: 0 -10px 28px rgba(29,35,31,.06); }
.ai-session-target { min-width: 0; display: flex; align-items: center; gap: 9px; }
.ai-session-target img { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 9px; object-fit: cover; background: #eef0ec; }
.ai-session-target span { min-width: 0; display: grid; gap: 3px; }
.ai-session-target small { color: #8d938d; font-size: 9px; }
.ai-session-target strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.ai-session-scope { min-width: 0; margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: #f3f4f0; display: flex; gap: 3px; }
.ai-session-scope legend { position: absolute; clip: rect(0 0 0 0); clip-path: inset(50%); }
.ai-session-scope label { min-height: 44px; padding: 0 10px; border-radius: 8px; display: flex; align-items: center; gap: 6px; color: #666d67; font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ai-session-scope label:has(input:checked) { background: #fff; color: #5846b1; box-shadow: 0 2px 8px rgba(50,44,82,.08); }
.ai-session-scope input { width: 16px; height: 16px; accent-color: #6d5ce7; }
.ai-session-input-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 9px; align-items: end; }
.ai-session-input-row label { grid-column: 1 / -1; color: #555c56; font-size: 10px; font-weight: 750; }
.ai-session-input-row textarea { width: 100%; min-height: 50px; max-height: 120px; padding: 9px 11px; border: 1px solid #d7dbd4; border-radius: 10px; resize: vertical; font: inherit; font-size: 11px; line-height: 1.5; }
.ai-session-input-row textarea:focus { border-color: #7866dc; outline: 3px solid rgba(109,92,231,.09); }
.ai-session-input-row .ai-primary { min-height: 50px; white-space: nowrap; }
.ai-session-review-note { grid-column: 1 / -1; margin: -3px 0 0; color: #838983; font-size: 9px; line-height: 1.5; }
.ai-inline-settings { min-height: 32px; padding: 0 9px; border: 1px solid #cfc7f5; border-radius: 8px; background: #f4f1ff; color: #604cc0; font: inherit; font-size: 9px; font-weight: 750; cursor: pointer; }
.ai-session-empty, .ai-session-loading { min-height: 100%; padding: 30px; display: grid; place-content: center; justify-items: center; text-align: center; }
.ai-session-empty > span, .ai-session-loading > span { width: 48px; height: 48px; border-radius: 15px; background: #eeeafe; display: grid; place-items: center; color: #6d5ce7; }
.ai-session-empty h3, .ai-session-loading h2 { margin: 14px 0 5px; }
.ai-session-empty p, .ai-session-loading p { margin: 0 0 16px; color: #8b918b; font-size: 11px; }
.ai-session-loading > [data-session-close] { position: absolute; right: 16px; top: 16px; }
.ai-history { padding: 26px 24px 34px; }
.ai-history-head { padding-bottom: 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.ai-history-head p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.ai-timeline { padding-top: 20px; }
.ai-timeline-item { display: grid; grid-template-columns: 94px 26px 1fr; gap: 10px; align-items: start; }
.ai-timeline-item > time { padding-top: 12px; color: #8c928c; font-size: 10px; text-align: right; }
.ai-timeline-line { height: 100%; display: flex; justify-content: center; position: relative; }
.ai-timeline-line::after { content: ""; width: 1px; background: #dedfd9; position: absolute; top: 17px; bottom: -10px; }
.ai-timeline-line i { width: 10px; height: 10px; margin-top: 13px; border: 2px solid #fff; border-radius: 50%; background: #6d5ce7; position: relative; z-index: 1; box-shadow: 0 0 0 2px #d8d1fa; }
.ai-history-card { min-width: 0; margin-bottom: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fafbf8; display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.ai-history-card .ai-asset-card { width: 112px; }
.ai-history-copy span { color: #7c827c; font-size: 9px; }
.ai-history-copy h3 { margin: 4px 0; font-size: 14px; }
.ai-history-copy p { margin: 0; color: #8b918b; font-size: 10px; line-height: 1.5; }
.ai-settings { padding: 26px 24px 34px; display: grid; gap: 18px; }
.ai-settings > *, .ai-settings-panel, .ai-settings-panel > section { min-width: 0; }
.ai-settings-tabs { min-height: 48px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #f3f4f0; display: flex; gap: 4px; overflow-x: auto; }
.ai-settings-tabs button { min-height: 38px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; color: #747b74; font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.ai-settings-tabs button.active { background: #fff; color: #342e61; box-shadow: 0 2px 10px rgba(45, 40, 83, .09); }
.ai-settings-panel > section { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fafbf8; }
.ai-settings-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.ai-settings-note { margin: 8px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.ai-feature-tabs { margin-bottom: 14px; display: flex; gap: 8px; overflow-x: auto; }
.ai-feature-tabs button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #626962; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.ai-feature-tabs button span { min-width: 18px; height: 18px; margin-left: 6px; border-radius: 9px; background: #eef0eb; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; }
.ai-feature-tabs button.active { border-color: #c9c0f5; background: #f1effd; color: #51458d; }
.ai-feature-tabs button.active span { background: #6d5ce7; color: #fff; }
.ai-route-toolbar { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #dfdbf2; border-radius: 11px; background: #f7f5ff; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ai-failover-switch { min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ai-failover-switch > input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: #6d5ce7; }
.ai-failover-switch span { min-width: 0; display: grid; gap: 2px; }
.ai-failover-switch strong { color: #4b465f; font-size: 11px; }
.ai-failover-switch small { color: #898498; font-size: 9px; line-height: 1.45; }
.ai-provider-table-wrap { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow-x: auto; }
.ai-provider-table { width: 100%; min-width: 1580px; border-collapse: collapse; table-layout: fixed; }
.ai-provider-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); background: #f5f6f2; color: #7b817b; font-size: 9px; font-weight: 750; text-align: left; }
.ai-provider-table td { padding: 9px 8px; border-bottom: 1px solid #eceee9; vertical-align: middle; }
.ai-provider-table tr:last-child td { border-bottom: 0; }
.ai-provider-table th:nth-child(1), .ai-provider-table td:nth-child(1) { width: 74px; }
.ai-provider-table th:nth-child(2), .ai-provider-table td:nth-child(2) { width: 118px; }
.ai-provider-table th:nth-child(3), .ai-provider-table td:nth-child(3) { width: 98px; }
.ai-provider-table th:nth-child(4), .ai-provider-table td:nth-child(4) { width: 132px; }
.ai-provider-table th:nth-child(5), .ai-provider-table td:nth-child(5) { width: 180px; }
.ai-provider-table th:nth-child(6), .ai-provider-table td:nth-child(6) { width: 172px; }
.ai-provider-table th:nth-child(7), .ai-provider-table td:nth-child(7) { width: 118px; }
.ai-provider-table th:nth-child(8), .ai-provider-table td:nth-child(8) { width: 174px; }
.ai-provider-table th:nth-child(9), .ai-provider-table td:nth-child(9) { width: 154px; }
.ai-provider-table th:nth-child(10), .ai-provider-table td:nth-child(10) { width: 158px; }
.ai-provider-table th:nth-child(11), .ai-provider-table td:nth-child(11) { width: 56px; }
.ai-provider-table th:nth-child(12), .ai-provider-table td:nth-child(12) { width: 58px; }
.ai-model-table { min-width: 680px; }
.ai-model-table th:nth-child(1), .ai-model-table td:nth-child(1) { width: 190px; }
.ai-model-table th:nth-child(2), .ai-model-table td:nth-child(2) { width: 140px; }
.ai-model-table th:nth-child(3), .ai-model-table td:nth-child(3) { width: 115px; }
.ai-model-table th:nth-child(4), .ai-model-table td:nth-child(4) { width: 95px; }
.ai-model-table th:nth-child(5), .ai-model-table td:nth-child(5) { width: 65px; }
.ai-model-table th:nth-child(6), .ai-model-table td:nth-child(6) { width: 65px; }
.ai-model-table.with-image-protocol { min-width: 890px; }
.ai-model-table.with-image-protocol th:nth-child(5), .ai-model-table.with-image-protocol td:nth-child(5) { width: 210px; }
.ai-model-table.with-image-protocol th:nth-child(6), .ai-model-table.with-image-protocol td:nth-child(6) { width: 65px; }
.ai-model-table.with-image-protocol th:nth-child(7), .ai-model-table.with-image-protocol td:nth-child(7) { width: 65px; }
.ai-service-provider-table { min-width: 1360px; }
.ai-service-provider-table th:nth-child(1), .ai-service-provider-table td:nth-child(1) { width: 105px; }
.ai-service-provider-table th:nth-child(2), .ai-service-provider-table td:nth-child(2) { width: 105px; }
.ai-service-provider-table th:nth-child(3), .ai-service-provider-table td:nth-child(3) { width: 205px; }
.ai-service-provider-table th:nth-child(4), .ai-service-provider-table td:nth-child(4) { width: 175px; }
.ai-service-provider-table th:nth-child(5), .ai-service-provider-table td:nth-child(5) { width: 165px; }
.ai-service-provider-table th:nth-child(6), .ai-service-provider-table td:nth-child(6) { width: 175px; }
.ai-service-provider-table th:nth-child(7), .ai-service-provider-table td:nth-child(7) { width: 145px; }
.ai-service-provider-table th:nth-child(8), .ai-service-provider-table td:nth-child(8) { width: 65px; }
.ai-service-provider-table th:nth-child(9), .ai-service-provider-table td:nth-child(9) { width: 65px; }
.ai-model-cell { display: grid; gap: 5px; }
.ai-model-cell small { color: #8b918b; font-size: 8px; }
.ai-success-count { width: max-content; min-width: 35px; padding: 6px 9px; border-radius: 9px; background: #e9f5eb; color: #39704a; text-align: center; }
.ai-success-cell { display: grid; justify-items: center; gap: 4px; text-align: center; }
.ai-success-cell small { color: #8b918b; font-size: 8px; line-height: 1.35; }
.ai-secret-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.ai-copy-secret { min-width: 44px; border: 1px solid #d5d0ef; border-radius: 8px; background: #f7f5ff; color: #605595; font-size: 9px; cursor: pointer; }
.ai-provider-table input:not([type="checkbox"]), .ai-provider-table select { width: 100%; min-height: 38px; box-sizing: border-box; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 10px; }
.ai-provider-table input:focus, .ai-provider-table select:focus { border-color: #9c8feb; outline: 3px solid rgba(109, 92, 231, .11); }
.ai-order-buttons { display: grid; grid-template-columns: 24px 25px 25px; gap: 3px; align-items: center; }
.ai-order-buttons b { color: #777e77; font-size: 10px; text-align: center; }
.ai-order-buttons button { width: 25px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fafbf8; color: #686f68; cursor: pointer; }
.ai-order-buttons button:disabled { opacity: .35; cursor: default; }
.ai-table-muted { color: #a1a6a1; font-size: 9px; }
.ai-table-delete { min-height: 34px; border: 0; background: transparent; color: #b65151; font-size: 10px; cursor: pointer; }
.ai-row-switch { width: 38px; height: 22px; position: relative; display: block; cursor: pointer; }
.ai-row-switch input { position: absolute; opacity: 0; }
.ai-row-switch i { inset: 0; border-radius: 12px; background: #d7dad5; position: absolute; transition: .18s ease; }
.ai-row-switch i::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: #fff; position: absolute; left: 3px; top: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .18s ease; }
.ai-row-switch input:checked + i { background: #6d5ce7; }
.ai-row-switch input:checked + i::after { transform: translateX(16px); }
.ai-quota { display: inline-flex; min-height: 25px; padding: 0 8px; border-radius: 13px; align-items: center; background: #eef0eb; color: #707770; font-size: 9px; font-weight: 700; white-space: nowrap; }
.ai-quota.unlimited { background: #e7f6ed; color: #43815a; }
.ai-quota.available { background: #e7f6ed; color: #34734b; }
.ai-quota.queryable { background: #e9f2ff; color: #446f9f; }
.ai-quota.external { background: #fff4dc; color: #956719; }
.ai-quota.unsupported { background: #f0eff5; color: #777085; }
.ai-quota.error { background: #fdecec; color: #a64b4b; }
.ai-quota.stale { background: #fff4dc; color: #956719; }
.ai-quota-config, .ai-quota-cell { min-width: 0; display: grid; gap: 6px; }
.ai-quota-cell { justify-items: start; }
.ai-quota-cell small { max-width: 100%; color: #8a908a; font-size: 8px; line-height: 1.4; overflow-wrap: anywhere; }
.ai-quota-refresh { min-height: 30px; padding: 0 10px; border: 1px solid #d5d0ef; border-radius: 8px; background: #f7f5ff; color: #605595; font-size: 9px; cursor: pointer; }
.ai-quota-refresh:disabled { opacity: .55; cursor: wait; }
.ai-quota-note { margin: 12px 2px 0; color: #8a908a; font-size: 9px; line-height: 1.55; }
.ai-provider-failure-dialog { width: min(720px, calc(100% - 24px)); }
.ai-provider-failure-dialog form { max-height: min(82vh, 760px); overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.ai-dialog-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f0f1ed; color: #555c56; font-size: 22px; cursor: pointer; }
.ai-provider-failure-list { min-height: 0; display: grid; gap: 10px; overflow-y: auto; }
.ai-provider-failure-list article { padding: 12px; border: 1px solid #ead7d3; border-radius: 10px; background: #fffafa; }
.ai-provider-failure-list article > header { display: flex; justify-content: space-between; gap: 12px; }
.ai-provider-failure-list article strong { color: #873f39; font-size: 11px; }
.ai-provider-failure-list article time { color: #8b918b; font-size: 9px; }
.ai-provider-failure-list dl { margin: 9px 0 0; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px 9px; }
.ai-provider-failure-list dt { color: #8b918b; font-size: 9px; }
.ai-provider-failure-list dd { margin: 0; color: #454b46; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-failure-model-switch { margin-top: 12px; padding: 13px; border: 1px solid #dcd6ff; border-radius: 11px; background: #faf9ff; }
.ai-failure-model-switch > strong { color: #4f42a7; font-size: 11px; }
.ai-failure-model-switch > p { margin: 6px 0 10px; color: #717772; font-size: 9px; line-height: 1.6; }
.ai-failure-model-switch > div { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-failure-model-switch button { max-width: 100%; overflow-wrap: anywhere; }
.ai-settings-actions { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; bottom: 10px; z-index: 3; box-shadow: 0 8px 30px rgba(38, 42, 37, .08); }
.ai-settings-actions span { color: #858b85; font-size: 9px; }
.ai-settings-actions .ai-primary { min-width: 180px; }
.ai-preset-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ai-preset-list fieldset { min-width: 0; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.ai-preset-list legend { padding: 0 7px; color: #4a514b; font-size: 12px; font-weight: 750; }
.ai-setting-warning { margin: 10px 0 0; color: #9a6b17; font-size: 10px; line-height: 1.45; }
.ai-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.ai-settings-grid label { color: #737973; font-size: 9px; }
.ai-settings-grid input { width: 100%; min-height: 38px; margin-top: 4px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; }
.ai-preset-list fieldset > small { display: block; margin-top: 10px; color: #888f88; font-size: 9px; }
.ai-model-options { margin: 16px 0; display: grid; gap: 8px; }
.ai-model-current { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: #f0f2ed; display: grid; gap: 3px; }
.ai-model-current span { color: #7f867f; font-size: 9px; }
.ai-model-current strong { color: #454b45; font-size: 11px; overflow-wrap: anywhere; }
.ai-model-options label { min-height: 52px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf8; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ai-model-options input { width: 18px; height: 18px; accent-color: #6d5ce7; }
.ai-model-options span { display: grid; gap: 3px; }
.ai-model-options strong { font-size: 11px; }
.ai-model-options small { color: #8d938d; font-size: 9px; }
.ai-model-footnote { margin: -6px 0 14px; color: #858b85; font-size: 9px; line-height: 1.55; }
.ai-audit-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-audit-grid > div { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.ai-audit-grid h3 { margin: 0 0 10px; font-size: 13px; }
.ai-audit-list { max-height: 360px; display: grid; gap: 7px; overflow-y: auto; }
.ai-audit-list article { padding: 10px; border-radius: 8px; background: #f5f6f2; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.ai-audit-list strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #484f49; font-size: 10px; }
.ai-audit-list span { grid-column: 1; color: #7e847e; font-size: 9px; }
.ai-audit-list time { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #979c97; font-size: 9px; }
.ai-audit-empty { margin: 0; padding: 20px 10px; border-radius: 8px; background: #f5f6f2; color: #929792; text-align: center; font-size: 10px; }

.ai-guide-dialog { width: min(920px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 0; border: 0; border-radius: 22px; background: #fff; color: var(--ink); overflow: auto; box-shadow: 0 28px 80px rgba(31, 27, 57, .3); }
.ai-guide-dialog::backdrop { background: rgba(25, 25, 32, .58); backdrop-filter: blur(4px); }
.ai-guide-sheet { padding: 26px; }
.ai-guide-head { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; }
.ai-guide-head span, .ai-feedback-head span { display: block; margin-bottom: 5px; color: #7969d1; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.ai-guide-head h2, .ai-feedback-head h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); }
.ai-guide-head p, .ai-feedback-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.ai-guide-head-actions { display: flex; align-items: center; gap: 8px; }
.ai-guide-head-actions a { min-height: 42px; padding: 0 14px; border-radius: 10px; background: #6753d3; color: #fff; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; font-size: 11px; font-weight: 750; }
.ai-guide-head-actions button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #f6f7f3; color: #59605a; font-size: 23px; cursor: pointer; }
.ai-guide-overview { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 20px; }
.ai-guide-visual { min-height: 330px; margin: 0; padding: 22px; border-radius: 17px; background: linear-gradient(145deg, #eeebff, #e8f3ed); position: relative; overflow: hidden; }
.ai-guide-mock-nav { height: 34px; padding: 0 14px; border-radius: 10px 10px 0 0; background: #fff; display: flex; align-items: center; gap: 9px; }
.ai-guide-mock-nav i { width: 54px; height: 6px; border-radius: 5px; background: #dadde7; }
.ai-guide-mock-nav i:first-child { background: #7866dc; }
.ai-guide-mock-body { height: 235px; padding: 16px; border-radius: 0 0 12px 12px; background: rgba(255,255,255,.82); display: grid; grid-template-columns: .8fr 1.2fr; gap: 12px; }
.ai-guide-mock-form, .ai-guide-mock-results { padding: 13px; border: 1px solid #dfe2dc; border-radius: 10px; background: #fff; }
.ai-guide-mock-form { display: grid; align-content: start; gap: 10px; }
.ai-guide-mock-form b, .ai-guide-mock-results b { width: 55%; height: 9px; border-radius: 5px; background: #4c514d; }
.ai-guide-mock-form span { height: 30px; border-radius: 7px; background: #eef0ec; }
.ai-guide-mock-form em { height: 56px; border: 1px dashed #b9b3dd; border-radius: 8px; background: #f8f6ff; }
.ai-guide-mock-results > div { margin-top: 13px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ai-guide-mock-results i { aspect-ratio: 1; border-radius: 7px; background: linear-gradient(145deg, #b9c5bc, #eff2ef); }
.ai-guide-visual mark { width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50%; position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); background: #6652ce; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 850; box-shadow: 0 5px 14px rgba(66,49,146,.3); }
.ai-guide-notes { margin: 0; padding: 0; display: grid; gap: 10px; list-style: none; counter-reset: guide-step; }
.ai-guide-notes li { padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; display: grid; grid-template-columns: 28px 1fr; gap: 3px 9px; counter-increment: guide-step; }
.ai-guide-notes li::before { width: 26px; height: 26px; grid-row: 1 / span 2; border-radius: 8px; background: #eeeafe; color: #6652ce; content: counter(guide-step); display: grid; place-items: center; font-size: 10px; font-weight: 850; }
.ai-guide-notes b { font-size: 11px; }
.ai-guide-notes span { color: #777e78; font-size: 9px; line-height: 1.5; }
.ai-guide-cards { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ai-guide-cards article { padding: 13px; border-radius: 11px; background: #f4f5f1; }
.ai-guide-cards strong { font-size: 11px; }
.ai-guide-cards p { margin: 6px 0 0; color: #747b74; font-size: 9px; line-height: 1.55; }
.ai-guide-tip { margin-top: 15px; padding: 12px 14px; border-radius: 11px; background: #fff7df; color: #80651a; display: flex; gap: 8px; font-size: 10px; line-height: 1.5; }

.ai-feedback-page { padding: 26px 24px 32px; }
.ai-feedback-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.ai-feedback-head > b { padding: 7px 10px; border-radius: 18px; background: #f0edff; color: #6150ba; white-space: nowrap; font-size: 10px; }
.ai-feedback-form { max-width: 700px; margin-top: 22px; padding: 18px; border: 1px solid #dcd7f3; border-radius: 14px; background: linear-gradient(145deg, #fbfaff, #f6f7f3); }
.ai-feedback-form .ai-primary { min-width: 150px; }
.ai-feedback-records { margin-top: 26px; }
.ai-feedback-records > h3 { margin: 0 0 12px; font-size: 15px; }
.ai-feedback-list { display: grid; gap: 10px; }
.ai-feedback-list article { padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf8; }
.ai-feedback-list header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-feedback-list code { padding: 4px 7px; border-radius: 6px; background: #eeeafe; color: #5f4db8; font-size: 10px; font-weight: 800; }
.ai-feedback-list header span { padding: 4px 7px; border-radius: 10px; background: #fff2d6; color: #8c6815; font-size: 9px; }
.ai-feedback-list p { margin: 10px 0; color: #444b45; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-feedback-list footer { display: flex; gap: 7px; color: #909690; font-size: 9px; }
.ai-feedback-list footer b { color: #656c66; }
.ai-feedback-list footer i { font-style: normal; }
.ai-feedback-empty { min-height: 130px; border: 1px dashed #d8dcd4; border-radius: 12px; color: #929792; display: grid; place-content: center; justify-items: center; gap: 5px; font-size: 10px; }
.ai-feedback-empty strong { color: #646b65; font-size: 12px; }

.ai-task-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ai-task-scope { padding: 3px; border: 1px solid #ded9f4; border-radius: 9px; background: #f8f7fd; display: flex; gap: 2px; }
.ai-task-scope button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #777485; font-size: 9px; cursor: pointer; }
.ai-task-scope button.active { background: #6552cb; color: #fff; box-shadow: 0 4px 12px rgba(76, 60, 164, .18); }
.ai-team-job-card { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; display: grid; gap: 10px; }
.ai-team-job-card > header { display: flex; justify-content: space-between; gap: 10px; }
.ai-team-job-card > header span { color: #8b918b; font-size: 8px; font-weight: 750; letter-spacing: .06em; }
.ai-team-job-card > header h3 { margin: 3px 0 0; font-size: 13px; }
.ai-team-job-card > header b { align-self: start; padding: 5px 8px; border-radius: 12px; background: #efedf9; color: #6255a4; font-size: 9px; }
.ai-team-owner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-team-owner strong { font-size: 10px; }
.ai-team-owner span, .ai-team-job-card > small { color: #858b85; font-size: 9px; }
.ai-team-owner code { color: #5d50af; font-weight: 800; }

.ai-drive-dialog { width: min(720px, calc(100% - 28px)); }
.ai-drive-picker, .ai-drive-auth { padding: 24px; }
.ai-drive-picker .ai-settings-head p { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-drive-toolbar { margin: 16px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-drive-new-folder { display: flex; gap: 8px; }
.ai-drive-new-folder input { min-width: 210px; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; }
.ai-drive-folder-list { min-height: 220px; max-height: 46vh; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #f7f8f5; display: grid; align-content: start; gap: 6px; overflow-y: auto; }
.ai-drive-folder-list > button { min-height: 48px; padding: 8px 11px; border: 1px solid transparent; border-radius: 9px; background: #fff; color: #4e554f; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.ai-drive-folder-list > button:hover, .ai-drive-folder-list > button:focus-visible { border-color: #bdb4ed; outline: 0; }
.ai-drive-folder-list > button span { font-size: 18px; }
.ai-drive-folder-list > button strong { font-size: 10px; }
.ai-drive-folder-list > button i { color: #8d938d; font-size: 9px; font-style: normal; }
.ai-drive-empty { min-height: 200px; color: #8d938d; display: grid; place-content: center; justify-items: center; gap: 5px; font-size: 9px; }
.ai-drive-empty strong { color: #666d67; font-size: 11px; }
.ai-drive-auth p { color: #777e78; line-height: 1.7; }
.ai-drive-auth .ai-primary { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.ai-drive-progress { width: min(360px, calc(100vw - 24px)); max-height: min(480px, calc(100vh - 90px)); position: fixed; right: 18px; bottom: 18px; z-index: 30; border: 1px solid #d8d2f3; border-radius: 15px; background: rgba(255,255,255,.97); box-shadow: 0 18px 60px rgba(45, 37, 83, .24); overflow: hidden; backdrop-filter: blur(12px); }
.ai-drive-progress > header { min-height: 58px; padding: 10px 13px; background: linear-gradient(120deg, #6652cf, #8778dc); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-drive-progress > header div { display: grid; gap: 2px; }
.ai-drive-progress > header span { font-size: 8px; opacity: .78; letter-spacing: .12em; }
.ai-drive-progress > header strong { font-size: 11px; }
.ai-drive-progress > header button { min-height: 32px; padding: 0 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.ai-drive-progress-list { max-height: 390px; padding: 10px; display: grid; gap: 8px; overflow-y: auto; }
.ai-drive-progress-list article { padding: 10px; border-radius: 10px; background: #f6f6f3; display: grid; gap: 7px; }
.ai-drive-progress-list article > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.ai-drive-progress-list strong { max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.ai-drive-progress-list span, .ai-drive-progress-list small { color: #7f857f; font-size: 8px; }
.ai-drive-progress-bar { height: 5px; border-radius: 5px; background: #dedfe0; overflow: hidden; }
.ai-drive-progress-bar i { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6551cd, #53a489); display: block; transition: width .25s ease; }
.ai-drive-progress-list small.error { color: #ad4c45; }
.ai-drive-progress.collapsed { max-height: 58px; }
.ai-drive-progress.collapsed .ai-drive-progress-list { display: none; }

@media (max-width: 980px) {
  .ai-workspace-grid { grid-template-columns: 1fr; }
  .ai-task-grid { max-height: none; }
  .ai-output-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ai-session-composer { grid-template-columns: minmax(140px, .45fr) minmax(0, 1fr); }
  .ai-session-scope { justify-self: end; }
  .ai-session-input-row, .ai-session-review-note { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .ai-tool-head { padding: 28px 0 22px; grid-template-columns: auto 1fr; align-items: start; }
  .ai-title-mark { width: 52px; height: 52px; border-radius: 16px; }
  .ai-title-mark svg { width: 25px; height: 25px; }
  .ai-tool-head .eyebrow { display: none; }
  .ai-tool-head > div:nth-child(2) > p:last-child { line-height: 1.5; }
  .ai-head-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .ai-shell { border-radius: 16px; }
  .ai-nav { min-height: 56px; padding: 0 15px; gap: 20px; overflow-x: auto; }
  .ai-nav button { white-space: nowrap; font-size: 12px; }
  .ai-notice { margin: 14px 14px 0; align-items: flex-start; flex-direction: column; gap: 3px; }
  .ai-mode-bar { padding: 16px 14px; align-items: stretch; flex-direction: column; }
  .ai-task-heading { align-items: flex-start; flex-direction: column; }
  .ai-task-heading-actions { width: 100%; justify-content: space-between; }
  .ai-task-scope button { min-height: 42px; }
  .ai-segmented { display: grid; grid-template-columns: repeat(2, 1fr); }
  .ai-segmented button { padding: 0 8px; font-size: 11px; }
  .ai-asset-actions { flex-wrap: wrap; }
  .ai-asset-actions span { flex: 1 0 100%; }
  .ai-asset-actions button { min-height: 44px; flex: 1; }
  .ai-asset-checkbox { width: 44px; height: 44px; left: 0; top: 0; }
  .ai-batch-toolbar { flex-wrap: wrap; }
  .ai-batch-toolbar label, .ai-batch-toolbar button { min-height: 44px; }
  .ai-video-confirm { min-height: 44px; }
  .ai-upload-chip button { width: 44px; height: 44px; right: -9px; top: -10px; }
  .ai-choice label, .ai-rights, .ai-check { min-height: 44px; }
  .ai-settings-grid input { min-height: 44px; }
  .ai-workspace-grid { padding: 0 14px 18px; }
  .ai-form-grid { grid-template-columns: 1fr; gap: 0; }
  .ai-output-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-history, .ai-settings { padding: 20px 14px 26px; }
  .ai-history-head { align-items: start; flex-direction: column; }
  .ai-timeline-item { grid-template-columns: 18px 1fr; gap: 8px; }
  .ai-timeline-item > time { grid-column: 2; padding-top: 7px; text-align: left; }
  .ai-timeline-line { grid-column: 1; grid-row: 1 / span 2; }
  .ai-history-card { grid-column: 2; }
  .ai-preset-list { grid-template-columns: 1fr; }
  .ai-audit-grid { grid-template-columns: 1fr; }
  .ai-guide-sheet { padding: 19px 15px; }
  .ai-guide-head, .ai-feedback-head { align-items: stretch; flex-direction: column; }
  .ai-guide-head-actions { justify-content: space-between; }
  .ai-guide-overview { grid-template-columns: 1fr; }
  .ai-guide-visual { min-height: 280px; }
  .ai-guide-mock-body { height: 190px; }
  .ai-guide-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-feedback-page { padding: 21px 14px 26px; }
  .ai-drive-toolbar { align-items: stretch; flex-direction: column; }
  .ai-drive-toolbar > button { min-height: 44px; }
  .ai-drive-new-folder { width: 100%; }
  .ai-drive-new-folder input { min-width: 0; flex: 1; }
  .ai-drive-new-folder button { min-height: 44px; }
  .ai-drive-progress { right: 10px; bottom: 10px; }
  .ai-settings-tabs button { min-height: 44px; padding: 0 15px; }
  .ai-route-toolbar { align-items: stretch; flex-direction: column; }
  .ai-route-toolbar .ai-secondary { width: 100%; min-height: 44px; }
  .ai-feature-tabs button { min-height: 44px; }
  .ai-provider-table-wrap { border: 0; background: transparent; overflow: visible; }
  .ai-provider-table { width: 100%; min-width: 0; display: block; }
  .ai-provider-table thead { display: none; }
  .ai-provider-table tbody { width: 100%; min-width: 0; display: grid; gap: 12px; }
  .ai-provider-table tr { width: 100%; min-width: 0; box-sizing: border-box; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 10px; }
  .ai-provider-table td { width: auto !important; min-width: 0; padding: 0; border: 0; display: grid; gap: 5px; }
  .ai-provider-table td::before { content: attr(data-label); color: #8b918b; font-size: 9px; font-weight: 700; }
  .ai-provider-table td:nth-child(2), .ai-provider-table td:nth-child(4), .ai-provider-table td:nth-child(5), .ai-provider-table td:nth-child(6), .ai-provider-table td:nth-child(7), .ai-provider-table td:nth-child(8), .ai-provider-table td:nth-child(9), .ai-provider-table td:nth-child(10) { grid-column: 1 / -1; }
  .ai-provider-table input:not([type="checkbox"]), .ai-provider-table select { min-height: 44px; }
  .ai-order-buttons { grid-template-columns: 24px 44px 44px; gap: 8px; }
  .ai-order-buttons button { width: 44px; height: 44px; }
  .ai-quota-refresh, .ai-table-delete { min-width: 44px; min-height: 44px; }
  .ai-provider-table td:nth-child(11) { justify-items: end; }
  .ai-settings-actions { align-items: stretch; flex-direction: column; }
  .ai-settings-actions .ai-primary { width: 100%; min-height: 46px; }
  .ai-dialog form { padding: 22px 18px; }
  .ai-asset-lightbox { width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 14px; }
  .ai-lightbox-shell > main { padding: 8px 44px; }
  .ai-lightbox-nav { width: 38px; height: 62px; border-radius: 10px; }
  .ai-lightbox-nav.prev { left: 3px; }
  .ai-lightbox-nav.next { right: 3px; }
  .ai-lightbox-shell > footer { max-height: 32vh; overflow-y: auto; }
  .ai-session-dialog { width: calc(100% - 12px); height: calc(100% - 12px); border-radius: 15px; }
  .ai-session-head { min-height: 68px; padding: 11px 12px; }
  .ai-session-head h2 { max-width: 55vw; font-size: 17px; }
  .ai-session-head-actions { gap: 6px; }
  .ai-session-timeline { padding: 18px 12px; }
  .ai-session-message { max-width: 92%; }
  .ai-session-job { grid-template-columns: 17px minmax(0, 1fr); gap: 6px; }
  .ai-session-job-content { padding: 11px; }
  .ai-session-assets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-quality-summary { min-height: 44px; }
  .ai-session-composer { padding: 11px 12px 13px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .ai-session-target { min-height: 54px; }
  .ai-session-scope { width: 100%; box-sizing: border-box; justify-self: stretch; }
  .ai-session-scope label { min-width: 0; padding: 0 7px; flex: 1; justify-content: center; white-space: normal; text-align: center; }
  .ai-session-input-row, .ai-session-review-note { grid-column: 1 / -1; }
}

@media (max-width: 440px) {
  .ai-tool-head { grid-template-columns: 1fr; }
  .ai-title-mark { display: none; }
  .ai-head-actions { grid-column: 1; }
  .ai-guide-button, .ai-provider-badge { flex: 1; justify-content: center; }
  .ai-compose-form { padding: 16px 13px; }
  .ai-card-heading, .ai-task-heading { padding: 14px; }
  .ai-output-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-upload-head { align-items: flex-start; flex-direction: column; }
  .ai-upload-button { width: 100%; justify-content: center; }
  .ai-upload-chip.with-role { width: 122px; flex-basis: 122px; }
  .ai-upload-chip.with-role img { width: 122px; height: 82px; }
  .ai-structure-actions > button { width: 100%; }
  .ai-history-card { grid-template-columns: 86px 1fr; gap: 10px; }
  .ai-history-card .ai-asset-card { width: 86px; }
  .ai-settings-grid { grid-template-columns: 1fr; }
  .ai-settings { padding-left: 10px; padding-right: 10px; }
  .ai-settings-panel > section { padding: 15px 12px; }
  .ai-settings-head { align-items: flex-start; flex-direction: column; }
  .ai-provider-table tr { grid-template-columns: 1fr; }
  .ai-provider-table td:nth-child(n) { grid-column: 1; }
  .ai-provider-table td:nth-child(10), .ai-provider-table td:nth-child(11) { min-height: 44px; align-content: center; justify-items: start; }
  .ai-dialog-actions { flex-direction: column-reverse; }
  .ai-dialog-actions button { width: 100%; }
  .ai-asset-lightbox { width: 100%; height: 100%; border-radius: 0; }
  .ai-lightbox-shell > main { padding: 5px 38px; }
  .ai-lightbox-shell > footer { justify-content: stretch; }
  .ai-lightbox-shell > footer button { flex: 1 1 42%; }
  .ai-session-dialog { width: 100%; height: 100%; border-radius: 0; }
  .ai-session-head > div:first-child > span, .ai-session-head p { display: none; }
  .ai-session-head h2 { max-width: 58vw; margin: 0; font-size: 16px; }
  .ai-session-head-actions b { display: none; }
  .ai-session-timeline { padding: 14px 8px; }
  .ai-session-events { gap: 13px; }
  .ai-session-message { max-width: 96%; padding: 10px 12px; }
  .ai-session-job { grid-template-columns: 12px minmax(0, 1fr); gap: 4px; }
  .ai-session-job-marker i { width: 8px; height: 8px; }
  .ai-session-job-content { padding: 9px; border-radius: 11px; }
  .ai-session-job-content > header { align-items: flex-start; }
  .ai-session-job-content > header > div { display: grid; gap: 2px; }
  .ai-session-assets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .ai-session-composer { max-height: 48vh; overflow-y: auto; grid-template-columns: 1fr; }
  .ai-session-target, .ai-session-scope, .ai-session-input-row, .ai-session-review-note { grid-column: 1; }
  .ai-session-target img { width: 46px; height: 46px; }
  .ai-session-input-row { grid-template-columns: 1fr; }
  .ai-session-input-row label { grid-column: 1; }
  .ai-session-input-row .ai-primary { width: 100%; }
  .ai-guide-dialog { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .ai-guide-head-actions a { flex: 1; justify-content: center; }
  .ai-guide-overview { margin-top: 18px; }
  .ai-guide-visual { min-height: 245px; padding: 14px; }
  .ai-guide-mock-body { height: 175px; padding: 10px; }
  .ai-guide-notes, .ai-guide-cards { grid-template-columns: 1fr; }
  .ai-guide-tip { flex-direction: column; }
  .ai-feedback-form { padding: 14px; }
  .ai-feedback-form .ai-primary { width: 100%; }
  .ai-quality-badge, .ai-selected-target { top: 4px; min-height: 20px; padding: 0 5px; font-size: 7px; }
  .ai-quality-badge { left: 4px; }
  .ai-selected-target { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-quality-badge.pending::before, .ai-session-stage i { animation: none; }
}
