.user-app-shell:has(.ad-studio-page) {
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
}
.user-app-shell:has(.ad-studio-page) > .user-sidebar,
.user-app-shell:has(.ad-studio-page) .user-topbar {
    display: none !important;
}
.user-app-shell:has(.ad-studio-page) > .user-main {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}
.user-app-shell:has(.ad-studio-page) .user-content {
    height: 100dvh;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.ad-studio-page {
    --studio-ink: #14233a;
    --studio-muted: #778397;
    --studio-blue: #2865ee;
    --studio-line: #e2e8f1;
    --studio-card: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    color: var(--studio-ink);
    background: #f3f6fa;
    font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.studio-progress-header {
    --studio-ink: #14233a;
    --studio-muted: #778397;
    --studio-blue: #2865ee;
    --studio-line: #e2e8f1;
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 7px;
    padding: 8px 18px 7px;
    border-bottom: 1px solid var(--studio-line);
    background: #fff;
}
.studio-progress-header.is-review {
    top: 70px;
    margin: 0 0 16px;
    border: 1px solid var(--studio-line);
    border-top: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 16px #1b34500d;
}
.studio-progress-header-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    min-height: 34px;
}
.studio-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    color: var(--studio-ink, #14233a);
    text-decoration: none;
    font-size: 18px;
}
.studio-brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--studio-blue);
    color: #fff;
    font-weight: 800;
}
.studio-title {
    display: grid;
    gap: 1px;
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 16px;
    border-left: 1px solid var(--studio-line);
}
.studio-title strong { font-size: 15px; }
.studio-title span { color: var(--studio-muted); font-size: 11px; }
.studio-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.studio-steps {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
}
.studio-progress-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 29px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 20px;
    background: #edf1f6;
    color: #647188;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}
