/* /new presentation tokens. Existing controls, owners and state remain canonical. */
.dashboard-body.fotogenic-new-app :is(#app, #productFeedback, #videoScenarioIdeaPicker, .new-auth-gate, .new-error-fallback, .modern-select-dropdown--portal, [data-dashboard-modal-root]:not(:where(.lightbox, .result-reveal, .lightbox *, .result-reveal *))) {
    --bg-color: #f9f9f9;
    --text-primary: #121212;
    --text-secondary: #626262;
    --text-tertiary: #737373;
    --accent-color: #121212;
    --accent-rgb: 18, 18, 18;
    --accent-foreground: #f9f9f9;
    --accent-hover: #303030;
    --accent-dim: rgba(18, 18, 18, .055);
    --panel-bg: rgba(249, 249, 249, .9);
    --card-bg: #f9f9f9;
    --sidebar-bg: rgba(249, 249, 249, .94);
    --input-bg: rgba(18, 18, 18, .035);
    --border-color: rgba(18, 18, 18, .1);
    --border-strong: rgba(18, 18, 18, .22);
    --history-config-bar-bg: #f9f9f9;
    --history-fade-solid: #f9f9f9;
    --new-surface: rgba(249, 249, 249, .86);
    --new-shadow: 0 12px 36px rgba(18, 18, 18, .055), 0 2px 6px rgba(18, 18, 18, .02);
    --new-radius: 24px;
    --new-control-radius: 12px;
    --new-blur: 14px;
    --new-duration: 180ms;
    color: var(--text-primary);
    letter-spacing: -.01em;
}
[data-theme="dark"] .dashboard-body.fotogenic-new-app :is(#app, #productFeedback, #videoScenarioIdeaPicker, .new-auth-gate, .new-error-fallback, .modern-select-dropdown--portal, [data-dashboard-modal-root]:not(:where(.lightbox, .result-reveal, .lightbox *, .result-reveal *))) {
    --bg-color: #121212;
    --text-primary: #f9f9f9;
    --text-secondary: #b8b8b8;
    --text-tertiary: #a0a0a0;
    --accent-color: #f9f9f9;
    --accent-rgb: 249, 249, 249;
    --accent-foreground: #121212;
    --accent-hover: #ddd;
    --accent-dim: rgba(249, 249, 249, .08);
    --panel-bg: rgba(24, 24, 24, .94);
    --card-bg: #1b1b1b;
    --sidebar-bg: rgba(24, 24, 24, .96);
    --input-bg: rgba(249, 249, 249, .05);
    --border-color: rgba(249, 249, 249, .13);
    --border-strong: rgba(249, 249, 249, .26);
    --history-config-bar-bg: #121212;
    --history-fade-solid: #121212;
    --new-surface: rgba(24, 24, 24, .9);
    --new-shadow: 0 12px 36px rgba(0, 0, 0, .18);
}
.dashboard-body.fotogenic-new-app :is(#app, .new-auth-gate) { background: var(--bg-color) !important; }
.dashboard-body.fotogenic-new-app { background: #f9f9f9 !important; }
[data-theme="dark"] .dashboard-body.fotogenic-new-app { background: #121212 !important; }
.dashboard-body.fotogenic-new-app::before, .dashboard-body.fotogenic-new-app::after { display: none; }
.dashboard-body.fotogenic-new-app .app-container { padding: 0; gap: 0; background: none; flex-direction: column; }
.dashboard-body.fotogenic-new-app .main-content {
    margin: 0 !important;
    padding: 0 32px;
    width: 100%; max-width: none;
    height: calc(100dvh - 76px);
    border: 0; border-radius: 0; box-shadow: none; background: transparent;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.dashboard-body.fotogenic-new-app :is(button, input, textarea, select):not(:where(.lightbox *, .result-reveal *)) { font-family: inherit; }
.dashboard-body.fotogenic-new-app :is(button, a, input, textarea, select, summary):not(:where(.lightbox *, .result-reveal *)):focus-visible {
    outline: 2px solid var(--text-primary); outline-offset: 4px;
}
.dashboard-body.fotogenic-new-app :is(.action-btn, .icon-btn, .modern-select-trigger):not(:where(.lightbox *, .result-reveal *)) {
    border-radius: var(--new-control-radius); box-shadow: none;
}
.dashboard-body.fotogenic-new-app .action-btn--accent:not(:where(.lightbox *, .result-reveal *)) {
    background: var(--accent-color); color: var(--accent-foreground);
    border-color: transparent; font-weight: 600; box-shadow: none;
}
.dashboard-body.fotogenic-new-app .action-btn--accent:not(:where(.lightbox *, .result-reveal *)):not(:disabled, [aria-disabled="true"]):hover { background: var(--accent-hover); }
.dashboard-body.fotogenic-new-app .action-btn--accent:is(:disabled, [aria-disabled="true"]):not(:where(.lightbox *, .result-reveal *)) { background: var(--input-bg); color: var(--text-secondary) !important; border-color: var(--border-color); }
.dashboard-body.fotogenic-new-app :is(button:disabled, [aria-disabled="true"]):not(:where(.lightbox *, .result-reveal *)) { cursor: not-allowed; }
.dashboard-body.fotogenic-new-app :is(button, a[href], summary, [role="button"], [role="tab"], [role="menuitem"]):not(:disabled, [aria-disabled="true"]) { cursor: pointer; }
/* Pointer-restored focus is not a selected action. Keyboard focus stays visible. */
html[data-new-input-modality="pointer"] body.fotogenic-new-app :is(button, a[href], summary, [role="button"], [role="tab"], [role="menuitem"]):focus {
    outline: none !important;
}
.dashboard-body.fotogenic-new-app :is(.modern-input, .modern-textarea, .modern-select-trigger):not(:where(.lightbox *, .result-reveal *)) {
    background: var(--input-bg); border-color: var(--border-color); color: var(--text-primary);
}
.dashboard-body.fotogenic-new-app :is(.modal-content, .app-modal-content, .app-modal-card, .settings-modal-content):not(:where(.lightbox *, .result-reveal *)) {
    border-radius: var(--new-radius); background: var(--new-surface); box-shadow: var(--new-shadow);
}
.dashboard-body.fotogenic-new-app .history-config-bar :is(button, .history-working-directory) { border-radius: 10px; box-shadow: none; }
.dashboard-body.fotogenic-new-app :is(.job-card, .history-card):not(:where(.lightbox *, .result-reveal *)) { border-radius: 16px; box-shadow: none; }

@media (max-width: 764px) {
    .dashboard-body.fotogenic-new-app .main-content { margin-top: 0 !important; padding: 0 14px 20px; height: calc(100dvh - 66px); }
    .dashboard-body.fotogenic-new-app .modern-textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .dashboard-body.fotogenic-new-app :not(:where(.lightbox, .lightbox *, .result-reveal, .result-reveal *)),
    .dashboard-body.fotogenic-new-app :not(:where(.lightbox, .lightbox *, .result-reveal, .result-reveal *))::before,
    .dashboard-body.fotogenic-new-app :not(:where(.lightbox, .lightbox *, .result-reveal, .result-reveal *))::after {
        animation-duration: 0s !important; animation-iteration-count: 1 !important;
        transition-duration: 0s !important; scroll-behavior: auto !important;
    }
}
@media (prefers-reduced-transparency: reduce) {
    .dashboard-body.fotogenic-new-app :is(#app, #productFeedback, #videoScenarioIdeaPicker, .new-auth-gate, .new-error-fallback, .modern-select-dropdown--portal, [data-dashboard-modal-root]:not(:where(.lightbox, .result-reveal, .lightbox *, .result-reveal *))) { --new-surface: var(--card-bg) !important; --new-blur: 0px !important; }
}

.new-auth-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg-color); }
.new-auth-card { width: min(420px, 100%); text-align: center; }
.new-auth-brand { margin-bottom: 48px; font-size: 22px; font-weight: 600; }
.new-auth-title { font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.new-auth-description, .new-auth-status { color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
.new-auth-actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.new-auth-signin, .new-auth-continue { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 20px; font: inherit; text-decoration: none; cursor: pointer; background: var(--input-bg); color: var(--text-primary); }
.new-auth-signin { background: var(--accent-color); color: var(--accent-foreground); }

/* Auth remains fail-closed even if an already pending canonical overlay mounts late. */
.dashboard-body.fotogenic-new-app.new-auth-required > :not(.new-auth-gate):not(script):not(style):not(link):not(template) {
    display: none !important;
}

/* Shared alerts must be styled even before any workflow stylesheet is loaded. */
body.fotogenic-new-app #inAppAlertModal { z-index: 2501; }
body.fotogenic-new-app #inAppAlertModal .in-app-alert-card {
    max-height: calc(100dvh - 40px);
}
body.fotogenic-new-app #inAppAlertModal .in-app-alert-body {
    min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
body.fotogenic-new-app #inAppAlertModal .in-app-alert-footer { flex-shrink: 0; }
body.fotogenic-new-app #inAppAlertModal .in-app-alert-message { overflow-wrap: anywhere; }
body.fotogenic-new-app #inAppAlertModal .in-app-alert-actions {
    flex-direction: row; flex-wrap: wrap; justify-content: flex-end;
}
body.fotogenic-new-app :is(#inAppAlertModal, .new-error-fallback) button {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; min-width: 44px; min-height: 44px; height: auto; flex: 0 1 auto;
    padding: 10px; border: 0; border-radius: var(--new-control-radius, 12px);
    font-size: 14px; font-weight: 500; line-height: 1.4; box-shadow: none;
}
body.fotogenic-new-app #inAppAlertModal .action-btn--neutral {
    background: var(--input-bg); color: var(--text-primary);
}
body.fotogenic-new-app #inAppAlertModal .action-btn--neutral:hover { background: var(--accent-dim); }
body.fotogenic-new-app :is(#inAppAlertModal, .new-error-fallback) button:focus-visible { outline-offset: -2px; }

/* Early native tooltip layout: /new replaces sidebar.css, but keeps its tooltip owner. */
body.fotogenic-new-app .hover-popover,
body.fotogenic-new-app .sidebar-nav-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 260;
    max-width: 220px;
    width: max-content;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(9, 13, 20, 0.98);
    color: rgba(255, 255, 255, 0.99);
    font-size: 0.67rem;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: normal;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 0, 0) scale(0.98);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

body.fotogenic-new-app .hover-popover {
    z-index: 6000;
}

body.fotogenic-new-app .hover-popover--right {
    transform: translateX(6px);
}

body.fotogenic-new-app .hover-popover--left {
    transform: translateX(-6px);
}

body.fotogenic-new-app .hover-popover--above {
    transform: translateY(6px);
}

body.fotogenic-new-app .hover-popover--below {
    transform: translateY(-6px);
}

body.fotogenic-new-app .hover-popover.is-visible,
body.fotogenic-new-app .sidebar-nav-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0) scale(1);
    transition-delay: 0s;
}

