:root {
  --sc-bg: #0c0a09;
  --sc-panel: #171412;
  --sc-panel-2: #211d1a;
  --sc-border: #3b332d;
  --sc-text: #fafaf9;
  --sc-muted: #d6d3d1;
  --sc-gold: #f2c94c;
}

html { overflow-x: clip; scroll-behavior: smooth; }
body.size-chart-page { margin: 0; overflow-x: clip; background: var(--sc-bg); color: var(--sc-text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.size-chart-page *, .size-chart-page *::before, .size-chart-page *::after { box-sizing: border-box; }
.sc-container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sc-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sc-print { display: none; }
.size-chart-page [hidden] { display: none !important; }

/* Hero */
.sc-hero { padding: 112px 0 56px; background: radial-gradient(circle at 85% 10%, rgba(45, 212, 191, .13), transparent 34%), #0c0a09; border-bottom: 1px solid #29231f; }
.sc-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: #d6d3d1; font-size: .86rem; margin-bottom: 24px; }
.sc-breadcrumb a { color: var(--sc-gold); text-decoration: underline; text-underline-offset: 3px; }
.sc-eyebrow, .sc-kicker { margin: 0; color: var(--sc-gold); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sc-hero h1 { margin: 12px 0 18px; max-width: 900px; font-family: "Space Grotesk", Inter, sans-serif; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -.05em; color: #fff; }
.sc-hero h1 span { color: #5eead4; }
.sc-lead { max-width: 740px; margin: 0 0 22px; color: #e7e5e4; font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.7; }
.sc-proof { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; }
.sc-proof li { padding: 8px 11px; border: 1px solid #51463d; border-radius: 999px; background: #171412; color: #f5f5f4; font-size: .82rem; font-weight: 700; }
.sc-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.sc-answer { background: #ecfdf5; color: #064e3b; border-block: 1px solid #a7f3d0; }
.sc-answer p { margin: 0; padding: 18px 0; line-height: 1.65; }

.sc-tool-section, .sc-section { padding: 72px 0; }
.sc-section--soft { background: #151210; border-block: 1px solid #2f2925; }
.sc-heading { max-width: 780px; margin: 0 auto 32px; text-align: center; }
.sc-heading h2, .sc-copy h2, .sc-final h2 { margin: 8px 0 12px; color: #fff; font-family: "Space Grotesk", Inter, sans-serif; font-size: clamp(1.75rem, 3.4vw, 2.7rem); line-height: 1.1; letter-spacing: -.035em; }
.sc-heading p:last-child, .sc-copy p, .sc-copy li, .sc-final p { color: #d6d3d1; line-height: 1.75; }
.sc-copy a, .sc-cards a, .sc-faq a, .sc-related a, .sc-note a, .sc-howto a, .sc-answer a { color: var(--sc-gold); text-decoration: underline; text-underline-offset: 3px; }
.sc-answer a { color: #065f46; font-weight: 700; }

/* Herramienta */
.sc-workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 26px; align-items: start; }
.sc-editor, .sc-side { min-width: 0; border: 1px solid var(--sc-border); border-radius: 22px; background: var(--sc-panel); }
.sc-editor { padding: 24px; }
.sc-editor fieldset { min-width: 0; margin: 0; padding: 0 0 24px; border: 0; }
.sc-editor fieldset + fieldset { padding-top: 22px; border-top: 1px solid var(--sc-border); }
.sc-editor legend, .sc-side h3 { padding: 0; margin: 0; color: #fff; font-size: 1.1rem; font-weight: 800; }
.sc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.sc-wide { grid-column: 1 / -1; }
.sc-editor label, .sc-side label { display: grid; gap: 6px; color: #f5f5f4; font-size: .85rem; font-weight: 700; }
.sc-editor label small, .sc-help { color: #d6d3d1; font-size: .78rem; font-weight: 500; line-height: 1.5; }
.sc-editor input[type="text"], .sc-editor input:not([type]), .sc-editor select, .sc-side textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #62564d; border-radius: 10px; background: #fff; color: #1c1917; font: inherit; font-weight: 500; }
.sc-editor input::placeholder { color: #6b625b; }
.sc-editor :focus-visible, .sc-side :focus-visible, .size-chart-page .sc-btn:focus-visible, .sc-presets label:focus-within, .sc-seg label:focus-within, .sc-check:focus-within { outline: 3px solid var(--sc-gold); outline-offset: 2px; }

.sc-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.sc-presets label { position: relative; display: flex !important; align-items: center; gap: 8px; min-height: 52px; padding: 10px; border: 1px solid #4b423b; border-radius: 12px; background: var(--sc-panel-2); font-size: .8rem !important; line-height: 1.25; cursor: pointer; }
.sc-presets label:has(input:checked) { border-color: #2dd4bf; background: #042f2e; }
.sc-presets input, .sc-seg input { accent-color: #14b8a6; flex: none; width: 18px; height: 18px; margin: 0; }

.sc-shoe { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 14px; padding: 12px; border: 1px dashed #5b4f45; border-radius: 12px; background: #1b1715; }
.sc-shoe label { min-width: 110px; }
.sc-shoe select { min-height: 42px; }
.sc-shoe p { flex-basis: 100%; margin: 0; }

.sc-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.sc-seg label { display: flex !important; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #4b423b; border-radius: 999px; background: var(--sc-panel-2); cursor: pointer; font-size: .82rem !important; }
.sc-seg label:has(input:checked) { border-color: #2dd4bf; background: #042f2e; }
.sc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 12px; }
.sc-toolbar__unit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #f5f5f4; font-size: .85rem; font-weight: 700; }

.sc-example { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 12px 14px; border: 1px solid #b45309; border-radius: 12px; background: #451a03; color: #fde68a; font-size: .85rem; font-weight: 700; line-height: 1.5; }
.sc-example[hidden] { display: none; }
.sc-example button { margin-left: auto; flex: none; }

.sc-grid { position: relative; max-width: 100%; overflow-x: auto; border: 1px solid #4b423b; border-radius: 14px; background: #1b1715; -webkit-overflow-scrolling: touch; }
.sc-grid:focus-visible { outline: 3px solid var(--sc-gold); outline-offset: 2px; }
.sc-grid__table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.sc-grid__table th, .sc-grid__table td { padding: 6px; border-bottom: 1px solid #332c27; text-align: left; vertical-align: top; }
.sc-grid__table thead th { background: #26211d; }
.sc-grid__table tbody tr:last-child th, .sc-grid__table tbody tr:last-child td { border-bottom: 0; }
.sc-grid__table input { width: 100%; min-width: 86px; min-height: 40px !important; padding: 7px 9px !important; border-radius: 8px !important; font-size: .88rem !important; }
.sc-grid__table input.is-size { font-weight: 800 !important; min-width: 80px; }
.sc-grid__table thead input { font-weight: 700 !important; min-width: 132px; }
.sc-grid__head { display: grid; gap: 4px; }
.sc-grid__meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 26px; }
.sc-grid__kind { color: #a8a29e; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.sc-grid__actions, .sc-grid__actions-col { width: 1%; white-space: nowrap; }
.sc-grid__remove { min-height: 32px; padding: 4px 6px; border: 0; background: transparent; color: #fca5a5; font: inherit; font-size: .76rem; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sc-grid__remove:disabled { color: #78716c; cursor: not-allowed; text-decoration: none; }
.sc-grid-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sc-grid-actions + .sc-help { margin: 10px 0 0; }

.sc-check { display: flex !important; align-items: center; gap: 10px !important; padding: 12px; border: 1px solid #4b423b; border-radius: 12px; background: var(--sc-panel-2); cursor: pointer; }
.sc-check input { width: 20px; height: 20px; accent-color: #14b8a6; flex: none; margin: 0; }
.sc-color { display: flex; min-height: 46px; align-items: center; gap: 12px; padding: 6px 10px; border: 1px solid #62564d; border-radius: 10px; background: #fff; color: #292524; }
.sc-color input { width: 52px; height: 32px; padding: 0; border: 0; background: transparent; }
.sc-file { padding: 12px; border: 1px dashed #74675d; border-radius: 12px; background: var(--sc-panel-2); }
.sc-file input { max-width: 100%; color: #f5f5f4; font-weight: 500; }
.sc-file .sc-btn { justify-self: start; }

.size-chart-page .sc-btn { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 11px 18px; border: 1px solid transparent; border-radius: 11px; font: inherit; font-size: .9rem; font-weight: 800; line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.size-chart-page .sc-btn:hover { transform: translateY(-1px); }
.size-chart-page .sc-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.size-chart-page .sc-btn--primary { background: var(--sc-gold); color: #241900; border-color: var(--sc-gold); }
.size-chart-page .sc-btn--secondary { background: #292524; color: #fff; border-color: #786b61; }
.size-chart-page .sc-btn--quiet { background: transparent; color: #e7e5e4; border-color: #51463d; }
.size-chart-page .sc-btn--publish { background: #10b981; color: #052e1f; border-color: #10b981; }
.size-chart-page .sc-btn--publish:hover { background: #34d399; }
.size-chart-page .sc-btn--small { min-height: 38px; padding: 7px 12px; background: #332d28; color: #fff; border-color: #74675d; font-size: .8rem; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sc-status { min-height: 1.4em; margin: 14px 0 0; color: var(--sc-gold); font-size: .86rem; font-weight: 700; line-height: 1.5; }
.sc-status.is-error { color: #fca5a5; }
.sc-privacy { margin: 10px 0 0; color: #d6d3d1; font-size: .78rem; line-height: 1.6; }
.sc-howto { margin: 14px 0 0; padding: 12px 14px; border: 1px solid #4b423b; border-radius: 12px; background: #1b1715; color: #d6d3d1; font-size: .82rem; line-height: 1.6; }
.sc-howto ul { display: inline; margin: 0; padding: 0; list-style: none; }
.sc-howto li { display: inline; }
.sc-howto li + li::before { content: " · "; color: #78716c; }

/* Lateral: vista previa y salidas */
.sc-side { position: sticky; top: 88px; padding: 16px; }
.sc-side__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 2px 2px 12px; color: #e7e5e4; font-size: .8rem; font-weight: 800; }
.sc-preview { max-height: 620px; overflow: auto; padding: 12px; border-radius: 12px; background: #e7e5e4; }
.sc-format { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
.sc-format legend { margin-bottom: 8px; padding: 0; color: #fff; font-size: .9rem; font-weight: 800; }
.sc-format label { display: flex !important; align-items: center; gap: 8px; padding: 10px; border: 1px solid #4b423b; border-radius: 10px; background: var(--sc-panel-2); font-size: .8rem !important; cursor: pointer; }
.sc-format label:has(input:checked) { border-color: #2dd4bf; background: #042f2e; }
.sc-format label:focus-within { outline: 3px solid var(--sc-gold); outline-offset: 2px; }
.sc-format input { accent-color: #14b8a6; }
.sc-side__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sc-out { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--sc-border); }
.sc-out textarea { min-height: 150px; font: .78rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
.sc-out .sc-actions { margin-top: 10px; align-items: center; }
.sc-note { margin: 8px 0 0; color: #d6d3d1; font-size: .78rem; line-height: 1.55; }
.sc-publish-box { margin-top: 18px; padding: 16px; border: 1px solid #065f46; border-radius: 14px; background: #062a1f; }
.sc-publish-box p { margin: 0 0 12px; color: #d1fae5; font-size: .88rem; line-height: 1.6; }
.sc-publish-box .sc-btn { width: 100%; }

/* Hoja (vista previa y PDF) */
.sc-sheet { overflow: hidden; border-radius: 10px; background: #fff; color: #1c1917; box-shadow: 0 6px 18px rgba(0,0,0,.16); font-family: Inter, "Segoe UI", Arial, sans-serif; }
.sc-sheet__head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--sc-accent, #0f766e); color: var(--sc-on-accent, #fff); }
.sc-sheet__head img { width: 56px; height: 56px; padding: 4px; object-fit: contain; border-radius: 10px; background: #fff; flex: none; }
.sc-sheet__brand { margin: 0 0 2px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.sc-sheet__title { margin: 0; font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.sc-sheet__table { position: relative; overflow-x: auto; padding: 14px; }
.sc-sheet table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.sc-sheet th, .sc-sheet td { padding: 8px 7px; border: 1px solid #d6d3d1; text-align: center; }
.sc-sheet thead th { background: var(--sc-tint, #f0fdfa); font-size: .74rem; font-weight: 800; line-height: 1.3; }
.sc-sheet tbody th { font-weight: 800; white-space: nowrap; }
.sc-sheet tbody tr:nth-child(even) { background: #f5f5f4; }
.sc-sheet__example { margin: 0 14px 10px; padding: 9px 12px; border-radius: 8px; background: #fef3c7; color: #78350f; font-size: .8rem; font-weight: 700; line-height: 1.45; }
.sc-sheet__empty { margin: 0 14px 12px; color: #57534e; font-size: .85rem; }
.sc-sheet__notes { margin: 0; padding: 0 16px 16px 34px; color: #44403c; font-size: .8rem; line-height: 1.55; }

/* Cómo medir */
.sc-measure-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sc-measure-grid figure { margin: 0; padding: 18px; border: 1px solid #403832; border-radius: 16px; background: #1d1917; scroll-margin-top: 90px; }
.sc-measure-grid figure.is-relevant { border-color: #2dd4bf; }
.sc-measure-grid svg { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 12px; border-radius: 12px; background: #fafaf9; }
.sc-measure-grid figcaption h3 { margin: 0 0 6px; color: #fff; font-size: 1rem; }
.sc-measure-grid figcaption p, .sc-measure-grid figcaption li { margin: 0; color: #d6d3d1; font-size: .88rem; line-height: 1.6; }
.sc-measure-grid figcaption ul { margin: 6px 0 0; padding-left: 18px; }

/* Contenido */
.sc-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sc-steps article, .sc-cards article { padding: 22px; border: 1px solid #403832; border-radius: 16px; background: #1d1917; }
.sc-steps span { color: var(--sc-gold); font-size: .75rem; font-weight: 900; }
.sc-steps h3, .sc-cards h3 { margin: 10px 0 8px; color: #fff; font-size: 1.04rem; }
.sc-steps p, .sc-cards p, .sc-cards li { margin: 0; color: #d6d3d1; font-size: .9rem; line-height: 1.65; }
.sc-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sc-cards ul { margin: 10px 0 0; padding-left: 18px; }
.sc-copy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.sc-copy ul { padding-left: 20px; }
.sc-faq { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sc-faq details { padding: 16px 18px; border: 1px solid #4b423b; border-radius: 12px; background: var(--sc-panel-2); }
.sc-faq summary { color: #fff; font-weight: 800; cursor: pointer; }
.sc-faq summary:focus-visible { outline: 3px solid var(--sc-gold); outline-offset: 2px; }
.sc-faq p { color: #d6d3d1; line-height: 1.65; }
.sc-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.sc-related li { padding: 16px; border: 1px solid #403832; border-radius: 12px; background: #1d1917; color: #d6d3d1; font-size: .88rem; line-height: 1.55; }
.sc-related a { display: block; margin-bottom: 4px; font-weight: 800; }
.sc-final { padding: 44px; border: 1px solid #665a50; border-radius: 24px; background: linear-gradient(135deg, #211d1a, #151210); text-align: center; }
.sc-final > div { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.sc-final a:not(.sc-btn) { color: var(--sc-gold); }
.size-chart-page .footer { background: #0a0a0a; color: #f5f5f4; }
.size-chart-page .footer h3 { color: #fff; }
.size-chart-page .footer a, .size-chart-page .footer p { color: #a8a29e; }

@media (max-width: 980px) {
  .sc-workspace, .sc-copy-grid { grid-template-columns: 1fr; }
  .sc-side { position: static; }
  .sc-preview { max-height: none; }
  .sc-steps, .sc-cards, .sc-related, .sc-measure-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .sc-container { width: min(100% - 24px, 1180px); }
  .sc-hero { padding: 92px 0 44px; }
  .sc-tool-section, .sc-section { padding: 52px 0; }
  .sc-editor, .sc-side { padding: 14px; border-radius: 16px; }
  .sc-presets { grid-template-columns: 1fr 1fr; }
  .sc-fields, .sc-faq, .sc-steps, .sc-cards, .sc-related, .sc-measure-grid, .sc-side__actions { grid-template-columns: 1fr; }
  .sc-hero__actions .sc-btn, .sc-side__actions .sc-btn { width: 100%; }
  .sc-format { grid-template-columns: 1fr; }
  .sc-preview { padding: 8px; }
  .sc-final { padding: 28px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .size-chart-page .sc-btn { transition: none; }
  .size-chart-page .sc-btn:hover { transform: none; }
}

/* PDF */
@page { size: A4; margin: 14mm; }
@media print {
  html, body.size-chart-page { background: #fff !important; color: #1c1917 !important; }
  body.size-chart-page > :not(#sc-print) { display: none !important; }
  .sc-print { display: block !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .sc-print .sc-sheet { box-shadow: none; border-radius: 0; }
  .sc-print .sc-sheet__head { border-radius: 3mm; padding: 6mm 7mm; }
  .sc-print .sc-sheet__head img { width: 20mm; height: 20mm; }
  .sc-print .sc-sheet__title { font-size: 20pt; }
  .sc-print .sc-sheet__table { overflow: visible; padding: 6mm 0 3mm; }
  .sc-print table { font-size: 11pt; }
  .sc-print th, .sc-print td { padding: 2.6mm 2mm; }
  .sc-print tr { break-inside: avoid; }
  .sc-print .sc-sheet__example { margin: 0 0 3mm; }
  .sc-print .sc-sheet__notes { padding: 0 0 0 6mm; font-size: 10pt; }
}
