:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #151619;
  --surface-2: #1b1c20;
  --surface-3: #24252a;
  --line: #292a2f;
  --text: #f3f3f5;
  --muted: #9a9ca6;
  --blue: #4285f4;
  --danger: #ff6c73;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid #1b1c1f; }
.brand { font-size: 23px; font-weight: 700; letter-spacing: -0.6px; }
.top-actions { display: flex; gap: 20px; align-items: center; }
.icon-button { width: 40px; height: 40px; background: transparent; color: #b7b8c0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; transition: background .15s, color .15s; }
.icon-button:hover, .favorite-filter:hover { color: #fff; }
.icon-button:hover { background: #202127; }
.icon-button .ui-icon { width: 22px; height: 22px; }
.workspace { min-height: calc(100vh - 74px); padding: 36px 42px 300px; }
.toolbar { display: grid; grid-template-columns: 138px minmax(200px, 1fr); gap: 12px; align-items: center; }
.select-wrap select, .search-box, .control-field select, .control-field input { height: 64px; border: 1px solid var(--line); background: var(--surface); border-radius: 17px; }
.select-wrap select { width: 100%; padding: 0 18px; appearance: auto; }
.search-box { display: flex; align-items: center; gap: 16px; padding: 0 20px; color: #8e909a; }
.search-box span { display: inline-flex; align-items: center; }
.search-box span .ui-icon { width: 22px; height: 22px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #8e909a; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; margin-top: 24px; }
.art-card { min-width: 0; display: grid; grid-template-columns: 40% 60%; height: 250px; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; background: #111216; }
.art-preview { min-width: 0; position: relative; background: #1b1c20; display: flex; align-items: center; justify-content: center; }
.art-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-preview .status { position: absolute; inset: 12px auto auto 12px; background: rgba(7,8,10,.78); border-radius: 7px; padding: 5px 9px; font-size: 13px; }
.art-preview .status.error { color: var(--danger); font-weight: 600; }
.art-preview .status.loading { color: #8fb7ff; }
.placeholder-art .ui-icon { width: 38px; height: 38px; color: var(--danger); }
.art-meta { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; min-width: 0; min-height: 0; padding: 20px 17px 15px; }
.art-prompt { min-height: 0; overflow: hidden; margin: 0; font-size: 15px; line-height: 1.55; color: #e6e6e9; overflow-wrap: anywhere; }
.tag-row { display: flex; gap: 5px; min-width: 0; overflow: hidden; }
.tag { flex: 0 1 auto; min-width: 0; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 6px; border-radius: 5px; background: #222328; color: #bdbec7; font-size: 11px; line-height: 16px; }
.tag.green { color: #46d7a1; background: #102b24; }
.card-actions { margin-top: auto; display: flex; align-items: center; justify-content: flex-end; gap: 18px; color: #a9abb5; }
.card-actions button { padding: 0; background: transparent; color: inherit; font-size: 23px; }
.card-actions button:hover { color: #fff; }
.empty-state { max-width: 430px; margin: 160px auto 0; text-align: center; color: var(--muted); }
.empty-icon { color: #777b87; display: flex; justify-content: center; margin-bottom: 6px; }
.empty-icon .ui-icon { width: 56px; height: 56px; }
.empty-state h2 { margin: 14px 0 7px; color: #eeeef0; font-size: 19px; }
.empty-state p { margin: 0 0 22px; }
.composer { position: fixed; z-index: 3; right: max(32px, calc((100vw - 1600px) / 2)); bottom: 24px; left: max(32px, calc((100vw - 1600px) / 2)); padding: 13px 20px 15px; border: 1px solid #2d2e33; border-radius: 24px; background: rgba(25,26,29,.97); box-shadow: 0 18px 50px rgba(0,0,0,.42); }
.prompt-shell { position: relative; }
.prompt-shell textarea { display: block; width: 100%; height: 72px; min-height: 72px; resize: none; overflow: auto; padding: 7px 0; border: 0; outline: 0; background: transparent; font-size: 14px; line-height: 1.45; }
.prompt-shell textarea::placeholder { color: #e7e7e9; opacity: .95; }
.expand-prompt { position: absolute; right: 0; background: transparent; color: #aaaab4; font-size: 20px; }
.expand-prompt { right: 1px; bottom: 6px; font-size: 18px; }
.control-row { display: flex; gap: 12px; align-items: end; }
.control-field { flex: 1 1 130px; min-width: 0; }
.control-field span { display: block; margin-bottom: 5px; color: #aaaab3; font-size: 11px; }
.control-field select, .control-field input, .picker-trigger { width: 100%; height: 42px; padding: 0 12px; border-radius: 13px; outline: 0; }
.control-field select { appearance: auto; }
.control-field input { background: var(--surface); }
.model-control select:disabled { opacity: .78; color: #d1d1d6; cursor: default; }
.number-field { max-width: 130px; }
.size-control { position: relative; }
.picker-trigger { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.picker-chevron { color: #a8a9b1; }
.picker-trigger .picker-chevron { width: 16px; height: 16px; flex-shrink: 0; }
.size-menu { position: absolute; z-index: 7; bottom: calc(100% + 10px); left: 0; width: min(430px, 70vw); padding: 12px; border: 1px solid #35363d; border-radius: 16px; background: #1b1c20; box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.size-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.size-grid button, .custom-size-option { min-height: 40px; border: 1px solid #303138; border-radius: 9px; background: #191a1e; color: #d6d6db; font-size: 13px; }
.size-grid button:hover, .size-grid button.selected { border-color: var(--blue); background: #1d2a43; color: #8bb5ff; }
.custom-size-option { width: 100%; margin-top: 10px; color: #bfc0c8; }
.custom-size-row { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.custom-size-row input { min-width: 0; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #111216; }
.custom-size-row button { height: 34px; padding: 0 11px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 12px; }
.attach-button, .generate-button { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.attach-button { position: relative; border: 1px solid #363941; background: #2b2c31; color: #f2f2f4; transition: border-color .15s, background .15s; }
.attach-button:hover, .attach-button:focus-within { border-color: #64708a; background: #333640; }
.paperclip-icon { position: relative; width: 14px; height: 25px; border: 2px solid currentColor; border-radius: 9px; transform: rotate(42deg); }
.paperclip-icon::after { position: absolute; content: ""; top: 4px; left: 3px; width: 6px; height: 14px; border: 2px solid currentColor; border-radius: 6px; }
.attach-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.generate-button { background: var(--blue); color: white; font-size: 34px; transition: transform .15s, background .15s; }
.generate-button:hover { background: #5c99fb; transform: translateY(-1px); }
.generate-button:disabled { opacity: .5; cursor: wait; transform: none; }
.attachment-preview { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.attachment-preview img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; }
.attachment-preview button { color: var(--muted); background: transparent; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 7px; cursor: pointer; }
.attachment-preview button .ui-icon { width: 16px; height: 16px; }
.attachment-preview button:hover { color: var(--text); background: #202127; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 105px; transform: translate(-50%, 12px); padding: 11px 16px; border: 1px solid #3a3b42; border-radius: 10px; background: #26272c; color: #f4f4f5; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dialog { width: min(520px, calc(100vw - 32px)); border: 1px solid #36373d; border-radius: 18px; padding: 25px; background: #191a1e; color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.6); }
.dialog::backdrop { background: rgba(0,0,0,.68); }
.active-key-select { max-width: min(220px, 42vw); height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 12px; }
.form-field select, .key-input-row input { width: 100%; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #101115; color: var(--text); }
.key-input-row { display: flex; gap: 8px; }
.key-input-row button { flex-shrink: 0; }
.key-profile-actions { display: flex; gap: 8px; margin-top: 10px; }
.key-cards { display: grid; gap: 12px; }
.key-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #131418; }
.key-card-head, .key-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.key-card-head { margin-bottom: 10px; }
.profile-name { width: 70%; min-width: 0; border: 0; padding: 4px 0; background: transparent; color: var(--text); font-size: 13px; }
.key-state, .key-help { color: var(--muted); font-size: 11px; }
.key-state { flex-shrink: 0; }
.key-card-actions { margin-top: 10px; }
.key-delete { background: transparent; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.key-delete:disabled { opacity: .4; cursor: default; }
.add-key-button { width: 100%; margin-top: 12px; }
#settingsDialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.dialog.fallback-open, .prompt-dialog.fallback-open { display: block; position: fixed; z-index: 20; inset: 0; margin: auto; }
.dialog.fallback-open::before, .prompt-dialog.fallback-open::before { position: fixed; z-index: -1; content: ""; inset: -100vh; background: rgba(0,0,0,.68); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog h2 { margin: 0; font-size: 22px; }
.close-button { background: transparent; color: #aaaab3; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; cursor: pointer; }
.close-button .ui-icon { width: 20px; height: 20px; }
.close-button:hover { color: #fff; background: #202127; }
.dialog-copy, .help-content { color: var(--muted); line-height: 1.6; }
.form-field { display: block; margin-top: 17px; }
.form-field span { display: block; margin-bottom: 7px; color: #c3c4cb; font-size: 14px; }
.form-field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #101115; }
.key-application-link { display: inline-block; margin-top: 16px; color: #80abff; font-size: 13px; text-decoration: none; }
.key-application-link:hover { text-decoration: underline; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.primary-button, .secondary-button { min-height: 42px; padding: 0 18px; border-radius: 11px; }
.primary-button { background: var(--blue); color: white; }
.secondary-button { background: #2b2c31; color: #eee; }
.prompt-dialog { width: min(1250px, calc(100vw - 48px)); height: min(720px, calc(100vh - 80px)); max-width: none; max-height: none; padding: 0; overflow: hidden; border: 1px solid #36373d; border-radius: 22px; background: #1a1b1f; color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.65); }
.prompt-dialog::backdrop { background: rgba(0,0,0,.68); }
.expanded-prompt-shell { position: relative; width: 100%; height: 100%; }
.expanded-prompt-shell textarea { width: 100%; height: 100%; resize: none; padding: 25px 58px 28px 25px; border: 0; outline: 0; background: transparent; color: #ededf0; font-size: 17px; line-height: 1.6; }
.expanded-prompt-shell textarea::placeholder { color: #dedee2; }
.expanded-close, .expanded-collapse { position: absolute; z-index: 1; background: transparent; color: #aeb0ba; font-size: 26px; }
.expanded-close { top: 15px; right: 18px; }
.expanded-collapse { right: 19px; bottom: 17px; font-size: 20px; }
@media (max-width: 900px) { .topbar { padding: 0 20px; } .workspace { padding: 24px 20px 300px; } .composer { right: 16px; left: 16px; bottom: 16px; } .control-row { flex-wrap: wrap; } .control-field { flex-basis: calc(33.333% - 10px); } .attach-button, .generate-button { width: 50px; height: 50px; } }
@media (max-width: 560px) { .topbar { height: 62px; } .brand { font-size: 23px; } .top-actions { gap: 6px; } .icon-button { width: 36px; height: 36px; } .toolbar { grid-template-columns: 105px minmax(0, 1fr); gap: 7px; } .select-wrap select, .search-box { height: 54px; border-radius: 14px; } .search-box { padding: 0 10px; gap: 5px; } .search-box input { font-size: 14px; } .gallery { grid-template-columns: 1fr; gap: 14px; } .art-card { height: 214px; } .art-prompt { font-size: 15px; } .composer { padding: 10px 13px 12px; border-radius: 20px; } .prompt-shell textarea { height: 58px; min-height: 58px; font-size: 13px; } .control-field { flex-basis: calc(50% - 6px); } .control-field select, .control-field input, .picker-trigger { height: 38px; } .number-field { max-width: none; } .attach-button, .generate-button { align-self: end; width: 48px; height: 48px; } .size-menu { width: min(360px, calc(100vw - 32px)); } .size-grid { grid-template-columns: repeat(5, 1fr); } .prompt-dialog { width: calc(100vw - 24px); height: calc(100vh - 32px); border-radius: 16px; } .expanded-prompt-shell textarea { padding: 20px 45px 20px 18px; font-size: 15px; } }

/* Compact composer expands vertically in place, keeping its width and bottom anchor. */
.composer { left: 50%; right: auto; transform: translateX(-50%); width: min(960px, calc(100% - 40px)); bottom: 20px; padding: 16px; border-radius: 22px; max-height: calc(100dvh - 32px); }
.prompt-shell textarea { height: 52px; min-height: 0; padding: 14px 42px 14px 16px; border: 1px solid #303136; border-radius: 16px; background: #202125; font-size: 13px; line-height: 22px; transition: height 300ms cubic-bezier(.22, 1, .36, 1); }
.prompt-shell textarea::placeholder { color: #898b95; }
.expand-prompt { right: 12px; bottom: 13px; }
.control-row { display: grid; grid-template-columns: 1.2fr 1.6fr repeat(4, 1fr) .65fr 40px 40px; gap: 8px; margin-top: 12px; }
.control-field { min-width: 0; }
.control-field select, .control-field input, .picker-trigger { height: 34px; padding: 0 8px; border-radius: 11px; font-size: 12px; }
.control-field > span { font-size: 11px; margin-bottom: 4px; }
.picker-trigger span { margin: 0; font-size: 11px; }
.attach-button, .generate-button { width: 40px; height: 40px; border-radius: 12px; }
.generate-button { font-size: 26px; }
.paperclip-icon { transform: rotate(42deg) scale(.8); }
.composer.is-expanded .prompt-shell textarea { height: min(380px, 48dvh); }
@media (max-width: 760px) {
  .composer { width: calc(100% - 24px); bottom: 12px; padding: 12px; }
  .control-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .model-control { grid-column: span 2; }
  .number-field { max-width: none; }
  .attach-button, .generate-button { width: 100%; height: 34px; }
  .composer.is-expanded .prompt-shell textarea { height: min(300px, max(100px, calc(100dvh - 260px))); }
  .size-menu { width: min(360px, calc(100vw - 48px)); }
}
@media (max-height: 500px) {
  .composer { overflow-y: auto; }
  .composer.is-expanded .prompt-shell textarea { height: 120px; }
}
@media (prefers-reduced-motion: reduce) { .prompt-shell textarea { transition: none; } }

/* Consistent vector action icons, independent of the platform font. */
.ui-icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; pointer-events: none; }
.card-actions { gap: 8px; }
.card-actions button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; transition: color .15s, background .15s; }
.card-actions button:hover { background: #272930; }
.card-actions button[aria-pressed="true"] { color: #efc46b; }
.card-actions button[aria-pressed="true"] svg { fill: currentColor; }
.attach-button .ui-icon { width: 21px; height: 21px; }
.generate-button .ui-icon { width: 23px; height: 23px; stroke-width: 2; }
.expand-prompt { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; right: 9px; bottom: 13px; border-radius: 6px; }
.expand-prompt .ui-icon { width: 17px; height: 17px; }
.expand-prompt:hover { background: #303138; color: #fff; }
.card-actions button:focus-visible, .expand-prompt:focus-visible, .generate-button:focus-visible { outline: 2px solid #8bb5ff; outline-offset: 3px; }
.retention-notice { margin: 8px 0 0; padding: 8px 12px; border: 1px solid #57451f; border-radius: 9px; background: #302719; color: #e4c577; font-size: 12px; line-height: 1.5; }
@media (max-width: 760px) { .composer.is-expanded .prompt-shell textarea { height: min(300px, max(80px, calc(100dvh - 310px))); } }

.preview-trigger { display: block; width: 100%; height: 100%; padding: 0; background: transparent; cursor: zoom-in; }
.preview-trigger:focus-visible { outline: 2px solid #8bb5ff; outline-offset: -3px; }
.art-preview .status { pointer-events: none; }
.image-lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 56px 24px 24px; border: 0; background: transparent; color: var(--text); }
.image-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.image-lightbox::backdrop { background: rgba(0,0,0,.88); }
.image-lightbox.fallback-open { z-index: 30; background: rgba(0,0,0,.94); }
.image-lightbox > img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.image-lightbox > img[hidden] { display: none; }
.lightbox-close { position: absolute; top: 12px; right: 16px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #282a30; color: #fff; }
.lightbox-close:hover { background: #40434b; }
.lightbox-close:focus-visible { outline: 2px solid #8bb5ff; outline-offset: 3px; }
body:has(.image-lightbox[open]) { overflow: hidden; }

.prompt-shell textarea { scrollbar-gutter: stable; padding-right: 50px; scrollbar-width: thin; scrollbar-color: #686a73 transparent; }
.prompt-measure { position: fixed; left: -10000px; top: 0; height: 0; min-height: 0; max-height: none; visibility: hidden; pointer-events: none; overflow: hidden; resize: none; }
.expand-prompt { right: 18px; }

.prompt-shell textarea { padding-right: 82px; }
.expand-prompt.fit-prompt { right: 50px; }

/* Bound the grid row even when a broken image has a long alt label. */
.art-card { grid-template-rows: minmax(0, 1fr); }
.art-preview, .preview-trigger { min-height: 0; overflow: hidden; }
.art-meta { overflow: hidden; }
.image-unavailable { padding: 20px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--muted); }
.art-card { cursor: pointer; }
.art-card:focus-visible { outline: 2px solid #8bb5ff; outline-offset: 3px; }
.record-dialog { position: fixed; inset: 0; margin: auto; width: min(1120px, calc(100vw - 48px)); max-width: none; height: min(650px, calc(100dvh - 64px)); max-height: none; padding: 0; border: 1px solid #34353b; border-radius: 26px; background: #191a1e; color: var(--text); overflow: hidden; box-shadow: 0 30px 100px #0008; }
.record-dialog[open] { display: grid; grid-template-columns: 1fr 1fr; }
.record-dialog::backdrop { background: #000b; backdrop-filter: blur(8px); }
.record-dialog.fallback-open { z-index: 25; }
.detail-close { position: absolute; top: 12px; right: 14px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; background: #24252b; color: #bbbcc7; display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; }
.detail-close .ui-icon { width: 18px; height: 18px; }
.detail-close:hover { background: #2c2d34; color: #fff; }
.detail-preview { min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: #111214; color: #999ba6; font-size: 13px; text-align: center; }
.detail-image-button { width: 100%; height: 100%; padding: 0; background: transparent; cursor: zoom-in; }
.detail-image-button img { width: 100%; height: 100%; object-fit: contain; }
.detail-content { padding: 32px 26px 24px; overflow-y: auto; min-width: 0; scrollbar-width: thin; }
.detail-heading { color: #9395a1; font-size: 12px; margin: 0 0 12px; }
.detail-text-button { margin-left: 8px; background: transparent; color: #86b2fb; font-size: 12px; }
.detail-prompt { margin: 0 0 24px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.8; user-select: text; }
.detail-params { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.detail-params > div { padding: 12px 14px; border-radius: 11px; background: #222328; min-width: 0; }
.detail-params > div:first-child { grid-column: 1 / -1; }
.detail-params dt { color: #92949e; font-size: 12px; margin-bottom: 4px; }
.detail-params dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.detail-time { color: #9395a1; font-size: 11px; line-height: 1.7; margin: 20px 0; }
.detail-error { color: #f09e9e; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; border-top: 1px solid #2d2e34; }
.detail-actions button { padding: 10px 13px; border-radius: 12px; font-size: 12px; }
.detail-reuse { color: #83b6ff; background: #202d42; }
.detail-delete { color: #f28b8b; background: #3a2328; }
.detail-actions button:disabled { opacity: .4; cursor: default; }
.detail-wait { width: 80%; line-height: 1.8; }
.detail-spinner { width: 44px; height: 44px; margin: 0 auto 22px; border: 6px solid #243850; border-top-color: #619cee; border-radius: 50%; animation: detail-spin 1s linear infinite; }
.detail-progress { height: 6px; background: #25272d; border-radius: 6px; overflow: hidden; margin-top: 16px; }
.detail-progress span { display: block; width: 35%; height: 100%; border-radius: inherit; background: #528fec; animation: detail-slide 1.8s ease-in-out infinite alternate; }
@keyframes detail-spin { to { transform: rotate(360deg); } }
@keyframes detail-slide { to { transform: translateX(185%); } }
body:has(.record-dialog[open]) { overflow: hidden; }
@media (max-width: 700px) {
  .record-dialog { width: calc(100vw - 24px); height: calc(100dvh - 32px); border-radius: 18px; overflow-y: auto; }
  .record-dialog[open] { display: block; }
  .detail-preview { height: 32dvh; padding: 18px; }
  .detail-content { overflow: visible; padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) { .detail-spinner, .detail-progress span { animation: none; } }

/* Email account screens */
#accountForm { font-size:14px; }
.site-message-dialog { width:min(420px,calc(100vw - 32px)); box-sizing:border-box; }
.site-message-dialog h2 { font-size:18px; }
.site-message-dialog .dialog-copy { font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; }
.auth-modes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; padding:4px; border:1px solid #303138; border-radius:12px; background:#101115; }
.auth-modes button { padding:10px 4px; border-radius:8px; background:transparent; color:#999ba6; font:inherit; cursor:pointer; transition:background .15s,color .15s; }
.auth-modes button:hover { color:#f3f3f5; background:#202127; }
.auth-modes button[aria-pressed="true"] { color:#fff; background:#34363e; box-shadow:0 1px 4px #0003; }
.auth-modes button:focus-visible { outline:2px solid #8bb5ff; outline-offset:1px; }
#accountForm label { display:grid; gap:8px; }
#accountForm input, #accountForm select { width:100%; min-width:0; height:42px; border:1px solid #36373d; border-radius:10px; background:#101115; color:#eee; padding:0 12px; }
#authCodeRow:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:end; }
#authError { color:#f0b580; margin:0; line-height:1.5; }
#accountButton { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media(max-width:560px) { #accountButton { max-width:95px; font-size:11px; } #accountForm { gap:12px!important; } }


.attachment-preview{flex-wrap:wrap}.reference-item{display:flex;align-items:center;gap:8px;max-width:240px;padding:6px 8px;background:#202127;border-radius:9px}.reference-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reference-item img,.reference-item button{flex-shrink:0}