[data-theme="light"] body.fotogenic-new-app .hover-popover,
[data-theme="light"] body.fotogenic-new-app .sidebar-nav-tooltip {
    border-color: rgba(16, 24, 40, 0.24);
    background: rgba(255, 255, 255, 0.99);
    color: rgba(16, 24, 40, 0.98);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.14);
}

/* Field examples share the compact composer's readable hint color. */
.dashboard-body.fotogenic-new-app :is(.modern-input, .modern-textarea):not(:where(.lightbox *, .result-reveal *))::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

/* Drive connection actions retain shared geometry in idle and loading states. */
body.fotogenic-new-app :is(#settingsGoogleDriveActionBtn, #settingsGoogleDrivePickFolderBtn, #settingsGoogleDriveRefreshUploadsBtn) {
    min-height: 44px; border-radius: var(--new-control-radius, 14px); font-size: 14px; font-weight: 500;
}
body.fotogenic-new-app #settingsGoogleDrivePickFolderBtn .spinner { width: 16px; height: 16px; }

body.fotogenic-new-app :is(#settingsGoogleDriveActionBtn, #settingsGoogleDrivePickFolderBtn, #settingsGoogleDriveRefreshUploadsBtn) svg { width: 18px; height: 18px; }

/* Text-only notices never intercept interaction with the underlying controls. */
body.fotogenic-new-app #toastContainer { pointer-events: none; max-width: min(440px, calc(100vw - 44px)); }

/* Segmented choices use the same typography as standard action buttons. */
.dashboard-body.fotogenic-new-app .segmented-control .segment-btn {
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

body.fotogenic-new-app { --new-shell-height: 76px; }
body.fotogenic-new-app #app {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
body.fotogenic-new-app #app > .main-content {
    isolation: isolate;
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - var(--new-shell-height));
    max-height: calc(100dvh - var(--new-shell-height));
}
body.fotogenic-new-app #sharedSidebarMount {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: var(--new-shell-height);
    flex: 0 0 auto;
    z-index: 110;
}
body.fotogenic-new-app #sharedSidebarMount > .sidebar,
body.fotogenic-new-app #sidebarBackdrop,
body.fotogenic-new-app #mobileMenuBtn {
    display: none !important;
}
#sharedSidebarMount .new-shell {
    --new-shell-ink: var(--text-primary, #121212);
    --new-shell-paper: var(--bg-color, #f9f9f9);
    --new-shell-line: var(--border-color, rgb(18 18 18 / 8%));
    display: flex;
    align-items: center;
    gap: 22px;
    height: var(--new-shell-height);
    min-height: var(--new-shell-height);
    padding: 12px 32px;
    box-sizing: border-box;
    color: var(--new-shell-ink);
    font-family: inherit;
}
#sharedSidebarMount .new-shell .brand-content {
    position: static !important;
    visibility: visible !important;
    transform: none !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    flex: 0 0 auto;
}
#sharedSidebarMount .new-shell .logo-text {
    color: inherit;
    font-family: 'Jost', sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
