.ai-page { --ai-gold: #d7bf91; --ai-panel: #0d1015; --ai-bubble: #191c22; height: 100vh; height: 100dvh; overflow: hidden; font-size: 15px; }
html:has(.ai-page) { scrollbar-gutter: auto; scroll-behavior: auto; }
html[data-theme='light'] .ai-page { --ai-gold: #725b39; --ai-panel: #e5e8e8; --ai-bubble: #dde2e3; }
.ai-page button,.ai-page input,.ai-page select,.ai-page textarea { font-family: var(--sans); }
.ai-page button,.ai-page a { touch-action: manipulation; }
.ai-page :focus-visible { outline-offset: 3px; }
.ai-page button:disabled { cursor: not-allowed; }
.ai-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: 22px; line-height: 1; }
.ai-icon:hover { background: var(--raised); border-color: var(--line); }
.ai-icon svg { width: 21px; height: 21px; }
.ai-primary,.ai-send { display: inline-flex; justify-content: center; align-items: center; gap: 1rem; min-height: 44px; padding: .7rem 1.2rem; border: 1px solid var(--ai-gold); border-radius: 10px; background: var(--ai-gold); color: #19160f; font-weight: 600; }
html[data-theme='light'] .ai-primary,html[data-theme='light'] .ai-send { color: #fff; }
.ai-primary:hover,.ai-send:hover { filter: brightness(1.08); }
.ai-full { width: 100%; }
.ai-text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .35rem .55rem; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .85rem; text-decoration: none; }
.ai-text-button:hover { color: var(--ink); background: var(--raised); }
.ai-muted,.ai-fine { color: var(--muted); }
.ai-fine { font-size: .78rem; line-height: 1.8; }
.ai-eyebrow { color: var(--ai-gold); font-size: .75rem; letter-spacing: .12em; }
.ai-access { height: 100%; overflow-y: auto; }
.ai-access__header { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: auto; padding: 1.4rem clamp(1.2rem,5vw,4rem); }
.ai-access__body { display: grid; grid-template-columns: 1fr minmax(290px,390px); gap: 6rem; align-items: center; max-width: 1050px; min-height: calc(100% - 110px); margin: auto; padding: 3rem 2rem 6rem; }
.ai-access__intro h1 { margin: 1rem 0 1.4rem; font: 400 clamp(2.1rem,4vw,3.5rem)/1.45 var(--serif); }
.ai-access__intro p { color: var(--muted); line-height: 2; }
.ai-access__card { padding: 1.8rem; border: 1px solid var(--line); border-radius: 18px; background: var(--ai-panel); }
.ai-access__card h2 { margin: 0 0 .6rem; font-size: 1.12rem; font-weight: 500; }
.ai-access__card > p { font-size: .84rem; margin: .7rem 0 1.4rem; }
.ai-field { display: grid; gap: .55rem; color: var(--muted); font-size: .82rem; }
.ai-field input { min-width: 0; width: 100%; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 9px; background: var(--void); color: var(--ink); font-size: 16px; }
.ai-check { display: flex; align-items: center; gap: .6rem; min-height: 50px; color: var(--muted); font-size: .8rem; }
.ai-check input,.ai-retention input { accent-color: var(--ai-gold); width: 16px; height: 16px; }
.ai-status { min-height: 1.6em; margin-bottom: 0 !important; color: var(--muted); overflow-wrap: anywhere; }
.ai-status.is-error { color: var(--danger); }
.ai-access__owner { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: .6rem; font-size: .8rem; }
.ai-access__card .ai-fine { margin-bottom: 0; font-size: .75rem; }
.ai-app { height: 100%; display: grid; grid-template-columns: 250px minmax(0,1fr); }
.ai-sidebar { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 1.1rem .9rem .7rem; background: var(--ai-panel); border-right: 1px solid var(--line); }
.ai-sidebar__brand { display: flex; align-items: center; justify-content: space-between; padding: .2rem .7rem 1.4rem; }
.ai-sidebar .cosmos-brand { font-size: .72rem; }
.ai-sidebar .singularity-mark { width: 1.35rem; height: 1.35rem; }
.ai-new { display: flex; align-items: center; gap: .6rem; min-height: 46px; padding: .55rem .8rem; color: var(--ai-gold); border: 1px solid color-mix(in srgb,var(--ai-gold) 35%,var(--line)); border-radius: 10px; background: transparent; font-size: .88rem; }
.ai-new:hover { background: var(--raised); }
.ai-new > span:first-child { font-size: 1.2rem; }
.ai-new__arrow { margin-left: auto; opacity: .7; }
.ai-sidebar__heading { display: flex; align-items: center; justify-content: space-between; margin: 1.35rem .2rem .25rem .65rem; }
.ai-sidebar__heading h2 { margin: 0; color: var(--muted); font-size: .72rem; font-weight: 400; letter-spacing: .06em; }
.ai-sidebar__heading .ai-icon { width: 32px; height: 32px; flex-basis: 32px; font-size: 17px; }
.ai-history { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: .2rem .1rem; scrollbar-width: thin; }
.ai-history__empty { color: var(--muted); padding: .4rem .7rem; font-size: .8rem; line-height: 1.9; }
.ai-history__group { margin: .65rem .65rem .3rem; color: var(--muted); font-size: .68rem; }
.ai-history__item { display: flex; align-items: center; gap: .1rem; margin-bottom: 3px; border-radius: 9px; }
.ai-history__item:hover,.ai-history__item.is-active { background: var(--raised); }
.ai-history__open { flex: 1; display: grid; gap: .12rem; min-width: 0; text-align: left; padding: .65rem .7rem; border: 0; background: transparent; border-radius: inherit; }
.ai-history__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.ai-history__meta { font-size: .65rem; color: var(--muted); }
.ai-history__delete { flex-basis: 32px; width: 32px; height: 38px; margin-right: 3px; font-size: 17px; color: var(--muted); }
.ai-sidebar__bottom { border-top: 1px solid var(--line); padding: .8rem .55rem 0; }
.ai-member { margin: 0; font-size: .85rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-quota { margin: .35rem 0 .45rem; color: var(--muted); font-size: .68rem; line-height: 1.8; }
.ai-sidebar__links { display: flex; gap: 1.1rem; }
.ai-sidebar__links a { display: inline-flex; align-items: center; min-height: 34px; text-decoration: none; color: var(--muted); font-size: .75rem; }
.ai-sidebar__links a:hover { color: var(--ai-gold); }
.ai-sidebar__account { display: flex; align-items: center; justify-content: space-between; }
.ai-sidebar__account > .ai-text-button { padding-left: 0; }
.ai-workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.ai-topbar { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; min-height: 76px; padding: .8rem clamp(1rem,3vw,2.3rem); border-bottom: 1px solid color-mix(in srgb,var(--line) 65%,transparent); }
.ai-topbar__title { flex: 1; min-width: 0; }
.ai-topbar h1 { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .98rem; font-weight: 500; }
.ai-topbar__title > span { display: block; color: var(--muted); font-size: .68rem; margin-top: 1px; }
.ai-retention { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; min-height: 44px; color: var(--muted); font-size: .77rem; cursor: pointer; }
.ai-retention:has(input:not(:checked)) { color: var(--ai-gold); }
.ai-chat-scroll { min-height: 0; flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scroll-behavior: smooth; scrollbar-width: thin; padding: 0 1.5rem; }
.ai-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; max-width: 700px; margin: auto; padding: 2rem 0 2.5rem; text-align: center; }
.ai-welcome__orbit { position: relative; display: block; width: 51px; height: 51px; margin: 0 0 2rem; border: 1px solid color-mix(in srgb,var(--ai-gold) 75%,transparent); border-radius: 50%; box-shadow: inset -7px -4px 15px color-mix(in srgb,var(--ai-gold) 8%,transparent); }
.ai-welcome__orbit::after { content: ''; position: absolute; inset: 14px -18px; border: 1px solid var(--ai-gold); border-radius: 50%; transform: rotate(-25deg); }
.ai-welcome h2 { margin: .8rem 0 .55rem; font: 400 clamp(1.7rem,3vw,2.3rem)/1.5 var(--serif); }
.ai-welcome > p { margin: .2rem 0 1.8rem; color: var(--muted); font-size: .86rem; }
.ai-suggestions { display: flex; gap: .6rem; width: 100%; justify-content: center; flex-wrap: wrap; }
.ai-suggestions button { display: flex; gap: 1.2rem; align-items: center; justify-content: space-between; min-height: 44px; padding: .7rem .95rem; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: .78rem; }
.ai-suggestions button:hover { color: var(--ink); border-color: var(--ai-gold); }
.ai-suggestions button > span { color: var(--ai-gold); }
.ai-conversation-state { max-width: 760px; margin: 2rem auto; color: var(--muted); font-size: .88rem; }
.ai-messages { max-width: 760px; margin: auto; padding: 1.3rem 0 1rem; }
.ai-messages:empty { padding: 0; }
.ai-message { margin: 1.4rem 0 2rem; min-width: 0; }
.ai-message__label { margin: 0 0 .6rem; color: var(--ai-gold); font-size: .7rem; letter-spacing: .06em; }
.ai-message--user { margin-left: auto; max-width: 88%; }
.ai-message--user .ai-message__label { text-align: right; color: var(--muted); }
.ai-message__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; font-size: .93rem; }
.ai-message--user .ai-message__text { padding: .8rem 1rem; background: var(--ai-bubble); border-radius: 15px 15px 4px 15px; }
.ai-message__images { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin: .8rem 0; max-width: 620px; }
.ai-message__images:has(> :only-child) { grid-template-columns: minmax(0,1fr); max-width: 510px; }
.ai-message--user .ai-message__images { max-width: 280px; margin-left: auto; }
.ai-image-card { min-width: 0; margin: 0; }
.ai-image-button { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--ai-panel); min-height: 100px; }
.ai-image-button img { display: block; width: 100%; max-height: 540px; object-fit: contain; }
.ai-message--user .ai-image-button img { max-height: 200px; }
.ai-image-card__actions,.ai-message__actions { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; padding-top: .3rem; }
.ai-image-card__actions .ai-text-button,.ai-message__actions .ai-text-button { font-size: .72rem; min-height: 36px; }
.ai-message__pending,.ai-message__error { margin: .8rem 0; display: flex; align-items: center; gap: .65rem; font-size: .85rem; color: var(--muted); }
.ai-message__error { color: var(--danger); flex-wrap: wrap; }
.ai-spinner { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; border: 1.5px solid var(--line); border-top-color: var(--ai-gold); border-radius: 50%; animation: ai-spin 1.1s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-compose-area { flex-shrink: 0; padding: .1rem clamp(1rem,3vw,2rem) max(.65rem,env(safe-area-inset-bottom)); }
.ai-compose-area > * { max-width: 760px; margin-inline: auto; }
.ai-retention-note { margin-top: .5rem; margin-bottom: .45rem; text-align: center; color: var(--muted); font-size: .68rem; }
.ai-composer { border: 1px solid var(--line); border-radius: 17px; background: var(--ai-panel); padding: .6rem .65rem .55rem; transition: border-color 150ms; }
.ai-composer:focus-within { border-color: color-mix(in srgb,var(--ai-gold) 60%,var(--line)); }
.ai-composer__controls { display: flex; align-items: center; gap: .55rem; min-width: 0; padding: 0 .2rem .25rem; }
.ai-mode { display: inline-flex; flex-shrink: 0; border: 1px solid var(--line); padding: 2px; border-radius: 8px; }
.ai-mode button { min-height: 31px; padding: .25rem .7rem; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: .77rem; }
.ai-mode button[aria-pressed='true'] { color: var(--ai-gold); background: var(--raised); }
.ai-model-field { flex: 1; min-width: 0; }
.ai-size-field { max-width: 150px; min-width: 0; }
.ai-composer select { display: block; max-width: 100%; width: 100%; min-height: 38px; padding: .3rem 1.3rem .3rem .35rem; border: 0; border-radius: 5px; color: var(--muted); background-color: transparent; font-size: .75rem; text-overflow: ellipsis; }
.ai-composer select option { color: var(--ink); background: var(--surface); }
.ai-composer select option:disabled { color: var(--muted); }
.ai-composer textarea { display: block; width: 100%; min-height: 72px; max-height: 180px; resize: none; overflow: auto; padding: .75rem .55rem .5rem; border: 0; outline: none; border-radius: 0; color: var(--ink); background: transparent; line-height: 1.7; font-size: 16px; }
.ai-composer textarea::placeholder { color: var(--muted); opacity: .8; }
.ai-composer__footer { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.ai-creation-settings-trigger { display: none; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .4rem .5rem; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 14px; }
.ai-creation-settings-trigger:hover { color: var(--ai-gold); background: var(--raised); }
.ai-creation-settings-trigger svg { width: 18px; height: 18px; flex-shrink: 0; }
.ai-attachment-control { display: flex; align-items: center; gap: .25rem; min-width: 0; color: var(--muted); }
.ai-attachment-control > span { font-size: .68rem; }
.ai-send { min-height: 40px; padding: .45rem .8rem; border-radius: 10px; font-size: .8rem; flex-shrink: 0; gap: .8rem; }
.ai-send > span:last-child { font-size: 1.2rem; line-height: 1; }
.ai-composer-help { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .1rem 1rem; color: var(--muted); font-size: .64rem; margin-top: .5rem; margin-bottom: 0; }
.ai-compose-error { color: var(--danger); font-size: .8rem; margin-top: .5rem; margin-bottom: 0; }
.ai-references { display: flex; gap: .55rem; overflow-x: auto; padding: .65rem .45rem .1rem; }
.ai-reference { position: relative; width: 66px; height: 66px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.ai-reference img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.ai-reference .ai-icon { position: absolute; right: -5px; top: -6px; width: 24px; height: 24px; min-height: 24px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; border-radius: 50%; }
.ai-reference__status { position: absolute; bottom: 0; inset-inline: 0; padding: 1px; border-radius: 0 0 7px 7px; background: #080b10da; color: #fff; font-size: .6rem; text-align: center; }
.ai-notice,.ai-task-banner { display: flex; justify-content: center; align-items: center; gap: .6rem; flex-wrap: wrap; flex-shrink: 0; padding: .6rem 1rem; background: var(--ai-panel); color: var(--muted); font-size: .76rem; border-bottom: 1px solid var(--line); }
.ai-notice a { color: var(--ai-gold); }
.ai-task-banner { color: var(--ai-gold); padding-block: .2rem; min-height: 42px; }
.ai-task-banner .ai-text-button { color: inherit; font-size: .75rem; }
.ai-dialog { width: min(440px,calc(100vw - 2rem)); border: 1px solid var(--line); padding: 1.8rem; border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 80px #0006; }
.ai-dialog::backdrop,.ai-image-dialog::backdrop,.ai-creation-settings::backdrop { background: #000b; backdrop-filter: blur(5px); }
.ai-dialog h2 { margin: .4rem 1rem 1rem 0; font-size: 1.1rem; font-weight: 500; }
.ai-dialog p { font-size: .85rem; line-height: 1.9; color: var(--muted); white-space: pre-line; }
.ai-dialog__close { position: absolute; top: .4rem; right: .4rem; }
.ai-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; margin-top: 1.5rem; }
.ai-dialog__actions .ai-primary { font-size: .8rem; padding: .5rem .85rem; }
.ai-dialog__actions .is-danger { color: var(--danger); }
.ai-image-dialog { width: min(1060px,calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: .8rem; color: var(--ink); background: var(--ai-panel); border: 1px solid var(--line); border-radius: 14px; }
.ai-image-dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 .3rem .5rem; }
.ai-image-dialog__bar h2 { margin: 0; font-size: .9rem; font-weight: 400; }
.ai-image-dialog > img { display: block; width: 100%; max-height: calc(100dvh - 180px); min-height: 60px; object-fit: contain; border-radius: 7px; background: var(--void); }
.ai-image-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .4rem; padding: .65rem .2rem .2rem; }
.ai-image-dialog__actions .ai-primary { font-size: .8rem; min-height: 40px; padding: .4rem .9rem; }
.ai-creation-settings { position: fixed; inset: auto 0 var(--ai-viewport-bottom,0px); width: min(560px,100%); max-height: min(80dvh,var(--ai-viewport-height,100dvh)); margin: 0 auto; padding: 1rem 1.2rem max(1.3rem,env(safe-area-inset-bottom)); overflow: auto; overscroll-behavior: contain; color: var(--ink); background: var(--ai-panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 60px #0004; }
.ai-creation-settings__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.ai-creation-settings__header h2 { margin: 0; font-size: 16px; font-weight: 500; }
.ai-creation-settings__header .ai-icon { width: 44px; height: 44px; flex-basis: 44px; }
.ai-creation-settings .ai-composer__controls { display: grid; grid-template-columns: minmax(0,1fr); gap: 1.1rem; padding: 0; }
.ai-creation-settings .ai-mode { width: 100%; padding: 3px; }
.ai-creation-settings .ai-mode button { flex: 1; min-height: 44px; font-size: 14px; }
.ai-creation-settings .ai-model-field,.ai-creation-settings .ai-size-field { display: grid; gap: .55rem; max-width: none; width: 100%; }
.ai-creation-settings .ai-settings-field-label { position: static; width: auto; height: auto; margin: 0; padding: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal; color: var(--muted); font-size: 14px; }
.ai-creation-settings select { display: block; width: 100%; min-width: 0; min-height: 48px; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: var(--void); color: var(--ink); font-family: var(--sans); font-size: 16px; text-overflow: ellipsis; }
.ai-creation-settings select option { color: var(--ink); background: var(--surface); }
.ai-creation-settings select option:disabled { color: var(--muted); }
.ai-more-menu { position: relative; flex-shrink: 0; }
.ai-more-menu summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 24px; }
.ai-more-menu summary::-webkit-details-marker { display: none; }
.ai-more-menu[open] summary { background: var(--raised); color: var(--ink); }
.ai-more-menu__items { position: absolute; z-index: 4; bottom: calc(100% + .4rem); left: 0; min-width: 148px; padding: .3rem; border: 1px solid var(--line); border-radius: 10px; background: var(--ai-panel); box-shadow: 0 8px 24px #0004; }
.ai-more-menu__items .ai-text-button { justify-content: flex-start; width: 100%; min-height: 44px; font-size: 14px; padding: .4rem .7rem; }
.ai-image-dialog__actions .ai-more-menu { margin-right: auto; }
.ai-image-save { color: var(--ink); border: 1px solid var(--line); }
.ai-toast { position: fixed; z-index: 100; bottom: max(1.3rem,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2rem); padding: .7rem 1.1rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--raised); box-shadow: 0 8px 30px #0004; font-size: .83rem; }
.ai-mobile-only { display: none; }
.ai-noscript { position: fixed; inset: auto 1rem 1rem; padding: 1rem; background: var(--surface); color: var(--danger); }
@media(max-width:900px) { .ai-app { grid-template-columns: 220px minmax(0,1fr); } .ai-access__body { gap: 3rem; } .ai-size-field { max-width: 110px; } .ai-composer-help span { display: none; } }
@media(max-width:700px) {
  .ai-page { position: fixed; inset: auto 0; top: var(--ai-viewport-offset-top,0px); width: 100%; height: var(--ai-viewport-height,100dvh); }
  .ai-app { display: block; }
  .ai-workspace { height: 100%; }
  .ai-mobile-only { display: inline-flex; }
  .ai-icon { width: 44px; height: 44px; flex-basis: 44px; }
  .ai-text-button { min-height: 44px; }
  .ai-sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(290px,calc(100vw - 40px)); transform: translateX(-100%); transition: transform 180ms ease; padding-top: max(1rem,env(safe-area-inset-top)); padding-bottom: max(.7rem,env(safe-area-inset-bottom)); box-shadow: 15px 0 60px #0004; }
  .ai-sidebar.is-open { transform: translateX(0); }
  .ai-sidebar-backdrop { position: fixed; z-index: 59; inset: 0; background: #0009; }
  .ai-topbar { min-height: 66px; padding: max(.5rem,env(safe-area-inset-top)) .75rem .5rem; gap: .35rem; }
  .ai-topbar h1 { font-size: 15px; }
  .ai-topbar__title > span { font-size: 12px; }
  .ai-retention { font-size: 12px; gap: .3rem; }
  .ai-chat-scroll { padding-inline: 1rem; }
  .ai-welcome { padding: 1.7rem 0; }
  .ai-welcome__orbit { margin-bottom: 1.3rem; width: 42px; height: 42px; }
  .ai-welcome h2 { font-size: 1.65rem; }
  .ai-welcome > p { font-size: 14px; margin-bottom: 1.2rem; }
  .ai-suggestions { gap: .4rem; }
  .ai-suggestions button { padding: .55rem .7rem; font-size: 12px; min-height: 44px; gap: .7rem; }
  .ai-suggestions button:last-child { display: none; }
  .ai-compose-area { padding: 6px 10px max(10px,env(safe-area-inset-bottom)); }
  .ai-composer { padding: 6px; border-radius: 14px; }
  #creation-settings-inline { display: none; }
  .ai-creation-settings-trigger { display: inline-flex; margin-right: auto; }
  .ai-composer__footer { gap: 4px; }
  .ai-composer textarea { min-height: 64px; max-height: min(168px,35dvh); padding: 8px 8px 4px; line-height: 1.5; }
  .ai-attachment-control > span { display: none; }
  .ai-send { min-width: 100px; min-height: 44px; padding: .45rem .7rem; font-size: 14px; gap: .65rem; }
  .ai-retention-note,.ai-composer-help { display: none; }
  .ai-compose-area[data-keep-history='false'] .ai-retention-note { display: block; margin: 0 4px 7px; font-size: 12px; line-height: 1.5; }
  .ai-compose-error { font-size: 14px; line-height: 1.5; }
  .ai-references { gap: 16px; padding: 10px 10px 4px; scrollbar-width: thin; }
  .ai-reference { width: 56px; height: 56px; }
  .ai-reference .ai-icon { z-index: 1; isolation: isolate; right: -10px; top: -10px; width: 44px; height: 44px; min-height: 44px; border: 0; background: transparent; font-size: 16px; }
  .ai-reference .ai-icon::before { content: ''; position: absolute; z-index: -1; inset: 10px; border: 1px solid var(--line); border-radius: 50%; background: var(--ai-panel); }
  .ai-reference .ai-icon:hover::before { border-color: var(--ai-gold); }
  .ai-reference__status { font-size: 12px; line-height: 1.5; }
  .ai-message { margin-bottom: 1.5rem; }
  .ai-message--user { max-width: 95%; }
  .ai-message__text { font-size: 16px; }
  .ai-message__label { font-size: 12px; }
  .ai-message__pending,.ai-message__error { font-size: 14px; }
  .ai-message__images { gap: .4rem; }
  .ai-image-card__actions { gap: 6px; padding-top: 8px; }
  .ai-image-card__actions .ai-text-button,.ai-message__actions .ai-text-button { min-height: 44px; padding: .4rem .65rem; font-size: 14px; }
  .ai-image-card__actions .ai-primary { min-height: 44px; padding: .45rem .9rem; font-size: 14px; }
  .ai-image-card__actions .ai-more-menu { margin-left: auto; }
  .ai-image-card__actions .ai-more-menu__items { left: auto; right: 0; }
  .ai-sidebar__heading h2,.ai-history__meta,.ai-history__group,.ai-quota { font-size: 12px; }
  .ai-history__title { font-size: 14px; }
  .ai-sidebar__heading .ai-icon,.ai-history__delete { width: 44px; height: 44px; flex-basis: 44px; }
  .ai-sidebar__links a { min-height: 44px; font-size: 14px; }
  .ai-image-dialog { position: fixed; inset: auto 0; top: var(--ai-viewport-offset-top,0px); width: 100%; max-width: none; height: var(--ai-viewport-height,100dvh); max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; }
  .ai-image-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
  .ai-image-dialog__bar { padding: max(8px,env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line); }
  .ai-image-dialog__bar h2 { font-size: 14px; }
  .ai-image-dialog > img { width: 100%; height: 100%; min-height: 0; max-height: none; border-radius: 0; object-fit: contain; }
  .ai-image-dialog__actions { flex-wrap: nowrap; gap: 8px; padding: 10px 12px max(10px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .ai-image-dialog__actions .ai-primary,.ai-image-dialog__actions .ai-image-save { min-height: 44px; padding: .45rem .85rem; font-size: 14px; white-space: nowrap; }
  .ai-toast { bottom: calc(var(--ai-viewport-bottom,0px) + var(--ai-compose-height,148px) + 8px); padding: .6rem .9rem; font-size: 14px; }
  .ai-page.is-keyboard-open .ai-compose-area { padding-bottom: 6px; }
  .ai-page.is-keyboard-open .ai-composer textarea { max-height: min(120px,30dvh); }
  .ai-page.is-keyboard-open .ai-welcome__orbit { display: none; }
  .ai-access__header { padding: 1rem 1.4rem; }
  .ai-access__body { grid-template-columns: minmax(0,1fr); gap: 1.5rem; padding: 2rem 1.25rem; min-height: auto; max-width: 450px; }
  .ai-access__intro h1 { font-size: 2rem; margin: .8rem 0; }
  .ai-access__intro p { font-size: .88rem; margin-bottom: .2rem; }
  .ai-access__card { padding: 1.35rem; }
}
@media(max-width:350px) { .ai-topbar { padding-inline: .45rem; } .ai-composer__footer { gap: 0; } .ai-creation-settings-trigger { padding-inline: .25rem; gap: .25rem; } .ai-welcome h2 { font-size: 1.45rem; } .ai-welcome .ai-eyebrow { font-size: 12px; } .ai-message__images { grid-template-columns: minmax(0,1fr); } }
@media(prefers-reduced-motion:reduce) { .ai-page *, .ai-page *::before,.ai-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
