/* Advertiser portal styles, matching /advertise.html.
   Bitter display + Outfit body, mint/green palette, pill buttons, rounded cards. */

:root {
    --sq-50: #F3FAF6;
    --sq-100: #E8F5EE;
    --sq-200: #d3ecdc;
    --sq-400: #4DB87A;
    --sq-500: #2D9D5F;
    --sq-600: #1E7A4A;
    --sq-700: #1A5C3A;
    --sq-900: #0D3320;
    --sq-text: #1a1a1a;
    --sq-muted: #64748b;
    --sq-line: #e5e7eb;
    --sq-radius: 14px;
    --sq-radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', -apple-system, system-ui, sans-serif;
    color: var(--sq-text);
    background: #fff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--sq-600); }
a:hover { color: var(--sq-700); }

.portal-container,
.editor-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

.editor-container { max-width: 1240px; }

/* ── Top brand bar (portal + editor) ──────────────────────────── */

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    text-align: left;
    justify-content: flex-start;
    border-bottom: 1px solid var(--sq-line);
}

.brand img {
    height: 26px;
    width: auto;
    margin: 0;
    vertical-align: middle;
}

.brand h4 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: var(--sq-muted);
    letter-spacing: 0.005em;
}

.brand-divider {
    color: var(--sq-line);
    font-size: 1.2rem;
    line-height: 1;
}

.brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--sq-line);
}

.editor-header a.text-muted {
    color: var(--sq-muted) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
}

.editor-header a.text-muted:hover { color: var(--sq-700) !important; }

#loading {
    text-align: center;
    padding: 6rem 1rem;
    color: var(--sq-muted);
}

/* ── Cards (sign-in / profile setup) ──────────────────────────── */

.portal-card {
    max-width: 480px;
    margin: 3rem auto;
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius);
    box-shadow: 0 1px 2px rgba(13, 51, 32, 0.04);
    padding: 2.25rem 2rem !important;
}

.portal-card h5 {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--sq-text);
    margin-bottom: 0.5rem;
}

.portal-card p.text-muted {
    color: var(--sq-muted) !important;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ── Form controls ────────────────────────────────────────────── */

.form-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sq-text);
    margin-bottom: 0.35rem;
}

.form-control,
.editor-form .form-control {
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius-sm);
    padding: 0.7rem 0.9rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--sq-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.editor-form .form-control:focus {
    border-color: var(--sq-400);
    box-shadow: 0 0 0 3px rgba(77, 184, 122, 0.18);
    outline: none;
}

.form-text {
    color: var(--sq-muted);
    font-size: 0.82rem;
}

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border-radius: 999px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.94rem;
    border: 1px solid transparent;
    transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:focus { box-shadow: 0 0 0 3px rgba(77, 184, 122, 0.22); outline: none; }

.btn-primary {
    background: var(--sq-700);
    color: #fff;
    border-color: var(--sq-700);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--sq-600);
    border-color: var(--sq-600);
    color: #fff;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--sq-400);
    color: var(--sq-900);
    border-color: var(--sq-400);
}

.btn-success:hover {
    background: #6ed096;
    color: var(--sq-900);
    border-color: #6ed096;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: #fff;
    border-color: var(--sq-line);
    color: var(--sq-text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--sq-50);
    border-color: var(--sq-200);
    color: var(--sq-text);
}

.btn-outline-dark {
    background: #fff;
    border-color: var(--sq-text);
    color: var(--sq-text);
}

.btn-outline-dark:hover {
    background: var(--sq-text);
    color: #fff;
}

/* Google/Apple sign-in buttons: white with a clear (not hairline) border and an
   icon sitting to the left of the label. */
.btn-social {
    background: #fff;
    border-color: #cbd5e1;
    color: var(--sq-text);
}
.btn-social:hover,
.btn-social:focus {
    background: var(--sq-50);
    border-color: var(--sq-500);
    color: var(--sq-text);
}
.btn-social svg { flex-shrink: 0; }

.btn-outline-danger {
    background: #fff;
    border-color: #ef4444;
    color: #b91c1c;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.btn-link {
    background: transparent;
    color: var(--sq-600);
    border: none;
    padding: 0;
    font-weight: 500;
    border-radius: 0;
}

.btn-link:hover { color: var(--sq-700); text-decoration: underline; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

.w-100 { width: 100%; }

/* Sign-in divider */

.signin-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sq-muted);
    font-size: 0.85rem;
    margin: 1.25rem 0 0.9rem;
    gap: 0.85rem;
}