#sharedSidebarMount .new-shell .logo-text span { color: inherit !important; }
#sharedSidebarMount .new-shell-disclosure { position: relative; }
#sharedSidebarMount .new-shell summary {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 7px 10px;
    border-radius: 14px;
    color: inherit;
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 150ms ease;
}
#sharedSidebarMount .new-shell summary > * { pointer-events: none; }
#sharedSidebarMount .new-shell summary::-webkit-details-marker { display: none; }
#sharedSidebarMount .new-shell summary > svg { width: 16px; height: 16px; flex-shrink: 0; }
#sharedSidebarMount .new-shell summary:hover,
#sharedSidebarMount .new-shell details[open] > summary { background: var(--accent-dim); }
#sharedSidebarMount .new-shell :where(summary, button):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
#sharedSidebarMount .new-shell-workflow { min-width: 0; border-left: 1px solid var(--new-shell-line); padding-left: 18px; }
#sharedSidebarMount .new-shell-workflow-label { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sharedSidebarMount .new-shell-popover {
    position: absolute;
    top: calc(100% + 12px);
    left: 18px;
    width: 280px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid var(--new-shell-line);
    border-radius: 22px;
    background: var(--panel-bg, rgb(249 249 249 / 94%));
    box-shadow: 0 16px 50px rgb(18 18 18 / 10%), 0 1px 3px rgb(18 18 18 / 5%);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transform-origin: top right;
}
#sharedSidebarMount .new-shell .nav-menu {
    display: flex;
    flex-direction: column;
    max-height: min(650px, calc(100dvh - 120px));
    overflow: auto;
    scrollbar-width: thin;
    gap: 2px;
    margin: 0;
    padding: 0;
}
#sharedSidebarMount .new-shell :where(.nav-item, .user-actions .icon-btn, #sidebarSecondaryActionBtn, .new-shell-account-link) {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: var(--new-shell-item-padding, 11px 12px) !important;
    border: 0;
    border-radius: 12px;
    gap: var(--new-shell-item-gap, 12px) !important;
    background: transparent;
    color: var(--new-shell-ink);
    box-shadow: none;
    transform: none;
    transition: none;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
}
#sharedSidebarMount .new-shell .nav-item .nav-label {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
#sharedSidebarMount .new-shell :where(.nav-item, .user-actions .icon-btn, #sidebarSecondaryActionBtn, .new-shell-account-link) svg { width: var(--new-shell-item-icon-size, 18px); height: var(--new-shell-item-icon-size, 18px); flex-shrink: 0; }
#sharedSidebarMount .new-shell :where(.nav-item, .user-actions .icon-btn, #sidebarSecondaryActionBtn, .new-shell-account-link):not(.is-loading) svg { opacity: .65; }
#sharedSidebarMount .new-shell :where(.nav-item, .user-actions .icon-btn, #sidebarSecondaryActionBtn, .new-shell-account-link):focus-visible { outline-offset: -3px; }
#sharedSidebarMount .new-shell :where(.nav-item, .user-actions .icon-btn, #sidebarSecondaryActionBtn, .new-shell-account-link):hover { background: var(--accent-dim); }
#sharedSidebarMount .new-shell .nav-item.active { background: var(--new-shell-ink); color: var(--new-shell-paper); }
#sharedSidebarMount .new-shell .nav-item.active svg { opacity: 1; }
#sharedSidebarMount .new-shell .nav-item[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
#sharedSidebarMount .new-shell .nav-section-title {
    display: block !important;
    text-align: left !important;
    padding: 15px 12px 5px;
    margin: 0;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 1.4;
    text-transform: none;
}
#sharedSidebarMount .new-shell .nav-section-title-full { display: block !important; }
#sharedSidebarMount .new-shell .nav-section-title-compact { display: none !important; }
#sharedSidebarMount .new-shell-billing { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#sharedSidebarMount #mainContentLoading { position: static; inset: auto; display: flex !important; flex: 0 0 18px; width: 18px; height: 18px; background: none; opacity: 1; visibility: visible; transition: opacity 180ms ease, visibility 180ms; }
#sharedSidebarMount #mainContentLoading.hidden { opacity: 0; visibility: hidden; }
#sharedSidebarMount #mainContentLoading .app-boot-spinner { width: 18px; height: 18px; }
#sharedSidebarMount #mainContentLoading.hidden .app-boot-spinner { animation: none; }
#sharedSidebarMount .new-shell #topUpBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 92px;
    min-height: 44px;
    margin: 0;
    padding: 8px 18px;
    border: 1px solid var(--new-shell-line);
    border-radius: var(--new-shell-pill-radius, 999px);
    color: var(--text-primary) !important;
    background: var(--new-surface, rgb(255 255 255 / 70%)) !important;
    box-shadow: 0 2px 8px rgb(18 18 18 / 2%);
    transform: none;
    filter: none;
    transition: background-color 150ms ease;
}
#sharedSidebarMount .new-shell #topUpBtn:not(:disabled):hover { background: var(--accent-dim) !important; filter: none; }
#sharedSidebarMount .new-shell #topUpBtn > svg,
#sharedSidebarMount .new-shell #topUpBtn > span:not(#userBalanceDisplay) { display: none; }
#sharedSidebarMount .new-shell #userBalanceDisplay {
    display: block !important;
    max-width: 150px;
    color: inherit;
    font-size: 13px;
    font-weight: 550;
    white-space: nowrap;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
