:root {
    --blue: #1d4ed8;
    --green: #16a34a;
    --dark: #0f172a;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --danger: #dc2626;
    --border: #dbe3ef;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f8fafc;
    color: var(--dark);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 6vw;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(15,23,42,.06);
}
.brand { font-weight: 800; color: var(--blue); font-size: 1.18rem; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { font-weight: 700; color: #334155; }
.menu-toggle { display: none; }
.container { width: min(1180px, 88vw); margin: 0 auto; padding: 34px 0 56px; }

.hero {
    min-height: 420px;
    display: grid;
    align-items: center;
    padding: 56px;
    border-radius: 8px;
    color: var(--white);
    background:
        linear-gradient(90deg, rgba(15,23,42,.86), rgba(29,78,216,.48)),
        url("https://images.unsplash.com/photo-1532094349884-543bc11b234d?auto=format&fit=crop&w=1400&q=80") center/cover;
}
.hero h1 { margin: 0 0 16px; font-size: clamp(2.2rem, 5vw, 4.5rem); letter-spacing: 0; }
.hero p { max-width: 650px; font-size: 1.1rem; line-height: 1.7; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-weight: 800; text-transform: uppercase; font-size: .78rem; }
.section-head, .dashboard-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin: 34px 0 22px;
}
.section-head h1, .section-head h2, .dashboard-head h1 { margin: 0; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card, .form-card, .status-box, .stats div, .locked-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15,23,42,.06);
}
.card { overflow: hidden; }
.card img { width: 100%; height: 190px; object-fit: cover; background: var(--light); }
.card-body { padding: 18px; }
.card h3 { min-height: 52px; margin: 10px 0; }
.card p { color: var(--gray); line-height: 1.55; }
.tag, .pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #dcfce7;
    color: #166534;
    font-size: .8rem;
    font-weight: 800;
}
.pill { background: var(--light); color: #334155; }
.origin-badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--light);
    color: #334155;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}