.signin-divider::before,
.signin-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--sq-line);
}

/* ── Dashboard ────────────────────────────────────────────────── */

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 2.5rem;
    flex-wrap: wrap;
}

.dashboard-header .text-muted {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sq-muted) !important;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

#dashboard-brand-name {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--sq-text);
}

.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--sq-50);
    border: 1px solid var(--sq-200);
    border-radius: var(--sq-radius);
}

.empty-state h3 {
    font-family: 'Bitter', serif;
    font-weight: 800;
    font-size: 1.9rem;
    color: var(--sq-text);
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--sq-muted);
    margin-bottom: 1.5rem;
}

.ad-group {
    margin-bottom: 2.5rem;
}

.ad-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--sq-text);
    margin-bottom: 1rem;
    letter-spacing: -0.005em;
}

.ad-group-title .badge {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.badge.bg-success { background: var(--sq-600) !important; color: #fff; }
.badge.bg-warning { background: #d97706 !important; color: #fff !important; }
.badge.bg-danger { background: #dc2626 !important; color: #fff; }
.badge.bg-secondary { background: var(--sq-muted) !important; color: #fff; }
.badge.bg-info { background: #0369a1 !important; color: #fff !important; }

.ad-group-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ad-card {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.ad-card:hover {
    transform: translateY(-2px);
    border-color: var(--sq-200);
    box-shadow: 0 14px 36px rgba(13, 51, 32, 0.07);
    color: inherit;
}

.admin-preview-banner {
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: var(--sq-radius-sm);
    padding: 0.8rem 1.1rem;
    margin-bottom: 1.5rem;
    color: #92400e;
    font-size: 0.92rem;
}

.admin-preview-banner strong {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    margin-right: 0.4rem;
}

.ad-card-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--sq-radius-sm);
    flex-shrink: 0;
    background: var(--sq-50);
    border: 1px solid var(--sq-line);
}

.ad-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ad-card-title {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--sq-text);
    margin-bottom: 0.25rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-card-meta {
    color: var(--sq-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.ad-card-stats {
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--sq-muted);
    font-variant-numeric: tabular-nums;
}

.ad-card-stats strong {
    color: var(--sq-text);
    font-weight: 600;
    margin-right: 0.25rem;
}

/* ── Editor ───────────────────────────────────────────────────── */

.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .editor-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

.editor-form {
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius);
    padding: 2rem 1.75rem;
    box-shadow: 0 1px 2px rgba(13, 51, 32, 0.03);
}

.editor-form h4 {
    font-family: 'Bitter', serif;
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--sq-text);
    margin-bottom: 1.25rem;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--sq-line);
    flex-wrap: wrap;
}

#ad-image-preview,
#ad-video-preview {
    max-width: 220px;
    max-height: 160px;
    border-radius: var(--sq-radius-sm);
    margin-top: 0.5rem;
    border: 1px solid var(--sq-line);
    background: #000;
}

.editor-preview {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .editor-preview { position: static; }
}

/* ── Preview frame + mode toggle ───────────────────────────── */

.preview-frame {
    background: var(--sq-50);
    border: 1px solid var(--sq-200);
    border-radius: var(--sq-radius);
    padding: 1rem 1rem 1.25rem;
}

.preview-toggle {
    display: inline-flex;
    gap: 0.2rem;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: 999px;
    padding: 4px;
}

.preview-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: transparent;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sq-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.preview-toggle button:hover { color: var(--sq-text); }

.preview-toggle button.active {
    background: var(--sq-700);
    color: #fff;
}

.preview-toggle-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ── Mobile preview: phone frame with feed context ─────────── */

.phone-frame {
    width: 320px;
    max-width: 100%;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 38px;
    padding: 8px;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.phone-screen {
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 9 / 19.5;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
}

.phone-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 22px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
    flex-shrink: 0;
}

.phone-statusbar-icons {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: 10px;
}

.phone-app-header {
    display: flex;
    justify-content: center;
    padding: 6px 0 10px;
    flex-shrink: 0;
}

.phone-app-header img {
    height: 22px;
    width: auto;
}

.phone-feed {
    flex: 1;
    overflow: hidden;
    padding-bottom: 4px;
}

.phone-section-label {
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
    padding: 6px 16px 4px;
}

.phone-section-label-faded {
    opacity: 0.4;
    margin-top: 14px;
}

/* Sample group card (decorative context above the ad) */

.phone-group-card {
    margin: 4px 12px 8px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.phone-group-card-img {
    height: 104px;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 6px 8px;
    background-image:
        linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0)),
        linear-gradient(180deg, #d6d2c5 0%, #c9b88a 50%, #f0e8d0 100%);
}

.phone-group-card-img-green {
    background-image:
        linear-gradient(135deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0)),
        linear-gradient(180deg, #5e9b6d 0%, #3a7a4d 60%, #1f5a3a 100%);
}

.phone-group-card-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--sq-700);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.phone-group-card-title {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
}

.phone-group-card-meta {
    padding: 7px 10px;
    font-size: 10px;
    color: #6b7280;
    line-height: 1.45;
}

/* Bottom tab bar */

.phone-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #fff;
    border-top: 1px solid #f1f1f1;
    padding: 6px 0 10px;
    flex-shrink: 0;
}