#sharedSidebarMount .new-shell-account,
#sharedSidebarMount .new-shell-account summary { border-radius: var(--new-shell-pill-radius, 999px); }
#sharedSidebarMount .new-shell-account summary { flex-direction: row-reverse; padding: 4px 10px 4px 4px; }
#sharedSidebarMount .new-shell #userAvatar {
    display: block;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--new-shell-line);
}
#sharedSidebarMount .new-shell-account .new-shell-popover { left: auto; right: 0; width: 240px; }
#sharedSidebarMount .new-shell .user-panel,
#sharedSidebarMount .new-shell .user-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
    gap: 2px;
    padding: 0;
    margin: 0;
    border: 0;
    width: auto;
    background: none;
}
#sharedSidebarMount .new-shell .user-details,
#sharedSidebarMount .new-shell .user-actions {
    display: flex !important;
    position: static;
    width: auto;
    max-width: none;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
#sharedSidebarMount .new-shell .user-name { display: block !important; color: inherit; font-size: 13px; font-weight: 500; letter-spacing: normal; line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#sharedSidebarMount .new-shell .user-details { box-sizing: border-box; min-width: 0; padding: 12px 12px 8px; }
#sharedSidebarMount .new-shell #logoutBtn:not(.is-loading)::after { content: attr(title); }
#sharedSidebarMount .new-shell #sidebarSecondaryActionBtn span {
    display: inline !important;
    max-width: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
