:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #687386;
    --line: #dfe4ec;
    --soft: #f5f7fa;
    --white: #fff;
    --blue: #2f66e8;
    --blue-dark: #1f4fc7;
    --blue-soft: #edf3ff;
    --green: #16805d;
    --amber: #a96b08;
    --red: #b93838;
    --shadow: 0 16px 45px rgba(23, 32, 51, .08);
    font-family: Inter, "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 85% 8%, #eaf1ff 0, transparent 26rem), #f7f8fb; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.topbar { height: 68px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(223, 228, 236, .8); background: rgba(255,255,255,.82); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-logo { display: block; width: auto; height: 48px; object-fit: contain; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.privacy-pill { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--green); padding: 8px 12px; border-radius: 99px; background: #ecf8f3; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #20a777; box-shadow: 0 0 0 4px rgba(32,167,119,.12); }
.language-button, .icon-button, .text-button { border: 0; background: transparent; color: var(--blue); font-weight: 700; }
.language-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 58px 0 90px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: end; margin-bottom: 38px; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .16em; margin: 0 0 14px; }
h1 { max-width: 720px; margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.08; letter-spacing: -.045em; }
.hero-copy { max-width: 720px; margin: 20px 0 0; color: var(--muted); font-size: 17px; line-height: 1.8; }
.field-strip { display: grid; grid-template-columns: 1fr 1.65fr 1.05fr 1.45fr repeat(3, minmax(34px, .45fr)) 1.1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.field-strip span { min-width: 0; padding: 16px 4px; text-align: center; font-size: 13px; font-weight: 700; white-space: nowrap; border-right: 1px solid var(--line); }
.field-strip span:nth-child(n + 5):nth-child(-n + 7) { color: var(--muted); background: var(--soft); }
[data-language="es"] .field-strip span { font-size: 11px; }
.field-strip span:last-child { border: 0; }
.steps { list-style: none; display: flex; align-items: center; padding: 0; margin: 0 0 18px; }
.steps li { display: flex; align-items: center; gap: 9px; color: #98a1b1; font-size: 13px; font-weight: 700; }
.steps li:not(:last-child)::after { content: ""; width: 58px; height: 1px; margin: 0 14px; background: var(--line); }
.steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e8ebf0; }
.steps li.active { color: var(--blue); }
.steps li.active b { color: white; background: var(--blue); }
.steps li.done b { color: white; background: var(--green); }
.card { margin-top: 18px; border: 1px solid rgba(223,228,236,.9); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 26px; border-bottom: 1px solid var(--line); }
.section-heading > div:first-child { display: flex; align-items: center; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.section-number { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.dropzone { margin: 26px; min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1.5px dashed #b8c3d6; border-radius: 16px; background: #fbfcfe; transition: .2s ease; cursor: pointer; }
.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.upload-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; color: var(--blue); background: var(--blue-soft); font-size: 27px; font-weight: 400; }
.dropzone strong { font-size: 16px; }
.dropzone small, .file-summary small { color: var(--muted); }
.file-summary { margin: 26px; padding: 15px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.file-summary > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.file-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { display: grid; place-items: center; width: 38px; height: 44px; border-radius: 7px; color: white; background: #16805d; font-weight: 900; }
.icon-button { font-size: 24px; color: var(--muted); }
.sheet-controls { padding: 0 26px 26px; display: flex; align-items: end; gap: 14px; }
.sheet-controls label, dialog label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
select, input[type="number"], dialog input { min-height: 42px; padding: 0 12px; border: 1px solid #cfd6e2; border-radius: 10px; color: var(--ink); background: white; outline: none; }
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,102,232,.12); }
.sheet-controls select { min-width: 240px; }
.sheet-controls input { width: 100px; }
.primary-button, .secondary-button { min-height: 42px; padding: 0 17px; border-radius: 10px; border: 1px solid transparent; font-weight: 750; }
.primary-button { color: white; background: var(--blue); box-shadow: 0 7px 16px rgba(47,102,232,.2); }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { color: var(--ink); border-color: var(--line); background: white; }
.mapping-table { padding: 0 26px 18px; }
.mapping-head, .mapping-row { display: grid; grid-template-columns: 120px minmax(220px, 1.1fr) 130px minmax(260px, 1.4fr); gap: 18px; align-items: center; }
.mapping-head { padding: 16px 0 10px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.mapping-row { min-height: 70px; border-top: 1px solid #edf0f4; }
.target-field { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.field-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 12px; }
.mapping-row select { width: 100%; min-width: 0; }
.confidence { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; }
.confidence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.confidence.high { color: var(--green); }.confidence.medium { color: var(--amber); }.confidence.low { color: var(--red); }
.reason { color: var(--muted); font-size: 12px; line-height: 1.55; }
.heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.template-state { color: var(--green); font-size: 12px; }
.inline-alert { margin: 0 26px 24px; padding: 12px 14px; border-radius: 10px; color: #8e2c2c; background: #fff0f0; font-size: 13px; }
.preview-heading { border-bottom: 0; }
.toggle { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.toggle input { display: none; }
.toggle > input + span { flex: 0 0 36px; width: 36px; height: 20px; border-radius: 99px; background: #cfd6e2; position: relative; }
.toggle > input + span::after { content: ""; position: absolute; width: 16px; height: 16px; top: 2px; left: 2px; border-radius: 50%; background: white; transition: .2s; }
.toggle > input:checked + span { background: var(--blue); }.toggle > input:checked + span::after { transform: translateX(16px); }
.preview-meta { display: flex; justify-content: space-between; padding: 0 26px 12px; color: var(--muted); font-size: 11px; }
.table-scroll { margin: 0 26px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; position: relative; min-height: 110px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { position: sticky; top: 0; background: #f2f5fa; color: #526075; text-align: left; font-size: 11px; letter-spacing: .04em; }
th, td { max-width: 330px; padding: 11px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
.empty-preview { min-height: 108px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.export-footer { padding: 22px 26px 26px; display: flex; align-items: center; justify-content: space-between; }
.export-footer p { margin: 0; font-size: 13px; }.export-footer span { color: var(--muted); font-size: 12px; }
.export-actions { display: flex; align-items: center; gap: 10px; }
.export-actions .copy-button { min-height: 48px; padding: 0 22px; color: var(--blue); border-color: #b9c9f4; background: var(--blue-soft); }
.export-actions .copy-button:hover { border-color: var(--blue); background: #e2ebff; }
.export-footer .primary-button { min-height: 48px; padding: 0 22px; }.export-footer .primary-button span { color: white; margin-left: 16px; font-size: 16px; }
.busy-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(19,28,45,.36); backdrop-filter: blur(3px); }
.busy-card { width: min(360px, calc(100% - 32px)); padding: 28px; border-radius: 17px; background: white; text-align: center; box-shadow: 0 28px 70px rgba(0,0,0,.2); }
.spinner { display: block; width: 34px; height: 34px; margin: 0 auto 15px; border: 3px solid #dce6ff; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.progress { height: 4px; margin-top: 18px; overflow: hidden; border-radius: 99px; background: #e9edf4; }.progress span { display: block; height: 100%; width: 15%; background: var(--blue); transition: width .25s; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 110; display: grid; gap: 9px; }
.toast { max-width: 380px; padding: 13px 16px; border-radius: 11px; color: white; background: #26344d; box-shadow: 0 12px 35px rgba(0,0,0,.2); font-size: 13px; animation: toast-in .25s ease; }.toast.error { background: #9f3434; }.toast.success { background: #126c50; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
dialog { width: min(450px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 17px; box-shadow: 0 25px 80px rgba(0,0,0,.25); }dialog::backdrop { background: rgba(21,29,45,.45); backdrop-filter: blur(2px); }
.dialog-card { padding: 26px; }.dialog-card h3 { margin: 0 0 8px; }.dialog-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; font-size: 13px; }.dialog-card input { margin-top: 2px; }.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@media (max-width: 850px) {
    .hero { grid-template-columns: 1fr; gap: 25px; }.field-strip { max-width: 560px; }
    .mapping-head { display: none; }.mapping-row { grid-template-columns: 110px 1fr; padding: 15px 0; gap: 10px 14px; }.mapping-row .confidence, .mapping-row .reason { grid-column: 2; }
    .section-heading { align-items: flex-start; flex-wrap: wrap; }.section-heading p { display: none; }.sheet-controls { flex-wrap: wrap; }
    .heading-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 560px) {
    .privacy-pill { display: none; }.page-shell { width: min(100% - 20px, 1180px); padding-top: 34px; }h1 { font-size: 37px; }
    .field-strip { grid-template-columns: 72px 112px 74px 102px 28px 28px 28px 78px; overflow-x: auto; }.steps li:not(:last-child)::after { width: 18px; margin: 0 8px; }.steps li span { display: none; }
    .section-heading, .mapping-table, .export-footer { padding-left: 17px; padding-right: 17px; }.dropzone, .file-summary, .table-scroll { margin-left: 17px; margin-right: 17px; }.sheet-controls { padding-left: 17px; padding-right: 17px; }.sheet-controls label:first-child { width: 100%; }.sheet-controls select { width: 100%; min-width: 0; }
    .mapping-row { grid-template-columns: 1fr; }.mapping-row .confidence, .mapping-row .reason { grid-column: 1; }.target-field { margin-bottom: 2px; }.heading-actions { align-items: flex-start; }
    .preview-heading { flex-direction: column; }.export-footer { align-items: stretch; flex-direction: column; gap: 18px; }.export-actions { flex-direction: column; }.export-actions .primary-button, .export-actions .copy-button { width: 100%; }.preview-meta span:last-child { display: none; }
}
