/**
 * Fotogenic AI Settings workspace.
 * The WordPress admin is treated as an untrusted host: all resets and tokens are scoped.
 */

body.fotogenic-ai_page_fotogenic-ai #wpcontent {
    background: #eef0f3;
}

@media (max-width: 782px) {
    body.fotogenic-ai_page_fotogenic-ai #wpcontent {
        padding-inline-start: 0;
    }
}

.fotogenic-ai-settings,
.fotogenic-ai-settings *,
.fotogenic-ai-settings *::before,
.fotogenic-ai-settings *::after,
.fotogenic-ai-settings-confirm-layer,
.fotogenic-ai-settings-confirm-layer *,
.fotogenic-ai-settings-confirm-layer *::before,
.fotogenic-ai-settings-confirm-layer *::after {
    box-sizing: border-box;
}

.fotogenic-ai-settings {
    --fa-settings-gutter: 24px;
    max-width: 1200px;
    color: var(--fa-color-text);
    font-family: var(--fa-font-sans);
    font-size: 16px;
    line-height: normal;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

.fotogenic-ai-settings[data-fa-ui-state="pending"] {
    visibility: hidden;
}

.fotogenic-ai-settings button,
.fotogenic-ai-settings input,
.fotogenic-ai-settings select,
.fotogenic-ai-settings textarea,
.fotogenic-ai-settings-confirm-layer button {
    font-family: inherit;
}

.fotogenic-ai-settings :where(
    button:not(:disabled),
    select:not(:disabled),
    input[type="checkbox"]:not(:disabled),
    input[type="radio"]:not(:disabled),
    [role="button"]:not([aria-disabled="true"]),
    [role="option"]:not([aria-disabled="true"])
),
.fotogenic-ai-settings-confirm-layer :where(
    button:not(:disabled),
    [role="button"]:not([aria-disabled="true"])
) {
    cursor: pointer;
}

.fotogenic-ai-settings :where(button, select, input[type="checkbox"], input[type="radio"]):disabled,
.fotogenic-ai-settings-confirm-layer button:disabled {
    cursor: not-allowed;
}

.fotogenic-ai-settings [hidden],
.fotogenic-ai-settings-confirm-layer[hidden] {
    display: none;
}

.fotogenic-ai-settings-shell {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: min(
        clamp(620px, calc(100dvh - 64px), 920px),
        var(--fa-settings-available-height, 100dvh)
    );
    min-height: 0;
    margin: 20px 0 32px;
    overflow: hidden;
    background: var(--fa-color-surface);
    border: 1px solid #ccd2db;
    border-radius: 13px;
    box-shadow: 0 16px 46px rgba(24, 32, 45, 0.09);
}

.fotogenic-ai-settings-page {
    display: grid;
    grid-template-rows: 102px minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.fotogenic-ai-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 27px var(--fa-settings-gutter) 22px;
    border-bottom: 1px solid var(--fa-color-border);
}

.fotogenic-ai-settings-heading h1 {
    margin: 0 0 7px;
    padding: 0;
    color: var(--fa-color-text-strong);
    font-size: 22px;
    font-weight: 700;
    line-height: 28px;
    letter-spacing: -0.025em;
}

.fotogenic-ai-settings-heading p {
    margin: 0;
    color: var(--fa-color-text-muted);
    font-size: 12px;
    line-height: 18px;
}

.fotogenic-ai-settings-return {
    align-self: flex-start;
    min-height: 32px;
    margin-top: 2px;
    padding: 7px 0 3px;
    color: #586375;
    border-bottom: 1px solid #7b8492;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
}

.fotogenic-ai-settings-return:hover,
.fotogenic-ai-settings-return:focus-visible {
    color: var(--fa-color-text-strong);
    border-bottom-color: var(--fa-color-text-strong);
}

#fotogenic-ai-settings-form {
    display: grid;
    grid-template-rows: minmax(0, 1fr) 72px;
    min-height: 0;
    margin: 0;
}