/* Recolor the existing Welcome icon treatment, including its hover/focus states. */
body.fotogenic-new-app .welcome-launch-card { --primary-color: var(--text-primary, #121212); }

/* Start only when native details becomes visible, not while its content is closed. */
#sharedSidebarMount .new-shell-disclosure[open] > .new-shell-popover { animation: new-shell-appear 180ms cubic-bezier(.22,.61,.36,1) both; }
#sharedSidebarMount .new-shell-disclosure.is-closing .new-shell-popover { animation: new-shell-disappear 180ms ease both; pointer-events: none; }
@keyframes new-shell-appear {
    from { opacity: 0; transform: translate3d(0,-6px,0) scale(.98); }
    to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}
@keyframes new-shell-disappear {
    from { opacity: 1; transform: translate3d(0,0,0) scale(1); }
    to { opacity: 0; transform: translate3d(0,-6px,0) scale(.98); }
}
@media (max-width: 764px) {
    body.fotogenic-new-app { --new-shell-height: calc(112px + env(safe-area-inset-top)); }
    body.fotogenic-new-app #app > .main-content > .mobile-top-bar:not(:has(.mobile-top-action.visible)) { display: none; }
    #sharedSidebarMount .new-shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; gap: 8px 12px; }
    #sharedSidebarMount .new-shell .brand-content { grid-column: 1 / -1; grid-row: 1; justify-self: start; min-width: 0; max-width: calc(100% - 88px) !important; overflow: hidden !important; text-overflow: ellipsis; white-space: nowrap; }
    #sharedSidebarMount .new-shell .logo-text { font-size: 18px; }
    #sharedSidebarMount .new-shell-account { grid-column: 2; grid-row: 1; justify-self: end; }
    #sharedSidebarMount .new-shell-workflow { grid-column: 1; grid-row: 2; width: 100%; padding: 0; border: 0; }
    #sharedSidebarMount .new-shell-workflow > summary { justify-content: flex-start; width: fit-content; max-width: 100%; min-height: 44px; padding-inline: 10px; }
    #sharedSidebarMount .new-shell-workflow .new-shell-popover { left: 0; top: calc(100% + 4px); width: min(320px, calc(100vw - 32px)); }
    #sharedSidebarMount .new-shell .nav-menu { max-height: calc(100dvh - 170px); }
    #sharedSidebarMount .new-shell-billing { grid-column: 2; grid-row: 2; justify-self: end; gap: 8px; margin: 0; }
    #sharedSidebarMount .new-shell #topUpBtn { padding: 8px 12px; min-width: 72px; max-width: min(160px, 50vw); }
    #sharedSidebarMount .new-shell #userBalanceDisplay { overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) {
    #sharedSidebarMount .new-shell-disclosure[open] > .new-shell-popover { animation: none; }
    #sharedSidebarMount #mainContentLoading { transition: none; }
    #sharedSidebarMount .new-shell :is(summary, #topUpBtn, .nav-item, .user-actions .icon-btn, #sidebarSecondaryActionBtn, .new-shell-account-link) { transition: none; }
}

/* Workflow and History keep their own state in one stable header loading slot. */
#sharedSidebarMount .new-shell-loading { display: grid; flex: 0 0 18px; width: 18px; height: 18px; }
#sharedSidebarMount .new-shell-loading > div { grid-area: 1 / 1; }
#sharedSidebarMount #historyLoadingMoreHint { position: static; inset: auto; width: 18px; height: 18px; min-width: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 180ms ease, visibility 180ms; }
#sharedSidebarMount #historyLoadingMoreHint.visible { opacity: 1; visibility: visible; }
#sharedSidebarMount #historyLoadingMoreHint .spinner { width: 18px; height: 18px; margin: 0; }
/* Remove inactive animations instead of retaining a paused compositor timeline. */
.fotogenic-new-app .history-loading-more-hint:not(.visible) .spinner { animation: none; }
#sharedSidebarMount .new-shell-loading:has(#mainContentLoading:not(.hidden)) #historyLoadingMoreHint { opacity: 0; visibility: hidden; }
.fotogenic-new-app #historyBulkDeleteBtn:not(.has-selection) { --control-gap: 0px; }
@media (prefers-reduced-motion: reduce) {
    #sharedSidebarMount #historyLoadingMoreHint { transition: none; }
}

/* Activity is a billing peer, with the same 44px pill geometry. */
#sharedSidebarMount .new-shell-jobs > summary {
    width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--new-shell-line);
    border-radius: var(--new-shell-pill-radius, 999px);
    background: var(--new-surface, rgb(255 255 255 / 70%));
    box-shadow: 0 2px 8px rgb(18 18 18 / 2%);
}
#sharedSidebarMount .new-shell-jobs > summary > svg { width: 20px; height: 20px; }
#sharedSidebarMount .new-shell-jobs .new-shell-popover {
    right: 0; left: auto; width: min(360px, calc(100vw - 32px)); padding: 16px;
    display: flex; flex-direction: column;
    max-height: calc(100dvh - var(--new-shell-height) - 12px);
    overflow-y: auto; overscroll-behavior: contain;
}
#sharedSidebarMount .new-shell-jobs .new-shell-popover > :not(.new-shell-jobs-list) { flex-shrink: 0; }
#sharedSidebarMount .new-shell-jobs h2 { font-size: 16px; margin: 0 0 12px; }
#sharedSidebarMount .new-shell-jobs p { font-size: 13px; color: var(--text-secondary); margin: 0 0 12px; }
#sharedSidebarMount .new-shell-jobs-list { min-height: 0; overflow-anchor: none; max-height: min(360px, 50dvh); overflow-y: auto; overscroll-behavior: contain; }
/* Keep a usable scroll target when error controls fill a very short viewport. */
#sharedSidebarMount .new-shell-jobs-list:not(:empty) { min-height: 44px; }
#sharedSidebarMount .new-shell-jobs-list { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
#sharedSidebarMount .new-shell-jobs-list::-webkit-scrollbar { width: 5px; }
#sharedSidebarMount .new-shell-jobs-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
#sharedSidebarMount .new-shell-jobs-list::-webkit-scrollbar-track { background: transparent; }
#sharedSidebarMount .new-shell-job { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 0; border-bottom: 1px solid var(--new-shell-line); font-size: 13px; }
#sharedSidebarMount .new-shell-job-preview { display: grid; place-items: center; flex: 0 0 80px; width: 80px; height: 80px; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--bg-secondary, rgba(127,127,127,.08)); color: var(--text-secondary); }
#sharedSidebarMount .new-shell-job-preview img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
#sharedSidebarMount .new-shell-job-details { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
#sharedSidebarMount .new-shell-job strong { min-width: 0; overflow-wrap: anywhere; }
#sharedSidebarMount .new-shell-job span { flex-shrink: 0; color: var(--text-secondary); }
#sharedSidebarMount .new-shell-jobs-create { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin-top: 12px; padding: 10px 16px; border: 1px solid transparent; border-radius: var(--new-control-radius, 14px); background: var(--text-primary); color: var(--bg-color); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
#sharedSidebarMount .new-shell-loading { grid-template-columns: 20px auto; align-items: center; gap: 8px; width: auto; height: 44px; flex: 0 0 auto; opacity: 0; visibility: hidden; transition: opacity 180ms ease, visibility 180ms; }
#sharedSidebarMount .new-shell-loading > div { grid-area: 1 / 1; }
#sharedSidebarMount .new-shell-loading-copy { grid-area: 1 / 2; font-size: 14px; font-weight: 500; color: var(--text-primary); }
#sharedSidebarMount .new-shell-loading:has(#mainContentLoading:not(.hidden), #historyLoadingMoreHint.visible) { opacity: 1; visibility: visible; }
#sharedSidebarMount .new-shell-loading :is(#mainContentLoading, #historyLoadingMoreHint, .app-boot-spinner, .spinner) { width: 20px; height: 20px; }
@media (max-width: 480px) {
    #sharedSidebarMount .new-shell-loading-copy { display: none; }
    #sharedSidebarMount .new-shell-loading { grid-template-columns: 20px; gap: 0; }
    #sharedSidebarMount .new-shell-jobs .new-shell-popover { position: fixed; top: calc(var(--new-shell-height) + 12px); right: 16px; max-height: calc(100dvh - var(--new-shell-height) - 28px); }
}
@media (prefers-reduced-motion: reduce) {
    #sharedSidebarMount .new-shell-loading { transition: none; }
}