.phone-tabs span {
    text-align: center;
    font-size: 8.5px;
    color: #9ca3af;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.phone-tabs .phone-tab-active {
    color: var(--sq-600);
    font-weight: 600;
}

.phone-tab-icon {
    font-size: 14px;
    line-height: 1;
}

/* ── The real ad widget (shared mobile + web) ──────────────── */

.mobile-ad-slot {
    margin-top: 16px;
}

.web-ad-slot {
    margin-top: 16px;
}

/* Faded placeholder card under "Squabbit Showcase" */
.phone-showcase-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 12px 10px;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    opacity: 0.45;
}
.phone-showcase-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    flex: none;
    background: linear-gradient(180deg, #cdebd8, #8fd3a9);
}
.phone-showcase-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.phone-showcase-bar {
    height: 9px;
    border-radius: 4px;
    background: #e5e7eb;
    display: block;
}
.phone-showcase-bar.w-70 { width: 70%; }
.phone-showcase-bar.w-45 { width: 45%; }

.mobile-promoted-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 6px;
    color: #9e9e9e;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.mobile-dots {
    font-size: 15px;
    line-height: 1;
    color: #9e9e9e;
}

.mobile-ad-card {
    margin: 0 12px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.18);
}

.mobile-ad-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #e9ecef;
}

.mobile-ad-media img,
.mobile-ad-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mobile-ad-media-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 0.85rem;
}

.mobile-ad-content {
    padding: 12px 14px 14px;
}