#fotogenic-ai-settings-form > input[type="hidden"] {
    display: none;
}

.fotogenic-ai-settings-groups {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.fotogenic-ai-settings-group {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 0;
    border-bottom: 1px solid var(--fa-color-border);
}

.fotogenic-ai-settings-group--advanced {
    min-height: 220px;
    border-bottom: 0;
}

.fotogenic-ai-settings-group__label {
    padding: 22px var(--fa-settings-gutter);
}

.fotogenic-ai-settings-group__label h2 {
    margin: 0 0 7px;
    padding: 0;
    color: var(--fa-color-text-strong);
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: -0.01em;
}

.fotogenic-ai-settings-group__label p {
    max-width: 190px;
    margin: 0;
    color: var(--fa-color-text-muted);
    font-size: 11px;
    line-height: 18px;
}

.fotogenic-ai-settings-group__content {
    min-width: 0;
    padding: 22px var(--fa-settings-gutter);
    border-left: 1px solid var(--fa-color-border);
}

.fotogenic-ai-settings-auth {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    min-height: 58px;
    padding: 8px 12px 8px 16px;
    background: var(--fa-color-surface);
    border: 1px solid var(--fa-color-border-strong);
    border-radius: 8px;
}

.fotogenic-ai-settings-auth__overview {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
}

.fotogenic-ai-settings-auth__identity {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.fotogenic-ai-settings-auth__email {
    max-width: 36ch;
    color: var(--fa-color-text-muted);
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.fotogenic-ai-settings-auth__status,
.fotogenic-ai-settings-auth__credits,
.fotogenic-ai-settings-auth__actions {
    display: inline-flex;
    align-items: center;
}

.fotogenic-ai-settings-auth__status {
    gap: 7px;
    color: var(--fa-color-status-success);
    font-size: 12px;
    white-space: nowrap;
}

.fotogenic-ai-settings-auth__status-dot {
    width: 7px;
    height: 7px;
    background: var(--fa-color-status-success);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--fa-color-status-success-surface);
}

.fotogenic-ai-settings-auth.is-disconnected .fotogenic-ai-settings-auth__status {
    color: #6d7787;
}

.fotogenic-ai-settings-auth.is-disconnected .fotogenic-ai-settings-auth__status-dot {
    background: #8d96a4;
    box-shadow: 0 0 0 3px #eef0f3;
}

.fotogenic-ai-settings-auth__separator {
    width: 1px;
    height: 26px;
    margin: 0 14px;
    background: var(--fa-color-border);
}

.fotogenic-ai-settings-auth__credits {
    gap: 5px;
    color: var(--fa-color-text-strong);
    font-size: 12px;
    white-space: nowrap;
}

.fotogenic-ai-settings-auth__refresh {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: #667184;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.fotogenic-ai-settings-auth__refresh:hover {
    color: var(--fa-color-text-strong);
    background: var(--fa-color-hover-surface);
}

.fotogenic-ai-settings-auth__refresh .fotogenic-ai-icon {
    width: 17px;
    height: 17px;
    font-size: 17px;
    line-height: 17px;
}

.fotogenic-ai-settings-auth__actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.fotogenic-ai-settings-auth__primary,
.fotogenic-ai-settings-auth__secondary,
.fotogenic-ai-settings-save,
.fotogenic-ai-settings-row-button,
.fotogenic-ai-settings-resource-links a,
.fotogenic-ai-debug-btn,
.fotogenic-ai-settings-confirm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 7px;
    box-shadow: none;
    font-size: 11px;
    font-weight: 700;
    line-height: normal;
    text-decoration: none;
    white-space: nowrap;
}

.fotogenic-ai-settings .fotogenic-ai-settings-auth__primary,
.fotogenic-ai-settings .fotogenic-ai-settings-auth__secondary {
    gap: 7px;
    min-height: 40px;
    margin: 0;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 750;
}

.fotogenic-ai-settings .fotogenic-ai-settings-auth__primary,
.fotogenic-ai-settings .fotogenic-ai-settings-save {
    color: var(--fa-color-inverse);
    background: #171c25;
    border: 1px solid #171c25;
}

.fotogenic-ai-settings .fotogenic-ai-settings-auth__primary:hover,
.fotogenic-ai-settings .fotogenic-ai-settings-auth__primary:focus,
.fotogenic-ai-settings .fotogenic-ai-settings-save:hover,
.fotogenic-ai-settings .fotogenic-ai-settings-save:focus {
    color: var(--fa-color-inverse);
    background: #303642;
    border-color: #303642;
}

.fotogenic-ai-settings .fotogenic-ai-settings-auth__secondary,
.fotogenic-ai-settings .fotogenic-ai-settings-row-button,
.fotogenic-ai-settings .fotogenic-ai-settings-resource-links a,
.fotogenic-ai-settings .fotogenic-ai-debug-btn,
.fotogenic-ai-settings-confirm-button {
    color: #4b5668;
    background: var(--fa-color-surface);
    border: 1px solid var(--fa-color-border-strong);
}

.fotogenic-ai-settings .fotogenic-ai-settings-auth__secondary {
    color: #455062;
}

.fotogenic-ai-settings .fotogenic-ai-settings-row-button {
    gap: 5px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.fotogenic-ai-settings .fotogenic-ai-settings-auth__secondary:hover,
.fotogenic-ai-settings .fotogenic-ai-settings-row-button:hover,
.fotogenic-ai-settings .fotogenic-ai-settings-resource-links a:hover,
.fotogenic-ai-settings .fotogenic-ai-debug-btn:hover,
.fotogenic-ai-settings-confirm-button:hover {
    color: var(--fa-color-text-strong);
    background: var(--fa-color-surface);
    border-color: #7d8795;
}

.fotogenic-ai-settings-guidance {
    position: relative;
    display: grid;
    gap: 6px;
}

.fotogenic-ai-settings-guidance > span {
    color: #465163;
    font-size: 11px;
    font-weight: 700;
}

.fotogenic-ai-settings .fotogenic-ai-field {
    width: 100%;
    min-width: 0;
    max-width: none;
    color: var(--fa-color-text-strong);
    background: var(--fa-color-surface);
    border: 1px solid var(--fa-color-border-strong);
    border-radius: 7px;
    box-shadow: none;
    font-size: 12px;
}

.fotogenic-ai-settings .fotogenic-ai-field:hover {
    border-color: var(--fa-color-border-strong);
}

.fotogenic-ai-settings .fotogenic-ai-field:focus {
    border-color: var(--fa-color-border-strong);
    box-shadow: none;
}

.fotogenic-ai-settings-guidance textarea {
    min-height: 102px;
    padding: 12px 14px 27px;
    resize: vertical;
    line-height: 18px;
}

.fotogenic-ai-settings-guidance textarea::placeholder {
    color: #7b8594;
    opacity: 1;
}

.fotogenic-ai-settings-guidance small {
    position: absolute;
    right: 13px;
    bottom: 10px;
    color: #8a93a2;
    font-size: 9px;
}

.fotogenic-ai-settings-advanced {
    display: grid;
}

.fotogenic-ai-settings-advanced__row,
.fotogenic-ai-settings-debug-trigger {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border: 0;
    border-bottom: 1px solid var(--fa-color-border);
}

.fotogenic-ai-settings-advanced__row {
    min-height: 58px;
}

.fotogenic-ai-settings-advanced__row > .fotogenic-ai-icon,
.fotogenic-ai-settings-debug-trigger > .fotogenic-ai-icon {
    width: 18px;
    height: 18px;
    color: #536071;
    font-size: 18px;
    line-height: 18px;
}

.fotogenic-ai-settings-advanced__copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.fotogenic-ai-settings-advanced__copy strong {
    color: var(--fa-color-text-strong);
    font-size: 11px;
    line-height: 16px;
}

.fotogenic-ai-settings-advanced__copy small {
    color: var(--fa-color-text-muted);
    font-size: 9px;
    line-height: 14px;
}

.fotogenic-ai-settings-advanced__row--toggle {
    cursor: pointer;
}

.fotogenic-ai-settings .fotogenic-ai-settings-advanced__row--toggle > input[type="checkbox"] {
    align-self: center;
    width: 34px;
    min-width: 34px;
    height: 18px;
    margin: 0 7px 0 0;
    background: initial;
    border: initial;
    border-radius: initial;
    box-shadow: none;
    -webkit-appearance: checkbox;
    appearance: auto;
    accent-color: #171c25;
}

.fotogenic-ai-settings .fotogenic-ai-settings-advanced__row--toggle > input[type="checkbox"]:checked::before {
    display: none;
    content: none;
}

.fotogenic-ai-settings .fotogenic-ai-settings-advanced__row--toggle > input[type="checkbox"]:focus {
    box-shadow: none;
}

.fotogenic-ai-settings-debug-trigger {
    width: 100%;
    min-height: 54px;
    color: #536071;
    text-align: left;
    background: transparent;
    cursor: pointer;
}

.fotogenic-ai-settings-debug-trigger:hover {
    background: #fafbfc;
}

.fotogenic-ai-settings-debug-trigger__action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #4b5668;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.fotogenic-ai-settings-debug-trigger__action .fotogenic-ai-icon {
    width: 15px;
    height: 15px;
    font-size: 15px;
    line-height: 15px;
    transition: transform 160ms ease;
}

.fotogenic-ai-settings-debug-trigger.is-open .fotogenic-ai-settings-debug-trigger__action .fotogenic-ai-icon {
    transform: rotate(180deg);
}

.fotogenic-ai-settings-debug-workspace {
    --fa-debug-line: #d9dde4;
    --fa-debug-line-strong: #b9c0cb;
    position: relative;
    display: grid;
    margin: 10px 0 2px;
    overflow: hidden;
    background: var(--fa-color-surface);
    border: 1px solid var(--fa-debug-line-strong);
    border-radius: 8px;
}

.fotogenic-ai-settings-debug-workspace__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border-bottom: 1px solid var(--fa-debug-line);
}