/* Navigation groups use the same title-and-rule treatment as template fields. */
#sharedSidebarMount .new-shell-popover .nav-section-title { display: flex !important; align-items: center; gap: 12px; }
#sharedSidebarMount .new-shell-popover .nav-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border-color, rgba(128,128,128,.2)); }

#sharedSidebarMount .new-shell-job-status { display: flex; align-items: center; gap: 6px; }
#sharedSidebarMount .new-shell-job-status-icon { width: 14px; height: 14px; flex: 0 0 14px; }
#sharedSidebarMount .new-shell-job-status-icon.is-spinning { animation: new-shell-job-spin 1.2s linear infinite; }
@keyframes new-shell-job-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    #sharedSidebarMount .new-shell-job-status-icon.is-spinning { animation: none; }
}

#sharedSidebarMount .new-shell-jobs-message:not([hidden]) { display: flex; align-items: center; gap: 6px; }

#sharedSidebarMount .new-shell-jobs-retry { min-height: 44px; padding: 10px 16px; margin-bottom: 12px; border: 1px solid var(--border-color); border-radius: var(--new-control-radius, 14px); background: var(--card-bg); color: var(--text-primary); font: inherit; font-size: 14px; cursor: pointer; }
#sharedSidebarMount .new-shell-jobs-retry:disabled { cursor: default; opacity: .6; }

/* /new workflow surfaces. Exact owner roots exclude composer and lightbox UI.
   Hidden, active, loading, disabled, scrolling and media ownership remain canonical. */
body.fotogenic-new-app :is(#tab-welcome, #creationPresetCatalog) {
    --primary-color: var(--text-primary, #121212);
    --workflow-surface: var(--new-surface, rgba(249, 249, 249, .9));
    --workflow-border: var(--border-color, rgba(18, 18, 18, .1));
    --workflow-shadow: var(--new-shadow, 0 12px 36px rgba(18, 18, 18, .055));
    --workflow-radius: 22px;
    color: var(--text-primary);
}

/* Welcome: one small launch window, with the original three actions. */
#tab-welcome .welcome-page { gap: 40px; }
#tab-welcome .welcome-launchpad {
    padding: 32px 0 44px;
    min-height: calc(100dvh - var(--new-shell-height, 76px) - clamp(20px, 3vw, 34px) - 44px);
    border: 0;
    background: transparent;
    box-shadow: none;
}
#tab-welcome .welcome-launchpad-content { width: min(100%, 760px); max-width: 760px; gap: 30px; }
#tab-welcome .welcome-launchpad-eyebrow { display: none; }
#tab-welcome .welcome-launchpad-heading { max-width: 600px; margin-inline: auto; }
#tab-welcome #welcomeTitle {
    margin-bottom: 12px;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.035em;
}
#tab-welcome .welcome-launchpad-heading > p:last-child {
    max-width: 520px;
    margin-inline: auto;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}
#tab-welcome .welcome-launchpad-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--workflow-border);
    border-radius: var(--workflow-radius);
    background: var(--workflow-surface);
    box-shadow: var(--workflow-shadow);
    -webkit-backdrop-filter: blur(var(--new-blur, 12px));
    backdrop-filter: blur(var(--new-blur, 12px));
}
#tab-welcome .welcome-launch-card {
    min-height: 104px;
    padding: 20px;
    gap: 18px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
}
#tab-welcome .welcome-launch-card:hover { background: var(--accent-dim); box-shadow: none; }
#tab-welcome .welcome-launch-card:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: -2px;
    box-shadow: none;
}
#tab-welcome .welcome-launch-card-visual {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 13px;
    background: var(--input-bg);
    color: var(--text-primary);
}
#tab-welcome .welcome-launch-card-visual svg { width: 22px; height: 22px; stroke-width: 1.6; }
#tab-welcome .welcome-launch-card-copy { gap: 5px; }
#tab-welcome .welcome-launch-card-copy strong { font-size: 15px; font-weight: 550; line-height: 1.4; }
#tab-welcome .welcome-launch-card-copy small { font-size: 13px; line-height: 1.55; }
#tab-welcome .welcome-launch-card-icon {
    width: 28px;
    height: 28px;
    color: var(--text-tertiary);
    background: transparent;
    border: 0;
}

