/* Account popover and modal panels use the existing theme palette. */
.ac-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.ac-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid color-mix(in srgb, var(--violet) 20%, transparent); border-radius: 50%; color: var(--ac-avatar-color, var(--violet)); background: var(--ac-avatar-bg, color-mix(in srgb, var(--violet) 9%, var(--surface))); font-weight: 600; }
.ac-avatar svg { width: 65%; height: 65%; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linejoin: round; stroke-linecap: round; }
.ac-avatar .ac-avatar-image { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ac-avatar[data-avatar="custom"] { background: var(--surface); }
.ac-avatar[data-avatar="orbit"] { --ac-avatar-color: #8b5cf6; --ac-avatar-bg: linear-gradient(140deg, #f1e8ff, #dce7ff); }
.ac-avatar[data-avatar="spark"] { --ac-avatar-color: #bd6c20; --ac-avatar-bg: linear-gradient(140deg, #fff0ce, #ffe4d7); }
.ac-avatar[data-avatar="planet"] { --ac-avatar-color: #14898e; --ac-avatar-bg: linear-gradient(140deg, #dcfff4, #daeffa); }
.ac-avatar[data-avatar="flower"] { --ac-avatar-color: #c55f8d; --ac-avatar-bg: linear-gradient(140deg, #ffe0f2, #f0e1ff); }
.ac-avatar[data-avatar="wave"] { --ac-avatar-color: #4279d3; --ac-avatar-bg: linear-gradient(140deg, #e0efff, #e6e4ff); }
html:not([data-theme="light"]) .ac-avatar[data-avatar="orbit"] { --ac-avatar-color: #d8b4fe; --ac-avatar-bg: linear-gradient(140deg, #45305e, #27324f); }
html:not([data-theme="light"]) .ac-avatar[data-avatar="spark"] { --ac-avatar-color: #f9ce90; --ac-avatar-bg: linear-gradient(140deg, #513a28, #412936); }
html:not([data-theme="light"]) .ac-avatar[data-avatar="planet"] { --ac-avatar-color: #83e5d7; --ac-avatar-bg: linear-gradient(140deg, #19423d, #233c4e); }
html:not([data-theme="light"]) .ac-avatar[data-avatar="flower"] { --ac-avatar-color: #f2a9d0; --ac-avatar-bg: linear-gradient(140deg, #4d2b42, #3b2a52); }
html:not([data-theme="light"]) .ac-avatar[data-avatar="wave"] { --ac-avatar-color: #a6c8ff; --ac-avatar-bg: linear-gradient(140deg, #253d54, #333454); }
html .sidebar .account-card { padding: 10px; border-color: transparent; border-radius: 12px; background: transparent; min-height: 62px; }
html .sidebar .account-card:hover:not(:disabled), html .sidebar .account-card[aria-expanded="true"] { background: color-mix(in srgb, var(--violet) 7%, var(--surface)); border-color: var(--line); }
html .sidebar .account-card .user-avatar { width: 38px; height: 38px; border-radius: 50%; }
html .sidebar .account-card .user-avatar.ac-avatar { color: var(--ac-avatar-color, var(--violet)); background: var(--ac-avatar-bg, color-mix(in srgb, var(--violet) 9%, var(--surface))); }
.account-menu { padding: 7px; border-radius: 15px; box-shadow: 0 15px 50px -15px rgba(0,0,0,.3), 0 3px 14px rgba(0,0,0,.06); }
.account-menu-separator, .account-menu-divider { height: 1px; margin: 6px 8px; border: 0; background: var(--line); }
.account-menu .account-menu-chevron { width: 14px; height: 14px; margin-left: auto; color: var(--muted); }
.account-menu #account-switch-list:not([hidden]) { margin: 4px 0; padding: 5px 0; border-bottom: 1px solid var(--line); }
.account-menu .ac-account-option { gap: 9px; min-height: 48px; padding: 7px 9px; }
.account-menu .ac-account-option-avatar { width: 28px; height: 28px; }
.account-menu .ac-account-option-info strong { font-size: 12px; }
.account-menu .ac-account-option-info small { font-size: 10px; }
.account-menu .ac-account-current { font-size: 9px; }
.account-menu .ac-account-option[aria-current="true"] { opacity: 1; cursor: default; }
.ac-dialog { width: min(760px, calc(100vw - 40px)); max-width: none; max-height: min(690px, calc(100dvh - 56px)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 30px 110px -35px rgba(0,0,0,.5); font-size: 14px; }
.ac-dialog::backdrop { background: rgba(13,17,26,.32); backdrop-filter: blur(5px); }
.ac-dialog[open] { animation: ac-dialog-in .16s ease-out; }
.ac-dialog button, .ac-dialog input { font: inherit; }
.ac-dialog button:disabled { opacity: .45; cursor: not-allowed; }
.ac-dialog button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.ac-dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 23px 26px 20px; border-bottom: 1px solid var(--line); }
.ac-dialog-header h2 { margin: 0; color: var(--text); font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.ac-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.ac-close:hover { color: var(--text); background: var(--surface-raised); }
.ac-settings-layout { display: grid; grid-template-columns: 178px minmax(0, 1fr); min-height: 420px; max-height: calc(100dvh - 140px); }
.ac-settings-nav { display: flex; flex-direction: column; gap: 6px; padding: 22px 14px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface-raised) 45%, var(--surface)); }
.ac-settings-tab { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--soft); text-align: left; white-space: nowrap; }
.ac-settings-tab .ac-icon { width: 18px; height: 18px; }
.ac-settings-tab:hover { background: color-mix(in srgb, var(--violet) 5%, var(--surface)); }
.ac-settings-tab[aria-selected="true"] { background: color-mix(in srgb, var(--violet) 11%, var(--surface)); color: var(--violet); font-weight: 600; }
.ac-settings-content { min-width: 0; overflow: auto; overscroll-behavior: contain; padding: 28px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.ac-settings-panel { outline: none; }
.ac-settings-panel > h3 { margin: 0 0 24px; font-size: 16px; font-weight: 600; }
.ac-profile-heading { display: flex; align-items: center; gap: 16px; margin: 0 0 28px; }
.ac-profile-heading > div { min-width: 0; }
.ac-profile-heading strong { display: block; margin-bottom: 3px; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.ac-profile-heading .ac-muted { display: block; font-size: 12px; }
.ac-profile-avatar { width: 62px; height: 62px; font-size: 22px; }
.ac-avatar-upload { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: 62px; height: 62px; padding: 0; border: 0; border-radius: 50%; color: var(--violet); background: transparent; cursor: pointer; }
.ac-avatar-camera { position: absolute; right: -3px; bottom: -2px; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--surface); border-radius: 50%; background: color-mix(in srgb, var(--violet) 11%, var(--surface)); color: var(--violet); box-shadow: 0 2px 6px rgba(0,0,0,.08); transition: background .15s, color .15s, transform .15s; pointer-events: none; }
.ac-avatar-camera .ac-icon { width: 13px; height: 13px; stroke-width: 1.8; }
.ac-avatar-upload:hover:not(:disabled) .ac-avatar-camera, .ac-avatar-upload:focus-visible .ac-avatar-camera { color: var(--surface); background: var(--violet); transform: scale(1.08); }
.ac-avatar-upload[aria-busy="true"] .ac-profile-avatar { opacity: .65; }
.ac-field-label { display: block; margin: 0 0 10px; color: var(--soft); font-size: 12px; font-weight: 500; }
.ac-input { width: 100%; height: 43px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.ac-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 12%, transparent); }
.ac-input::placeholder { color: var(--muted); }
.ac-avatar-field { min-width: 0; margin: 23px 0 0; padding: 0; border: 0; }
.ac-avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.ac-avatar-choice { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 9px 3px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); background: transparent; }
.ac-avatar-choice > .ac-avatar { width: 39px; height: 39px; }
.ac-avatar-choice > span:last-child { font-size: 10px; }
.ac-avatar-choice:hover { background: var(--surface-raised); }
.ac-avatar-choice[aria-pressed="true"] { border-color: color-mix(in srgb, var(--violet) 40%, transparent); color: var(--violet); background: color-mix(in srgb, var(--violet) 7%, var(--surface)); }
.ac-form-footer { display: flex; justify-content: flex-end; margin-top: 28px; }
.ac-primary, .ac-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 9px 17px; border: 1px solid transparent; border-radius: 10px; font-size: 12px!important; font-weight: 500!important; }
.ac-primary { background: #7950bf; color: #fff; box-shadow: 0 3px 9px rgba(105,66,169,.1); }
.ac-primary:hover:not(:disabled) { background: #6940ad; }
html[data-theme="cyan"] .ac-primary { color: #062c35; background: #44cfdf; }
html[data-theme="cyan"] .ac-primary:hover:not(:disabled) { background: #65deea; }
.ac-secondary { border-color: var(--line); color: var(--soft); background: var(--surface); }
.ac-secondary:hover:not(:disabled) { border-color: var(--violet); color: var(--violet); }
.ac-secondary .ac-icon { width: 15px; height: 15px; }
.ac-error { margin: 14px 0 0; color: var(--danger); font-size: 12px; line-height: 1.65; }
.ac-muted { color: var(--muted); }
.ac-guest { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 22px; min-height: 315px; }
.ac-guest > .ac-icon { width: 42px; height: 42px; color: var(--muted); }
.ac-theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.ac-theme-card { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 13px; color: var(--soft); background: transparent; }
.ac-theme-card:hover { border-color: var(--violet); }
.ac-theme-card[aria-pressed="true"] { color: var(--violet); border-color: var(--violet); box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet) 10%, transparent); }
.ac-theme-preview { position: relative; display: block; height: 86px; border: 1px solid rgba(143,143,165,.14); border-radius: 7px; overflow: hidden; background: #fff; }
.ac-theme-preview-sidebar { position: absolute; top: 0; bottom: 0; left: 0; width: 24%; background: #f4f4f6; border-right: 1px solid #ebebef; }
.ac-theme-preview-sidebar::after { content: ""; position: absolute; width: 62%; left: 18%; top: 15px; height: 4px; border-radius: 5px; background: #c9b8ec; box-shadow: 0 11px 0 #dfe0e5, 0 22px 0 #dfe0e5; }
.ac-theme-preview-message { position: absolute; top: 18px; left: 36%; width: 48%; height: 16px; border-radius: 5px; background: #f0ebf8; }
.ac-theme-preview-composer { position: absolute; bottom: 10px; right: 9%; left: 33%; height: 17px; border: 1px solid #e5e5ed; border-radius: 5px; }
.ac-theme-card[data-theme-preview="dark"] .ac-theme-preview { background: #000000; }
.ac-theme-card[data-theme-preview="dark"] .ac-theme-preview-sidebar { background: #191919; border-color: #373737; }
.ac-theme-card[data-theme-preview="dark"] .ac-theme-preview-message { background: #242424; }
.ac-theme-card[data-theme-preview="dark"] .ac-theme-preview-composer { border-color: #373737; background: #191919; }
.ac-theme-card[data-theme-preview="dark"] .ac-theme-preview-sidebar::after { background: #9a84d4; box-shadow: 0 11px 0 #424242, 0 22px 0 #424242; }
.ac-theme-card[data-theme-preview="cyan"] .ac-theme-preview { background: #101b22; }
.ac-theme-card[data-theme-preview="cyan"] .ac-theme-preview-sidebar { background: #14191d; border-color: #2c363d; }
.ac-theme-card[data-theme-preview="cyan"] .ac-theme-preview-message { background: #153c46; }
.ac-theme-card[data-theme-preview="cyan"] .ac-theme-preview-composer { border-color: #2c4856; background: #122129; }
.ac-theme-card[data-theme-preview="cyan"] .ac-theme-preview-sidebar::after { background: #4bd3e6; box-shadow: 0 11px 0 #3c4c55, 0 22px 0 #3c4c55; }
.ac-theme-card[data-theme-preview="system"] .ac-theme-preview { background: linear-gradient(115deg,#fff 49.5%,#000000 50%); }
.ac-theme-card[data-theme-preview="system"] .ac-theme-preview-message { background: linear-gradient(115deg,#f0ebf8 49.5%,#242424 50%); }
.ac-theme-card[data-theme-preview="system"] .ac-theme-preview-composer { border-color: #8c8c8c; }
.ac-theme-caption { display: flex; align-items: center; justify-content: space-between; margin: 10px 4px 3px; font-size: 12px; }
.ac-theme-caption .ac-icon { width: 16px; height: 16px; opacity: 0; }
.ac-theme-card[aria-pressed="true"] .ac-theme-caption .ac-icon { opacity: 1; }
.ac-accounts-list { display: flex; flex-direction: column; gap: 9px; }
.ac-account-option { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; }
.ac-account-option:hover:not(:disabled) { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 5%, var(--surface)); }
.ac-dialog .ac-account-option[aria-current="true"] { opacity: 1; cursor: default; background: color-mix(in srgb, var(--violet) 5%, var(--surface)); }
.ac-account-option-avatar { width: 38px; height: 38px; }
.ac-account-option-info { flex: 1; min-width: 0; }
.ac-account-option-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.ac-account-option-info small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.ac-account-current { color: var(--violet); font-size: 10px; white-space: nowrap; }
.ac-account-option > .ac-icon { color: var(--muted); width: 15px; height: 15px; }
.ac-add-account { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 43px; margin-top: 16px; border: 1px dashed var(--line); border-radius: 12px; background: transparent; color: var(--soft); }
.ac-add-account:hover { color: var(--violet); border-color: var(--violet); background: color-mix(in srgb, var(--violet) 5%, var(--surface)); }
.ac-add-account .ac-icon { width: 17px; height: 17px; }
.ac-favorites { width: min(620px, calc(100vw - 40px)); }
.ac-favorites-body { padding: 20px 24px 24px; max-height: calc(100dvh - 150px); overflow: auto; overscroll-behavior: contain; }
.ac-favorites-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ac-favorites-toolbar h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.ac-favorite-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ac-favorite-row { display: flex; align-items: center; min-width: 0; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ac-favorite-row:hover { background: color-mix(in srgb, var(--violet) 4%, var(--surface)); border-color: color-mix(in srgb, var(--violet) 30%, var(--line)); }
.ac-favorite-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 60px; padding: 16px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; }
.ac-favorite-open > .ac-icon { color: var(--violet); width: 18px; height: 18px; }
.ac-favorite-open > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ac-favorite-remove { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; margin-right: 12px; padding: 7px; border: 0; border-radius: 8px; color: var(--violet); background: transparent; }
.ac-favorite-remove .ac-icon { width: 17px; height: 17px; fill: color-mix(in srgb, var(--violet) 12%, transparent); }
.ac-favorite-remove:hover { background: color-mix(in srgb, var(--violet) 10%, transparent); }
.ac-empty { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 15px; min-height: 230px; color: var(--muted); font-size: 13px; }
.ac-empty > .ac-icon { width: 32px; height: 32px; opacity: .55; }
.ac-desktop { width: min(460px, calc(100vw - 40px)); }
.ac-desktop-body { padding: 28px 32px 34px; text-align: center; max-height: calc(100dvh - 150px); overflow: auto; }
.ac-desktop-art { display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto 20px; border: 1px solid color-mix(in srgb, var(--violet) 16%, transparent); border-radius: 22px; background: linear-gradient(140deg,color-mix(in srgb,var(--violet) 12%,var(--surface)),var(--surface)); color: var(--violet); }
.ac-desktop-art .ac-icon { width: 38px; height: 38px; stroke-width: 1.3; }
.ac-desktop-body h3 { margin: 0 0 22px; font-size: 18px; font-weight: 600; }
.ac-desktop-body .ac-primary { min-width: 190px; }
.ac-desktop-steps { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 20px 18px 20px 36px; border: 1px solid var(--line); border-radius: 13px; text-align: left; background: color-mix(in srgb,var(--surface-raised) 55%,var(--surface)); color: var(--soft); font-size: 12px; line-height: 1.8; }
.ac-desktop-steps li { padding-left: 3px; }
@keyframes ac-dialog-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .ac-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 28px); border-radius: 18px; }
  .ac-dialog-header { padding: 18px 19px 16px; }
  .ac-dialog-header h2 { font-size: 18px; }
  .ac-settings-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); max-height: calc(100dvh - 99px); min-height: 440px; }
  .ac-settings-nav { flex-direction: row; padding: 11px 12px; gap: 5px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ac-settings-tab { justify-content: center; flex: 1; gap: 6px; padding: 10px 5px; font-size: 12px!important; }
  .ac-settings-tab .ac-icon { width: 16px; height: 16px; }
  .ac-settings-content { padding: 23px 20px; }
  .ac-avatar-grid { gap: 3px; }
  .ac-avatar-choice > .ac-avatar { width: 34px; height: 34px; }
  .ac-avatar-choice { padding: 8px 1px; }
  .ac-theme-grid { gap: 11px; }
  .ac-theme-preview { height: 75px; }
  .ac-favorites-body { padding: 17px; max-height: calc(100dvh - 102px); }
  .ac-favorite-open { padding: 14px 11px; gap: 9px; }
  .ac-favorite-remove { margin-right: 6px; }
  .ac-desktop-body { padding: 25px 21px; max-height: calc(100dvh - 102px); }
}
@media (max-width: 359px) { .ac-settings-content { padding: 20px 14px; } .ac-settings-tab { gap: 4px; font-size: 11px!important; } .ac-avatar-choice > .ac-avatar { width: 30px; height: 30px; } }
@media (prefers-reduced-motion: reduce) { .ac-dialog[open] { animation: none; } }