.fotogenic-ai-settings-debug-workspace__header > div:first-child {
    display: grid;
    gap: 2px;
}

.fotogenic-ai-settings-debug-workspace__header strong {
    color: var(--fa-color-text-strong);
    font-size: 11px;
}

.fotogenic-ai-settings-debug-workspace__header small {
    color: var(--fa-color-text-muted);
    font-size: 9px;
    line-height: 14px;
}

.fotogenic-ai-settings-debug-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.fotogenic-ai-settings .fotogenic-ai-debug-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 30px;
    padding: 0 9px;
    color: #4b5668;
    background: var(--fa-color-surface);
    border: 1px solid var(--fa-debug-line-strong);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 750;
}

.fotogenic-ai-debug-btn--danger,
.fotogenic-ai-settings-row-button--danger {
    color: #943832;
    background: var(--fa-color-surface);
    border-color: #d9aaa6;
}

.fotogenic-ai-debug-btn--danger:hover,
.fotogenic-ai-settings-row-button--danger:hover {
    color: #7e2929;
    background: #fff6f6;
    border-color: #bd7777;
}

.fotogenic-ai-settings-debug-filters {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    color: var(--fa-color-text-muted);
    background: #fafbfc;
    border-bottom: 1px solid var(--fa-debug-line);
    font-size: 9px;
}