@media (max-width: 764px) {
    #tab-welcome .welcome-launchpad { padding: 12px 0 28px; min-height: 0; }
    #tab-welcome .welcome-launchpad-content { gap: 24px; }
    #tab-welcome .welcome-launchpad-grid { padding: 5px; border-radius: 18px; }
    #tab-welcome .welcome-launch-card { min-height: 106px; padding: 16px 12px; gap: 12px; grid-template-columns: 38px minmax(0, 1fr); }
    #tab-welcome .welcome-launch-card-visual { width: 38px; height: 38px; border-radius: 11px; }
    #tab-welcome .welcome-launch-card-copy strong { font-size: 13px; }
    #tab-welcome .welcome-launch-card-copy small { font-size: 12px; }
    #tab-welcome .welcome-launch-card-icon { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    #tab-welcome .welcome-launch-card { transition: none; }
}

/* The original three launch rows remain unchanged; the invitation is secondary. */
#tab-welcome .welcome-launchpad:has(.new-explore-invitation) { padding-block: 24px; }
#tab-welcome .welcome-launchpad-content:has(.new-explore-invitation) { gap: 24px; }
.new-explore-invitation { display:flex; align-items:center; gap:18px; width:min(100%,480px); min-height:76px; padding:14px 20px; margin:0 auto; border:1px solid var(--workflow-border); border-radius:var(--workflow-radius); background:var(--workflow-surface); color:var(--text-primary); font-family:inherit; font-size:14px; font-weight:500; line-height:1.4; cursor:pointer; }
.new-explore-invitation:hover { background:var(--input-bg); }
.new-explore-miniatures { display:flex; flex-shrink:0; }
.new-explore-miniatures img { width:34px; height:42px; object-fit:cover; border-radius:8px; box-shadow:none; }
.new-explore-miniatures img + img { margin-left:-4px; }
.new-explore-invitation > svg { width:18px; height:18px; margin-left:auto; flex-shrink:0; }
.new-explore-dialog { margin:auto; background:var(--card-bg); border-radius:var(--new-radius); box-shadow:var(--new-shadow); width:min(1120px,calc(100vw - 48px)); max-width:none; max-height:calc(100dvh - 48px); padding:28px; border:1px solid var(--border-color); color:var(--text-primary); overflow:auto; }
.new-explore-dialog::backdrop { background:rgba(0,0,0,.45); }
.new-explore-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:24px; }
.new-explore-header h2 { margin:0; font-size:24px; font-weight:500; letter-spacing:-.03em; }
.new-explore-dialog .icon-btn { flex-shrink:0; width:44px; height:44px; }
.new-explore-dialog .icon-btn svg { width:22px; height:22px; }
.new-explore-story { display:grid; grid-template-columns:minmax(0,2.2fr) minmax(230px,1fr); gap:32px; align-items:center; }
.new-explore-media { display:flex; gap:6px; height:min(430px,49dvh); min-width:0; }
.new-explore-media img { flex:1; width:0; min-width:0; height:100%; object-fit:cover; border-radius:4px; box-shadow:none; }
.new-explore-media[data-count="1"] img { object-fit:contain; }
.new-explore-copy h3 { font-size:28px; line-height:1.15; font-weight:550; letter-spacing:-.035em; margin:0 0 22px; }
.new-explore-copy > p { color:var(--text-secondary); font-size:16px; line-height:1.5; margin:0 0 28px; }
.new-explore-copy .action-btn { width:100%; justify-content:center; min-height:44px; }
.new-explore-footer { display:flex; justify-content:space-between; align-items:center; border-top:1px solid var(--border-color); padding-top:16px; margin-top:24px; }
.new-explore-label { text-align:center; margin:0 0 6px; font-size:14px; }
.new-explore-dots { display:flex; justify-content:center; }
.new-explore-dots button { padding:0; width:24px; height:24px; border:0; background:transparent; cursor:pointer; }
.new-explore-dots button::after { content:''; display:block; margin:auto; width:6px; height:6px; border-radius:50%; background:var(--text-secondary); opacity:.3; }
.new-explore-dots button[aria-pressed="true"]::after { background:var(--text-primary); opacity:1; }
@media(max-width:764px) {
 .new-explore-invitation { gap:12px; padding:12px 16px; }
 .new-explore-dialog { margin:auto; background:var(--card-bg); border-radius:var(--new-radius); box-shadow:var(--new-shadow); width:calc(100vw - 24px); max-height:calc(100dvh - 24px); padding:20px; }
 .new-explore-header h2 { font-size:20px; }
 .new-explore-story { grid-template-columns:1fr; gap:20px; }
 .new-explore-media { height:30dvh; }
 .new-explore-copy h3 { font-size:24px; margin-bottom:12px; }
 .new-explore-copy > p { font-size:14px; margin-bottom:16px; }
}

/* Match shared app-modal motion while retaining native dialog focus containment. */
.new-explore-dialog { opacity:0; transform:translateY(10px) scale(.986); transition:transform .24s cubic-bezier(.2,.8,.2,1), opacity .24s ease; }
.new-explore-dialog.is-visible { opacity:1; transform:translateY(0) scale(1); }
.new-explore-dialog::backdrop { opacity:0; transition:opacity .24s ease; }
.new-explore-dialog.is-visible::backdrop { opacity:1; }
@starting-style { .new-explore-dialog.is-visible::backdrop { opacity:0; } }
@media(prefers-reduced-motion:reduce) {
 .new-explore-dialog, .new-explore-dialog::backdrop { transition:none; }
}