.mobile-ad-company {
    font-size: 10px;
    font-weight: 600;
    color: #000;
    letter-spacing: 1.4px;
    line-height: 1.2;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-ad-title {
    font-family: 'Bitter', serif;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
    letter-spacing: -0.2px;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-ad-body {
    color: #616161;
    font-size: 11px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Web preview: browser chrome + Flutter web viewport ────── */

.web-stage {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--sq-line);
    box-shadow: 0 8px 28px -12px rgba(13, 51, 32, 0.2);
}

.browser-chrome {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: linear-gradient(180deg, #f0f1f3 0%, #e4e6ea 100%);
    border-bottom: 1px solid #d4d7dc;
}

.browser-controls {
    display: flex;
    gap: 6px;
}

.browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.browser-dot-red { background: #fc625d; }
.browser-dot-yellow { background: #fdbc40; }
.browser-dot-green { background: #34c749; }

.browser-address {
    flex: 1;
    background: #fff;
    border: 1px solid #d4d7dc;
    border-radius: 999px;
    padding: 5px 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 320px;
    margin: 0 auto;
}

.browser-lock {
    color: #34c749;
    font-size: 11px;
}

.browser-spacer {
    width: 54px;
    flex-shrink: 0;
}

.web-viewport {
    background: #f5f6f8;
    min-height: 420px;
    padding: 0;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.web-app-header {
    padding: 14px 0 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.web-app-header img {
    height: 26px;
}

.web-feed {
    max-width: 520px;
    margin: 0 auto;
    padding: 18px 0 28px;
}

.web-feed .phone-section-label {
    font-size: 13px;
    padding: 10px 16px 6px;
}

.web-feed-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 12px;
}

.web-feed-row .phone-group-card {
    margin: 4px 0 8px;
}

.web-feed-row .phone-group-card-img {
    height: 132px;
}

.web-feed-row .phone-group-card-title {
    font-size: 15px;
}

.web-feed-row .phone-group-card-meta {
    padding: 9px 12px;
    font-size: 11px;
}

.web-ad-slot {
    margin-top: 6px;
}

/* The Flutter app caps the card at maxWidth: 500dp on every platform.
   In the web preview the card stays the same size; the surrounding feed
   just has more whitespace around it. */
.web-feed .mobile-ad-title { font-size: 19px; }
.web-feed .mobile-ad-body { font-size: 13px; }
.web-feed .mobile-ad-company { font-size: 11px; }

/* ── Status banner ───────────────────────────────────────────── */

.status-banner {
    padding: 0.85rem 1.1rem;
    border-radius: var(--sq-radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    line-height: 1.5;
    border: 1px solid;
}

.status-banner.status-draft {
    background: #f9fafb;
    border-color: var(--sq-line);
    color: var(--sq-muted);
}

.status-banner.status-pending {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.status-banner.status-approved {
    background: var(--sq-50);
    border-color: var(--sq-200);
    color: var(--sq-700);
}

.status-banner.status-rejected {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* ── Stats panel ──────────────────────────────────────────────── */

.stats-panel {
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius);
    padding: 1.5rem 1.25rem;
}

.stats-title {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--sq-text);
    margin: 0 0 1rem;
    letter-spacing: -0.005em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.stat-tile {
    background: var(--sq-50);
    border: 1px solid var(--sq-200);
    border-radius: var(--sq-radius-sm);
    padding: 0.9rem 0.85rem;
    text-align: left;
}

.stat-tile-feature {
    background: var(--sq-700);
    border-color: var(--sq-700);
    color: #fff;
}

.stat-tile-feature .stat-label { color: rgba(255, 255, 255, 0.7); }
.stat-tile-feature .stat-value { color: #fff; }

.stat-value {
    font-family: 'Bitter', serif;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--sq-text);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--sq-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* ── Daily performance graph ─────────────────────────────────── */

.graph-canvas-wrap {
    position: relative;
    height: 240px;
    margin-top: 0.5rem;
}

/* ── Activity log (timeline) ─────────────────────────────────── */

.activity-log {
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius);
    padding: 1.5rem 1.25rem;
    margin-top: 1rem;
}

.activity-summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sq-700);
    background: var(--sq-50);
    border: 1px solid var(--sq-200);
    border-radius: var(--sq-radius-sm);
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
}

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-item {
    position: relative;
    padding: 0 0 1rem 1.25rem;
    border-left: 2px solid var(--sq-200);
}

.activity-item:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sq-500);
}

.activity-item-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--sq-text);
}

.activity-item-detail {
    font-size: 0.82rem;
    color: var(--sq-muted);
}

.activity-item-date {
    font-size: 0.72rem;
    color: var(--sq-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.1rem;
}

/* ── Alerts ──────────────────────────────────────────────────── */

.alert {
    border-radius: var(--sq-radius-sm);
    border: 1px solid;
    padding: 0.7rem 0.95rem;
    font-size: 0.9rem;
}

.alert-success { background: var(--sq-50); border-color: var(--sq-200); color: var(--sq-700); }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ── Small utilities used in HTML ────────────────────────────── */

.text-muted { color: var(--sq-muted) !important; }
.small { font-size: 0.85rem; }
.fw-semibold { font-weight: 600; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }

/* ── Country targeting picker ────────────────────────────────── */

.country-picker { position: relative; }

.country-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.country-chips:empty { display: none; }

.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    background: var(--sq-100);
    color: var(--sq-700);
    border: 1px solid var(--sq-200);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
}
.country-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--sq-600);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.country-chip button:hover { background: var(--sq-200); color: var(--sq-900); }

.country-options {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius-sm);
    box-shadow: 0 8px 24px rgba(13, 51, 32, 0.10);
}
.country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid var(--sq-50);
}
.country-option:last-child { border-bottom: none; }
.country-option:hover { background: var(--sq-50); }
.country-option.is-selected { color: var(--sq-700); font-weight: 500; }
.country-option .country-check {
    width: 16px;
    text-align: center;
    color: var(--sq-500);
}
.country-option-empty {
    padding: 12px;
    color: var(--sq-muted);
    font-size: 0.9rem;
}

/* ── Per-field show/hide toggles ─────────────────────────────── */

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
/* The label keeps its own bottom margin so the input spacing is unchanged. */
.field-label-row .form-label { margin-bottom: 0; }

.field-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    padding: 0;
    margin-bottom: 0.35rem;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius-sm);
    background: #fff;
    color: var(--sq-muted);
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.field-toggle svg { width: 16px; height: 16px; }
.field-toggle:hover { color: var(--sq-700); border-color: var(--sq-400); }
.field-toggle.is-off { color: var(--sq-muted); background: var(--sq-50); }
.field-toggle:disabled { opacity: 0.5; cursor: default; }
.field-toggle:focus-visible { outline: 2px solid var(--sq-400); outline-offset: 1px; }