.fotogenic-ai-settings-debug-filters label {
    display: grid;
    gap: 3px;
    color: #596476;
    font-weight: 700;
}

.fotogenic-ai-settings-debug-select-shell {
    position: relative;
    display: inline-flex;
}

.fotogenic-ai-settings-debug-select-shell > .fotogenic-ai-icon {
    position: absolute;
    top: 50%;
    right: 9px;
    width: 13px;
    height: 13px;
    color: #596476;
    font-size: 13px;
    line-height: 13px;
    pointer-events: none;
    transform: translateY(-50%);
}

.fotogenic-ai-settings-debug-filters .fotogenic-ai-field,
.fotogenic-ai-settings-debug-pagination .fotogenic-ai-field {
    width: auto;
    height: 32px;
    padding: 0 30px 0 9px;
    appearance: none;
    color: #465163;
    background: var(--fa-color-surface);
    border: 1px solid var(--fa-debug-line-strong);
    border-radius: 6px;
    font-size: 9px;
}

#fotogenic-ai-log-count {
    margin-left: auto;
    padding-bottom: 8px;
}

.fotogenic-ai-settings-debug-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 116px;
    padding: 18px;
    color: #637083;
    text-align: center;
    font-size: 10px;
}

.fotogenic-ai-settings-debug-state.is-error {
    color: #963b33;
    background: #fffafa;
}