/* History owns this floating signal. Other operations keep the header loader. */
body.fotogenic-new-app #historyLoadingMoreHint { position:fixed; left:50% !important; right:auto !important; bottom:max(24px,env(safe-area-inset-bottom)) !important; transform:translateX(-50%); width:max-content; max-width:calc(100vw - 32px); height:auto; min-height:44px; aspect-ratio:auto; min-width:0; padding:12px 18px; border:1px solid var(--border-color); border-radius:999px; background:var(--card-bg); color:var(--text-primary); box-shadow:var(--new-shadow); gap:10px; pointer-events:none; }
body.fotogenic-new-app #historyLoadingMoreHint::after { content:'Loading…'; font-size:14px; line-height:20px; }
body.fotogenic-new-app #historyLoadingMoreHint .spinner { width:18px; height:18px; margin:0; }
body.fotogenic-new-app #historyCollectionLoader { position:relative; inset:auto; min-height:280px; width:100%; }
body.fotogenic-new-app #historyCollectionLoader .history-collection-loader-content { display:none; }
.new-history-skeletons { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; width:100%; }
.new-history-skeleton { display:block; aspect-ratio:3/4; border-radius:16px; background:linear-gradient(100deg,var(--input-bg) 20%,var(--border-color) 45%,var(--input-bg) 70%); background-size:220% 100%; animation:new-history-shimmer 1.6s ease-in-out infinite; }
@keyframes new-history-shimmer { to { background-position:-220% 0; } }
@media(max-width:600px) { .new-history-skeletons { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(prefers-reduced-motion:reduce) { .new-history-skeleton { animation:none; } }

/* Opening a saved result keeps its photo visible and uses one compact status pill. */
body.fotogenic-new-app #sharedResultsContainer .job-card :is(.job-lightbox-open-loading,.job-campaign-set-open-loading,.job-content-kit-open-loading) {
  position:absolute; inset:auto; top:50%; left:50%; transform:translate(-50%,-50%);
  display:flex; flex-direction:row; align-items:center; justify-content:center; gap:9px;
  width:max-content; max-width:calc(100% - 24px); height:auto !important; min-height:44px !important;
  padding:11px 14px; border:1px solid rgba(0,0,0,.1); border-radius:999px;
  background:#fff; color:#242424; box-shadow:0 2px 8px rgba(0,0,0,.08); overflow:hidden;
}
body.fotogenic-new-app #sharedResultsContainer .job-card :is(.job-lightbox-open-loading,.job-campaign-set-open-loading,.job-content-kit-open-loading)::before,
body.fotogenic-new-app #sharedResultsContainer .job-card :is(.job-lightbox-open-loading,.job-campaign-set-open-loading,.job-content-kit-open-loading)::after { content:none; }
body.fotogenic-new-app #sharedResultsContainer .job-card :is(.job-lightbox-open-loading,.job-campaign-set-open-loading,.job-content-kit-open-loading) .spinner {
  flex:0 0 18px; width:18px; height:18px; margin:0; border:2px solid #dedede; border-top-color:#333;
}
body.fotogenic-new-app #sharedResultsContainer .job-card :is(.job-lightbox-open-loading,.job-campaign-set-open-loading,.job-content-kit-open-loading) .job-status-text {
  margin:0; color:#242424; font-size:13px; line-height:20px; font-weight:500; text-shadow:none;
}

/* Native configuration fields keep their values and event owners. */
body.fotogenic-new-app .new-fine-tune { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 0; min-height: 370px; align-items: start; }
body.fotogenic-new-app .new-fine-tune-nav { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 24px 0; border-right: 1px solid var(--border-color); align-self: stretch; }
body.fotogenic-new-app .new-fine-tune-nav button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 12px; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
body.fotogenic-new-app .new-fine-tune-nav button[aria-selected="true"] { background: var(--input-bg); }
body.fotogenic-new-app .new-fine-tune-nav button:focus-visible { outline: 2px solid var(--text-primary); outline-offset: -2px; }
body.fotogenic-new-app .new-fine-tune-nav svg { width: 20px; height: 20px; flex: 0 0 auto; }
body.fotogenic-new-app .new-fine-tune > .config-group { grid-column: 2; grid-row: 1; margin: 0; min-width: 0; padding: 16px 0 24px 24px; }
body.fotogenic-new-app .new-fine-tune > .config-group[data-new-fine-active="false"] { display: none !important; }
body.fotogenic-new-app .new-fine-tune > .config-group > .divider { display: none; }
body.fotogenic-new-app .new-fine-tune .config-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 24px; }
body.fotogenic-new-app .new-fine-tune .config-group-header { margin-top: 0; }
body.fotogenic-new-app .new-fine-tune .config-subtitle { margin-bottom: 24px; }
@media (max-width: 760px) {
    body.fotogenic-new-app .new-fine-tune { grid-template-columns: minmax(0,1fr); min-height: 0; }
    body.fotogenic-new-app .new-fine-tune-nav { flex-direction: row; overflow-x: auto; padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--border-color); }
    body.fotogenic-new-app .new-fine-tune-nav button { width: auto; flex: 0 0 auto; white-space: nowrap; }
    body.fotogenic-new-app .new-fine-tune > .config-group { grid-column: 1; grid-row: 2; padding: 20px 0; }
    body.fotogenic-new-app .new-fine-tune .config-fields { grid-template-columns: minmax(0,1fr); }
}
body.fotogenic-new-app .new-fine-tune-nav[hidden] { display: none !important; }
body.fotogenic-new-app .new-fine-tune:has(> .new-fine-tune-nav[hidden]) { grid-template-columns: minmax(0,1fr); }
body.fotogenic-new-app .new-fine-tune:has(> .new-fine-tune-nav[hidden]) > .config-group { grid-column: 1; padding-left: 0; }
