:root,
[data-theme="light"] {
    --text-xs: clamp(0.75rem, 0.72rem + 0.12vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.84rem + 0.18vw, 1rem);
    --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.02rem + 0.45vw, 1.45rem);
    --text-xl: clamp(1.5rem, 1.15rem + 1vw, 2.15rem);
    --text-2xl: clamp(2rem, 1.4rem + 2vw, 3.6rem);

    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    --color-bg: #f7f6f2;
    --color-surface: #fbfaf7;
    --color-surface-2: #f1eee8;
    --color-surface-offset: #ebe7df;
    --color-border: rgba(40, 37, 29, .12);
    --color-divider: rgba(40, 37, 29, .08);
    --color-text: #211f1a;
    --color-text-muted: #6c6a64;
    --color-text-faint: #9d9992;
    --color-primary: #0f6d74;
    --color-primary-hover: #0a5459;
    --color-success: #437a22;
    --color-warning: #964219;
    --color-error: #a12c7b;
    --color-accent-soft: rgba(15, 109, 116, .08);
    --color-inverse: #ffffff;

    --radius-sm: .5rem;
    --radius-md: .8rem;
    --radius-lg: 1.1rem;
    --radius-xl: 1.5rem;
    --radius-full: 999px;

    --shadow-sm: 0 4px 12px rgba(27, 21, 14, .06);
    --shadow-md: 0 12px 32px rgba(27, 21, 14, .09);
    --shadow-lg: 0 24px 64px rgba(27, 21, 14, .12);

    --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
    --font-body: 'Satoshi', 'Inter', sans-serif;

    --container: 1220px;
    --transition: 180ms cubic-bezier(.16, 1, .3, 1);
}

[data-theme="dark"] {
    --color-bg: #141311;
    --color-surface: #1c1b18;
    --color-surface-2: #242320;
    --color-surface-offset: #2d2b28;
    --color-border: rgba(255, 255, 255, .10);
    --color-divider: rgba(255, 255, 255, .08);
    --color-text: #ede7de;
    --color-text-muted: #bbb4aa;
    --color-text-faint: #8c857b;
    --color-primary: #68aeb4;
    --color-primary-hover: #8fc6ca;
    --color-success: #77b54e;
    --color-warning: #d08a54;
    --color-error: #d163a7;
    --color-accent-soft: rgba(104, 174, 180, .12);
    --color-inverse: #111111;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, .25);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, .32);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .45);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-base);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

img,
iframe { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: .85rem 1rem;
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(15, 109, 116, .12);
}

textarea { resize: vertical; min-height: 110px; }

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--color-divider);
    font-size: var(--text-sm);
}

th {
    font-weight: 700;
    color: var(--color-text);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    background: var(--color-primary);
    color: #fff;
    padding: .75rem 1rem;
    border-radius: var(--radius-md);
    z-index: 99;
}

.container {
    width: min(calc(100% - 2rem), var(--container));
    margin: 0 auto;
}

.narrow { max-width: 920px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .75rem;
    border-radius: var(--radius-full);
    background: var(--color-accent-soft);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.12;
    font-family: var(--font-display);
    letter-spacing: -.02em;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p { margin: 0; color: var(--color-text-muted); }

.section {
    padding: clamp(3rem, 8vw, 6rem) 0;
}

.section-heading {
    margin-bottom: var(--space-10);
    display: grid;
    gap: var(--space-4);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--color-divider);
    backdrop-filter: blur(18px);
    background: color-mix(in srgb, var(--color-bg) 82%, transparent);
}

.glass {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-wrap,
.footer-wrap,
.cta-content,
.workspace-header,
.preview-toolbar,
.modal-head,
.ai-panel-head,
.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-wrap,
.footer-wrap {
    min-height: 64px;
    flex-wrap: nowrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    font-size: var(--text-sm);
}

.brand strong {
    display: block;
    color: var(--color-text);
    font-size: 1rem;
}

.brand span:not(.brand-mark) {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.brand-mark {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: .9rem;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-family: var(--font-display);
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), #1d98a0);
    box-shadow: var(--shadow-sm);
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: .75rem;
}

.theme-toggle,
.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: .9rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    display: grid;
    place-items: center;
}

