.ai-trigger { border: 1px solid #269eba; border-radius: 7px; padding: 9px 15px; background: #eaf7fa; color: #237c94; font-weight: 800; white-space: nowrap; }
.ai-dialog { width: min(1200px, 95vw); max-height: 91vh; padding: 0; border: 1px solid #d9e3e6; border-radius: 12px; color: #536970; box-shadow: 0 18px 75px #203d4555; }
.ai-dialog::backdrop { background: #233d4580; }
.ai-shell { padding: 18px; }
.ai-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; position: sticky; top: 0; padding: 8px 0; background: white; z-index: 2; }
.ai-heading h2 { margin: 2px 0 3px; font-family: 'Sen', sans-serif; color: #477681; }
.ai-kicker { color: #299db8; font-size: 11px; letter-spacing: .12em; font-weight: 800; }
.ai-close { border: 0; background: transparent; color: #49747f; font-size: 30px; padding: 0 9px; }
.ai-intro, .ai-session-note { font-size: 13px; line-height: 1.5; margin: 5px 0 10px; }
.ai-request { border: 1px solid #cbe3e9; background: #f6fbfc; border-radius: 9px; padding: 12px; margin: 10px 0; }
.ai-request.is-compact { padding: 10px 12px; margin: 8px 0; }
.ai-consent { display: flex; gap: 8px; align-items: start; font-size: 13px; line-height: 1.5; margin: 10px 0; }
.ai-consent input { margin-top: 3px; flex: 0 0 auto; }
.ai-request-limit { margin: 10px 0; color: #3c6976; font-size: 13px; font-weight: 700; line-height: 1.5; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.ai-usage { margin-left: auto; font-size: 12px; line-height: 1.5; font-weight: 700; color: #3c6976; }
.ai-dialog button:not(.ai-close) { padding: 9px 14px; border: 1px solid #b7d1d9; border-radius: 6px; background: white; color: #3c6976; font-weight: 700; }
.ai-dialog button.ai-primary { background: #299dbc; border-color: #299dbc; color: white; }
.ai-dialog button:disabled { opacity: .5; }
.ai-dialog [hidden] { display: none !important; }
.ai-status { margin: 8px 0; font-size: 14px; line-height: 1.5; font-weight: 700; }
.ai-status.is-quiet { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ai-status.is-error { color: #a03b32; background: #fff4ed; border: 1px solid #edc5ac; border-left: 4px solid #c45d37; border-radius: 6px; padding: 12px 14px; }
.ai-status.is-busy::before { content: ''; display: inline-block; width: 13px; height: 13px; margin-right: 9px; border: 2px solid #b4e0e9; border-top-color: #299dbc; border-radius: 50%; animation: ai-spin 1s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-status.is-busy::before { animation: none; } }
.ai-batch { border-top: 1px solid #dce7ea; margin-top: 8px; padding-top: 9px; }
.ai-batch h3 { font-size: 13px; margin: 0 0 8px; }
.ai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ai-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid #d9e5e8; border-radius: 9px; overflow: hidden; padding: 10px; background: #fff; }
.ai-card img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 3px; }
.ai-card h4 { margin: 10px 0 5px; font-family: 'Sen', sans-serif; font-size: 16px; line-height: 1.3; }
.ai-card p { font-size: 12px; line-height: 1.5; margin: 0 0 12px; }
.ai-card button { margin-top: auto; }
.ai-card .ai-unavailable { color: #a03b32; margin: 7px 0; }
.ai-confirm { border: 1px solid #efd19f; background: #fff8e9; padding: 14px; border-radius: 8px; margin: 12px 0; }
.ai-confirm p { margin: 0 0 10px; font-size: 14px; }
@media (max-width: 800px) { .ai-grid { grid-template-columns: 1fr; } .ai-card { max-width: 600px; margin: auto; } .ai-shell { padding: 16px; } }
.ai-access { font-size:12px; margin-bottom:12px; }
.ai-access label { display:block; font-weight:700; margin-bottom:5px; }
.ai-access input { width:min(100%,470px); padding:10px; border:1px solid #bfd6dd; border-radius:5px; font-size:14px; }
.ai-access p { margin:6px 0 0; line-height:1.5; }
.ai-history-nav { display:flex; align-items:center; justify-content:center; gap:12px; margin:8px 0 4px; }
.ai-history-nav button span { font-size:20px; line-height:1; vertical-align:-1px; }
.ai-history-nav span { font-size:13px; font-weight:700; }
.ai-close:disabled { opacity:.35; cursor:default; }
.ai-dialog[aria-busy="true"] .ai-status { background:#eff9fb; border:1px solid #c8e6ee; border-radius:8px; padding:20px; }
.ai-dialog[aria-busy="true"] .ai-history, .ai-dialog[aria-busy="true"] .ai-history-nav { display:none; }
@media (pointer:coarse) { .ai-dialog button:not(.ai-close), .focused-commandbar button { min-height:42px; } }
@media (max-width: 540px) { .ai-usage { margin-left: 0; flex-basis: 100%; } .ai-request.is-compact { padding: 10px; } .ai-history-nav { gap: 9px; } }