/* A hidden field's input stays visible but reads as inactive. */
.field-input-hidden {
    opacity: 0.5;
    background: var(--sq-50);
}

/* ── Ad wallet balance card ──────────────────────────────────── */

.balance-card {
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius);
    padding: 18px 20px;
    margin-bottom: 1.25rem;
}
.balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.balance-amount {
    font-family: 'Bitter', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--sq-700);
    line-height: 1.1;
}
.add-funds-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--sq-line);
}
.fund-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.fund-presets .fund-preset { border-radius: 999px; }
.fund-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.fund-amount-group { max-width: 160px; }

.balance-card .btn-outline-primary {
    color: var(--sq-600);
    border-color: var(--sq-400);
}
.balance-card .btn-outline-primary:hover {
    background: var(--sq-600);
    border-color: var(--sq-600);
    color: #fff;
}

/* ── Funding step (ad editor) ────────────────────────────────── */

.funding-panel {
    margin-top: 1rem;
    padding: 20px;
    background: var(--sq-50);
    border: 1px solid var(--sq-200);
    border-radius: var(--sq-radius);
}
.funding-title {
    font-family: 'Bitter', serif;
    font-weight: 700;
    color: var(--sq-900);
    margin-bottom: 10px;
}
.funding-panel .fund-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.funding-panel .fund-preset { border-radius: 999px; }
.funding-panel .fund-amount-group { max-width: 160px; }
.funding-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
}
.funding-actions .btn-primary { margin-left: auto; }

/* ── Ad creation wizard ──────────────────────────────────────── */

.wizard-h1 { font-family: 'Bitter', serif; font-weight: 800; font-size: 1.7rem; color: var(--sq-900); margin: 0 0 4px; letter-spacing: -.01em; }
.wizard-sub { color: var(--sq-muted); font-size: .95rem; margin: 0 0 22px; }

.wsteps { display: flex; margin: 0 0 26px; }
.wstep { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.wstep .wrail { position: absolute; top: 17px; left: -50%; width: 100%; height: 2px; background: var(--sq-line); z-index: 0; }
.wstep:first-child .wrail { display: none; }
.wstep.done .wrail, .wstep.active .wrail { background: var(--sq-400); }
.wnode { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .95rem; position: relative; z-index: 1; background: #fff; border: 2px solid var(--sq-line); color: var(--sq-muted); }
.wstep.done .wnode { background: var(--sq-500); border-color: var(--sq-500); color: #fff; }
.wstep.done .wnode::after { content: '\2713'; }
.wstep.done .wnode { font-size: 0; }
.wstep.done .wnode::after { font-size: .95rem; }
.wstep.active .wnode { border-color: var(--sq-500); color: var(--sq-700); box-shadow: 0 0 0 4px var(--sq-100); }
.wstep .wlabel { margin-top: 9px; font-size: .82rem; font-weight: 600; color: var(--sq-muted); text-align: center; }
.wstep.active .wlabel { color: var(--sq-900); }
.wstep.done .wlabel { color: var(--sq-700); }

.step-h { font-family: 'Bitter', serif; font-weight: 700; font-size: 1.2rem; color: var(--sq-900); margin: 0 0 16px; }

/* Full-width form when the preview is hidden (steps 2-3). */
.editor-grid.single { grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; }

.wizard-nav { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.wizard-nav #wiz-next { margin-left: auto; }

/* Evaluating (AI check) */
.eval-card { display: none; flex-direction: column; align-items: center; text-align: center; background: #fff; border: 1px solid var(--sq-line); border-radius: var(--sq-radius); padding: 48px 24px; max-width: 520px; margin: 0 auto; }
.eval-spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--sq-100); border-top-color: var(--sq-500); animation: sq-spin 1s linear infinite; margin-bottom: 18px; }
@keyframes sq-spin { to { transform: rotate(360deg); } }
.eval-title { font-family: 'Bitter', serif; font-weight: 700; font-size: 1.15rem; color: var(--sq-900); }
.eval-sub { color: var(--sq-muted); font-size: .88rem; margin-top: 6px; max-width: 360px; }
.eval-chip { margin-top: 16px; font-size: .78rem; font-weight: 600; color: var(--sq-600); background: var(--sq-50); border: 1px solid var(--sq-200); border-radius: 999px; padding: 6px 14px; }
@media (prefers-reduced-motion: reduce) { .eval-spinner { animation: none; } }

/* Payment summary on the budget step */
.paybox { background: var(--sq-50); border: 1px solid var(--sq-200); border-radius: var(--sq-radius); padding: 14px 16px; margin-top: 18px; }
.payrow { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; padding: 3px 0; }
.payrow.total { font-weight: 700; color: var(--sq-900); border-top: 1px dashed var(--sq-200); margin-top: 6px; padding-top: 9px; }
.paynote { font-size: .8rem; color: var(--sq-muted); margin-top: 8px; }

/* ── Audience scope choice (Everywhere / Specific) ───────────── */

.audience-choice { display: flex; gap: 10px; }
.ac-opt {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius-sm);
    padding: 13px 15px;
    cursor: pointer;
    font-weight: 500;
    color: var(--sq-text);
    transition: border-color .12s, background .12s, box-shadow .12s;
}
.ac-opt input { accent-color: var(--sq-600); width: 16px; height: 16px; margin: 0; }
.ac-opt:hover { border-color: var(--sq-400); }
.ac-opt:has(input:checked) {
    border-color: var(--sq-500);
    background: var(--sq-50);
    color: var(--sq-700);
    box-shadow: 0 0 0 3px var(--sq-100);
}

/* ── Optional schedule (budget step) ─────────────────────────── */
.schedule-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--sq-line); }
.schedule-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Tabbed editor (existing/funded ad) ──────────────────────── */