.nav-actions,
.hero-actions,
.preview-toolbar-actions,
.auth-actions,
.footer-links {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}
@media (max-width: 980px) {
    /* existing rules stay, add these: */

    .site-header .btn-primary {
        padding: .6rem .85rem;
        font-size: var(--text-xs);
        min-height: 38px;
        border-radius: .75rem;
    }

    .brand > div > strong {
        font-size: .88rem;
    }

    .brand > div > span {
        display: none;        /* hide subtitle on mobile to save width */
    }
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .85rem 1.15rem;
    border-radius: .95rem;
    font-size: var(--text-sm);
    font-weight: 700;
    transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
    border: 1px solid transparent;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover { background: var(--color-primary-hover); }

.btn-secondary {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-ghost {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.btn-lg { padding-inline: 1.4rem; min-height: 50px; }
.btn-sm { min-height: 38px; padding: .6rem .9rem; font-size: var(--text-xs); }
.full { width: 100%; }
.mt-8 { margin-top: .5rem; }
.mt-16 { margin-top: 1rem; }

.hero-section {
    padding: clamp(4rem, 10vw, 8rem) 0 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr .95fr;
    gap: var(--space-12);
    align-items: center;
}

.hero-copy {
    display: grid;
    gap: var(--space-5);
}

.hero-text {
    font-size: var(--text-lg);
    max-width: 62ch;
}

.hero-metrics,
.feature-grid,
.steps-grid,
.admin-grid,
.payment-grid {
    display: grid;
    gap: var(--space-4);
}

.hero-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--space-4); }
.metric-card,
.feature-card,
.step-card,
.solution-card,
.pricing-card,
.control-card,
.form-panel,
.preview-panel,
.auth-card,
.admin-card,
.modal-card,
.ai-panel,
.pay-card,
.resume-window {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.metric-card,
.feature-card,
.step-card,
.solution-card,
.pricing-card,
.control-card,
.admin-card,
.pay-card {
    border-radius: var(--radius-xl);
    padding: 1.35rem;
}

.metric-card strong,
.step-card span,
.price,
.status-pill,
.badge {
    color: var(--color-text);
}

.hero-panel { position: relative; }

.resume-window {
    padding: 1rem;
    border-radius: 1.6rem;
    background:
        radial-gradient(circle at top right, rgba(15, 109, 116, .12), transparent 30%),
        var(--color-surface);
}

.window-top {
    display: flex;
    gap: .4rem;
    margin-bottom: 1rem;
}

.window-top span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--color-surface-offset);
}

.resume-preview-card {
    position: relative;
    min-height: 460px;
    padding: 1.4rem;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.preview-avatar {
    width: 74px;
    height: 74px;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--color-primary), rgba(15, 109, 116, .25));
}

.preview-lines,
.preview-section {
    display: grid;
    gap: .7rem;
    margin-bottom: 1.2rem;
}

.line {
    display: block;
    height: 11px;
    border-radius: 999px;
    background: rgba(15, 109, 116, .12);
}

.line.lg { width: 90%; height: 13px; }
.line.sm { width: 55%; }

.floating-chip,
.status-pill,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .4rem .75rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-xs);
}

.floating-chip {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.problem-grid,
.steps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.solution-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: var(--space-4);
}

.solution-card.highlighted,
.pricing-card.featured,
.pay-card.selected {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 9%, var(--color-surface)), var(--color-surface));
    border-color: rgba(15, 109, 116, .22);
}

.video-card {
    display: grid;
    gap: 1rem;
}