.fotogenic-ai-settings-debug-state > .fotogenic-ai-icon {
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 20px;
}

.fotogenic-ai-settings-debug-state button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 9px;
    color: #4b5668;
    background: var(--fa-color-surface);
    border: 1px solid var(--fa-debug-line-strong);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 750;
}

.fotogenic-ai-settings-debug-table-wrap {
    max-height: 240px;
    overflow: auto;
    overscroll-behavior: contain;
}

#fotogenic-ai-log-table {
    width: 100%;
    border: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

#fotogenic-ai-log-table th,
#fotogenic-ai-log-table td {
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--fa-debug-line);
    text-align: left;
    vertical-align: top;
    font-size: 10.5px;
    line-height: 15px;
    overflow-wrap: anywhere;
}

#fotogenic-ai-log-table th {
    position: sticky;
    z-index: 1;
    top: 0;
    color: #657083;
    background: #f6f7f9;
    font-weight: 800;
}

#fotogenic-ai-log-table th:first-child {
    width: 142px;
}

#fotogenic-ai-log-table th:nth-child(2) {
    width: 72px;
}

#fotogenic-ai-log-table th:nth-child(3) {
    width: 92px;
}

.fotogenic-ai-debug-level {
    display: inline-flex;
    padding: 2px 5px;
    color: #375b8d;
    background: #edf4fd;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
}

.fotogenic-ai-debug-level.is-warning {
    color: #825d0e;
    background: #fff5d9;
}

.fotogenic-ai-debug-level.is-error {
    color: #913a33;
    background: #fff0ef;
}

.fotogenic-ai-settings-debug-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 7px 10px;
    background: #fafbfc;
    border-top: 1px solid var(--fa-debug-line);
}

.fotogenic-ai-settings-debug-pagination label,
.fotogenic-ai-settings-debug-pagination > div {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #657083;
    font-size: 9px;
}

.fotogenic-ai-settings-debug-pagination button {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    padding: 0;
    color: #536071;
    background: var(--fa-color-surface);
    border: 1px solid var(--fa-debug-line-strong);
    border-radius: 6px;
}

.fotogenic-ai-settings-debug-pagination button:disabled {
    color: #b5bbc4;
    background: #f6f7f8;
}

.fotogenic-ai-settings-advanced__row--resources {
    grid-template-columns: 24px minmax(0, 1fr) minmax(0, auto);
}

.fotogenic-ai-settings-resource-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.fotogenic-ai-settings-resource-links a {
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
}

.fotogenic-ai-settings-advanced__row--danger > .fotogenic-ai-icon,
.fotogenic-ai-settings-advanced__row--danger .fotogenic-ai-settings-advanced__copy strong {
    color: #963636;
}