/* Tab strip. An underline rides beneath the active tab; the whole strip
   scrolls sideways on narrow screens rather than wrapping. */
.editor-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--sq-line);
    margin: 0 0 26px;
    overflow-x: auto;
    scrollbar-width: none;
}
.editor-tabs::-webkit-scrollbar { display: none; }
.etab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 10px 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--sq-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: color .12s, border-color .12s;
}
.etab:hover { color: var(--sq-700); }
.etab.active { color: var(--sq-900); border-bottom-color: var(--sq-500); }
.etab:focus-visible { outline: 2px solid var(--sq-500); outline-offset: 2px; border-radius: 6px; }

/* Layout modes toggled per active tab: Creative keeps the two-column
   form+preview; the rest go full width with one column hidden. */
.editor-grid.only-form { grid-template-columns: 1fr; }
.editor-grid.only-form .editor-preview { display: none; }
.editor-grid.only-preview { grid-template-columns: 1fr; }
.editor-grid.only-preview .editor-form { display: none; }

/* Per-tab action row (Save creative / audience / schedule). */
.tab-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.tab-actions .btn-primary { margin-left: auto; }
.tab-warning {
    font-size: 0.83rem;
    color: var(--sq-700);
    background: var(--sq-50);
    border: 1px solid var(--sq-200);
    border-radius: var(--sq-radius-sm);
    padding: 10px 12px;
    margin-top: 16px;
}

/* ── Budget tab ──────────────────────────────────────────────── */

/* Spent / Budget pair with labels beneath, then a spend progress bar. */
.budget-stats { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 0.5rem; }
.budget-stat {
    display: grid;
    grid-template-columns: auto auto auto;
    column-gap: 0.7rem;
    align-items: baseline;
    justify-content: start;
}
.bs-val {
    font-family: 'Bitter', serif;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--sq-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.bs-slash { font-family: 'Bitter', serif; font-size: 1.5rem; font-weight: 400; color: var(--sq-200); }
.bs-label {
    font-size: 0.7rem;
    color: var(--sq-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
    margin-top: 0.2rem;
}
.budget-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--sq-100);
    overflow: hidden;
    margin: 0.25rem 0 0.5rem;
}
.budget-bar-fill { height: 100%; border-radius: 999px; background: var(--sq-500); transition: width .3s ease; }
.budget-views-note { font-size: 0.82rem; color: var(--sq-muted); }

.budget-increase {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--sq-line);
}
.budget-increase-title { font-family: 'Bitter', serif; font-weight: 700; font-size: 1.05rem; color: var(--sq-900); margin: 0 0 4px; }
.budget-increase .fund-amount-group { max-width: 160px; flex: 0 0 auto; }
.budget-add-row { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; margin-top: 10px; }

/* Compact budget summary shown on the Performance tab. */
.perf-budget {
    background: #fff;
    border: 1px solid var(--sq-line);
    border-radius: var(--sq-radius);
    padding: 1.5rem 1.25rem;
    margin-bottom: 1rem;
}
