:root {
  --ks-bg: #fbfaf8;
  --ks-paper: #fffefc;
  --ks-ink: #29212e;
  --ks-muted: #77707a;
  --ks-primary: #7d6198;
  --ks-primary-dark: #654979;
  --ks-lavender: #f3ecf8;
  --ks-lavender-border: #d7c5e6;
  --ks-stroke: #e9e3e0;
  --ks-sand: #e0b98f;
  --ks-blush: #d9a5ac;
  --ks-control-bg: #fff;
  --ks-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ks-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.ks-body { margin: 0; background: var(--ks-bg); color: var(--ks-ink); font-family: var(--ks-font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.ks-body button, body.ks-body input, body.ks-body select { font: inherit; }
body.ks-body button { cursor: pointer; }
body.ks-body :is(button, input, select, a):focus-visible { outline: 3px solid var(--ks-primary); outline-offset: 3px; }
[hidden] { display: none !important; }
.ks-visually-hidden { position: absolute !important; height: 1px; width: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.ks-skip-link { position: fixed; z-index: 100; left: 12px; top: -80px; background: var(--ks-ink); color: #fff; padding: 11px 14px; border-radius: 4px; }
.ks-skip-link:focus { top: 12px; }
.ks-app { min-height: 100vh; padding: 34px 0 28px; overflow-x: clip; }
.ks-shell { width: min(1300px, calc(100% - 64px)); margin-inline: auto; }
.ks-intro { text-align: center; margin: 0 auto 34px; }
.ks-eyebrow { display: flex; align-items: center; justify-content: center; gap: 13px; color: var(--ks-primary); font-size: 10px; font-weight: 700; letter-spacing: .2em; margin-bottom: 7px; }
.ks-eyebrow-line { display: block; width: 38px; height: 1px; background: #e0d5e5; }
.ks-intro h1 { font-family: var(--ks-display); font-size: clamp(46px, 5.4vw, 75px); letter-spacing: -.022em; line-height: 1.04; font-weight: 400; margin: 0; }
.ks-intro h1 em { color: var(--ks-primary); font-weight: 400; }
.ks-intro p { font-size: 16px; line-height: 1.6; color: #66606b; max-width: 630px; margin: 16px auto 0; }
.ks-workspace { display: grid; grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr); gap: 20px; align-items: stretch; }
.ks-panel { background: var(--ks-paper); border: 1px solid var(--ks-stroke); border-radius: 19px; padding: 27px 29px 28px; min-width: 0; box-shadow: 0 8px 36px rgba(52, 41, 61, .025); }
.ks-panel-heading { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 22px; }
.ks-step { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #f3ede9; color: var(--ks-primary-dark); font-family: var(--ks-display); font-size: 25px; line-height: 1; }
.ks-panel-heading h2 { font-family: var(--ks-display); font-size: clamp(30px, 2.6vw, 39px); font-weight: 400; letter-spacing: -.018em; line-height: 1.04; margin: 0 0 6px; }
.ks-panel-heading p { color: var(--ks-muted); font-size: 13px; margin: 0; line-height: 1.5; }
.ks-unit-switch { display: grid; grid-template-columns: 1fr 1fr; background: #faf7f8; border: 1px solid var(--ks-stroke); padding: 3px; gap: 4px; border-radius: 10px; margin: 0 0 21px; }
.ks-unit-button { border: 0; background: none; color: #7d7681; min-height: 42px; font-size: 13px !important; font-weight: 600 !important; border-radius: 7px; transition: background-color .2s, color .2s; }
.ks-unit-button.is-active { background: #ebe0f1; color: #4f3b63; box-shadow: 0 1px 2px rgba(69, 50, 78, .04); }
fieldset.ks-sex-choice, fieldset.ks-goal-choice { margin: 0; padding: 0; border: none; min-width: 0; }
.ks-sex-choice legend, .ks-goal-choice legend, .ks-field > label, .ks-field-caption { display: block; width: 100%; font-size: 13px; font-weight: 700; line-height: 1.5; color: #332b38; margin-bottom: 8px; }
.ks-field label span, .ks-field-caption span { font-weight: 400; color: var(--ks-muted); }
.ks-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 21px; }
.ks-sex-option { display: flex; align-items: center; gap: 10px; border: 1px solid #e8e1e1; background: #fff; padding: 0 14px; min-height: 49px; border-radius: 9px; cursor: pointer; position: relative; transition: border-color .18s, background .18s; }
.ks-sex-option:has(input:checked), .ks-goal-option:has(input:checked) { border-color: #cfbbe0; background: #faf5ff; }
.ks-sex-option:has(input:focus-visible), .ks-goal-option:has(input:focus-visible) { outline: 3px solid var(--ks-primary); outline-offset: 2px; }
.ks-sex-option input, .ks-goal-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ks-sex-label { font-size: 14px; }
.ks-radio-indicator { display: inline-flex; flex: 0 0 auto; height: 18px; width: 18px; border-radius: 50%; border: 1.5px solid #c8c0c8; background: #fff; position: relative; }
.ks-sex-option .ks-radio-indicator { margin-left: auto; }
.ks-sex-option input:checked ~ .ks-radio-indicator, .ks-goal-option input:checked + .ks-radio-indicator { border-color: var(--ks-primary); }
.ks-sex-option input:checked ~ .ks-radio-indicator:after, .ks-goal-option input:checked + .ks-radio-indicator:after { content: ''; position: absolute; inset: 3px; background: var(--ks-primary); border-radius: 50%; }
.ks-measurements { display: grid; grid-template-columns: .82fr 1fr 1fr; gap: 13px; margin-bottom: 20px; }
.ks-field { min-width: 0; }
.ks-field input, .ks-field select { width: 100%; min-width: 0; height: 49px; padding: 0 12px; background: var(--ks-control-bg); border: 1px solid #e7e0dd; border-radius: 9px; color: #302735; outline: none; transition: border-color .18s, box-shadow .18s; }
.ks-field input:hover, .ks-field select:hover { border-color: #c7b3d2; }
.ks-field input:focus, .ks-field select:focus { border-color: var(--ks-primary); box-shadow: 0 0 0 3px rgba(125,97,152,.12); }
.ks-field input[aria-invalid="true"] { border-color: #ba5964; background: #fff8f8; }
.ks-height-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ks-height-pair input { padding: 0 8px; text-align: center; }
.ks-select-wrap { position: relative; }
.ks-select-wrap select { appearance: none; padding-right: 40px; font-size: 14px; background: #fff; }
.ks-select-wrap svg { position: absolute; right: 13px; top: calc(50% - 10px); pointer-events: none; color: var(--ks-primary); }
.ks-activity-field { margin-bottom: 21px; }
.ks-goal-choice legend { margin-bottom: 9px; }
.ks-goal-option { display: flex; align-items: center; gap: 13px; border: 1px solid #e9e3e0; background: #fff; padding: 10px 14px; min-height: 59px; border-radius: 9px; cursor: pointer; position: relative; margin-bottom: 8px; transition: border-color .18s, background .18s; }
.ks-goal-copy { display: flex; flex-direction: column; min-width: 0; }
.ks-goal-copy strong { font-size: 13.5px; font-weight: 700; }
.ks-goal-copy small { font-size: 11.5px; color: var(--ks-muted); line-height: 1.35; margin-top: 2px; }
.ks-primary-button { width: 100%; display: flex; justify-content: center; align-items: center; gap: 13px; min-height: 52px; border: 1px solid var(--ks-primary); border-radius: 10px; background: var(--ks-primary); color: #fff; font-size: 14px !important; font-weight: 600 !important; transition: background-color .2s, transform .2s; margin-top: 16px; }
.ks-primary-button:hover { background: var(--ks-primary-dark); }
.ks-primary-button svg { flex: 0 0 auto; }
.ks-primary-button:active { transform: translateY(1px); }
.ks-form-footnote { text-align: center; font-size: 11px; color: #8b828b; margin: 9px 0 0; }
.ks-error { background: #fff5f4; border: 1px solid #efbabb; border-radius: 9px; padding: 12px 14px; color: #922b36; margin-top: 12px; font-size: 13px; }
.ks-results-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.ks-panel-heading--results { margin-bottom: 0; }
.ks-print-button { flex: 0 0 auto; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #e7ddea; background: #f7f2fa; color: #624676; padding: 0 13px; border-radius: 8px; font-size: 12px !important; font-weight: 700 !important; margin-top: 4px; }
.ks-print-button:hover { background: #ede2f2; }
.ks-main-metrics { display: grid; grid-template-columns: 1fr .93fr; min-height: 339px; border-top: 1px solid var(--ks-stroke); border-bottom: 1px solid var(--ks-stroke); padding: 26px 0 25px; }
.ks-calorie-area { display: flex; flex-direction: column; align-items: center; text-align: center; border-right: 1px solid var(--ks-stroke); padding: 1px 20px 0 4px; }
.ks-metric-overline { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: #84798b; text-align: center; }
.ks-calorie-ring { display: grid; place-items: center; width: min(228px, 100%); aspect-ratio: 1; margin: 15px auto 9px; border-radius: 50%; background: conic-gradient(var(--ks-primary) 0 25%, var(--ks-sand) 25% 70%, var(--ks-blush) 70% 100%); position: relative; padding: 13px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.8); }
.ks-calorie-ring::before { content: ''; position: absolute; inset: -5px; border: 1px solid #eee7ed; border-radius: 50%; }
.ks-calorie-inner { background: var(--ks-paper); width: 100%; height: 100%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.ks-calorie-number { font-family: var(--ks-display); font-size: clamp(48px, 4vw, 64px); font-weight: 400; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.ks-calorie-unit { font-size: 13px; color: #5c5360; margin-top: 5px; }
.ks-calorie-badge { background: #f1e6f8; color: #644c7b; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; margin-top: 12px; }
.ks-energy-hint { font-size: 11.5px; line-height: 1.5; color: var(--ks-muted); max-width: 240px; margin: 9px auto 0; }
.ks-bmi-area { display: flex; align-items: center; flex-direction: column; text-align: center; padding: 3px 0 0 22px; }
.ks-bmi-value { font-family: var(--ks-display); font-size: 79px; line-height: 1.02; margin: 20px 0 0; font-variant-numeric: tabular-nums; }
.ks-bmi-status { display: inline-flex; align-items: center; justify-content: center; padding: 4px 14px; font-size: 12px; border-radius: 40px; background: #e8f1e6; color: #406e44; font-weight: 700; }
.ks-bmi-status.is-caution { background: #fff2e6; color: #865327; }
.ks-bmi-track { display: flex; width: min(240px, 100%); height: 13px; border-radius: 16px; overflow: visible; margin-top: 32px; position: relative; }
.ks-bmi-band { height: 100%; border-right: 2px solid var(--ks-paper); }
.ks-band-low { flex: 0 0 14%; background: #e9d8bc; border-radius: 16px 0 0 16px; }
.ks-band-normal { flex: 0 0 26%; background: #cce0cf; }
.ks-band-over { flex: 0 0 20%; background: #e6d4ab; }
.ks-band-high { flex: 1; background: #e6bac1; border-right: 0; border-radius: 0 16px 16px 0; }
.ks-bmi-pointer { position: absolute; width: 11px; height: 11px; top: 1px; transform: translateX(-50%); border: 2px solid #fff; background: #342b39; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.26); transition: left .3s; }
.ks-bmi-markers { display: flex; width: min(240px, 100%); font-size: 10px; color: #8a818a; position: relative; height: 24px; }
.ks-bmi-markers span { position: absolute; transform: translateX(-50%); top: 4px; }
.ks-bmi-markers span:nth-child(1) { left: 14%; }
.ks-bmi-markers span:nth-child(2) { left: 40%; }
.ks-bmi-markers span:nth-child(3) { left: 60%; }
.ks-bmi-note { color: var(--ks-muted); font-size: 12px; line-height: 1.55; max-width: 240px; margin: 9px auto 0; }
.ks-macros { padding: 21px 0 0; }
.ks-macros-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.ks-macros-heading h3 { font-family: var(--ks-display); font-size: 27px; font-weight: 400; line-height: 1.1; margin: 0 0 4px; }
.ks-macros-heading p { margin: 0; font-size: 12px; color: var(--ks-muted); }
.ks-macros-heading > span { color: #9a909b; font-size: 9px; font-weight: 700; letter-spacing: .055em; white-space: nowrap; }
.ks-macro-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
.ks-macro { min-width: 0; border-radius: 10px; padding: 16px 14px 13px; }
.ks-macro-protein { background: #f4eef9; --ks-bar: #9c7fb9; }
.ks-macro-carbs { background: #faf3e9; --ks-bar: #d4a775; }
.ks-macro-fat { background: #faf0f1; --ks-bar: #d7a3a9; }
.ks-macro-name { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ks-macro-dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--ks-bar); }
.ks-macro strong { display: block; font-family: var(--ks-display); font-size: 38px; font-weight: 400; line-height: 1.15; margin: 9px 0 9px; font-variant-numeric: tabular-nums; }
.ks-macro strong small { font-family: var(--ks-font); font-weight: 500; font-size: 12px; }
.ks-macro-line { background: rgba(80,55,70,.09); height: 5px; border-radius: 20px; overflow: hidden; }
.ks-macro-line span { display: block; height: 100%; background: var(--ks-bar); border-radius: inherit; }
.ks-macro-pct { display: block; margin-top: 8px; color: #6a5f6f; font-size: 10px; }
.ks-summary-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid var(--ks-stroke); margin-top: 20px; padding-top: 17px; }
.ks-summary-strip > div { display: flex; flex-direction: column; gap: 4px; }
.ks-summary-strip > div + div { border-left: 1px solid var(--ks-stroke); padding-left: 18px; }
.ks-summary-strip span { color: #7d747e; font-size: 11px; }
.ks-summary-strip strong { color: #55415f; font-size: 16px; font-weight: 700; }
.ks-empty-results { border: 1px dashed var(--ks-lavender-border); padding: 50px 30px; text-align: center; border-radius: 12px; }
.ks-empty-results h3 { font-family: var(--ks-display); font-size: 30px; font-weight: 400; margin: 0 0 5px; }
.ks-empty-results p { color: var(--ks-muted); font-size: 14px; }
.ks-disclaimer { display: flex; align-items: flex-start; gap: 12px; padding: 22px 7px 17px; color: #817983; max-width: 1050px; margin-inline: auto; }
.ks-disclaimer svg { flex: 0 0 auto; color: var(--ks-primary); margin-top: 3px; }
.ks-disclaimer p { margin: 0; font-size: 12px; line-height: 1.6; }
.ks-disclaimer strong { color: #5d5361; }
.ks-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--ks-stroke); padding: 17px 2px 0; color: #918791; font-size: 10px; letter-spacing: .01em; }
.ks-footer span:first-child { font-weight: 700; letter-spacing: .1em; }
.ks-standard-page { width: min(860px, calc(100% - 40px)); margin: 60px auto; min-height: 70vh; }
.ks-standard-page h1 { font: 400 clamp(42px, 6vw, 68px)/1.1 var(--ks-display); }
.ks-plain-link { color: var(--ks-primary-dark); text-underline-offset: 4px; }
@media (max-width: 1190px) {
  .ks-shell { width: min(900px, calc(100% - 48px)); }
  .ks-workspace { grid-template-columns: 1fr; }
  .ks-panel { padding: 31px; }
  .ks-main-metrics { grid-template-columns: 1fr 1fr; }
  .ks-calorie-ring { width: 245px; }
}
@media (max-width: 700px) {
  .ks-app { padding-top: 26px; }
  .ks-shell { width: calc(100% - 28px); }
  .ks-intro { margin-bottom: 24px; }
  .ks-intro h1 { font-size: clamp(43px, 10vw, 60px); }
  .ks-intro p { font-size: 14px; padding-inline: 6px; }
  .ks-panel { padding: 22px 18px 24px; border-radius: 15px; }
  .ks-panel-heading { gap: 11px; }
  .ks-panel-heading h2 { font-size: 34px; }
  .ks-step { width: 38px; height: 38px; font-size: 23px; }
  .ks-results-heading { flex-wrap: wrap; }
  .ks-main-metrics { grid-template-columns: 1fr 1fr; min-height: 0; gap: 12px; }
  .ks-calorie-area { padding-right: 12px; }
  .ks-bmi-area { padding-left: 0; }
  .ks-calorie-ring { width: min(195px, 100%); padding: 9px; }
  .ks-calorie-number { font-size: clamp(36px, 7vw, 56px); }
  .ks-bmi-value { font-size: clamp(54px, 13vw, 76px); }
  .ks-macros-heading > span { display: none; }
  .ks-macro { padding: 14px 11px 12px; }
  .ks-macro strong { font-size: 33px; }
  .ks-macro-name { font-size: 11px; }
  .ks-disclaimer { padding-inline: 0; }
}
@media (max-width: 480px) {
  .ks-shell { width: calc(100% - 24px); }
  .ks-intro h1 { font-size: clamp(42px, 10.5vw, 52px); }
  .ks-intro p { font-size: 13.5px; }
  .ks-panel { padding: 22px 16px; }
  .ks-measurements { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .ks-measurements > div:last-child { grid-column: span 2; }
  .ks-sex-option { padding: 0 11px; }
  .ks-main-metrics { grid-template-columns: 1fr; padding-block: 22px; }
  .ks-calorie-area { border-right: none; border-bottom: 1px solid var(--ks-stroke); padding: 0 0 23px; }
  .ks-bmi-area { padding: 17px 0 0; }
  .ks-calorie-ring { width: 215px; }
  .ks-calorie-number { font-size: 57px; }
  .ks-bmi-value { margin-top: 10px; }
  .ks-bmi-track { margin-top: 20px; }
  .ks-macro-grid { gap: 6px; }
  .ks-macro { padding: 12px 9px; }
  .ks-macro strong { font-size: 31px; }
  .ks-macro-name { font-size: 10px; }
  .ks-macro-dot { width: 7px; height: 7px; }
  .ks-macro-pct { font-size: 9px; }
  .ks-summary-strip strong { font-size: 14px; }
  .ks-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 340px) {
  .ks-macro-grid { grid-template-columns: 1fr; }
  .ks-macro { display: grid; grid-template-columns: 1fr auto; column-gap: 15px; align-items: center; }
  .ks-macro strong { margin: 0; }
  .ks-macro-line, .ks-macro-pct { grid-column: span 2; }
  .ks-intro h1 { font-size: 40px; }
  .ks-results-heading { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
/* El reporte PDF se crea como un documento independiente, no desde la vista de impresión. */
.ks-print-button:disabled { opacity: .6; cursor: progress; }
.ks-error:not([hidden]) { margin-top: 12px; }
@media (max-width: 700px) { .ks-select-wrap select { font-size: 16px; } }