.fotogenic-ai-settings-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 72px;
    padding: 10px var(--fa-settings-gutter);
    background: var(--fa-color-surface);
    border-top: 1px solid var(--fa-color-border);
}

.fotogenic-ai-settings .fotogenic-ai-settings-save {
    gap: 8px;
    min-width: 158px;
    min-height: 44px;
    margin: 0;
    padding: 0 18px;
    font-size: 12px;
    font-weight: 750;
    line-height: normal;
}

.fotogenic-ai-settings .fotogenic-ai-settings-save:disabled,
.fotogenic-ai-settings button:disabled {
    color: #9098a4;
    background: #f1f3f5;
    border-color: var(--fa-color-border);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

.fotogenic-ai-settings .fotogenic-ai-settings-auth__secondary:disabled {
    color: #455062;
    background: var(--fa-color-surface);
    border-color: var(--fa-color-border-strong);
    opacity: 0.45;
}

.fotogenic-ai-settings button:focus-visible,
.fotogenic-ai-settings a:focus-visible,
.fotogenic-ai-settings input:focus-visible,
.fotogenic-ai-settings select:focus-visible,
.fotogenic-ai-settings textarea:focus-visible,
.fotogenic-ai-settings-confirm-layer button:focus-visible,
.fotogenic-ai-settings-confirm:focus-visible {
    outline: 2px solid #3458f5;
    outline-offset: 2px;
    box-shadow: none;
}

.fotogenic-ai-settings-confirm-layer {
    position: fixed;
    z-index: 100100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 14px;
    background: rgba(20, 27, 38, 0);
    font-family: var(--fa-font-sans);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: background-color 0.18s ease, opacity 0.18s ease;
}

.fotogenic-ai-settings-confirm-layer.is-open {
    background: rgba(20, 27, 38, 0.43);
    opacity: 1;
    pointer-events: auto;
    animation: fotogenic-ai-settings-confirm-backdrop-enter 0.18s ease both;
}

.fotogenic-ai-settings-confirm-layer.is-closing {
    pointer-events: none;
    animation: fotogenic-ai-settings-confirm-backdrop-exit 0.18s ease both;
}

.fotogenic-ai-settings-confirm {
    display: grid;
    justify-items: center;
    gap: 9px;
    width: min(360px, 100%);
    padding: 20px;
    color: #783833;
    background: var(--fa-color-surface);
    border: 1px solid #d4c1bf;
    border-radius: 9px;
    box-shadow: 0 22px 58px rgba(18, 25, 36, 0.24);
    text-align: center;
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.985);
    transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.fotogenic-ai-settings-confirm-layer.is-open .fotogenic-ai-settings-confirm {
    animation: fotogenic-ai-settings-confirm-panel-enter 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fotogenic-ai-settings-confirm-layer.is-closing .fotogenic-ai-settings-confirm {
    animation: fotogenic-ai-settings-confirm-panel-exit 0.22s cubic-bezier(0.4, 0, 1, 1) both;
}

.fotogenic-ai-settings-confirm > .fotogenic-ai-icon {
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 20px;
}

.fotogenic-ai-settings-confirm h2 {
    margin: 0;
    color: #783833;
    font-size: 14px;
    line-height: 20px;
}

.fotogenic-ai-settings-confirm p {
    max-width: 290px;
    margin: 0;
    color: var(--fa-color-text-muted);
    font-size: 10px;
    line-height: 16px;
}

.fotogenic-ai-settings-confirm > div {
    display: flex;
    gap: 7px;
}

@keyframes fotogenic-ai-settings-confirm-backdrop-enter {
    from { background: rgba(20, 27, 38, 0); opacity: 0; }
    to { background: rgba(20, 27, 38, 0.43); opacity: 1; }
}

@keyframes fotogenic-ai-settings-confirm-backdrop-exit {
    from { background: rgba(20, 27, 38, 0.43); opacity: 1; }
    to { background: rgba(20, 27, 38, 0); opacity: 0; }
}

@keyframes fotogenic-ai-settings-confirm-panel-enter {
    from { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.985); }
    to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes fotogenic-ai-settings-confirm-panel-exit {
    from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    to { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.985); }
}

@media (max-width: 1199px) {
    .fotogenic-ai-settings {
        --fa-settings-gutter: 20px;
    }

    .fotogenic-ai-settings-shell {
        height: min(
            clamp(620px, calc(100dvh - 104px), 920px),
            var(--fa-settings-available-height, 100dvh)
        );
    }
}

@media (max-width: 820px) {
    .fotogenic-ai-settings {
        --fa-settings-gutter: 16px;
        margin-right: 10px;
    }

    .fotogenic-ai-settings-shell {
        display: block;
        height: auto;
        min-height: calc(100dvh - 112px);
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .fotogenic-ai-settings-page,
    #fotogenic-ai-settings-form {
        display: block;
        min-height: 0;
        overflow: visible;
    }

    .fotogenic-ai-settings-groups {
        overflow: visible;
    }

    .fotogenic-ai-settings-group {
        grid-template-columns: minmax(0, 1fr);
    }

    .fotogenic-ai-settings-group__label {
        padding: 20px var(--fa-settings-gutter) 11px;
    }

    .fotogenic-ai-settings-group__label p {
        max-width: none;
    }

    .fotogenic-ai-settings-group__content {
        padding: 12px var(--fa-settings-gutter) 22px;
        border-left: 0;
    }

    .fotogenic-ai-settings-footer {
        position: sticky;
        z-index: 15;
        bottom: 0;
        min-height: 66px;
        background: rgba(255, 255, 255, 0.97);
    }

    .fotogenic-ai-settings-debug-workspace__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .fotogenic-ai-settings-debug-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 540px) {
    .fotogenic-ai-settings {
        --fa-settings-gutter: 12px;
        margin-right: 0;
    }

    .fotogenic-ai-settings-shell {
        min-height: calc(100dvh - 110px);
        margin-top: 10px;
    }

    .fotogenic-ai-settings-heading {
        padding-block: 14px;
    }

    .fotogenic-ai-settings-heading h1 {
        font-size: 18px;
        line-height: 23px;
    }

    .fotogenic-ai-settings-heading p {
        max-width: 250px;
        font-size: 11px;
        line-height: 16px;
    }

    .fotogenic-ai-settings-return {
        min-height: 44px;
        padding-top: 12px;
        font-size: 10px;
    }

    .fotogenic-ai-settings-group__label {
        padding: 13px var(--fa-settings-gutter) 7px;
    }

    .fotogenic-ai-settings-group__label h2 {
        margin-bottom: 3px;
        font-size: 13px;
        line-height: 18px;
    }

    .fotogenic-ai-settings-group__label p {
        font-size: 9.5px;
        line-height: 14px;
    }

    .fotogenic-ai-settings-group__content {
        padding: 8px var(--fa-settings-gutter) 14px;
    }

    .fotogenic-ai-settings-auth {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        padding: 9px;
    }

    .fotogenic-ai-settings-auth__overview {
        justify-content: space-between;
        width: 100%;
    }

    .fotogenic-ai-settings-auth__status,
    .fotogenic-ai-settings-auth__credits {
        font-size: 11px;
    }

    .fotogenic-ai-settings-auth__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        margin-left: 0;
    }

    .fotogenic-ai-settings .fotogenic-ai-settings-auth__primary,
    .fotogenic-ai-settings .fotogenic-ai-settings-auth__secondary {
        min-height: 40px;
        font-size: 10.5px;
    }

    .fotogenic-ai-settings .fotogenic-ai-settings-guidance textarea {
        min-height: 86px;
        font-size: 11px;
        line-height: 16px;
    }

    .fotogenic-ai-settings-advanced__row {
        gap: 7px;
        grid-template-columns: 24px minmax(0, 1fr);
        min-height: 50px;
        padding-block: 8px;
    }

    .fotogenic-ai-settings-debug-trigger {
        gap: 7px;
        grid-template-columns: 24px minmax(0, 1fr) auto;
        min-height: 50px;
        padding-block: 8px;
    }

    .fotogenic-ai-settings-advanced__copy strong {
        font-size: 10.5px;
        line-height: 15px;
    }

    .fotogenic-ai-settings-advanced__copy small {
        font-size: 9px;
        line-height: 13px;
    }

    .fotogenic-ai-settings-advanced__row > :last-child {
        grid-column: 2;
        justify-self: end;
    }

    .fotogenic-ai-settings-resource-links {
        justify-content: flex-end;
    }

    .fotogenic-ai-settings-debug-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .fotogenic-ai-settings .fotogenic-ai-debug-btn,
    .fotogenic-ai-settings-debug-state button {
        min-height: 44px;
        padding-inline: 10px;
        font-size: 11px;
    }

    .fotogenic-ai-settings-debug-filters {
        align-items: stretch;
        flex-direction: column;
        font-size: 11px;
    }

    .fotogenic-ai-settings-debug-filters .fotogenic-ai-settings-debug-select-shell,
    .fotogenic-ai-settings-debug-filters .fotogenic-ai-field {
        width: 100%;
        height: 44px;
        font-size: 11px;
    }

    #fotogenic-ai-log-count {
        margin-left: 0;
        padding-bottom: 0;
    }

    .fotogenic-ai-settings-debug-table-wrap {
        max-height: none;
        overflow: visible;
    }

    #fotogenic-ai-log-table,
    #fotogenic-ai-log-table tbody,
    #fotogenic-ai-log-table tr {
        display: block;
        width: 100%;
    }

    #fotogenic-ai-log-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    #fotogenic-ai-log-table tr {
        padding: 8px 10px;
        border-bottom: 1px solid var(--fa-debug-line);
    }

    #fotogenic-ai-log-table td {
        display: grid;
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 8px;
        width: auto;
        height: auto;
        padding: 4px 0;
        border: 0;
        font-size: 11px;
        line-height: 16px;
    }

    #fotogenic-ai-log-table td::before {
        color: #657083;
        font-weight: 800;
        content: attr(data-label);
    }

    .fotogenic-ai-settings-debug-pagination .fotogenic-ai-field {
        height: 44px;
        font-size: 11px;
    }

    .fotogenic-ai-settings-debug-pagination button {
        width: 44px;
        height: 44px;
    }

    .fotogenic-ai-settings-footer {
        align-items: center;
        min-height: 56px;
        padding-block: 8px;
    }

    .fotogenic-ai-settings-save {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 360px) {
    .fotogenic-ai-settings-heading {
        gap: 10px;
    }

    .fotogenic-ai-settings-heading p {
        max-width: 180px;
    }

    .fotogenic-ai-settings-resource-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fotogenic-ai-settings *,
    .fotogenic-ai-settings *::before,
    .fotogenic-ai-settings *::after,
    .fotogenic-ai-settings-confirm-layer,
    .fotogenic-ai-settings-confirm-layer * {
        scroll-behavior: auto;
        transition-duration: 0.01ms;
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
    }

    .fotogenic-ai-settings-confirm-layer.is-open,
    .fotogenic-ai-settings-confirm-layer.is-closing,
    .fotogenic-ai-settings-confirm-layer.is-open .fotogenic-ai-settings-confirm,
    .fotogenic-ai-settings-confirm-layer.is-closing .fotogenic-ai-settings-confirm {
        transition: none;
        animation: none;
    }
}

@media (forced-colors: active) {
    .fotogenic-ai-settings-auth__status-dot,
    .fotogenic-ai-settings .fotogenic-ai-settings-advanced__row--toggle > input[type="checkbox"] {
        border: 1px solid CanvasText;
    }

    .fotogenic-ai-settings-confirm-layer {
        background: Canvas;
    }
}