.origin-openai { background: #ede9fe; color: #6d28d9; }
.origin-plantilla, .origin-ia { background: #dbeafe; color: #1d4ed8; }
.origin-manual { background: #dcfce7; color: #166534; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 800;
    cursor: pointer;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-outline { border-color: var(--blue); color: var(--blue); background: var(--white); }
.btn-light { background: var(--light); color: var(--dark); }
.btn-ai { background: #7c3aed; color: var(--white); }
.btn-ai:hover { background: #6d28d9; }
.btn-small { min-height: 34px; padding: 6px 10px; background: var(--blue); color: var(--white); }
.actions, .quick-links { display: flex; gap: 12px; flex-wrap: wrap; }
.generator-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ai-status { margin: 12px 0 0; font-size: .92rem; }
.pdf-import-box { margin: 18px 0; padding: 18px; border: 1px solid #bfdbfe; border-radius: 12px; background: linear-gradient(135deg, #eff6ff, #f5f3ff); }
.pdf-import-box h3 { margin: 0 0 6px; color: #3730a3; }
.pdf-import-box label { margin: 14px 0 12px; }

.catalog-search {
    margin: 24px 0 8px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 14px 30px rgba(15,23,42,.05);
}
.catalog-search label { margin: 0 0 10px; }
.catalog-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
}
.catalog-search-row input { min-height: 44px; }
.empty-results {
    padding: 22px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray);
    text-align: center;
}

.auth-panel { min-height: 65vh; display: grid; place-items: center; }
.form-card { width: min(480px, 100%); padding: 24px; }
.form-card.wide { width: 100%; }
label { display: grid; gap: 7px; margin: 12px 0; font-weight: 800; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: var(--white);
}
textarea { resize: vertical; }
.project-edit-form input,
.project-edit-form textarea,
.project-edit-form select,
.experiment-edit-form input,
.experiment-edit-form textarea,
.experiment-edit-form select {
    font-size: .92rem;
    font-weight: 400;
    line-height: 1.45;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.alert { background: #fee2e2; color: #991b1b; padding: 12px; border-radius: 8px; }
.success { background: #dcfce7; color: #166534; padding: 12px; border-radius: 8px; }
.muted { color: var(--gray); }

.experiment-hero { width: 100%; height: 340px; object-fit: cover; border-radius: 8px; }
.experiment-layout { display: grid; grid-template-columns: 1fr 330px; gap: 28px; margin-top: 26px; align-items: start; }
.experiment-content {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
}
.experiment-content p { line-height: 1.75; }
.premium-content { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 10px; }
.locked-box { position: relative; overflow: hidden; margin-top: 24px; padding: 24px; }
.blur-lines { filter: blur(4px); opacity: .45; }
.blur-lines span { display: block; height: 18px; margin: 14px 0; border-radius: 8px; background: #94a3b8; }
.locked-box h2, .locked-box p, .locked-box a { position: relative; z-index: 1; }
.rating-card { position: sticky; top: 92px; }
.project-cover {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 24px;
    align-items: center;
    padding: 34px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15,23,42,.06);
}
.project-cover h1 {
    margin: 8px 0 12px;
    font-size: clamp(1.8rem, 2.8vw, 2.65rem);
    line-height: 1.12;
    letter-spacing: -.025em;
}
.project-cover > div > p:not(.eyebrow) {
    margin: 0;
    max-width: 58ch;
    color: #475569;
    font-size: .95rem;
    line-height: 1.45;
}
.project-cover img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: #ffffff; }
.project-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.project-meta span {
    padding: 7px 9px;
    border-radius: 8px;
    background: var(--light);
    color: #334155;
    font-weight: 800;
    font-size: .82rem;
}
.index-list { columns: 2; line-height: 1.8; }
.code-block {
    white-space: pre-wrap;
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}
.premium-text-block {
    white-space: pre-wrap;
    line-height: 1.7;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--dark);
    font-family: Arial, Helvetica, sans-serif;
}
.edit-preview {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.bulk-image-form { display: grid; gap: 18px; }
.bulk-save-bar {
    position: sticky;
    top: 78px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    box-shadow: 0 12px 28px rgba(15,23,42,.10);
}
.bulk-save-bar div { display: grid; gap: 4px; }
.bulk-save-bar strong { color: var(--blue); font-size: 1.05rem; }
.bulk-save-bar span { color: var(--gray); }
.image-upload-card {
    width: 100%;
    display: grid;
    gap: 14px;
    align-content: start;
}
.empty-preview {
    display: grid;
    place-items: center;
    min-height: 180px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--light);
    color: var(--gray);
    font-weight: 800;
}
.prompt-gallery,
.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.prompt-gallery article,
.project-gallery article {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}
.prompt-gallery img,
.project-gallery img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: contain;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 10px;
}
.project-gallery h3 { margin: 0; }
.prompt-text-list p {
    line-height: 1.75;
    margin: 0 0 18px;
}
.admin-project-prompt {
    margin: 34px 0 28px;
    padding: 22px;
    border: 1px solid #c4b5fd;
    border-radius: 10px;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 72%);
}
.admin-prompt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.admin-prompt-head h2 { margin: 3px 0 0; }
.admin-project-prompt > .muted { margin: 12px 0; }
.admin-prompt-text {
    min-height: 430px;
    border-color: #ddd6fe;
    background: #ffffff;
    color: var(--dark);
    line-height: 1.55;
    font-family: inherit;
}
.copy-prompt-status {
    min-height: 22px;
    margin: 8px 0 0;
    color: #166534;
    font-weight: 700;
}
.experiment-image-prompts { margin: 26px 0; }
.experiment-prompt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.experiment-prompt-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    background: #ffffff;
}
.experiment-prompt-card:last-child { grid-column: 1 / -1; }
.experiment-prompt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.experiment-prompt-card h3 { margin: 0; }
.experiment-prompt-card textarea {
    min-height: 180px;
    line-height: 1.5;
    background: #f8fafc;
}
.experiment-visual-asset {
    display: grid;
    gap: 8px;
}
.experiment-visual-asset > img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fafc;
}
.experiment-visual-asset.is-poster > img {
    max-height: 520px;
    aspect-ratio: 4 / 5;
    object-fit: contain;
}
.experiment-visual-empty {
    display: grid;
    min-height: 150px;
    place-items: center;
    padding: 20px;
    border: 1px dashed #a8b7cc;
    border-radius: 12px;
    color: #64748b;
    background: #f8fafc;
    text-align: center;
}
.experiment-visual-asset .muted {
    min-height: 40px;
    line-height: 1.45;
}
.experiment-visual-upload {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
}
.experiment-visual-upload input[type="file"] { min-width: 0; }
.experiment-section-image {
    margin: 22px 0 30px;
    padding: 10px;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(30, 64, 175, .08);
}
.experiment-section-image img {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
}
.experiment-section-image figcaption {
    padding: 10px 6px 3px;
    color: #64748b;
    font-size: .88rem;
    font-weight: 700;
    text-align: center;
}
.experiment-poster-image { max-width: 720px; margin-inline: auto; }
.experiment-poster-image img { max-height: 820px; }
.visual-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}
.visual-prompt-state-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 14px 0 4px;
}
.visual-prompt-state {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: .88rem;
    font-weight: 800;
}
.visual-prompt-state[data-version="ia"] {
    background: #ede9fe;
    color: #6d28d9;
}
.visual-prompt-message {
    min-height: 24px;
    margin: 12px 0 0;
    font-weight: 700;
}
.visual-prompt-message[data-kind="info"] { color: #475569; }
.visual-prompt-message[data-kind="success"] { color: #166534; }
.visual-prompt-message[data-kind="error"] { color: #b91c1c; }
.visual-prompt-dialog {
    width: min(1080px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    padding: 22px;
    border: 1px solid #c4b5fd;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}
.visual-prompt-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.visual-prompt-dialog-head,
.visual-prompt-dialog-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.visual-prompt-dialog-head h2 { margin: 3px 0 0; }
.visual-prompt-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.visual-prompt-preview-grid label:last-child { grid-column: 1 / -1; }
.visual-prompt-preview-grid textarea {
    min-height: 150px;
    margin-top: 7px;
    background: #f8fafc;
    line-height: 1.5;
}
.visual-prompt-dialog-actions { justify-content: flex-end; }
.idea-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 14px;
}
.idea-status-tabs a {
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: #334155;
    font-weight: 800;
}
.idea-status-tabs a.active {
    border-color: var(--blue);
    background: #eff6ff;
    color: var(--blue);
}
.idea-status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    text-transform: capitalize;
}
.idea-status-pendiente { background: #fef3c7; color: #92400e; }
.idea-status-desarrollada { background: #dcfce7; color: #166534; }
.idea-status-descartada { background: #f1f5f9; color: #64748b; }
.generator-success {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.download-list {
    display: grid;
    gap: 12px;
    margin: 12px 0 22px;
}
.download-item {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}
.download-item strong { color: var(--blue); }
.download-item span { color: var(--gray); font-size: .92rem; }
.premium-downloads-final {
    margin-top: 34px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.client-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: stretch;
    margin-bottom: 20px;
}
.client-hero > div,
.subscription-card,
.client-panel,
.upgrade-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15,23,42,.06);
}
.client-hero > div { padding: 28px; }
.client-hero h1 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: 0; }
.client-hero p { color: var(--gray); line-height: 1.65; }
.client-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.subscription-card {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 24px;
}
.subscription-card span { font-weight: 900; text-transform: uppercase; font-size: .82rem; }
.subscription-card strong { font-size: 1.8rem; color: var(--dark); }
.subscription-card p { margin: 0; color: var(--gray); }
.subscription-card small { font-weight: 900; }
.subscription-card.ok { background: #f0fdf4; border-color: #bbf7d0; }
.subscription-card.ok span, .subscription-card.ok small { color: #166534; }
.subscription-card.warn { background: #fffbeb; border-color: #fde68a; }
.subscription-card.warn span, .subscription-card.warn small { color: #92400e; }
.client-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.client-kpis article {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15,23,42,.05);
}
.client-kpis strong { color: var(--blue); font-size: 2rem; line-height: 1; }
.client-kpis span { color: var(--gray); font-weight: 800; }
.upgrade-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
    background: #eff6ff;
}
.upgrade-panel h2 { margin: 0 0 6px; }
.upgrade-panel p { margin: 0; color: var(--gray); }
.client-two-col {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 18px;
    margin-bottom: 24px;
}
.client-panel { padding: 20px; }
.client-panel h2 { margin: 0 0 14px; }
.client-shortcuts {
    display: grid;
    gap: 10px;
}
.client-shortcuts a {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--light);
}
.client-shortcuts strong { color: var(--blue); }
.client-shortcuts span { color: var(--gray); font-weight: 700; }
.download-quota { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 11px 13px; border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; }
.download-quota strong { color: var(--blue); }
.download-quota span { color: var(--gray); font-weight: 700; font-size: .9rem; }
.download-quota.unlimited { border-color: #bbf7d0; background: #f0fdf4; }
.download-quota.unlimited strong { color: #166534; }
.natural-writing-note { display: flex; gap: 10px; align-items: center; margin: 14px 0; padding: 12px 14px; border: 1px solid #c4b5fd; border-radius: 8px; background: #f5f3ff; }
.natural-writing-note strong { color: #6d28d9; white-space: nowrap; }
.natural-writing-note span { color: var(--gray); font-weight: 700; }
.individual-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.individual-upload .btn { height: 100%; white-space: nowrap; }
.affiliate-panel {
    display: grid;
    gap: 18px;
    margin: 24px 0;
    padding: 24px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 72%);
    box-shadow: 0 14px 30px rgba(37,99,235,.08);
}
.affiliate-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.affiliate-head h2 { margin: 0 0 8px; }
.affiliate-head p { margin: 0; }
.affiliate-code { white-space: nowrap; padding: 9px 12px; border-radius: 999px; background: #dbeafe; color: var(--blue); font-weight: 900; }
.affiliate-share { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
.affiliate-share input { background: #fff; }
.btn-whatsapp { color: #fff; background: #16a34a; border-color: #16a34a; }
.affiliate-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.affiliate-stats article { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.affiliate-stats strong { color: var(--blue); font-size: 1.55rem; }
.affiliate-stats span { color: var(--gray); font-weight: 800; font-size: .88rem; }
.affiliate-history { display: grid; gap: 8px; }
.affiliate-history h3 { margin: 0 0 4px; }
.affiliate-history > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.affiliate-status { font-size: .83rem; color: #92400e; }
.affiliate-status.recompensado { color: #166534; }

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}
.admin-nav a {
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 8px;
    font-weight: 800;
}
.admin-shell {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.admin-sidebar {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 14px;
    max-height: calc(100vh - 112px);
    padding: 16px 14px 18px;
    overflow-y: auto;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 18px 45px rgba(30,64,175,.08);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.admin-sidebar-title {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 5px 16px;
    border-bottom: 1px solid #e2e8f0;
}
.admin-sidebar-title > div { display: grid; gap: 2px; }
.admin-sidebar-title strong { color: #0f172a; font-size: 1.02rem; line-height: 1.2; }
.admin-sidebar-title > div > span { color: #64748b; font-size: .76rem; }
.admin-brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    color: #fff;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 7px 16px rgba(37,99,235,.24);
}
.admin-brand-mark .admin-nav-icon { width: 21px; height: 21px; }
.admin-sidebar nav { display: grid; gap: 4px; }
.admin-nav-section {
    margin-top: 7px;
    padding: 11px 9px 5px;
    color: #94a3b8;
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.admin-nav-section:first-child { margin-top: 0; padding-top: 3px; }
.admin-sidebar a {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #334155;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.admin-sidebar a.active,
.admin-sidebar a:hover {
    color: #1d4ed8;
    border-color: #dbeafe;
    background: #eff6ff;
    box-shadow: 0 6px 16px rgba(37,99,235,.07);
}
.admin-sidebar a:hover { transform: translateX(2px); }
.admin-sidebar a.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 5px 5px 0;
    background: #2563eb;
}
.admin-nav-icon-box {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #64748b;
    border-radius: 9px;
    background: #f1f5f9;
}
.admin-sidebar a:hover .admin-nav-icon-box,
.admin-sidebar a.active .admin-nav-icon-box { color: #2563eb; background: #dbeafe; }
.admin-nav-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.admin-nav-copy { display: grid; gap: 2px; min-width: 0; }
.admin-nav-copy strong { overflow: hidden; font-size: .88rem; line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
.admin-nav-copy small { overflow: hidden; color: #94a3b8; font-size: .68rem; font-weight: 650; line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
.admin-sidebar a.active .admin-nav-copy small,
.admin-sidebar a:hover .admin-nav-copy small { color: #60a5fa; }
.admin-nav-arrow { color: #cbd5e1; font-size: 1.2rem; font-weight: 500; }
.admin-sidebar a.active .admin-nav-arrow,
.admin-sidebar a:hover .admin-nav-arrow { color: #2563eb; }
.admin-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.admin-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 20px;
    align-items: end;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15,23,42,.06);
}
.admin-hero h1 { margin: 0 0 8px; }
.admin-hero p { margin-bottom: 0; color: var(--gray); }
.admin-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin: 0;
}
.admin-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 14px;
}
.admin-kpis article {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15,23,42,.05);
}
.admin-kpis span,
.admin-kpis small { color: var(--gray); font-weight: 800; }
.admin-kpis strong { color: var(--blue); font-size: 2rem; line-height: 1; }
@media (max-width: 1350px) and (min-width: 901px) {
    .admin-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.admin-panel {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15,23,42,.05);
}
.admin-panel h2 { margin: 0 0 14px; }
.admin-search-results,
.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.quick-action-grid a {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--light);
}
.quick-action-grid strong { color: var(--blue); }
.quick-action-grid span { color: var(--gray); font-weight: 700; }
.admin-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.admin-two-col.wide-left { grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr); }
.alert-list,
.premium-check-list { display: grid; gap: 10px; }
.alert-list div,
.premium-check-list div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--light);
}
.alert-list strong { color: var(--blue); }
.alert-list span,
.premium-check-list span { color: var(--gray); }
.premium-check-list .ok { border-color: #bbf7d0; background: #f0fdf4; }
.premium-check-list .warn { border-color: #fde68a; background: #fffbeb; }
.rank-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.rank-row span { font-weight: 800; }
.rank-row strong { color: var(--green); }
.rank-row small { color: var(--gray); }
.section-head.compact { margin: 0 0 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stats div { padding: 22px; }
.stats strong { display: block; font-size: 2rem; color: var(--blue); }
.stats span { color: var(--gray); font-weight: 800; }
.status-box { padding: 18px; font-weight: 900; }
.status-box.ok { color: #166534; background: #dcfce7; }
.status-box.warn { color: #92400e; background: #fef3c7; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: var(--light); }
.table-actions { display: flex; gap: 10px; }
.inline-form { margin: 0; }
.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--blue);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.danger { color: var(--danger); font-weight: 800; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.error { background: #fee2e2; color: #991b1b; padding: 12px; border-radius: 8px; }

.prompt-admin-main { min-width: 0; }
.prompt-admin-hero { grid-template-columns: minmax(0, 1fr) auto; }
.prompt-header-actions,
.prompt-editor-actions,
.prompt-file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.prompt-total {
    padding: 9px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 800;
}
.prompt-create-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.prompt-create-form[hidden] { display: none; }
.prompt-create-form small { grid-column: 1 / -1; color: var(--gray); }
.prompt-workspace {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
}
.prompt-template-browser,
.prompt-editor-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15,23,42,.06);
    min-width: 0;
}
.prompt-template-browser { overflow: hidden; }
.prompt-template-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 14px;
    margin: 0;
    border-bottom: 1px solid var(--border);
}
.prompt-template-search a { grid-column: 1 / -1; font-weight: 700; font-size: .86rem; }
.prompt-template-list {
    display: grid;
    align-content: start;
    max-height: 820px;
    overflow: auto;
}
.prompt-template-item {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f7;
    color: #334155;
}
.prompt-template-item strong { overflow-wrap: anywhere; font-size: .92rem; }
.prompt-template-item span,
.prompt-template-item time { color: var(--gray); font-size: .76rem; }
.prompt-template-item:hover,
.prompt-template-item.active { background: #eff6ff; color: var(--blue); }
.prompt-template-item.active { box-shadow: inset 4px 0 0 var(--blue); }
.prompt-empty { padding: 16px; }
.prompt-editor-panel { padding: 18px; }
.prompt-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.prompt-editor-header h2 { margin: 0; overflow-wrap: anywhere; font-size: 1.2rem; }
.prompt-editor-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.prompt-editor-meta > span {
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #f8fafc;
    font-size: .79rem;
    color: #475569;
}
.prompt-save-state[data-state="saved"] { color: #166534; background: #f0fdf4; }
.prompt-save-state[data-state="saving"] { color: #1d4ed8; background: #eff6ff; }
.prompt-save-state[data-state="pending"] { color: #92400e; background: #fffbeb; }
.prompt-save-state[data-state="error"] { color: #991b1b; background: #fef2f2; }
.prompt-find-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
}
.prompt-editor-panel .CodeMirror {
    height: 610px;
    border: 1px solid #1e293b;
    border-radius: 8px;
    font: 14px/1.6 Consolas, "Courier New", monospace;
}
.prompt-editor-panel .CodeMirror-gutters { border-right-color: #334155; }
.prompt-preview {
    min-height: 610px;
    max-height: 610px;
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}
.prompt-preview h1,
.prompt-preview h2,
.prompt-preview h3,
.prompt-preview h4 { margin: 18px 0 8px; }
.prompt-preview p { margin: 0 0 9px; white-space: pre-wrap; }
.prompt-preview code { padding: 2px 5px; border-radius: 4px; background: #e2e8f0; }
.prompt-file-actions {
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.prompt-file-actions form { margin: 0; }
.prompt-history-panel { padding-top: 16px; }
.prompt-history-panel h3 { margin: 0 0 12px; }
.prompt-history-list { display: grid; gap: 8px; }
.prompt-history-list article {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 7px;
    background: #f8fafc;
    font-size: .8rem;
}
.prompt-history-list article > div { display: grid; gap: 3px; }
.prompt-history-list form { margin: 0; }
.prompt-history-list span,
.prompt-history-list time { color: var(--gray); }
.prompt-history-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}
.prompt-history-pagination span { color: var(--gray); font-size: .85rem; font-weight: 700; }
.prompt-empty-editor { padding: 70px 20px; text-align: center; }
.prompt-inspector-main { min-width: 0; }
.prompt-inspector-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.inspector-safe-badge {
    padding: 10px 14px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
}
.inspector-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15,23,42,.05);
}
.inspector-form label { margin: 0; }
.inspector-form .inspector-materials,
.inspector-form .inspector-objective { grid-column: span 2; }
.inspector-form > .btn { align-self: end; min-height: 46px; }
.inspector-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 10px;
}
.inspector-metrics article {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.inspector-metrics span { color: var(--gray); font-size: .78rem; font-weight: 700; }
.inspector-metrics strong { color: #0f172a; font-size: 1.35rem; }
.inspector-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}
.inspector-panel { min-width: 0; }
.inspector-template-list,
.inspector-variable-list { display: grid; gap: 8px; }
.inspector-template-list article {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 7px;
    background: #f8fafc;
}
.inspector-template-list article > span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 900;
}
.inspector-template-list article div { display: grid; gap: 3px; min-width: 0; }
.inspector-template-list strong { overflow-wrap: anywhere; }
.inspector-template-list small { color: var(--gray); }
.inspector-variable-list details {
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #f8fafc;
}
.inspector-variable-list summary { padding: 10px; cursor: pointer; font-weight: 800; }
.inspector-variable-list pre {
    max-height: 230px;
    overflow: auto;
    margin: 0;
    padding: 10px;
    border-top: 1px solid var(--border);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .78rem;
}
.inspector-prompt-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.inspector-prompt-head h2 { margin: 0; }
.inspector-prompt-panel textarea {
    min-height: 620px;
    resize: vertical;
    border-color: #1e293b;
    background: #0f172a;
    color: #e2e8f0;
    font: 13px/1.6 Consolas, "Courier New", monospace;
}
.inspector-view-tabs {
    display: flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
}
.inspector-view-tabs a {
    padding: 10px 14px;
    border-radius: 7px;
    color: #475569;
    font-weight: 800;
}
.inspector-view-tabs a:hover,
.inspector-view-tabs a.active { background: #eaf1ff; color: var(--blue); }
.inspector-compare-form { display: grid; gap: 16px; }
.inspector-compare-selects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.inspector-compare-selects label,
.inspector-compare-form > label { margin: 0; }
.inspector-compare-form textarea {
    font: 13px/1.55 Consolas, "Courier New", monospace;
    background: #f8fafc;
}
.inspector-compare-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.inspector-compare-actions span { color: var(--gray); font-size: .85rem; font-weight: 700; }
.inspector-version-summary h2 { margin: 12px 0 8px; font-size: 1rem; }
.inspector-change-list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.inspector-change-list li { padding: 7px 9px; border-radius: 6px; background: #f8fafc; overflow-wrap: anywhere; }
.inspector-change-list.additions li { color: #166534; }
.inspector-change-list.removals li { color: #991b1b; }
.inspector-variable-diff { display: grid; gap: 10px; }
.inspector-variable-diff > div {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 10px;
    border-radius: 7px;
    background: #f8fafc;
}
.inspector-variable-diff strong { width: 100%; font-size: .82rem; color: #475569; }
.inspector-variable-diff code { padding: 4px 6px; border-radius: 5px; background: #e2e8f0; }
.inspector-variable-diff span { color: var(--gray); }
.inspector-git-panel { min-width: 0; }
.git-identical,
.git-changed { padding: 8px 11px; border-radius: 999px; font-size: .8rem; font-weight: 900; }
.git-identical { background: #dcfce7; color: #166534; }
.git-changed { background: #fef3c7; color: #92400e; }
.inspector-git-diff {
    max-height: 760px;
    overflow: auto;
    margin-bottom: 10px;
    border: 1px solid #1e293b;
    border-radius: 8px;
    background: #0d1117;
    color: #c9d1d9;
    font: 13px/1.55 Consolas, "Courier New", monospace;
}
.git-file-header { padding: 6px 12px; background: #161b22; color: #8b949e; white-space: pre; }
.git-line {
    display: grid;
    grid-template-columns: 54px 54px minmax(max-content, 1fr);
    min-width: max-content;
}
.git-line > span {
    padding: 2px 8px;
    border-right: 1px solid rgba(240,246,252,.08);
    color: #6e7681;
    text-align: right;
    user-select: none;
}
.git-line code { display: block; padding: 2px 10px; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.git-add { background: rgba(46,160,67,.2); color: #aff5b4; }
.git-remove { background: rgba(248,81,73,.18); color: #ffdcd7; }
.git-context:hover { background: #161b22; }
.prompt-lab-main { min-width: 0; }
.prompt-lab-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.prompt-lab-selector {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: end;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.prompt-lab-selector label { margin: 0; }
.prompt-lab-selector > span { align-self: center; color: var(--gray); font-weight: 800; }
.prompt-lab-editors,
.prompt-lab-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.prompt-lab-editor,
.prompt-lab-results > article,
.prompt-lab-results > label { min-width: 0; }
.prompt-lab-card-head,
.prompt-lab-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}
.prompt-lab-card-head h2,
.prompt-lab-section-head h2 { margin: 0; }
.prompt-lab-card-head > span,
.prompt-lab-section-head > span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: .78rem;
    font-weight: 800;
}
.prompt-lab-editor textarea,
.prompt-lab-results textarea,
.prompt-lab-variables textarea {
    font: 13px/1.55 Consolas, "Courier New", monospace;
}
.prompt-lab-editor.baseline textarea { background: #f8fafc; color: #334155; }
.prompt-lab-editor .CodeMirror {
    height: 540px;
    border: 1px solid #1e293b;
    border-radius: 8px;
    font: 13px/1.55 Consolas, "Courier New", monospace;
}
.prompt-lab-editor > small { display: block; margin-top: 8px; color: var(--gray); }
.prompt-lab-variables {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr) auto;
    align-items: end;
    gap: 16px;
}
.prompt-lab-variables h2 { margin: 0 0 6px; }
.prompt-lab-variables p { margin: 0; color: var(--gray); }
.prompt-lab-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 10px;
}
.prompt-lab-metrics article {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
.prompt-lab-metrics span { color: var(--gray); font-size: .78rem; font-weight: 700; }
.prompt-lab-metrics strong { font-size: 1.2rem; color: #0f172a; overflow-wrap: anywhere; }
.prompt-lab-responses { display: grid; gap: 14px; }
.prompt-lab-results label { margin: 0; }
.prompt-lab-diff ul { max-height: 320px; overflow: auto; margin: 0; padding-left: 20px; }
.prompt-lab-diff li { margin-bottom: 8px; overflow-wrap: anywhere; }
.prompt-lab-commit { padding: 0; overflow: hidden; }
.prompt-lab-commit > summary { padding: 18px; cursor: pointer; font-weight: 900; }
.prompt-lab-warning { display: grid; gap: 12px; padding: 18px; border-top: 1px solid var(--border); background: #fff7ed; }
.prompt-lab-warning p { margin: 0; color: #9a3412; }
.prompt-lab-warning label { margin: 0; }
.prompt-lab-warning input[type="checkbox"] { width: auto; margin-right: 8px; }
.prompt-lab-warning input[name="confirmation_text"] { max-width: 260px; background: #fff; }
.prompt-lab-warning .btn { justify-self: start; }
.footer { padding: 24px 6vw; color: var(--gray); text-align: center; border-top: 1px solid var(--border); }

@media (max-width: 900px) {
    .grid, .stats, .experiment-layout, .project-cover, .image-upload-grid, .prompt-gallery, .project-gallery, .experiment-prompt-grid, .visual-prompt-preview-grid, .admin-shell, .admin-hero, .admin-kpis, .admin-search-results, .quick-action-grid, .admin-two-col, .admin-two-col.wide-left, .client-hero, .client-kpis, .client-two-col, .upgrade-panel, .affiliate-share, .affiliate-stats { grid-template-columns: 1fr; }
    .experiment-prompt-card:last-child { grid-column: auto; }
    .visual-prompt-preview-grid label:last-child { grid-column: auto; }
    .hero { padding: 34px; }
    .rating-card { position: static; }
    .admin-sidebar { position: static; max-height: none; overflow: visible; }
    .prompt-workspace { grid-template-columns: 1fr; }
    .prompt-template-list { max-height: 320px; }
    .inspector-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inspector-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .inspector-two-columns { grid-template-columns: 1fr; }
    .inspector-compare-selects { grid-template-columns: 1fr; }
    .prompt-lab-editors, .prompt-lab-results, .prompt-lab-variables { grid-template-columns: 1fr; }
    .prompt-lab-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .topbar { align-items: flex-start; }
    .menu-toggle { display: inline-flex; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); }
    .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
    .nav.open { display: flex; }
    .container { width: min(94vw, 1180px); padding-top: 22px; }
    .hero { min-height: 360px; padding: 26px; }
    .form-grid, .section-head, .dashboard-head { grid-template-columns: 1fr; display: grid; }
    .experiment-content { padding: 20px; }
    .experiment-visual-upload { grid-template-columns: 1fr; }
    .admin-search { grid-template-columns: 1fr; }
    .catalog-search-row { grid-template-columns: 1fr; }
    .bulk-save-bar { position: static; align-items: stretch; flex-direction: column; }
    .admin-panel { padding: 16px; }
    .admin-project-prompt { padding: 18px; }
    .admin-prompt-head { flex-direction: column; }
    .admin-prompt-head .btn { width: 100%; }
    .prompt-lab-selector { grid-template-columns: 1fr; }
    .prompt-lab-metrics { grid-template-columns: 1fr; }
    .admin-prompt-text { min-height: 360px; }
    .affiliate-head, .affiliate-history > div { flex-direction: column; }
    .affiliate-code { white-space: normal; }
    .prompt-create-form,
    .prompt-template-search,
    .prompt-find-bar { grid-template-columns: 1fr; }
    .prompt-editor-header,
    .prompt-history-list article { display: grid; grid-template-columns: 1fr; }
    .prompt-editor-actions { justify-content: stretch; }
    .prompt-editor-actions .btn { width: 100%; }
    .inspector-form,
    .inspector-metrics { grid-template-columns: 1fr; }
    .inspector-form .inspector-materials,
    .inspector-form .inspector-objective { grid-column: auto; }
    .inspector-prompt-head { align-items: stretch; flex-direction: column; }
    .inspector-view-tabs { flex-direction: column; }
    .inspector-version-metrics { grid-template-columns: 1fr; }
}

/* Portada premium ExpoCiencia */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.home-page { background:#f5f9ff; color:#0b1739; }
.home-page .topbar { position:relative; min-height:78px; padding:12px max(5vw, calc((100vw - 1280px) / 2)); border-bottom:0; box-shadow:none; background:#fff; }
.home-page .brand { display:inline-flex; align-items:center; gap:10px; color:#0b1739; font-size:1rem; line-height:1; }
.brand-mark { display:grid; width:38px; height:38px; place-items:center; border-radius:12px; color:#075fec; background:#e9f3ff; }
.brand-mark svg { width:25px; height:25px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.brand small { display:block; margin-top:4px; color:#64748b; font-size:.69rem; font-weight:700; }
.home-page .nav { gap:clamp(14px,2vw,28px); }
.home-page .nav > a:not(.btn) { color:#263553; font-size:.86rem; font-weight:700; }
.home-page .nav > a:not(.btn):hover { color:#075fec; }
.home-page .nav-register { min-height:40px; padding-inline:19px; border-radius:10px; background:#075fec; box-shadow:0 8px 18px rgba(7,95,236,.19); }
.home-container { width:min(1280px,92vw); padding:0 0 68px; }

.premium-hero { position:relative; min-height:545px; display:grid; align-items:center; overflow:hidden; padding:72px 52% 98px 5.5%; border-radius:0 0 24px 24px; background-color:#eef7ff; background-image:linear-gradient(90deg,rgba(247,251,255,.98) 0%,rgba(247,251,255,.94) 34%,rgba(247,251,255,.28) 58%,rgba(247,251,255,0) 76%),url("../images/hero-estudiante-microscopio.png"); background-position:center,center; background-size:cover,cover; box-shadow:0 18px 55px rgba(31,77,126,.10); }
.premium-hero::after { content:""; position:absolute; inset:auto 0 0; height:110px; pointer-events:none; background:linear-gradient(0deg,rgba(255,255,255,.86),rgba(255,255,255,0)); }
.premium-hero-content { position:relative; z-index:2; max-width:610px; }
.hero-kicker { display:inline-flex; margin-bottom:14px; color:#075fec; font-size:.75rem; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.premium-hero h1 { max-width:610px; margin:0; color:#071333; font-size:clamp(2.3rem,4vw,4.25rem); line-height:1.04; letter-spacing:-.045em; }
.premium-hero-content > p { max-width:545px; margin:20px 0 26px; color:#34435f; font-size:1rem; line-height:1.65; }
.hero-search { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; max-width:590px; padding:7px; border:1px solid #d7e3f4; border-radius:14px; background:#fff; box-shadow:0 13px 32px rgba(50,85,130,.14); }
.hero-search-icon { padding-left:10px; color:#71819a; font-size:1.45rem; line-height:1; }
.hero-search input { min-width:0; min-height:44px; padding:8px 4px; border:0; outline:0; color:#17213b; background:transparent; font-size:.9rem; }
.hero-search input:focus { box-shadow:none; }
.hero-search button { min-height:44px; padding:9px 23px; border:0; border-radius:10px; color:#fff; background:#075fec; font:inherit; font-weight:900; cursor:pointer; }
.hero-search button:hover { background:#004ccc; }
.popular-searches { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-top:14px; color:#6a7890; font-size:.7rem; }
.popular-searches > span { flex-basis:100%; font-weight:800; }
.popular-searches a { padding:5px 10px; border:1px solid #d9e3f1; border-radius:999px; color:#52617b; background:rgba(255,255,255,.72); }
.popular-searches a:hover { border-color:#9ec5ff; color:#075fec; background:#fff; }

.home-benefits { position:relative; z-index:3; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:-52px 4% 0; border:1px solid #dbe6f4; border-radius:18px; background:rgba(255,255,255,.96); box-shadow:0 18px 38px rgba(38,78,122,.13); }
.home-benefits article { display:flex; min-width:0; align-items:center; gap:14px; padding:22px 24px; }
.home-benefits article + article { border-left:1px solid #e4ebf5; }
.benefit-icon { display:grid; flex:0 0 42px; width:42px; height:42px; place-items:center; border:1px solid #cfe0fb; border-radius:12px; color:#075fec; background:#f2f7ff; font-size:1.4rem; font-weight:900; }
.home-benefits div { min-width:0; }
.home-benefits strong,.home-benefits small { display:block; }
.home-benefits strong { overflow:hidden; color:#0d1938; font-size:.9rem; text-overflow:ellipsis; white-space:nowrap; }
.home-benefits small { margin-top:4px; color:#748198; font-size:.7rem; }

.home-section { padding:54px 4% 0; scroll-margin-top:30px; }
.home-section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:23px; }
.home-section-heading h2 { margin:0; color:#0b1739; font-size:clamp(1.4rem,2.2vw,2rem); letter-spacing:-.025em; }
.home-section-heading p { margin:7px 0 0; color:#7b879b; font-size:.82rem; }
.home-section-heading > a { color:#075fec; font-size:.79rem; font-weight:900; }
.category-strip { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:12px; }
.category-tile { display:flex; min-width:0; min-height:140px; align-items:center; flex-direction:column; justify-content:center; padding:16px 9px; border:1px solid #e2e9f3; border-radius:14px; background:#fff; box-shadow:0 9px 22px rgba(25,63,104,.045); text-align:center; transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease; }
.category-tile:hover { z-index:1; border-color:currentColor; box-shadow:0 16px 28px rgba(25,63,104,.11); transform:translateY(-5px); }
.category-symbol { display:grid; width:48px; height:48px; place-items:center; margin-bottom:12px; border-radius:14px; color:currentColor; background:#f1f6fd; font-size:1.7rem; font-style:normal; font-weight:500; }
.category-tile strong { max-width:100%; overflow:hidden; color:#14203e; font-size:.76rem; text-overflow:ellipsis; white-space:nowrap; }
.category-tile small { margin-top:5px; color:#8a95a7; font-size:.62rem; }
.category-tone-1{color:#1ea868}.category-tone-2{color:#0ba5c9}.category-tone-3{color:#ff852d}.category-tone-4{color:#4169e1}.category-tone-5{color:#8854df}.category-tone-6{color:#13a3a7}.category-tone-7{color:#f39b16}.category-tone-8{color:#e84e68}

.featured-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; }
.featured-card { min-width:0; overflow:hidden; border:1px solid #dfe8f3; border-radius:17px; background:#fff; box-shadow:0 13px 29px rgba(27,63,103,.075); transition:transform .2s ease,box-shadow .2s ease; }
.featured-card:hover { box-shadow:0 19px 36px rgba(27,63,103,.14); transform:translateY(-4px); }
.featured-card-image { position:relative; display:grid; height:190px; place-items:center; overflow:hidden; }
.featured-card-image img { width:100%; height:100%; object-fit:cover; transition:transform .35s ease; }
.featured-card:hover .featured-card-image img { transform:scale(1.04); }
.featured-card-image > span { color:rgba(255,255,255,.92); font-size:4.2rem; text-shadow:0 9px 25px rgba(23,51,82,.18); }
.featured-card-image em { position:absolute; top:12px; right:12px; padding:5px 9px; border-radius:999px; color:#075fec; background:rgba(255,255,255,.92); font-size:.6rem; font-style:normal; font-weight:900; letter-spacing:.04em; text-transform:uppercase; }
.featured-visual-1{background:linear-gradient(145deg,#5ba970,#b9ddc0)}.featured-visual-2{background:linear-gradient(145deg,#537fc3,#b5d5ed)}.featured-visual-3{background:linear-gradient(145deg,#3eb7d0,#b4e9ee)}.featured-visual-4{background:linear-gradient(145deg,#e7a95f,#f1d8a5)}
.featured-card-body { padding:17px; }
.featured-category { display:inline-flex; color:#075fec; font-size:.65rem; font-weight:900; text-transform:uppercase; }
.featured-card h3 { min-height:44px; margin:9px 0 7px; color:#111d3a; font-size:1rem; line-height:1.35; }
.featured-card p { display:-webkit-box; min-height:38px; overflow:hidden; margin:0 0 15px; color:#718097; font-size:.72rem; line-height:1.5; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.featured-meta { display:flex; align-items:center; justify-content:space-between; gap:9px; padding-top:12px; border-top:1px solid #edf1f6; font-size:.67rem; }
.featured-meta span { min-width:0; overflow:hidden; color:#7b8799; text-overflow:ellipsis; white-space:nowrap; }
.featured-meta a,.compact-resource-card a { flex:0 0 auto; color:#075fec; font-weight:900; }

.compact-resource-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.compact-resource-card { display:grid; grid-template-columns:auto minmax(0,1fr); gap:15px; padding:19px; border:1px solid #e0e8f2; border-radius:15px; background:#fff; }
.compact-resource-icon { display:grid; width:52px; height:52px; place-items:center; border-radius:15px; color:#fff; font-size:1.55rem; }
.compact-resource-icon.tone-1{background:#27a873}.compact-resource-icon.tone-2{background:#1677d2}.compact-resource-icon.tone-3{background:#ef8d34}.compact-resource-icon.tone-4{background:#8a61db}
.compact-resource-card small { color:#075fec; font-size:.64rem; font-weight:900; text-transform:uppercase; }
.compact-resource-card h3 { margin:5px 0 7px; font-size:1rem; }
.compact-resource-card p { margin:0 0 9px; color:#718097; font-size:.75rem; line-height:1.5; }
.compact-resource-card a { font-size:.72rem; }
.home-empty { margin:28px 4% 0; }
.home-cta { display:flex; align-items:center; justify-content:space-between; gap:30px; margin:58px 4% 0; padding:34px 40px; border-radius:20px; color:#fff; background:linear-gradient(125deg,#071c48,#075fec); box-shadow:0 20px 40px rgba(7,65,154,.2); }
.home-cta .hero-kicker { margin-bottom:8px; color:#9dc8ff; }
.home-cta h2 { margin:0; font-size:clamp(1.5rem,2.5vw,2.2rem); }
.home-cta p { margin:9px 0 0; color:#d9e9ff; }
.home-cta .btn { flex:0 0 auto; color:#075fec; background:#fff; }
.home-page .footer { border-top:0; color:#778398; background:#f5f9ff; }

@media (max-width:1120px) {
    .premium-hero { padding-right:43%; background-position:center,58% center; }
    .premium-hero h1 { font-size:clamp(2.3rem,4.6vw,3.6rem); }
    .home-benefits { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .home-benefits article:nth-child(3) { border-left:0; border-top:1px solid #e4ebf5; }
    .home-benefits article:nth-child(4) { border-top:1px solid #e4ebf5; }
    .category-strip { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .featured-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:900px) {
    .home-page .topbar { position:sticky; padding-inline:4vw; }
    .home-page .menu-toggle { display:grid; width:42px; height:42px; place-content:center; gap:5px; padding:0; border:1px solid #dbe5f2; border-radius:10px; background:#fff; }
    .home-page .menu-toggle span { display:block; width:20px; height:2px; border-radius:2px; background:#183254; }
    .home-page .nav { position:absolute; top:calc(100% - 4px); right:4vw; left:4vw; display:none; align-items:stretch; flex-direction:column; gap:3px; padding:13px; border:1px solid #dfe8f3; border-radius:14px; background:#fff; box-shadow:0 18px 42px rgba(22,54,91,.16); }
    .home-page .nav.open { display:flex; }
    .home-page .nav a { padding:11px 12px; border-radius:8px; }
    .home-page .nav a:hover { background:#f0f6ff; }
    .home-page .nav .btn { width:100%; }
    .premium-hero { min-height:590px; align-items:start; padding:48px 6% 260px; background-image:linear-gradient(180deg,rgba(247,251,255,.99) 0%,rgba(247,251,255,.94) 46%,rgba(247,251,255,.18) 70%,rgba(247,251,255,0) 100%),url("../images/hero-estudiante-microscopio.png"); background-position:center,68% bottom; background-size:cover,auto 63%; background-repeat:no-repeat; }
    .premium-hero-content { max-width:640px; }
}

@media (max-width:680px) {
    .home-container { width:100%; padding-top:0; }
    .home-page .topbar { min-height:68px; align-items:center; }
    .home-page .brand { font-size:.9rem; }
    .brand-mark { width:34px; height:34px; }
    .premium-hero { min-height:650px; padding:38px 5% 270px; border-radius:0 0 18px 18px; background-position:center,64% bottom; background-size:cover,auto 50%; }
    .premium-hero h1 { font-size:clamp(2rem,10vw,3rem); }
    .premium-hero-content > p { margin:16px 0 21px; font-size:.9rem; }
    .hero-search { grid-template-columns:auto minmax(0,1fr); }
    .hero-search button { grid-column:1/-1; width:100%; }
    .popular-searches a:nth-of-type(n+4) { display:none; }
    .home-benefits { grid-template-columns:1fr 1fr; margin:-42px 4% 0; }
    .home-benefits article { align-items:flex-start; flex-direction:column; padding:17px; }
    .home-benefits article:nth-child(odd) { border-left:0; }
    .home-benefits article:nth-child(2) { border-left:1px solid #e4ebf5; }
    .home-benefits article:nth-child(n+3) { border-top:1px solid #e4ebf5; }
    .home-benefits strong { white-space:normal; }
    .home-section { padding:42px 4% 0; }
    .home-section-heading { align-items:flex-start; }
    .category-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .category-tile { min-height:128px; }
    .featured-grid,.compact-resource-grid { grid-template-columns:1fr; }
    .featured-card-image { height:210px; }
    .home-cta { align-items:stretch; flex-direction:column; margin:45px 4% 0; padding:28px 24px; }
    .home-cta .btn { width:100%; }
}