.studio-progress-step.is-current { border-color: #d7e4ff; background: #e8f0ff; color: #245ce0; }
.studio-progress-step.is-complete { border-color: #dbe6f5; background: #f6f9fd; color: #315b9e; }
.studio-progress-step.is-next { border-color: #e0e6ef; background: #fff; color: #54647a; font: inherit; font-size: 11px; cursor: pointer; }
.studio-progress-step.is-next:hover,
.studio-progress-step.is-complete:hover { border-color: #a9c2f5; background: #f4f8ff; color: #245ce0; }
.studio-progress-step:focus-visible,
.studio-connection-action:focus-visible,
.studio-drafts-link:focus-visible,
.studio-button:focus-visible { outline: 3px solid #2865ee66; outline-offset: 2px; }
.studio-progress-step b { font-size: 10px; }
.studio-progress-connector { width: 18px; height: 1px; flex: 0 0 18px; background: #d5deea; }
.studio-drafts-link {
    flex: 0 0 auto;
    color: #314765;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.studio-drafts-link:hover { color: var(--studio-blue, #2865ee); }
.studio-connection-state {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #52627a;
    font-size: 10px;
    line-height: 1.3;
}
.studio-connection-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #8a96a7; }
.studio-connection-state.is-connected .studio-connection-dot { background: #18a46b; }
.studio-connection-state.is-attention .studio-connection-dot,
.studio-connection-state.is-disconnected .studio-connection-dot { background: #d18a18; }
.studio-connection-state.is-unavailable .studio-connection-dot { background: #8994a4; }
.studio-connection-text { min-width: 0; }
.studio-connection-action {
    flex: 0 0 auto;
    color: #2865d6;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}
.studio-connection-action:hover { color: #184cb5; text-decoration: underline; }

/* Keep the separate logged-out preview header unchanged. */
.studio-header {
    height: 72px;
    flex: 0 0 72px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 22px;
    border-bottom: 1px solid var(--studio-line);
    background: #fff;
}
.studio-header .studio-title { flex: 0 0 auto; min-width: 210px; }
.studio-header .studio-steps { justify-content: center; gap: 8px; flex: 1 1 auto; }
.studio-header .studio-steps span {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 20px;
    background: #edf1f6;
    color: #647188;
    font-size: 11px;
    font-weight: 700;
}
.studio-header .studio-steps span.is-current { background: #e8f0ff; color: #245ce0; }
.studio-header .studio-steps b { font-size: 10px; }

.studio-alert {
    flex: 0 0 auto;
    margin: 10px 18px 0;
    padding: 10px 14px;
    border: 1px solid #f1d28c;
    border-radius: 9px;
    background: #fff8e5;
    color: #6b4e12;
    font-size: 12px;
}
.studio-alert a { margin-left: 7px; color: #174fba; font-weight: 700; }
.studio-alert-error { border-color: #f1b9b9; background: #fff2f2; color: #8b2424; }
.studio-alert-success { border-color: #a8dfbf; background: #effaf3; color: #256340; }
.studio-form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.studio-workspace {
    display: grid;
    grid-template-columns: minmax(145px, 178px) minmax(320px, .95fr) minmax(460px, 1.18fr);
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 14px;
}
.studio-creative-picker,
.studio-preview-column,
.studio-fields-column {
    min-width: 0;
    min-height: 0;
}
.studio-creative-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px 10px;
    border: 1px solid var(--studio-line);
    border-radius: 13px;
    background: #fff;
}
.studio-eyebrow {
    display: block;
    color: #4d71b5;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
    line-height: 1.4;
    text-transform: uppercase;
}
.studio-creative-picker h1 { margin: 3px 0 0; color: #1946a0; font-size: 18px; font-weight: 760; line-height: 1.18; }
.studio-creative-picker > p { margin: 0 0 2px; color: var(--studio-muted); font-size: 11px; }
.studio-creative-option {
    display: grid;
    grid-template-columns: 52px minmax(0,1fr) 18px;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f5f7fb;
    color: var(--studio-ink);
    text-align: left;
    cursor: pointer;
}
.studio-creative-option:hover { border-color: #c6d5f7; }
.studio-creative-option.is-selected { border-color: var(--studio-blue); background: #eef4ff; box-shadow: 0 0 0 1px var(--studio-blue); }
.studio-creative-thumb { display: grid; width: 52px; height: 48px; place-items: center; overflow: hidden; border-radius: 7px; background: #e7edf5; color: #4675d2; font-size: 25px; }
.studio-creative-thumb img { width: 100%; height: 100%; object-fit: cover; }
.studio-creative-option strong { display: block; font-size: 11px; line-height: 1.25; }
.studio-creative-option small { display: block; margin-top: 2px; color: var(--studio-muted); font-size: 9px; line-height: 1.25; }
.studio-selected-mark { display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid #cad3e0; border-radius: 50%; color: transparent; font-size: 10px; }
.studio-creative-option.is-selected .studio-selected-mark { border-color: var(--studio-blue); background: var(--studio-blue); color: #fff; }
.studio-preview-note { display: grid; gap: 4px; margin-top: auto; padding: 9px; border: 1px solid #e0e8f3; border-radius: 9px; background: #f6f9fd; }
.studio-preview-note strong { font-size: 10px; }
.studio-preview-note span { color: var(--studio-muted); font-size: 9px; line-height: 1.35; }

.studio-preview-column {
    display: flex;
    flex-direction: column;
    padding: 13px;
    border: 1px solid var(--studio-line);
    border-radius: 13px;
    background: #fff;
}
.studio-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.studio-panel-heading h2 { margin: 3px 0 0; color: #1946a0; font-size: 15px; font-weight: 760; }
.studio-preview-switch { display: flex; padding: 3px; border: 1px solid var(--studio-line); border-radius: 8px; background: #f6f8fb; }
.studio-preview-switch button { padding: 5px 9px; border: 0; border-radius: 6px; background: transparent; color: #68758a; font-size: 10px; }
.studio-preview-switch button.is-active { background: var(--studio-blue); color: #fff; box-shadow: none; font-weight: 700; }
.studio-preview-stage { display: grid; flex: 1 1 auto; min-height: 0; place-items: center; overflow: hidden; padding: 12px; border-radius: 11px; background: linear-gradient(140deg, #e8edf4, #f3f6fa); }
.studio-facebook-card { width: min(100%, 410px); overflow: hidden; border: 1px solid #e2e6eb; border-radius: 13px; background: #fff; box-shadow: 0 10px 30px #152a4515; }
.studio-facebook-header { display: flex; align-items: center; gap: 9px; padding: 11px 12px 6px; }
.studio-page-avatar { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; background: #2670f4; color: #fff; font-size: 13px; font-weight: 800; }
.studio-facebook-header strong,.studio-facebook-header small { display: block; }
.studio-facebook-header strong { font-size: 11px; }
.studio-facebook-header small { margin-top: 1px; color: #8290a2; font-size: 9px; }
.studio-more { margin-left: auto; color: #607087; letter-spacing: 2px; }
.studio-preview-copy { display: -webkit-box; overflow: hidden; margin: 4px 12px 14px; color: #243148; font-size: 11px; line-height: 1.5; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.studio-photo-frame { position: relative; display: grid; width: 100%; height: auto; min-height: 0; max-height: none; aspect-ratio: 4 / 3; place-items: stretch; overflow: hidden; background: #e8edf4; }
.studio-property-photo { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; }
.studio-photo-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 220px; color: #66788e; }
.studio-photo-placeholder > span { color: #3c70db; font-size: 42px; line-height: 1; }
.studio-photo-placeholder strong { font-size: 12px; }
.studio-photo-placeholder small { color: #8390a0; font-size: 10px; }
.studio-photo-label { position: absolute; top: 9px; left: 10px; padding: 4px 7px; border-radius: 4px; background: #fff; color: #3c5070; font-size: 8px; font-weight: 800; letter-spacing: .04em; }
.studio-agent-overlay { position: absolute; right: 0; bottom: 0; left: 0; display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 8px 14px; background: #0b1b35e8; color: #fff; }
.studio-agent-overlay[hidden] { display: none; }
.studio-agent-avatar { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--studio-blue); font-weight: 800; }
.studio-agent-photo-preview { width: 40px; height: 40px; flex: 0 0 40px; border: 2px solid #fff; border-radius: 50%; object-fit: cover; }
.studio-agent-overlay strong,.studio-agent-overlay small { display: block; }
.studio-agent-overlay strong { font-size: 11px; }
.studio-agent-overlay small { color: #d6e0f1; font-size: 9px; }
.studio-property-line { padding: 8px 12px; color: #61718a; font-size: 9px; line-height: 1.3; }
.studio-property-line:empty { display: none; }
.studio-facebook-link { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 9px 12px; border-top: 1px solid #edf0f3; background: #fafbfc; }
.studio-facebook-link strong,.studio-facebook-link small { display: block; }
.studio-facebook-link strong { font-size: 11px; }
.studio-facebook-link small { margin-top: 2px; color: #79879a; font-size: 9px; }
.studio-preview-cta { flex: 0 0 auto; padding: 7px 10px; border-radius: 5px; background: var(--studio-blue); color: #fff; font-size: 9px; font-weight: 700; }
.studio-facebook-actions { display: flex; align-items: center; gap: 18px; padding: 8px 12px; color: #77849a; font-size: 9px; letter-spacing: .08em; }
.studio-facebook-actions small { margin-left: auto; letter-spacing: 0; }
.studio-real-photo-warning { display: grid; gap: 2px; margin-top: 9px; padding: 9px 11px; border: 1px solid #f1daa1; border-radius: 8px; background: #fff8e4; color: #6d551e; }
.studio-real-photo-warning[hidden] { display: none; }
.studio-real-photo-warning strong { font-size: 10px; }
.studio-real-photo-warning span { font-size: 9px; }
.studio-preview-stage.is-feed .studio-facebook-card { width: min(100%, 580px); }
.studio-preview-stage.is-feed .studio-photo-frame { min-height: 150px; }

.studio-fields-column { overflow: auto; overscroll-behavior: contain; padding-right: 2px; }
.studio-form-grid { display: grid; grid-template-columns: minmax(0, .98fr) minmax(0, 1fr); align-items: start; gap: 9px; }
.studio-card { min-width: 0; padding: 12px; border: 1px solid var(--studio-line); border-radius: 11px; background: #fff; }
.studio-card-goal { grid-column: 1 / -1; grid-row: 1; }
.studio-card-property { grid-column: 1; grid-row: 2; }
.studio-card-property [data-listing-property-fields] { display: grid; gap: 8px; }
.studio-card-property [data-listing-property-fields][hidden] { display: none; }
.studio-card-copy { grid-column: 2; grid-row: 2 / span 2; }
.studio-card-photo { grid-column: 1; grid-row: 3; }
.studio-card-brand { grid-column: 2; grid-row: 4; }
.studio-card-campaign { grid-column: 1 / -1; grid-row: 5; }
.studio-card-heading { margin-bottom: 9px; }
.studio-card-heading h2 { margin: 3px 0 0; color: #1946a0; font-size: 15px; }
.studio-goal-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.studio-goal-option { display: grid; gap: 5px; min-height: 64px; padding: 10px 11px; border: 1px solid #dce4ef; border-radius: 9px; background: #fff; color: #293a52; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.studio-goal-option:hover { border-color: #8db0eb; }
.studio-goal-option.is-selected { border-color: var(--studio-blue); background: #f2f6ff; box-shadow: 0 0 0 1px var(--studio-blue); }
.studio-goal-option strong { font-size: 11px; }
.studio-goal-option small { color: var(--studio-muted); font-size: 9px; line-height: 1.45; }
.studio-goal-option:disabled { opacity: .48; cursor: not-allowed; }
.studio-destination-settings { display: grid; gap: 11px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--studio-line); }
.studio-destination-settings[hidden], .studio-property-page-editor[hidden], [data-website-destination][hidden] { display: none !important; }
.guest-property-card[hidden], [data-property-card][hidden], [data-listing-permission][hidden],
[data-destination-settings][hidden], [data-home-value-destination-note][hidden] { display: none !important; }
.studio-property-page-editor { display: block; padding: 10px 11px; border: 1px solid #e1e7f0; border-radius: 9px; background: #fafbfd; }
.studio-page-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.studio-page-summary > div:first-child { display: grid; gap: 3px; min-width: 0; }
.studio-page-summary strong { color: #34445b; font-size: 10px; }
.studio-page-summary span { color: var(--studio-muted); font-size: 9px; }
.studio-page-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.studio-page-action { padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: #52647e; font: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
.studio-page-action:hover { background: #edf2f8; color: #2459b7; }
.studio-page-action + .studio-page-action { color: #2865d6; }
.studio-card-goal .studio-helper { margin-top: 8px; }
.studio-demo-badge { display: inline-block; margin-top: 5px; padding: 4px 6px; border-radius: 5px; background: #fff4d9; color: #775819; font-size: 8px; font-weight: 700; }
.studio-label { display: block; margin: 8px 0 4px; color: #4a5a71; font-size: 9px; font-weight: 700; }
.studio-input { display: block; width: 100%; min-width: 0; min-height: 36px; padding: 7px 9px; border: 1px solid #d7dfea; border-radius: 7px; background: #fff; color: #192941; font: inherit; font-size: 11px; outline: none; }
.studio-input:focus { border-color: #5d8bf0; box-shadow: 0 0 0 3px #2f6feb1c; }
.studio-input::placeholder { color: #a2adbb; }
.studio-address-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.studio-field-pair,.studio-field-triple { display: grid; gap: 7px; }
.studio-field-pair { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.studio-field-triple { grid-template-columns: repeat(3,minmax(0,1fr)); }
.studio-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 7px 11px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; font: inherit; font-size: 10px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.studio-button-blue { border-color: var(--studio-blue); background: var(--studio-blue); color: #fff; }
.studio-button-blue:hover { background: #1f55d5; color: #fff; }
.studio-button-outline { border-color: #d6deea; background: #fff; color: #31435c; }
.studio-button-outline:hover { border-color: #9fb3d4; background: #f8faff; color: #1d3559; }
.studio-import-button { min-height: 36px; padding: 6px 8px; font-size: 9px; }
.studio-check-row { display: flex; align-items: flex-start; gap: 7px; margin-top: 9px; color: #4e5d73; font-size: 9px; line-height: 1.35; cursor: pointer; }
.studio-check-row input { width: 14px; height: 14px; flex: 0 0 14px; margin: 0; accent-color: var(--studio-blue); }
.studio-subcheck { margin-left: 20px; }
.studio-copy-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.studio-text-link { padding: 0; border: 0; background: transparent; color: #2865d6; font-size: 9px; font-weight: 700; cursor: pointer; }
.studio-copy-carousel { display: flex; justify-content: space-between; gap: 6px; margin: 7px 0 5px; padding: 4px; border: 1px solid #e2e8f1; border-radius: 8px; background: #f7f9fc; }
.studio-carousel-button { border: 0; background: transparent; color: #8390a2; font-size: 9px; cursor: pointer; }
.studio-carousel-button:disabled { opacity: .45; cursor: default; }
.studio-carousel-next { margin-left: auto; padding: 4px 8px; border-radius: 5px; background: var(--studio-blue); color: #fff; }
.studio-textarea { min-height: 130px; resize: vertical; white-space: pre-wrap; }
.studio-headline-pair,.studio-copy-controls { margin-top: 2px; }
.studio-upload-control { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; overflow: hidden; margin-top: 9px; padding: 10px; border: 1px dashed #cbd5e2; border-radius: 8px; background: #fafbfd; cursor: pointer; }
.studio-upload-control > span:first-child { min-width: 0; }
.studio-upload-control strong,.studio-upload-control small { display: block; }
.studio-upload-control strong { font-size: 10px; }
.studio-upload-control small { margin-top: 3px; color: var(--studio-muted); font-size: 8px; }
.studio-upload-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.studio-remove-photo { margin-top: 6px; }
.studio-helper { display: block; margin-top: 5px; color: var(--studio-muted); font-size: 8px; }
.studio-agent-profile { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 8px; border-radius: 7px; background: #f5f7fb; }
.studio-agent-profile[hidden] { display: none; }
.studio-agent-profile strong,.studio-agent-profile small { display: block; }
.studio-agent-profile strong { font-size: 10px; }
.studio-agent-profile small { color: #68778b; font-size: 8px; }
.studio-agent-profile a { color: #2865d6; font-size: 8px; font-weight: 700; white-space: nowrap; }
.studio-agent-upload { margin-top: 8px; }
.studio-agent-photo-preview { width: 34px; height: 34px; flex: 0 0 34px; border: 2px solid #fff; border-radius: 50%; object-fit: cover; }
.studio-card-campaign { padding: 0; }
.studio-card-campaign > summary { display: flex; justify-content: space-between; align-items: center; padding: 12px; cursor: pointer; list-style: none; }
.studio-card-campaign > summary::-webkit-details-marker { display: none; }
.studio-card-campaign:not([open]) .studio-collapse-icon { transform: rotate(180deg); }
.studio-collapse-icon { color: #68778b; transition: transform .15s ease; }
.studio-campaign-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; padding: 0 12px 12px; }
.studio-campaign-grid > div { min-width: 0; }
.studio-campaign-grid small { display: block; margin-top: 4px; color: var(--studio-muted); font-size: 8px; }
.studio-location-results:not(:empty) { display: grid; gap: 3px; max-height: 130px; overflow: auto; margin-top: 5px; }
.studio-location-results button { padding: 6px 8px; border: 1px solid #e1e7f0; border-radius: 5px; background: #fff; color: #283952; text-align: left; font-size: 9px; cursor: pointer; }
.studio-selected-locations { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.studio-location-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid #d5e1f3; border-radius: 999px; background: #f1f6ff; color: #29486e; font-size: 9px; }
.studio-location-remove { width: 17px; height: 17px; padding: 0; border: 0; border-radius: 50%; background: #dfe9f8; color: #29486e; font-size: 14px; line-height: 16px; cursor: pointer; }
.studio-campaign-names { grid-column: 1 / -1; }
.studio-campaign-names > .studio-text-link { margin-left: 7px; }
.studio-name-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.studio-name-fields[hidden] { display: none; }
.studio-name-fields .studio-label { margin-top: 7px; }
.studio-save-bar { position: sticky; bottom: 0; z-index: 12; display: flex; align-items: center; gap: 9px; min-height: 70px; padding: 9px 16px; border-top: 1px solid var(--studio-line); background: #fff; box-shadow: 0 -4px 15px #1b345010; }
.studio-save-copy { display: grid; flex: 1 1 auto; gap: 2px; }
.studio-save-copy strong { font-size: 11px; }
.studio-save-copy > span { color: var(--studio-muted); font-size: 9px; }
.studio-save-copy small { color: #a43d35; font-size: 9px; }
.public-studio-save-bar > div { display: grid; flex: 1 1 auto; gap: 2px; }
.public-studio-save-bar > div strong { font-size: 11px; }
.public-studio-save-bar > div span { color: var(--studio-muted); font-size: 9px; }
.public-studio-save-bar > div small { color: #a43d35; font-size: 9px; }
.studio-submit { min-height: 39px; padding-inline: 14px; }
.studio-footer-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.studio-button:disabled { border-color: #e2e7ee; background: #f2f4f7; color: #8792a2; cursor: not-allowed; }

.studio-import-dialog { width: min(550px,calc(100vw - 28px)); max-width: none; padding: 22px; border: 1px solid #dce3ed; border-radius: 14px; box-shadow: 0 20px 60px #162b4a33; }
.studio-import-dialog::backdrop { background: #0a183080; backdrop-filter: blur(3px); }
.studio-import-dialog > form:first-child { margin: 0; }
.studio-dialog-close { float: right; border: 0; background: transparent; color: #76859b; font-size: 24px; line-height: 1; cursor: pointer; }
.studio-import-dialog h2 { margin: 5px 0; font-size: 21px; }
.studio-import-dialog p { color: #65748a; font-size: 12px; }
.studio-import-dialog .studio-helper { margin: 10px 0; font-size: 9px; }
.studio-import-status { min-height: 20px; margin: 10px 0; color: #66758b; font-size: 10px; }
.studio-import-status.is-error { color: #a63232; }
.studio-import-thumbnails { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; max-height: 190px; overflow: auto; }
.studio-import-thumbnails button { position: relative; padding: 0; overflow: hidden; aspect-ratio: 1; border: 2px solid transparent; border-radius: 7px; background: #edf1f6; cursor: pointer; }
.studio-import-thumbnails button.is-selected { border-color: var(--studio-blue); }
.studio-import-thumbnails button.is-selected::after { content: "✓"; position: absolute; top: 5px; right: 5px; display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: var(--studio-blue); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 1px 4px #10214255; }
.studio-import-thumbnails img { display: block; width: 100%; height: 100%; object-fit: cover; }

.studio-carousel-navigation { position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; pointer-events: none; }
.studio-carousel-navigation[hidden] { display: none; }
.studio-carousel-navigation button { display: grid; width: 32px; height: 32px; place-items: center; padding: 0 0 3px; border: 1px solid #ffffffb8; border-radius: 50%; background: #102142cc; color: #fff; font-size: 25px; line-height: 1; box-shadow: 0 2px 8px #0c1a3033; cursor: pointer; pointer-events: auto; }
.studio-carousel-navigation button:hover { background: #0c1d3b; transform: scale(1.05); }
.studio-carousel-navigation span { position: absolute; right: 9px; bottom: 8px; min-width: 42px; padding: 4px 7px; border: 1px solid #ffffffa8; border-radius: 999px; background: #102142d9; color: #fff; font-size: 10px; font-weight: 700; text-align: center; }
.guest-carousel-saved { margin-top: 8px; padding: 8px; border: 1px solid #d7e3f3; border-radius: 9px; background: #f5f9ff; }
.guest-carousel-saved[hidden] { display: none; }
.guest-carousel-saved > strong { display: block; margin-bottom: 6px; color: #244674; font-size: 10px; }
.guest-carousel-saved-photos { display: flex; gap: 5px; overflow-x: auto; }
.guest-carousel-saved-photos button { position: relative; width: 46px; height: 42px; flex: 0 0 46px; overflow: hidden; padding: 0; border: 1px solid #dbe4ef; border-radius: 5px; background: #fff; cursor: pointer; }
.guest-carousel-saved-photos button.is-current { border: 2px solid var(--studio-blue); box-shadow: 0 0 0 2px #2563eb22; }
.guest-carousel-saved-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.guest-carousel-saved small { display: block; margin-top: 5px; color: #65748a; font-size: 9px; }
.studio-carousel-mode-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 27px; margin-top: 7px; padding: 4px 9px; border: 1px solid #b8ccef; border-radius: 7px; background: #fff; color: #2454a6; font-size: 10px; font-weight: 700; cursor: pointer; }
.studio-carousel-mode-toggle:hover { border-color: var(--studio-blue); background: #edf4ff; }
.studio-carousel-mode-toggle[hidden] { display: none; }
.studio-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.studio-property-dialog,
.studio-property-preview-dialog { width: min(650px,calc(100vw - 28px)); max-width: none; max-height: min(88dvh,860px); padding: 0; overflow: hidden; border: 1px solid #dce3ed; border-radius: 15px; background: #fff; color: var(--studio-ink); box-shadow: 0 24px 70px #162b4a38; }
.studio-property-dialog::backdrop,
.studio-property-preview-dialog::backdrop { background: #0a183080; backdrop-filter: blur(3px); }
.studio-property-dialog[open],
.studio-property-preview-dialog[open] { display: flex; flex-direction: column; }
.studio-property-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--studio-line); }
.studio-property-dialog-header h2,
.studio-property-preview-toolbar h2 { margin: 4px 0 3px; color: #25364c; font-size: 19px; line-height: 1.2; }
.studio-property-dialog-header p,
.studio-property-preview-toolbar p { margin: 0; color: var(--studio-muted); font-size: 11px; }
.studio-property-dialog-body { display: grid; gap: 8px; padding: 13px 22px; overflow: auto; overscroll-behavior: contain; }
.studio-property-dialog-body .studio-label { margin-top: 4px; font-size: 10px; }
.studio-property-dialog-body .studio-input { min-height: 39px; font-size: 12px; }
.studio-property-dialog-body .studio-textarea { min-height: 90px; }
.studio-property-dialog-body .studio-helper { font-size: 9px; }
.studio-property-dialog-footer { display: flex; justify-content: flex-end; padding: 11px 22px; border-top: 1px solid var(--studio-line); background: #fbfcfe; }
.studio-property-dialog-footer .studio-button { min-width: 115px; }
.studio-property-preview-dialog { width: min(1180px,calc(100vw - 28px)); height: min(850px,90dvh); max-height: 90dvh; }
.studio-property-preview-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 19px; border-bottom: 1px solid var(--studio-line); }
.studio-property-preview-toolbar h2 { font-size: 17px; }
.studio-property-preview-toolbar p { min-height: 16px; }
.studio-property-preview-toolbar p.is-error { color: #a63232; }
.studio-property-preview-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.studio-property-preview-tools .studio-button { min-height: 32px; }
.studio-property-preview-stage { display: grid; flex: 1 1 auto; min-height: 0; place-items: center; overflow: auto; padding: 18px; background: #edf1f6; }
.studio-property-preview-frame-wrap { position: relative; width: 100%; height: 100%; min-height: 280px; overflow: hidden; border: 1px solid #d4dce7; border-radius: 8px; background: #fff; box-shadow: 0 12px 35px #1a2f4a18; transition: width .18s ease; }
.studio-property-preview-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.studio-property-preview-frame-wrap.is-mobile { width: min(390px,100%); height: 100%; min-height: 560px; border-radius: 22px; box-shadow: 0 0 0 7px #28364a, 0 15px 38px #1a2f4a25; }
.studio-property-preview-frame-wrap.is-loading::after { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: #f9fbfe; color: #69788e; content: "Building your property page preview…"; font-size: 12px; text-align: center; }
.studio-property-preview-frame-wrap.has-error::after { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: #fff8f6; color: #8c4940; content: "Preview unavailable. Close this window and try again."; font-size: 12px; text-align: center; }
.studio-property-preview-frame-wrap.is-loading iframe,
.studio-property-preview-frame-wrap.has-error iframe { visibility: hidden; }

@media (max-width: 600px) {
    .studio-property-dialog { width: calc(100vw - 18px); max-height: 92dvh; border-radius: 12px; }
    .studio-property-dialog-header { padding: 16px 15px 12px; }
    .studio-property-dialog-body { padding: 12px 15px; }
    .studio-property-dialog-footer { padding: 10px 15px; }
    .studio-property-dialog-body .studio-field-triple { grid-template-columns: 1fr; }
    .studio-property-preview-dialog { width: calc(100vw - 12px); height: 94dvh; max-height: 94dvh; border-radius: 11px; }
    .studio-property-preview-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px; }
    .studio-property-preview-tools { width: 100%; justify-content: space-between; }
    .studio-property-preview-stage { padding: 12px; }
    .studio-property-preview-frame-wrap.is-mobile { min-height: 420px; }
    .studio-page-summary { align-items: flex-start; }
    .studio-page-summary span { max-width: 235px; }
}

@media (max-width: 1100px) {
    .studio-progress-header { padding-inline: 12px; }
    .studio-progress-header-main { gap: 12px; }
    .studio-progress-row { gap: 8px; }
    .studio-progress-step { padding-inline: 8px; font-size: 10px; }
    .studio-progress-step.is-next { font-size: 10px; }
    .studio-connection-state { gap: 5px; font-size: 9px; }
    .studio-connection-action { font-size: 9px; }
    .studio-workspace { grid-template-columns: minmax(130px,160px) minmax(260px,.9fr) minmax(390px,1.1fr); gap: 8px; padding: 8px; }
    .studio-preview-column { padding: 9px; }
    .studio-form-grid { gap: 7px; }
    .studio-card { padding: 9px; }
    .studio-campaign-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
    .user-app-shell:has(.ad-studio-page) { height: auto; min-height: 100dvh; overflow: visible; }
    .user-app-shell:has(.ad-studio-page) .user-content { height: auto; min-height: 100dvh; overflow: visible; }
    .ad-studio-page { height: auto; min-height: 100dvh; }
    .studio-progress-header { top: 0; padding: 8px 12px; }
    .studio-progress-header.is-review { top: 70px; }
    .studio-progress-header-main { gap: 10px; }
    .studio-title { min-width: 0; flex: 1; padding-left: 10px; }
    .studio-header { height: auto; min-height: 62px; flex-wrap: wrap; gap: 10px; padding: 9px 12px; }
    .studio-header .studio-title { min-width: 0; flex: 1; padding-left: 10px; }
    .studio-header .studio-steps { order: 3; width: 100%; justify-content: flex-start; }
    .studio-progress-row { align-items: flex-start; flex-direction: column; gap: 7px; }
    .studio-steps { width: 100%; justify-content: stretch; }
    .studio-progress-step { flex: 1 1 0; justify-content: center; min-width: 0; padding: 7px 8px; white-space: normal; }
    .studio-progress-step.is-next { font-size: 10px; }
    .studio-connection-state { width: 100%; flex-wrap: wrap; justify-content: flex-start; font-size: 10px; }
    .studio-connection-text { flex: 1 1 140px; overflow-wrap: anywhere; }
    .studio-connection-action { font-size: 10px; }
    .studio-workspace { display: flex; flex-direction: column; min-height: 0; padding: 9px; }
    .studio-creative-picker { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; gap: 6px; }
    .studio-creative-picker > .studio-eyebrow,.studio-creative-picker > h1,.studio-creative-picker > p,.studio-preview-note { grid-column: 1 / -1; }
    .studio-creative-picker h1 { font-size: 17px; }
    .studio-creative-option { grid-template-columns: 42px minmax(0,1fr); padding: 6px; }
    .studio-creative-thumb { width: 42px; height: 40px; }
    .studio-selected-mark { display: none; }
    .studio-preview-column { min-height: 520px; }
    .studio-preview-stage { min-height: 390px; }
    .studio-photo-frame { max-height: none; }
    .studio-property-photo { max-height: none; }
    .studio-fields-column { overflow: visible; }
    .studio-save-bar { z-index: 12; flex-wrap: wrap; }
    .studio-save-copy { flex-basis: 100%; }
    .studio-footer-actions { width: 100%; }
    .studio-footer-actions .studio-button { flex: 1 1 0; }
}
@media (max-width: 520px) {
    .studio-brand { font-size: 15px; }
    .studio-brand-mark { width: 29px; height: 29px; }
    .studio-title span { display: none; }
    .studio-title strong { font-size: 13px; }
    .studio-drafts-link { font-size: 10px; }
    .studio-progress-step { gap: 5px; padding: 7px 5px; font-size: 9px; }
    .studio-progress-step.is-next { font-size: 9px; }
    .studio-progress-connector { width: 10px; flex-basis: 10px; }
    .studio-header .studio-steps span { padding: 6px 9px; font-size: 9px; }
    .studio-form-grid { display: flex; flex-direction: column; }
    .studio-card { width: 100%; }
    .studio-goal-options { grid-template-columns: 1fr; }
    .studio-campaign-grid { grid-template-columns: 1fr; }
    .studio-name-fields { grid-template-columns: 1fr; }
    .studio-preview-column { min-height: 475px; }
    .studio-preview-stage { min-height: 340px; padding: 7px; }
    .studio-photo-frame { min-height: 0; }
    .studio-photo-placeholder { min-height: 170px; }
    .studio-address-row { grid-template-columns: minmax(0,1fr); }
    .studio-import-button { justify-self: start; }
    .studio-save-bar { gap: 6px; padding: 8px; }
    .studio-save-bar .studio-button { min-width: 0; padding: 7px; font-size: 9px; }
}

/* Pixel-match editor geometry from the supplied Homstir references.
   Keep every existing input in the form; only change the desktop arrangement. */
@media (min-width: 801px) {
    .ad-studio-page {
        --studio-blue: #1765ee;
        --studio-line: #dce6f3;
        background: #edf3fc;
    }

    .studio-progress-header {
        padding: 7px 16px 6px;
        background: #f8fbff;
    }

    .studio-progress-header-main { min-height: 32px; }
    .studio-brand-mark { width: 31px; height: 31px; border-radius: 9px; }
    .studio-title strong { font-size: 14px; }
    .studio-steps { gap: 5px; }
    .studio-progress-step { min-height: 27px; padding: 4px 9px; }
    .studio-connection-state { font-size: 9px; }

    .studio-workspace {
        grid-template-columns: minmax(0, .97fr) minmax(0, 1.03fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 10px;
        padding: 9px 12px;
        background: #edf3fc;
    }

    .studio-creative-picker {
        grid-column: 1 / -1;
        grid-row: 1;
        display: grid;
        grid-template-columns: minmax(145px, .8fr) repeat(3, minmax(120px, 1fr)) minmax(112px, .7fr);
        align-items: center;
        gap: 8px;
        padding: 8px 11px;
        border-color: #d9e5f5;
        border-radius: 12px;
        background: #f8fbff;
    }

    .studio-creative-picker > .studio-eyebrow,
    .studio-creative-picker > h1,
    .studio-creative-picker > p,
    .studio-preview-note { grid-column: auto; }
    .studio-creative-picker > .studio-eyebrow {
        grid-column: 1;
        grid-row: 1;
        align-self: end;
        margin: 0 0 -3px;
    }
    .studio-creative-picker > h1 {
        grid-column: 1;
        grid-row: 2;
        margin: 0;
        font-size: 15px;
        line-height: 1.15;
    }
    .studio-creative-picker > p {
        grid-column: 1;
        grid-row: 3;
        margin: -2px 0 0;
        font-size: 9px;
        line-height: 1.25;
    }
    .studio-creative-option {
        grid-row: 1 / 4;
        grid-template-columns: 40px minmax(0, 1fr) 16px;
        gap: 6px;
        min-height: 57px;
        padding: 6px;
        border: 1px solid #e1e8f2;
        background: #fff;
    }
    .studio-creative-thumb { width: 40px; height: 42px; }
    .studio-creative-option strong { font-size: 10px; }
    .studio-creative-option small { font-size: 8px; }
    .studio-selected-mark { width: 15px; height: 15px; }
    .studio-preview-note {
        display: grid;
        grid-column: 5;
        grid-row: 1 / 4;
        gap: 3px;
        margin: 0;
        padding: 7px;
        border-color: #dfe8f4;
        background: #f2f7ff;
    }
    .studio-preview-note strong { font-size: 9px; }
    .studio-preview-note span { font-size: 8px; }

    .studio-preview-column {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        padding: 11px;
        border: 1px solid #dce6f3;
        border-radius: 12px;
        background: #f8fbff;
    }
    .studio-panel-heading { margin-bottom: 7px; }
    .studio-panel-heading h2 { font-size: 13px; }
    .studio-preview-stage { padding: 9px; background: #eaf1fb; }
    .studio-facebook-card { border-radius: 12px; }

    .studio-fields-column {
        grid-column: 2;
        grid-row: 2;
        min-height: 0;
        overflow: auto;
        padding: 0 3px 0 0;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
    .studio-form-grid { gap: 8px; }
    .studio-card {
        padding: 10px;
        border-color: #dfe7f1;
        border-radius: 10px;
        box-shadow: 0 3px 10px #21426908;
    }
    .studio-card-heading { margin-bottom: 6px; }
    .studio-card-heading h2 { font-size: 13px; }
    .studio-goal-option { min-height: 52px; padding: 7px 9px; }
    .studio-goal-option strong { font-size: 10px; }
    .studio-goal-option small { font-size: 8px; }
    .studio-card-goal .studio-helper { margin-top: 5px; font-size: 8px; }
    .studio-label { margin-top: 6px; }
    .studio-input { min-height: 32px; padding: 6px 8px; font-size: 10px; }
    .studio-textarea { min-height: 76px; }
    .studio-upload-control { margin-top: 6px; padding: 7px; }
    .studio-campaign-grid { gap: 7px; padding: 0 10px 10px; }
    .studio-campaign-grid > div { min-width: 0; }
    .studio-save-bar { min-height: 60px; padding: 7px 13px; }

    @media (max-width: 1100px) {
        .studio-creative-picker {
            grid-template-columns: minmax(120px, .7fr) repeat(3, minmax(100px, 1fr));
        }
        .studio-preview-note { display: none; }
        .studio-creative-option { grid-template-columns: 34px minmax(0, 1fr) 14px; }
        .studio-creative-thumb { width: 34px; height: 38px; }
    }
}

/* V2 editor hierarchy: choices form a short band; the ad and its copy controls
   share the left workspace while property, destination and campaign setup stay
   together in a separately scrollable right rail. */
@media (min-width: 801px) {
    .ad-studio-page {
        --studio-blue: #2865d6;
        --studio-line: #dce5ef;
        background: #edf2f8;
    }
    .studio-progress-header { background: #f8fafc; }
    .studio-workspace {
        grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 11px;
        padding: 10px 14px;
        background: #edf2f8;
    }
    .studio-creative-picker {
        grid-column: 1 / -1;
        grid-row: 1;
        display: grid;
        grid-template-columns: minmax(175px, .72fr) repeat(3, minmax(125px, 1fr)) minmax(130px, .62fr);
        grid-template-rows: auto auto;
        align-items: center;
        gap: 5px 10px;
        min-height: 74px;
        padding: 8px 12px;
        border-color: #d7e1ed;
        background: #f8fafc;
        box-shadow: 0 3px 12px #213b5d08;
    }
    .studio-creative-picker > .studio-eyebrow { grid-column: 1; grid-row: 1; align-self: end; }
    .studio-creative-picker h1 { grid-column: 1; grid-row: 2; margin: 0; font-size: 16px; }
    .studio-creative-picker > p { display: none; }
    .studio-creative-option {
        grid-row: 1 / 3;
        min-height: 56px;
        grid-template-columns: 44px minmax(0,1fr) 16px;
        padding: 6px;
        border-color: #e0e7ef;
        background: #fff;
    }
    .studio-creative-thumb { width: 44px; height: 43px; }
    .studio-creative-option strong { font-size: 10px; }
    .studio-creative-option small { font-size: 8px; }
    .studio-preview-note {
        grid-column: 5;
        grid-row: 1 / 3;
        margin: 0;
        padding: 8px;
        border-color: #dfe7ef;
        background: #f0f4f7;
    }
    .studio-preview-column {
        grid-column: 1;
        grid-row: 2;
        min-height: 0;
        overflow: auto;
        padding: 12px;
        border-color: #d8e2ed;
        background: #f8fafc;
        scrollbar-gutter: stable;
    }
    .studio-preview-stage {
        flex: 0 0 420px;
        min-height: 0;
        padding: 10px;
        background: #e6ecf3;
    }
    .studio-preview-stage.is-feed { flex-basis: 420px; }
    .studio-facebook-card { width: min(100%, 350px); }
    .studio-photo-frame { height: clamp(160px, 17vh, 175px); aspect-ratio: auto; }
    .studio-copy-under-preview {
        flex: 0 0 auto;
        margin-top: 4px;
        padding: 9px 10px;
        border-color: #d8e2ed;
        background: #fff;
        box-shadow: 0 3px 12px #213b5d08;
    }
    .studio-copy-under-preview .studio-textarea {
        height: 64px;
        min-height: 64px;
        resize: vertical;
    }
    .studio-copy-under-preview .studio-label { margin-top: 3px; }
    .studio-copy-under-preview .studio-copy-carousel { margin: 3px 0; padding: 2px; }
    .studio-real-photo-warning { margin-top: 7px; padding: 6px 9px; }
    .studio-fields-column {
        grid-column: 2;
        grid-row: 2;
        min-height: 0;
        overflow: auto;
        padding-right: 3px;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
    .studio-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .studio-card { padding: 11px; border-color: #dce5ef; background: #fff; }
    .studio-card-goal { grid-column: 1 / -1; grid-row: 1; }
    .studio-card-property { grid-column: 1; grid-row: 2; }
    .studio-card-photo { grid-column: 1; grid-row: 3; }
    .studio-card-brand { grid-column: 2; grid-row: 2 / span 2; }
    .studio-card-campaign { grid-column: 1 / -1; grid-row: 4; }
    .studio-campaign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .studio-save-bar { min-height: 62px; }
}
@media (min-width: 801px) and (max-width: 1100px) {
    .studio-workspace { grid-template-columns: minmax(0, 1fr) minmax(365px, 1fr); gap: 8px; padding: 8px; }
    .studio-creative-picker { grid-template-columns: minmax(140px, .7fr) repeat(3, minmax(90px, 1fr)); }
    .studio-preview-note { display: none; }
    .studio-creative-option { grid-template-columns: 34px minmax(0,1fr) 13px; }
    .studio-creative-thumb { width: 34px; height: 36px; }
}
@media (max-width: 800px) {
    .studio-copy-under-preview { margin-top: 10px; }
    .studio-preview-column { overflow: visible; }
}

@media (min-width: 801px) {
    .studio-creative-picker {
        grid-template-columns: minmax(145px, .62fr) repeat(3, minmax(100px, .82fr)) minmax(345px, 1.8fr);
    }
    .studio-creative-picker > .studio-band-goal-card {
        grid-column: 5;
        grid-row: 1 / 3;
        display: block;
        min-width: 0;
        margin: 0;
        padding: 9px 10px;
        border-color: #d9e3ed;
        border-radius: 9px;
        background: #fff;
        box-shadow: none;
    }
    .studio-creative-picker > .studio-band-goal-card .studio-card-heading { margin-bottom: 5px; }
    .studio-creative-picker > .studio-band-goal-card .studio-card-heading h2 { margin: 2px 0 0; font-size: 12px; }
    .studio-creative-picker > .studio-band-goal-card .studio-goal-options { gap: 6px; }
    .studio-creative-picker > .studio-band-goal-card .studio-goal-option {
        min-height: 43px;
        padding: 6px 7px;
        gap: 3px;
    }
    .studio-creative-picker > .studio-band-goal-card .studio-goal-option strong { font-size: 9px; }
    .studio-creative-picker > .studio-band-goal-card .studio-goal-option small { font-size: 7px; line-height: 1.25; }
    .studio-creative-picker > .studio-band-goal-card .studio-helper { margin-top: 4px; font-size: 7px; }
    .studio-creative-picker > .studio-band-goal-card .studio-destination-settings { gap: 6px; margin-top: 7px; padding-top: 7px; }
    .studio-creative-picker > .studio-band-goal-card .studio-property-page-editor { padding: 7px; }
    .studio-creative-picker > .studio-band-goal-card .studio-preview-note { display: none; }
    .studio-preview-note { display: none; }
}
@media (min-width: 801px) and (max-width: 1100px) {
    .studio-creative-picker {
        grid-template-columns: minmax(125px, .55fr) repeat(3, minmax(82px, .8fr)) minmax(300px, 1.8fr);
    }
    .studio-creative-picker > .studio-band-goal-card { padding: 7px; }
    .studio-creative-picker > .studio-band-goal-card .studio-goal-option { min-height: 40px; padding: 5px; }
}
@media (max-width: 800px) {
    .studio-creative-picker > .studio-band-goal-card {
        grid-column: 1 / -1;
        grid-row: auto;
        width: 100%;
        margin: 0;
    }
    .studio-creative-picker > .studio-band-goal-card .studio-goal-options { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Signed-in V2 Ad Studio: align the editor with the guest workspace without
   changing its authenticated controls, form fields, or publishing workflow. */
.ad-studio-page {
    --studio-blue: #1765e8;
    --studio-line: #d9e4f1;
    --studio-muted: #687a91;
    background: #edf3fc;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ad-studio-page .studio-eyebrow { color: #2865d6; }
.ad-studio-page .studio-creative-picker h1,
.ad-studio-page .studio-panel-heading h2,
.ad-studio-page .studio-card-heading h2 { color: #17469e; }
.ad-studio-page .studio-progress-header {
    background: #f8fbff;
    border-color: #dce6f2;
    box-shadow: 0 2px 8px #1d3e6408;
}
.ad-studio-page .studio-progress-step.is-current {
    border-color: #1765e8;
    background: #1765e8;
    color: #fff;
}
.ad-studio-page .studio-progress-step.is-current b { color: #fff; }
.ad-studio-page .studio-creative-option.is-selected {
    border-color: #1765e8;
    background: #edf4ff;
    box-shadow: 0 0 0 1px #1765e8;
}
.ad-studio-page .studio-goal-option.is-selected {
    border-color: #1765e8;
    background: #dce8fc;
    color: var(--studio-ink);
    box-shadow: 0 0 0 1px #1765e8;
}
.ad-studio-page .studio-goal-option.is-selected small { color: var(--studio-muted); }
.ad-studio-page .studio-preview-switch button.is-active,
.ad-studio-page .studio-carousel-next,
.ad-studio-page .studio-button-blue,
.ad-studio-page .studio-preview-cta {
    background: #1765e8;
    color: #fff;
}
.ad-studio-page .studio-preview-switch button.is-active { border-color: #1765e8; }
.ad-studio-page .studio-card,
.ad-studio-page .studio-preview-column,
.ad-studio-page .studio-creative-picker {
    border-color: #d7e3f1;
    box-shadow: 0 3px 12px #21426908;
}
.ad-studio-page .studio-card-heading h2 { font-weight: 760; }
.ad-studio-page .studio-label { color: #3d506b; font-size: 10px; }
.ad-studio-page .studio-input { color: #1b2d46; }
.ad-studio-page .studio-check-row { color: #465b75; }
.ad-studio-page .studio-save-bar {
    border-color: #d8e3ef;
    background: #f8fbff;
}

@media (min-width: 801px) {
    .ad-studio-page .studio-progress-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .ad-studio-page .studio-progress-header-main { flex: 1 1 auto; }
    .ad-studio-page .studio-progress-row { flex: 0 0 auto; justify-content: flex-end; }
    .ad-studio-page .studio-steps { display: none; }
    .ad-studio-page .studio-connection-state { white-space: nowrap; }
    .ad-studio-page .studio-workspace {
        grid-template-columns: minmax(0, 1.12fr) minmax(365px, .88fr);
        gap: 10px;
        padding: 9px 12px;
    }
    .ad-studio-page .studio-preview-column {
        overflow: auto;
        scrollbar-gutter: stable;
        padding: 10px;
    }
    .ad-studio-page .studio-preview-stage {
        flex: 0 0 auto;
        min-height: 0;
        padding: 9px;
    }
    .ad-studio-page .studio-facebook-card { width: min(100%, 360px); }
    .ad-studio-page .studio-photo-frame {
        height: clamp(150px, 22vh, 220px);
        aspect-ratio: auto;
    }
    .ad-studio-page .studio-copy-under-preview {
        flex: 0 0 auto;
        margin-top: 8px;
        background: #fff;
    }
    .ad-studio-page .studio-fields-column {
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
    .ad-studio-page .studio-form-grid { gap: 8px; }
    .ad-studio-page .studio-card { padding: 10px; }
    .ad-studio-page .studio-card-campaign { grid-column: 1 / -1; }
    .ad-studio-page .studio-campaign-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 8px;
    }
    .ad-studio-page .studio-account-settings {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 0;
    }
    .ad-studio-page .studio-campaign-module {
        min-width: 0;
        padding: 9px;
        border: 1px solid #dce6f2;
        border-radius: 9px;
        background: #f8fbff;
    }
    .ad-studio-page .studio-campaign-module-title {
        display: block;
        margin-bottom: 4px;
        color: #17469e;
        font-size: 11px;
        line-height: 1.25;
    }
    .ad-studio-page .studio-location-fields,
    .ad-studio-page .studio-budget-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
    .ad-studio-page .studio-campaign-names { grid-column: 1 / -1; }
    .ad-studio-page .studio-campaign-grid small { font-size: 9px; }
}

@media (max-width: 800px) {
    .ad-studio-page .studio-preview-column,
    .ad-studio-page .studio-fields-column { overflow: visible; }
    .ad-studio-page .studio-account-settings,
    .ad-studio-page .studio-location-fields,
    .ad-studio-page .studio-budget-fields {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ad-studio-page .studio-campaign-module { width: 100%; }
    .ad-studio-page .studio-campaign-grid { grid-template-columns: 1fr; }
    .ad-studio-page .studio-campaign-module-title { font-size: 12px; }
    .ad-studio-page .studio-save-bar {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}
@media (max-width: 520px) {
    .ad-studio-page .studio-account-settings,
    .ad-studio-page .studio-location-fields,
    .ad-studio-page .studio-budget-fields { grid-template-columns: 1fr; }
}

/* Signed-in Ad Studio uses the same card composition as the guest preview. */
.ad-studio-page .studio-form-grid {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.ad-studio-page .studio-card-property,
.ad-studio-page .studio-card-brand,
.ad-studio-page .guest-destination-card,
.ad-studio-page .studio-card-campaign {
    width: 100%;
    grid-column: auto;
    grid-row: auto;
}

.ad-studio-page .guest-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.ad-studio-page .guest-card-heading > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ad-studio-page .guest-card-icon {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #dce7f7;
    border-radius: 8px;
    background: #f3f7ff;
    color: #2463d3;
    font-size: 16px;
}

.ad-studio-page .guest-section-title {
    color: #153b7a;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.2;
}

.ad-studio-page .guest-card-heading small {
    display: block;
    margin-top: 2px;
    color: #78869a;
    font-size: 10px;
}

.ad-studio-page .guest-property-summary {
    display: grid;
    grid-template-columns: minmax(88px, 108px) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ad-studio-page .guest-property-summary > img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    background: #e9eff8;
}

.ad-studio-page .guest-property-summary > img[hidden] { display: none; }

.ad-studio-page .guest-property-facts {
    display: grid;
    min-width: 0;
    gap: 3px;
    color: #526176;
    font-size: 11px;
}

.ad-studio-page .guest-property-facts > strong {
    overflow: hidden;
    color: #172b49;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-studio-page .guest-property-facts > span { overflow-wrap: anywhere; }

.ad-studio-page .guest-property-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.ad-studio-page .guest-property-meta b {
    color: #152a45;
    font-size: 13px;
}

.ad-studio-page .guest-property-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.ad-studio-page .guest-property-actions .studio-button {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 10px;
}

.ad-studio-page .guest-upload-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.ad-studio-page .guest-upload-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ad-studio-page .guest-property-toggles {
    display: grid;
    gap: 3px;
    margin-top: 7px;
}

.ad-studio-page .guest-property-toggles .studio-check-row {
    margin: 0;
    font-size: 10px;
}

.ad-studio-page .guest-property-toggles .studio-subcheck { padding-left: 19px; }

.ad-studio-page .studio-property-editor {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5ebf3;
}

.ad-studio-page .studio-property-editor[hidden] { display: none; }

.ad-studio-page .studio-property-editor [data-listing-property-fields] {
    display: grid;
    gap: 7px;
}

.ad-studio-page .studio-property-editor .studio-input {
    min-height: 34px;
    padding: 7px 9px;
}

.ad-studio-page .studio-property-editor .studio-field-pair { margin: 0; }

.ad-studio-page .studio-card-brand .guest-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: #34445b;
    font-size: 10px;
    cursor: pointer;
}

.ad-studio-page .guest-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ad-studio-page .guest-switch-track {
    position: relative;
    flex: 0 0 30px;
    width: 30px;
    height: 17px;
    border-radius: 99px;
    background: #aeb9c9;
    transition: background .15s ease;
}

.ad-studio-page .guest-switch-track::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    content: "";
    transition: transform .15s ease;
}

.ad-studio-page .guest-switch input:checked + .guest-switch-track { background: #2865d7; }
.ad-studio-page .guest-switch input:checked + .guest-switch-track::after { transform: translateX(13px); }
.ad-studio-page .guest-switch input:focus-visible + .guest-switch-track { outline: 2px solid #152a45; outline-offset: 2px; }

.ad-studio-page .guest-agent-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px;
    border-radius: 8px;
    background: #172d4b;
    color: #fff;
}

.ad-studio-page .guest-agent-summary > img,
.ad-studio-page .guest-agent-summary > .studio-agent-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.ad-studio-page .guest-agent-summary > span:not(.studio-agent-avatar) {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
}

.ad-studio-page .guest-agent-summary strong,
.ad-studio-page .guest-agent-summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-studio-page .guest-agent-summary strong { font-size: 10px; }
.ad-studio-page .guest-agent-summary small { color: #d2dced; font-size: 9px; }
.ad-studio-page .guest-agent-summary .studio-page-action { flex: 0 0 auto; color: #fff; border-color: #ffffff55; }
.ad-studio-page .studio-agent-upload { margin-top: 7px; }
.ad-studio-page .studio-agent-upload .studio-button { font-size: 10px; }
.ad-studio-page .studio-card-brand > .studio-helper { margin: 6px 0 0; font-size: 9px; }

.ad-studio-page .guest-destination-card .studio-destination-settings {
    display: grid;
    gap: 8px;
}

.ad-studio-page .guest-destination-card .studio-goal-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-studio-page .guest-destination-card .studio-goal-option { padding: 8px; }
.ad-studio-page .guest-destination-card .studio-goal-option small { font-size: 9px; }

.ad-studio-page .studio-preview-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding: 3px 2px;
}

.ad-studio-page .studio-copy-choices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    color: #40516a;
    font-size: 10px;
}

.ad-studio-page .studio-copy-choices > span { margin-right: 3px; font-weight: 650; }

.ad-studio-page .studio-copy-choices > button {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid #cfd8e6;
    border-radius: 7px;
    background: #fff;
    color: #1b365c;
    font-size: 10px;
    font-weight: 700;
}

.ad-studio-page .studio-copy-choices > button.is-active {
    border-color: #2865d7;
    background: #2865d7;
    color: #fff;
}

.ad-studio-page .studio-copy-choices > button:disabled { opacity: .42; }

.ad-studio-page .studio-image-format-control {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #40516a;
    font-size: 10px;
    font-weight: 650;
}

.ad-studio-page .studio-image-format-control .studio-input {
    width: auto;
    min-width: 126px;
    min-height: 28px;
    padding: 4px 7px;
    font-size: 10px;
}

.ad-studio-page .studio-cta-control {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #40516a;
    font-size: 10px;
    font-weight: 650;
}

.ad-studio-page .studio-cta-control .studio-input {
    width: auto;
    min-width: 116px;
    min-height: 28px;
    padding: 4px 7px;
    font-size: 10px;
}

.ad-studio-page .studio-copy-editor { flex: 0 0 100%; min-width: 0; }

.ad-studio-page .studio-copy-editor > summary {
    width: fit-content;
    padding: 2px 0;
    color: #1d5ecb;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
}

.ad-studio-page .studio-copy-editor > summary::-webkit-details-marker { display: none; }

.ad-studio-page .studio-copy-editor-content {
    display: grid;
    gap: 7px;
    margin-top: 7px;
    padding: 10px;
    border: 1px solid #dce5f1;
    border-radius: 9px;
    background: #fff;
}

.ad-studio-page .studio-copy-editor-content .studio-field-pair { margin: 0; }

@media (min-width: 801px) {
    .ad-studio-page .studio-facebook-card { width: min(100%, 350px); }
    .ad-studio-page .studio-photo-frame { height: auto; aspect-ratio: 1 / 1; }
}

@media (max-width: 800px) {
    .ad-studio-page .guest-property-summary { grid-template-columns: 88px minmax(0, 1fr); }
    .ad-studio-page .studio-preview-controls-row { justify-content: flex-start; }
    .ad-studio-page .guest-destination-card .studio-goal-options { grid-template-columns: 1fr; }
}
