/* Shared by the homepage promo, generator and workbook preview. */
.email-generator-promo { width: min(1120px, 90%); margin: 28px auto; color: var(--text-dark, #08233f); }
.email-generator-promo-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 30px; border: 1px solid var(--border-light, rgba(11,73,122,.16)); border-radius: 20px; background: var(--bg-gray-100, rgba(255,255,255,.88)); box-shadow: var(--shadow-md, 0 18px 40px rgba(8,35,63,.12)); }
.email-generator-promo-card .eyebrow { display: inline-block; margin-bottom: 5px; color: var(--primary, #0e5ea8); font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.email-generator-promo-card h2 { margin: 0 0 5px; color: var(--text-dark, #08233f); font-size: clamp(1.35rem, 2.2vw, 1.8rem); line-height: 1.25; }
.email-generator-promo-card p { color: var(--text-muted, #53718d); }
.email-generator-promo-card .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 11px; background: var(--primary, #0e5ea8); color: #fff; font-weight: 700; white-space: nowrap; }

.email-generator-page {
    --ep-primary: #0e5ea8;
    --ep-primary-hover: #0b4b81;
    --ep-ink: #102b45;
    --ep-muted: #5a7085;
    --ep-page: #f4f8fc;
    --ep-card: #fff;
    --ep-soft: #f7faff;
    --ep-border: #dce7f1;
    --ep-shadow: 0 10px 30px rgba(20,54,86,.07);
    margin: 0;
    min-height: 100vh;
    color: var(--ep-ink);
    background: var(--ep-page);
    font: 15px/1.55 "Segoe UI Variable Text", "Segoe UI", Roboto, Arial, sans-serif;
}
.email-generator-page :where(*, *::before, *::after) { box-sizing: border-box; }
.email-generator-page :where(button, input, select) { font: inherit; }
.email-generator-page :where(a) { color: inherit; text-decoration: none; }
.email-generator-page :where(button) { color: inherit; }
.email-generator-page :where(button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible) { outline: 3px solid rgba(14,94,168,.28); outline-offset: 2px; }
:root[data-theme="dark"] .email-generator-page {
    --ep-primary: #8ccaff;
    --ep-primary-hover: #b8dfff;
    --ep-ink: #eaf4fd;
    --ep-muted: #abc0d3;
    --ep-page: #091522;
    --ep-card: #102337;
    --ep-soft: #142c43;
    --ep-border: #29435b;
    --ep-shadow: 0 12px 36px rgba(0,0,0,.24);
}
.ep-container { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.ep-site-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--ep-border); background: color-mix(in srgb, var(--ep-card) 92%, transparent); backdrop-filter: blur(16px); }
.ep-nav-wrap { position: relative; display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 16px; }
.ep-logo { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 9px; color: var(--ep-ink); font-size: 1.18rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.ep-logo-mark { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #0e5ea8, #0a2d4a); color: white; }
.ep-logo-accent { color: var(--ep-primary); }
.ep-nav { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 3px; }
.ep-nav > a { display: inline-flex; min-height: 38px; align-items: center; padding: 6px 7px; border-radius: 8px; color: var(--ep-muted); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.ep-nav > a:hover, .ep-nav > a[aria-current="page"] { color: var(--ep-primary); background: var(--ep-soft); }
.ep-nav .ep-login { margin-left: 4px; padding-inline: 10px; color: var(--ep-ink); }
.ep-nav .ep-register { min-height: 40px; justify-content: center; margin-left: 2px; padding-inline: 13px; border-radius: 9px; background: var(--ep-primary); color: #fff; font-size: .82rem; }
.ep-nav .ep-register:hover { background: var(--ep-primary-hover); color: #fff; }
.ep-theme-toggle { display: inline-flex; flex: 0 0 auto; min-height: 38px; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--ep-border); border-radius: 9px; background: var(--ep-card); color: var(--ep-ink); cursor: pointer; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.ep-theme-toggle > span:first-child { color: var(--ep-primary); font-size: 1rem; }
.ep-menu-toggle { display: none; width: 42px; height: 42px; flex: 0 0 auto; align-items: center; justify-content: center; flex-direction: column; gap: 4px; border: 1px solid var(--ep-border); border-radius: 10px; background: var(--ep-card); cursor: pointer; }
.ep-menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 3px; background: var(--ep-ink); }
.ep-main { padding-block: 34px 64px; }
.email-permutation { color: var(--ep-ink); }
.email-permutation-heading { max-width: 920px; margin: 0 auto 24px; text-align: center; }
.email-permutation-heading .eyebrow { display: inline-block; margin-bottom: 7px; color: var(--ep-primary); font-size: .78rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.email-permutation-heading h1 { margin: 0; color: var(--ep-ink); font-size: clamp(1.9rem, 3.5vw, 2.75rem); line-height: 1.15; letter-spacing: -.04em; }
.email-permutation-heading > p { margin: 10px auto 17px; color: var(--ep-muted); font-size: 1.04rem; }
.ep-feature-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ep-feature-badges span { padding: 6px 10px; border: 1px solid var(--ep-border); border-radius: 999px; background: var(--ep-card); color: var(--ep-muted); font-size: .78rem; font-weight: 650; }
.email-permutation-workflow { max-width: 1080px; margin: 0 auto; padding: 4px 26px; border: 1px solid var(--ep-border); border-radius: 18px; background: var(--ep-card); box-shadow: var(--ep-shadow); }
.email-permutation-step { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--ep-border); }
.email-permutation-step:last-child { border-bottom: 0; }
.email-permutation-step-number { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #eaf4fc; color: #0e5ea8; font-size: .95rem; font-weight: 800; }
.email-permutation-step-number.ep-step-subnumber { width: 26px; height: 26px; margin: 5px auto; border: 1px solid var(--ep-border); background: var(--ep-card); color: var(--ep-muted); font-size: .75rem; }
:root[data-theme="dark"] .email-permutation-step-number { background: #173a59; color: #a9d9ff; }
.email-permutation-step-content { display: grid; min-width: 0; align-content: start; gap: 12px; }
.ep-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ep-step-kicker { display: block; margin-bottom: 2px; color: var(--ep-primary); font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.ep-section-heading h2 { margin: 0; color: var(--ep-ink); font-size: 1.2rem; letter-spacing: -.02em; }
.ep-section-heading p { margin: 5px 0 0; color: var(--ep-muted); }
.email-permutation-step-content > p { margin: 0; color: var(--ep-muted); }
.ep-limit-pill { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; background: var(--ep-soft); color: var(--ep-muted); font-size: .76rem; font-weight: 700; }
.ep-upload-dropzone { position: relative; display: flex; min-height: 190px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 20px; border: 1.5px dashed #9cb9d2; border-radius: 14px; background: var(--ep-soft); text-align: center; transition: border-color .18s ease, background .18s ease; }
.ep-upload-dropzone.is-dragging { border-color: var(--ep-primary); background: color-mix(in srgb, var(--ep-primary) 9%, var(--ep-card)); }
.ep-upload-icon { display: grid; width: 36px; height: 36px; place-items: center; margin-bottom: 3px; border-radius: 11px; background: #e5f2fd; color: #0e5ea8; font-size: 1.3rem; font-weight: 800; }
:root[data-theme="dark"] .ep-upload-icon { background: #173a59; color: #a9d9ff; }
.ep-upload-dropzone strong { color: var(--ep-ink); font-size: .98rem; }
.ep-upload-dropzone > span:not(.ep-upload-icon) { color: var(--ep-muted); font-size: .84rem; }
.ep-upload-dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.email-permutation-page .btn, .email-generator-page .btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; text-align: center; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.email-generator-page .btn:hover:not(:disabled) { transform: translateY(-1px); }
.email-generator-page .btn-primary { background: #0e5ea8; color: #fff; }
.email-generator-page .btn-primary:hover:not(:disabled) { background: #0b4b81; }
.email-generator-page .btn-ghost { border-color: var(--ep-border); background: var(--ep-card); color: var(--ep-primary); }
.email-generator-page .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.ep-upload-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 16px; }
.ep-upload-meta a { color: var(--ep-primary); font-size: .85rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ep-upload-meta span, .email-permutation-muted { color: var(--ep-muted); font-size: .82rem; }
.ep-selected-file { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--ep-border); border-radius: 11px; background: var(--ep-soft); }
.ep-file-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #e7f2fc; color: #0e5ea8; font-size: .65rem; font-weight: 900; }
:root[data-theme="dark"] .ep-file-icon { background: #173a59; color: #a9d9ff; }
.ep-file-details { display: grid; min-width: 0; gap: 1px; }
.ep-file-details strong { overflow: hidden; color: var(--ep-ink); text-overflow: ellipsis; white-space: nowrap; }
.ep-file-details small { color: var(--ep-muted); font-size: .77rem; }
.ep-text-button { margin-left: auto; padding: 6px 8px; color: var(--ep-primary); cursor: pointer; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.email-permutation-hidden { display: none !important; }
.ep-file-info { display: grid; gap: 8px; padding: 13px; border: 1px solid var(--ep-border); border-radius: 11px; background: var(--ep-soft); }
.ep-file-info > strong { color: var(--ep-ink); font-size: .86rem; }
.ep-file-info > div { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.ep-file-info > div span { display: grid; gap: 1px; color: var(--ep-muted); font-size: .76rem; }
.ep-file-info b { color: var(--ep-ink); font-size: 1rem; }
.email-permutation-validation { color: #b42318; font-size: .9rem; }
.email-permutation-validation.has-results { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; }
.email-permutation-validation .metric { display: grid; gap: 1px; padding: 11px 12px; border: 1px solid var(--ep-border); border-radius: 10px; background: var(--ep-soft); }
.email-permutation-validation .metric strong { color: var(--ep-primary); font-size: 1.08rem; }
.email-permutation-validation .metric span { color: var(--ep-muted); font-size: .76rem; }
.email-permutation-mappings { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.email-permutation-mappings label { display: grid; min-width: 0; gap: 5px; color: var(--ep-ink); font-size: .84rem; font-weight: 700; }
.email-generator-page select { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid var(--ep-border); border-radius: 9px; background: var(--ep-card); color: var(--ep-ink); }
.email-permutation-invalid { padding: 12px 14px; border: 1px solid #f1b6b1; border-radius: 10px; background: #fff7f6; color: #912018; }
.email-permutation-invalid summary { cursor: pointer; font-weight: 700; }
.email-permutation-error-list { max-height: 260px; overflow: auto; margin-top: 9px; font-size: .83rem; }
.email-permutation-error-list ol { display: grid; gap: 5px; margin: 0; padding-left: 24px; }
.email-permutation-show-errors { margin-top: 8px; color: #912018; cursor: pointer; font-weight: 700; text-decoration: underline; }
.email-permutation-presets { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 1px 0 0; padding: 0; border: 0; }
.email-permutation-presets legend { grid-column: 1 / -1; margin-bottom: 1px; color: var(--ep-ink); font-size: .86rem; font-weight: 750; }
.email-permutation-presets label { position: relative; display: flex; min-width: 0; min-height: 80px; align-items: flex-start; gap: 10px; padding: 14px 12px; border: 1px solid var(--ep-border); border-radius: 12px; background: var(--ep-card); cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.email-permutation-presets label:hover { border-color: #8eb9df; }
.email-permutation-presets label:has(input:checked) { border-color: var(--ep-primary); background: color-mix(in srgb, var(--ep-primary) 7%, var(--ep-card)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ep-primary) 14%, transparent); }
.email-permutation-presets input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ep-radio-dot { display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; margin-top: 1px; border: 1.5px solid #9cb0c2; border-radius: 50%; }
.email-permutation-presets label:has(input:checked) .ep-radio-dot { border: 5px solid #0e5ea8; }
.email-permutation-presets label:has(input:focus-visible) { outline: 3px solid rgba(14,94,168,.28); outline-offset: 2px; }
:root[data-theme="dark"] .email-permutation-presets label:has(input:checked) .ep-radio-dot { border-color: #8ccaff; }
.ep-preset-copy { display: grid; min-width: 0; gap: 4px; }
.ep-preset-copy strong { color: var(--ep-ink); font-size: .88rem; line-height: 1.25; }
.ep-preset-copy small { color: var(--ep-muted); font-size: .77rem; }
.email-permutation-custom { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--ep-border); border-radius: 13px; background: var(--ep-soft); }
.ep-custom-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ep-custom-heading h3 { margin: 0; color: var(--ep-ink); font-size: 1rem; }
.ep-custom-heading p { margin: 2px 0 0; color: var(--ep-muted); font-size: .8rem; }
.ep-custom-heading .email-permutation-selected-count { flex: 0 0 auto; margin: 0; padding: 7px 10px; border-radius: 999px; background: var(--ep-card); color: var(--ep-primary); font-size: .78rem; font-weight: 800; }
.email-permutation-pattern-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; min-width: 0; }
.email-permutation-pattern-option { display: flex; min-width: 0; min-height: 78px; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid var(--ep-border); border-radius: 10px; background: var(--ep-card); color: var(--ep-ink); cursor: pointer; transition: border-color .16s ease, background .16s ease, opacity .16s ease; }
.email-permutation-pattern-option:hover { border-color: #91b8d8; }
.email-permutation-pattern-option.is-selected { border-color: var(--ep-primary); background: color-mix(in srgb, var(--ep-primary) 7%, var(--ep-card)); }
.email-permutation-pattern-option input { width: 17px; height: 17px; flex: 0 0 auto; margin: 2px 0 0; accent-color: #0e5ea8; cursor: pointer; }
.email-permutation-pattern-option input:disabled { cursor: not-allowed; }
.email-permutation-pattern-option:has(input:disabled):not(:has(input:checked)) { opacity: .48; cursor: not-allowed; }
.email-permutation-pattern-option > span { display: grid; min-width: 0; gap: 3px; }
.email-permutation-pattern-option strong { color: var(--ep-ink); font-size: .84rem; line-height: 1.3; overflow-wrap: anywhere; }
.email-permutation-pattern-option small { color: var(--ep-muted); font-size: .75rem; line-height: 1.35; overflow-wrap: anywhere; }
.email-permutation-pattern-option .ep-pattern-example { color: var(--ep-primary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .73rem; }
.email-permutation-error { min-height: 1.2em; margin: 0; color: #b42318 !important; font-size: .85rem; font-weight: 700; }
.ep-generate-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px; border: 1px solid var(--ep-border); border-radius: 12px; background: var(--ep-soft); }
.ep-generate-panel > div { min-width: 0; }
.ep-generate-panel strong { color: var(--ep-ink); font-size: .91rem; }
.ep-generate-panel p { margin: 2px 0 0; color: var(--ep-muted); font-size: .83rem; }
.ep-generate-panel p b { color: var(--ep-primary); }
.ep-generate-panel .btn { flex: 0 0 auto; min-height: 46px; }
.ep-button-spinner { display: none; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.42); border-top-color: currentColor; border-radius: 50%; animation: ep-spin .7s linear infinite; }
.ep-generate-panel .btn.is-busy .ep-button-spinner { display: inline-block; }
@keyframes ep-spin { to { transform: rotate(360deg); } }
.email-permutation-results { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--ep-border); }
.email-permutation-results .ep-section-heading { margin-bottom: 14px; }
.email-permutation-results h2 { font-size: 1.45rem; }
.email-permutation-results .ep-section-heading p { color: var(--ep-muted); }
.email-permutation-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin: 15px 0; }
.email-permutation-summary > div { display: grid; gap: 3px; min-width: 0; padding: 12px 13px; border: 1px solid var(--ep-border); border-radius: 11px; background: var(--ep-soft); }
.email-permutation-summary span { color: var(--ep-muted); font-size: .77rem; }
.email-permutation-summary strong { color: var(--ep-primary); font-size: 1.13rem; overflow-wrap: anywhere; }
.ep-selected-pattern-line { margin: 10px 0; color: var(--ep-muted); font-size: .85rem; overflow-wrap: anywhere; }
.ep-selected-pattern-line strong { color: var(--ep-ink); }
.email-permutation-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; }
.email-permutation-actions .btn { min-height: 42px; }
.email-permutation-actions #email-permutation-preview-link { border-color: var(--ep-border); background: var(--ep-card); color: var(--ep-primary); }
.email-permutation-actions #email-permutation-download-link { background: #0e5ea8; color: #fff; }
.ep-results-card { overflow: hidden; border: 1px solid var(--ep-border); border-radius: 13px; background: var(--ep-card); }
.ep-results-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--ep-border); background: var(--ep-soft); }
.ep-results-tabs button { position: relative; min-height: 42px; padding: 8px 12px; color: var(--ep-muted); cursor: pointer; font-size: .84rem; font-weight: 700; }
.ep-results-tabs button[aria-selected="true"] { color: var(--ep-primary); }
.ep-results-tabs button[aria-selected="true"]::after { position: absolute; right: 8px; bottom: -1px; left: 8px; height: 2px; background: var(--ep-primary); content: ""; }
.email-permutation-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; background: var(--ep-card); }
.email-permutation-table-wrap table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.email-permutation-table-wrap th, .email-permutation-table-wrap td { max-width: 280px; padding: 10px 12px; border-bottom: 1px solid var(--ep-border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.email-permutation-table-wrap th { position: sticky; top: 0; z-index: 1; background: var(--ep-soft); color: var(--ep-ink); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.email-permutation-table-wrap td { color: var(--ep-muted); }
.email-permutation-table-wrap tbody tr:nth-child(even) { background: color-mix(in srgb, var(--ep-soft) 60%, var(--ep-card)); }
.ep-results-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--ep-border); color: var(--ep-muted); font-size: .79rem; }
.ep-results-pagination > div { display: flex; gap: 6px; }
.ep-results-pagination button { min-height: 32px; padding: 4px 9px; border: 1px solid var(--ep-border); border-radius: 7px; background: var(--ep-card); color: var(--ep-primary); cursor: pointer; font-size: .77rem; font-weight: 700; }
.ep-results-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.ep-preview-note { margin: 9px 12px 12px; color: var(--ep-muted); font-size: .77rem; }
.email-permutation-disclaimer { max-width: 1080px; margin: 14px auto 0; padding: 11px 14px; border: 1px solid var(--ep-border); border-radius: 10px; background: var(--ep-soft); color: var(--ep-muted); font-size: .8rem; }

.email-permutation-preview-page { min-height: 100vh; margin: 0; padding: 32px 0 56px; color: var(--ep-ink); background: var(--ep-page); font: 15px/1.55 "Segoe UI Variable Text", "Segoe UI", Roboto, Arial, sans-serif; }
.email-permutation-preview-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 25px; border: 1px solid var(--ep-border); border-radius: 18px; background: var(--ep-card); box-shadow: var(--ep-shadow); }
.email-permutation-preview-shell h1 { margin: 12px 0 5px; font-size: clamp(1.8rem, 3vw, 2.35rem); line-height: 1.2; }
.email-permutation-preview-shell h2 { margin: 0; font-size: 1.05rem; }
.email-permutation-preview-shell > p { margin: 8px 0 15px; color: var(--ep-muted); }
.ep-preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.email-permutation-preview-back { display: inline-flex; min-height: 36px; align-items: center; color: var(--ep-primary); font-size: .86rem; font-weight: 750; }
.ep-preview-toolbar .ep-theme-toggle { flex: 0 0 auto; }
.email-permutation-preview-shell .email-permutation-summary { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.email-permutation-preview-shell .btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; margin: 5px 0 16px; padding: 0 15px; border-radius: 9px; background: #0e5ea8; color: #fff; font-weight: 700; }
.email-permutation-preview-tabs { display: flex; gap: 4px; margin-top: 8px; padding: 8px 10px 0; border: 1px solid var(--ep-border); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--ep-soft); }
.email-permutation-preview-tabs button { position: relative; min-height: 42px; padding: 8px 12px; color: var(--ep-muted); cursor: pointer; font-size: .84rem; font-weight: 700; }
.email-permutation-preview-tabs button[aria-selected="true"] { color: var(--ep-primary); }
.email-permutation-preview-tabs button[aria-selected="true"]::after { position: absolute; right: 8px; bottom: -1px; left: 8px; height: 2px; background: var(--ep-primary); content: ""; }
.email-permutation-preview-pane[hidden] { display: none; }
.email-permutation-preview-shell .email-permutation-table-wrap { border: 1px solid var(--ep-border); border-radius: 0 0 12px 12px; }

@media (max-width: 1100px) {
    .ep-menu-toggle { display: inline-flex; }
    .ep-nav { display: none; position: absolute; top: calc(100% - 1px); right: 0; left: 0; z-index: 40; align-items: stretch; flex-direction: column; gap: 3px; padding: 12px; border: 1px solid var(--ep-border); border-radius: 0 0 14px 14px; background: var(--ep-card); box-shadow: var(--ep-shadow); }
    .ep-nav.is-open { display: flex; }
    .ep-nav > a, .ep-nav .ep-theme-toggle { width: 100%; min-height: 42px; justify-content: flex-start; padding-inline: 11px; font-size: .9rem; }
    .ep-nav .ep-register { justify-content: center; margin: 4px 0 0; }
    .email-permutation-presets { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .email-permutation-pattern-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .ep-container { width: min(100% - 32px, 620px); }
    .ep-nav-wrap { min-height: 66px; }
    .ep-main { padding-block: 24px 42px; }
    .email-permutation-heading { margin-bottom: 17px; text-align: left; }
    .email-permutation-heading h1 { font-size: clamp(1.75rem, 8vw, 2.25rem); }
    .email-permutation-heading > p { margin: 9px 0 13px; font-size: .95rem; }
    .ep-feature-badges { justify-content: flex-start; gap: 6px; }
    .ep-feature-badges span { font-size: .72rem; }
    .email-permutation-workflow { padding-inline: 16px; border-radius: 14px; }
    .email-permutation-step { grid-template-columns: 30px minmax(0,1fr); gap: 10px; padding: 20px 0; }
    .email-permutation-step-number { width: 29px; height: 29px; font-size: .82rem; }
    .ep-section-heading { flex-direction: column; gap: 7px; }
    .ep-section-heading h2 { font-size: 1.08rem; }
    .email-permutation-mappings { grid-template-columns: 1fr; }
    .email-permutation-presets, .email-permutation-pattern-list { grid-template-columns: 1fr; }
    .email-permutation-presets label { min-height: 66px; }
    .email-permutation-pattern-option { min-height: 68px; }
    .ep-custom-heading { align-items: flex-start; flex-direction: column; }
    .ep-generate-panel { align-items: stretch; flex-direction: column; }
    .ep-generate-panel .btn { width: 100%; }
    .email-permutation-validation.has-results, .ep-file-info > div { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .email-permutation-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .ep-results-tabs { overflow-x: auto; }
    .ep-results-tabs button { flex: 0 0 auto; font-size: .78rem; }
    .email-permutation-actions { display: grid; grid-template-columns: 1fr; }
    .email-permutation-actions .btn { width: 100%; }
    .ep-upload-meta { align-items: flex-start; flex-direction: column; }
    .ep-upload-dropzone { min-height: 175px; }
    .ep-limit-pill { white-space: nowrap; }
    .ep-text-button { padding-inline: 2px; font-size: .74rem; }
    .email-permutation-preview-page { padding: 16px 0 32px; }
    .email-permutation-preview-shell { width: calc(100% - 24px); padding: 16px; border-radius: 14px; }
}
@media (max-width: 390px) {
    .ep-container { width: calc(100% - 24px); }
    .email-permutation-workflow { padding-inline: 12px; }
    .email-permutation-step { grid-template-columns: 26px minmax(0,1fr); gap: 8px; }
    .email-permutation-step-number { width: 26px; height: 26px; }
    .email-permutation-summary { grid-template-columns: 1fr 1fr; gap: 7px; }
    .email-permutation-summary > div { padding: 10px; }
    .email-permutation-summary strong { font-size: 1rem; }
    .ep-selected-file { gap: 7px; padding: 8px; }
    .ep-file-details strong { max-width: 145px; font-size: .82rem; }
}