.video-frame {
    overflow: hidden;
    border-radius: 1.4rem;
    border: 1px solid var(--color-border);
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.step-card span {
    width: 2.2rem;
    height: 2.2rem;
    background: var(--color-accent-soft);
    color: var(--color-primary);
    border-radius: .75rem;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
}

.pricing-vertical {
    display: grid;
    gap: 1rem;
}

.pricing-card { position: relative; }
.pricing-card ul {
    margin: 1rem 0 1.3rem;
    padding-left: 1rem;
    color: var(--color-text-muted);
}
.pricing-card li { margin: .45rem 0; }
.price {
    margin-top: .75rem;
    font-size: clamp(2rem, 2vw, 2.6rem);
    font-family: var(--font-display);
}
.price span {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.cta-band {
    border-top: 1px solid var(--color-divider);
    border-bottom: 1px solid var(--color-divider);
    background: linear-gradient(180deg, transparent, var(--color-accent-soft));
}

.site-footer {
    padding: 1rem 0 2rem;
}

.footer-links a { color: var(--color-text-muted); }

.app-shell {
    display: grid;
    grid-template-columns: 330px 1fr;
    min-height: 100vh;
}

.sidebar {
    border-right: 1px solid var(--color-divider);
    background: color-mix(in srgb, var(--color-surface) 93%, var(--color-bg));
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}

.workspace {
    padding: 1.5rem;
    overflow: hidden;
}

.workspace-header {
    margin-bottom: 1rem;
}

.header-status {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.status-pill {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.status-pill.muted {
    color: var(--color-text-muted);
}

.control-stack,
.stack-form,
.auth-form {
    display: grid;
    gap: .9rem;
}

.control-card small,
.muted {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.template-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.template-btn {
    min-height: 44px;
    padding: .7rem .8rem;
    border-radius: .85rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    font-size: var(--text-sm);
    font-weight: 700;
}

.template-btn.active {
    border-color: rgba(15, 109, 116, .35);
    background: var(--color-accent-soft);
    color: var(--color-primary);
}

.template-btn.premium {
    position: relative;
}

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
}

.switch-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
}

.builder-content {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) 520px;
    gap: 1rem;
    min-height: calc(100vh - 180px);
}

.form-panel,
.preview-panel {
    border-radius: 1.3rem;
    overflow: hidden;
}

.form-panel { padding: 1.25rem; }
.preview-panel { display: flex; flex-direction: column; }

.preview-toolbar {
    padding: 1rem 1rem 0;
}

#previewFrame {
    width: 100%;
    min-height: 840px;
    border: 0;
    background: #fff;
    border-radius: 0 0 1.3rem 1.3rem;
}

.progress-wrap {
    margin-bottom: 1rem;
}

.step-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.step-tab {
    padding: .8rem 1rem;
    border-radius: .85rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-weight: 700;
    font-size: var(--text-sm);
}

.step-tab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.step-panel {
    display: grid;
    gap: 1rem;
}

.grid-2,
.grid-3 {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.repeat-list {
    display: grid;
    gap: 1rem;
}

.repeat-item {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: var(--color-surface-2);
}

.inline-actions,
.form-nav,
.coupon-inline {
    display: flex;
    gap: .75rem;
    align-items: center;
}

.form-nav {
    justify-content: space-between;
    margin-top: 1rem;
}

.photo-preview {
    width: 88px;
    height: 88px;
    border-radius: 1rem;
    background: var(--color-surface-offset);
    object-fit: cover;
    border: 1px solid var(--color-border);
}

.shape-options {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.shape-option {
    padding: .65rem .9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    font-size: var(--text-sm);
}

.shape-option.active {
    color: var(--color-primary);
    background: var(--color-accent-soft);
    border-color: rgba(15, 109, 116, .3);
}

.floating-ai {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 80;
}

.floating-ai-toggle {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
}

.floating-ai-panel {
    width: min(360px, calc(100vw - 2rem));
    margin-bottom: .8rem;
    border-radius: 1.2rem;
    overflow: hidden;
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.ai-panel-head,
.ai-panel-body {
    padding: 1rem;
}

.ai-panel-body {
    display: grid;
    gap: .7rem;
    max-height: 65vh;          /* cap height to viewport */
    overflow-y: auto;          /* scroll when content is tall */
    overscroll-behavior: contain;
    padding-bottom: 4rem;      /* reserve space for the bottom close button */
}
.ai-panel-close-bottom {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: .75rem 1rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-divider);
    text-align: center;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 0 0 1.2rem 1.2rem;
    transition: background var(--transition), color var(--transition);
}

.ai-panel-close-bottom:hover {
    background: var(--color-surface-offset);
    color: var(--color-text);
}

.ai-results {
    display: grid;
    gap: .6rem;
}

.ai-result-item {
    padding: .85rem 1rem;
    border-radius: 1rem;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    font-size: var(--text-sm);
}

.hidden { display: none !important; }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 8, 10, .55);
    display: grid;
    place-items: center;
    padding: 1rem;
    z-index: 100;
}

.modal-card {
    width: min(680px, 100%);
    border-radius: 1.2rem;
    overflow: hidden;
}

.modal-head,
.modal-body {
    padding: 1rem 1.2rem;
}

.alert {
    padding: .9rem 1rem;
    border-radius: 1rem;
    font-size: var(--text-sm);
}

.alert-error {
    background: rgba(161, 44, 123, .08);
    color: var(--color-error);
    border: 1px solid rgba(161, 44, 123, .2);
}

.auth-body,
.admin-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-shell,
.admin-shell {
    width: min(1180px, 100%);
}

.auth-card {
    max-width: 520px;
    margin: 0 auto;
    border-radius: 1.4rem;
    padding: 1.4rem;
}

.dashboard-mini,
.mini-stats {
    display: grid;
    gap: 1rem;
}

.mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-stat {
    padding: 1rem;
    border-radius: 1rem;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-card {
    border-radius: 1.2rem;
    padding: 1.2rem;
}

.full-span { grid-column: 1 / -1; }
.table-wrap { overflow: auto; }

.resume-template {
    font-family: Arial, sans-serif;
    color: #202020;
    background: #fff;
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
}

.rt-wrap { padding: 30px; }
.rt-header {
    display: flex;
    gap: 20px;
    align-items: center;
    border-bottom: 2px solid #ececec;
    padding-bottom: 18px;
    margin-bottom: 20px;
}
.rt-photo {
    width: 95px;
    height: 95px;
    display: block;
    object-fit: cover;
    background: #efefef;
    border: 1px solid #ddd;
}
.rt-circle { border-radius: 50%; }
.rt-rounded { border-radius: 18px; }
.rt-rect { border-radius: 6px; }
.rt-name {
    font-size: 30px;
    font-weight: 700;
    margin: 0;
}
.rt-role {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}
.rt-contact {
    margin-top: 10px;
    font-size: 13px;
    color: #555;
}
.rt-section {
    margin-bottom: 20px;
}
.rt-section h2 {
    font-size: 16px;
    margin: 0 0 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}
.rt-item {
    margin-bottom: 12px;
}
.rt-item h3 {
    font-size: 14px;
    margin: 0 0 3px;
}
.rt-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 6px;
}
.rt-list,
.rt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rt-tag {
    background: #f3f6f8;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}
.rt-branding {
    margin-top: 24px;
    font-size: 11px;
    color: #999;
    text-align: center;
}
.template-minimal .rt-header { border-color: #1f1f1f; }
.template-minimal .rt-section h2 { border-color: #1f1f1f; }
.template-creative { background: #fffaf6; }
.template-creative .rt-header { border-color: #d9804f; }
.template-creative .rt-section h2 { color: #b15c31; border-color: #edd2c2; }
.template-creative .rt-tag { background: #f8e5da; }
.template-ats {
    font-family: 'Helvetica Neue', Arial, sans-serif;
}
.template-ats .rt-wrap { padding: 24px; }
.template-ats .rt-header {
    display: block;
    border-bottom: 1px solid #000;
}
.template-ats .rt-photo { float: right; margin-left: 12px; }
.template-ats .rt-section h2 {
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #000;
}

@media (max-width: 1180px) {
    .builder-content { grid-template-columns: 1fr; }
    #previewFrame { min-height: 680px; }
}

@media (max-width: 980px) {
    .hero-grid,
    .solution-layout,
    .problem-grid,
    .steps-grid,
    .admin-grid,
    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--color-divider);
    }

    .grid-2,
    .grid-3,
    .mini-stats {
        grid-template-columns: 1fr;
    }
}


/* ════════════════════════════════════════════════════════════
   MOBILE BREAKPOINTS — append to bottom of styles.css
════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .nav-wrap { flex-wrap: nowrap; gap: .5rem; }
    .nav-actions { gap: .4rem; }
    .btn-lg { padding-inline: 1rem; }
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .pricing-vertical { gap: .75rem; }
    .template-picker { grid-template-columns: 1fr; }
    .cta-content { flex-direction: column; align-items: flex-start; }
    .form-nav { flex-direction: column; gap: .5rem; }
    .form-nav button { width: 100%; }
    .builder-content { grid-template-columns: 1fr; }
    .floating-ai { right: .5rem; bottom: .5rem; }
    .floating-ai-panel { width: calc(100vw - 1rem); }
    .modal-card { border-radius: .85rem; }
    .modal-head, .modal-body { padding: .85rem 1rem; }
    .payment-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 1rem; }
    .mini-stats { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   PRINT STYLES
════════════════════════════════════════════════════════════ */

@media print {
    .sidebar,
    .workspace-header,
    .progress-wrap,
    .preview-toolbar,
    .floating-ai,
    .modal,
    .site-header,
    .site-footer,
    .btn,
    .step-tabs,
    .form-nav { display: none !important; }

    .app-shell { display: block; }
    .workspace { padding: 0; }
    .builder-content { grid-template-columns: 1fr; }
    .preview-panel { box-shadow: none; border: none; }
    #previewFrame { min-height: auto; }
}

/* ════════════════════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.step-panel   { animation: fadeIn .22s ease; }
.modal-card   { animation: slideUp .22s ease; }
.ai-results   { animation: fadeIn .2s ease; }

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-surface-2) 25%,
        var(--color-surface-offset) 50%,
        var(--color-surface-2) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* ════════════════════════════════════════════════════════════
   UTILITY CLASSES
════════════════════════════════════════════════════════════ */

.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4      { gap: 1rem; }
.gap-2      { gap: .5rem; }
.w-full     { width: 100%; }
.text-sm    { font-size: var(--text-sm); }
.text-muted { color: var(--color-text-muted); }
.font-bold  { font-weight: 700; }
.rounded    { border-radius: var(--radius-md); }
.p-4        { padding: 1rem; }
.mt-4       { margin-top: 1rem; }
.mb-4       { margin-bottom: 1rem; }
.sr-only    {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* ════════════════════════════════════════════════════════════
   FORM LABELS
════════════════════════════════════════════════════════════ */

label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: .35rem;
}

.step-panel label {
    margin-top: .6rem;
}

.step-panel label:first-child {
    margin-top: 0;
}

/* ════════════════════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════════════════════ */

.empty-repeat {
    padding: 2rem 1rem;
    border: 1.5px dashed var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--color-surface-2);
}

/* ════════════════════════════════════════════════════════════
   AGENT NOTES
════════════════════════════════════════════════════════════ */

.agent-notes {
    padding: 1rem;
    background: var(--color-accent-soft);
    border: 1px solid rgba(15,109,116,.15);
    border-radius: var(--radius-md);
}

.agent-notes p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ════════════════════════════════════════════════════════════
   AUTH FOOTNOTE
════════════════════════════════════════════════════════════ */

.auth-footnote {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-divider);
    text-align: center;
}

.auth-footnote p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ════════════════════════════════════════════════════════════
   SIDEBAR BOTTOM ACTIONS
════════════════════════════════════════════════════════════ */

.sidebar-actions {
    margin-top: auto;
    display: grid;
    gap: .6rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-divider);
}

/* ════════════════════════════════════════════════════════════
   BADGE
════════════════════════════════════════════════════════════ */

.badge {
    position: absolute;
    top: -.6rem;
    right: 1rem;
    background: var(--color-primary);
    color: #fff;
    font-size: var(--text-xs);
    padding: .25rem .6rem;
    border-radius: var(--radius-full);
}

/* ════════════════════════════════════════════════════════════
   PREVIEW PANEL PLACEHOLDER (before data loads)
════════════════════════════════════════════════════════════ */

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: var(--color-text-muted);
    text-align: center;
    min-height: 400px;
    gap: 1rem;
}

.preview-placeholder svg {
    opacity: .25;
}

/* ════════════════════════════════════════════════════════════
   FOCUS VISIBLE
════════════════════════════════════════════════════════════ */

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

*:focus:not(:focus-visible) { outline: none; }

/* ════════════════════════════════════════════════════════════
   SELECTION
════════════════════════════════════════════════════════════ */

::selection {
    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    color: var(--color-text);
}

/* ════════════════════════════════════════════════════════════
   SCROLLBAR (webkit)
════════════════════════════════════════════════════════════ */

::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--color-border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover  { background: var(--color-text-faint); }

/* ════════════════════════════════════════════════════════════
   REDUCED MOTION
════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration:           .01ms !important;
        animation-iteration-count:    1     !important;
        transition-duration:          .01ms !important;
        scroll-behavior:              auto  !important;
    }
}

/* ── Plan notices ── */
.plan-notice {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .9rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
}
.free-notice { background: rgba(150,66,25,.06); border-color: rgba(150,66,25,.18); }
.pro-notice  { background: var(--color-accent-soft); border-color: rgba(15,109,116,.2); }
.plan-notice-icon { font-size: 1.4rem; line-height: 1; }
.plan-notice strong { display: block; color: var(--color-text); }
.plan-notice p { margin: .2rem 0 0; font-size: var(--text-xs); }
.upgrade-link { color: var(--color-primary); font-weight: 700; }

/* ── Branding locked row ── */
.branding-locked { opacity: .85; }
.locked-row { display: flex; justify-content: space-between; align-items: center; }
.locked-badge {
    padding: .25rem .65rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    background: rgba(150,66,25,.1);
    color: var(--color-warning);
}
.pro-badge {
    background: var(--color-accent-soft);
    color: var(--color-primary);
}

/* ── Upgrade button ── */
.upgrade-btn {
    background: linear-gradient(135deg, #0f6d74, #1d98a0) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.reset-btn { color: var(--color-error) !important; border-color: rgba(161,44,123,.25) !important; }

/* ── Plan notices ──────────────────────────────────────── */
.plan-notice {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    font-size: var(--text-sm);
}
.plan-notice p { color: var(--color-text-muted); font-size: var(--text-xs); }
.plan-notice-icon { font-size: 1.25rem; line-height: 1; margin-top: 1px; }
.free-notice { border-color: rgba(150,66,25,.18); background: rgba(150,66,25,.04); }
.pro-notice  { border-color: rgba(15,109,116,.2); background: var(--color-accent-soft); }

/* ── Branding lock row ─────────────────────────────────── */
.branding-locked .locked-row { display: flex; justify-content: space-between; align-items: center; }
.locked-badge { padding: .25rem .6rem; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 700; }
.free-badge { background: rgba(150,66,25,.1); color: var(--color-warning); }
.pro-badge  { background: var(--color-accent-soft); color: var(--color-primary); }

/* ── AI panel close bottom ─────────────────────────────── */
.ai-panel-close-bottom {
    width: 100%;
    padding: .85rem;
    background: var(--color-surface-2);
    border-top: 1px solid var(--color-border);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text-muted);
}

/* ── Auth footnote ─────────────────────────────────────── */
.auth-footnote { margin-top: 1rem; }
.auth-footnote p { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ── Agent notes ───────────────────────────────────────── */
.agent-notes p { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ── Stack form ────────────────────────────────────────── */
.stack-form label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: var(--text-sm); }
.stack-form > div { display: grid; gap: .3rem; }



.preview-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.skill-chip {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in oklch, var(--color-primary) 12%, var(--color-surface));
    color: var(--color-primary);
    letter-spacing: .02em;
}