/* Calculadora de sueldo de funcionario (clases .cs-*). La usa solo calculadora-sueldo-funcionario.html.
   Los colores y medidas salen de shared/tokens.css, que llega con index.css. */
body { background: var(--bg); }
.cs-wrap { max-width: var(--maxw-read); margin: 0 auto; padding: calc(var(--header-h) + 20px) 20px 72px; }

/* Cabecera compacta: la herramienta tiene que caber en la primera pantalla */
.cs-hero { position: relative; overflow: hidden; background: var(--hero-grad); border-radius: var(--r-lg); padding: 18px 28px 20px; color: #fff; }
.cs-hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.07); right: -70px; top: -150px; pointer-events: none; }
.cs-crumb { display: flex; gap: 6px; align-items: center; font-size: .78rem; color: rgba(255,255,255,.6); margin-bottom: 8px; }
.cs-crumb a { color: rgba(255,255,255,.8); text-decoration: none; }
.cs-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; align-items: end; }
.cs-hero > * { position: relative; z-index: 1; }
.cs-crumb, .cs-hero h1, .cs-hero > p { grid-column: 1; }
.cs-hero h1 { font-family: "RobotoSlab", serif; font-weight: 800; font-size: clamp(1.45rem, 2.6vw, 2.05rem); line-height: 1.15; margin: 0 0 6px; color: #fff; letter-spacing: -.01em; }
.cs-hero h1 em { font-style: normal; color: var(--accent); }
.cs-hero p { margin: 0; color: rgba(255,255,255,.86); font-size: 1rem; max-width: 62ch; line-height: 1.45; }
.cs-trust { grid-column: 2; grid-row: 1 / span 3; display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; align-self: center; }
.cs-trust li { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); border-radius: var(--r-pill); padding: 5px 12px; font-size: .78rem; font-weight: 600; color: #fff; }
.cs-trust svg { width: 14px; height: 14px; flex: none; }

/* Rejilla: pasos a la izquierda, resultado fijo a la derecha */
.cs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 24px; margin-top: 20px; align-items: start; }
.cs-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.cs-steps { padding: 6px 26px 22px; }
.cs-step { padding: 20px 0; border-bottom: 1px solid var(--border); }
.cs-step:last-child { border-bottom: 0; padding-bottom: 4px; }
.cs-step-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.cs-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--brand); font-weight: 800; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; transform: translateY(2px); }
.cs-step-h h2 { font-family: "RobotoSlab", serif; font-size: 1.12rem; font-weight: 700; margin: 0; color: var(--text); }
.cs-step-h small { color: var(--text-3); font-size: .82rem; font-weight: 500; }

.cs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cs-field label, .cs-lab { display: block; font-size: .78rem; font-weight: 700; color: var(--text-2); letter-spacing: .02em; margin: 0 0 6px; text-transform: uppercase; }
.cs-field select, .cs-field input[type=number] { width: 100%; height: 46px; border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); padding: 0 12px; font: inherit; font-size: 1rem; color: var(--text); font-weight: 600; }
.cs-field select:focus, .cs-field input:focus, .cs-chip:focus-visible, .cs-stepper button:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--brand-mid); }

.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-chip { min-width: 54px; height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--border); background: var(--surface-2); font: inherit; font-weight: 700; color: var(--text-2); cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.cs-chip:hover { border-color: var(--brand-mid); color: var(--brand); }
.cs-chip[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: #fff; }
.cs-chip small { display: block; font-size: .62rem; font-weight: 600; opacity: .75; line-height: 1; margin-top: 1px; }

/* Aviso de «dato real» o «dato que has puesto tú» */
.cs-real { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 11px 14px; border-radius: var(--r-sm); font-size: .88rem; line-height: 1.4; }
.cs-real svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.cs-real.ok { background: var(--state-open-bg); color: #0E5C39; }
.cs-real.aviso { background: var(--state-soon-bg); color: #6F4200; }
.cs-real a { color: inherit; font-weight: 700; }

.cs-range { display: grid; grid-template-columns: 1fr 150px; gap: 14px; align-items: center; }
.cs-range input[type=range] { width: 100%; accent-color: var(--brand-mid); height: 28px; }
.cs-hint { font-size: .82rem; color: var(--text-3); margin: 6px 0 0; line-height: 1.4; }

.cs-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); height: 46px; }
.cs-stepper button { width: 46px; height: 43px; border: 0; background: none; font-size: 1.35rem; font-weight: 700; color: var(--brand); cursor: pointer; border-radius: var(--r-sm); }
.cs-stepper output { min-width: 150px; text-align: center; font-weight: 700; color: var(--text); font-size: .98rem; }
.cs-mas { background: none; border: 0; padding: 0; margin-top: 12px; font: inherit; font-size: .88rem; font-weight: 700; color: var(--brand-mid); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Resultado */
.cs-res { position: sticky; top: calc(var(--header-h) + 16px); background: var(--brand); color: #fff; border-radius: var(--r-lg); padding: 24px 26px 22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.cs-res::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.cs-res-k { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.66); margin: 0 0 4px; }
.cs-big { font-family: "RobotoSlab", serif; font-weight: 800; font-size: 3.5rem; line-height: 1; letter-spacing: -.02em; margin: 0; display: flex; align-items: baseline; gap: 8px; }
.cs-big span { font-family: "Archivo", sans-serif; font-size: 1rem; font-weight: 600; color: rgba(255,255,255,.75); letter-spacing: 0; }
.cs-sub { margin: 8px 0 0; color: rgba(255,255,255,.86); font-size: .95rem; }
.cs-sub b { color: #fff; }
.cs-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 16px; }
.cs-duo div { background: rgba(255,255,255,.08); border-radius: var(--r-sm); padding: 10px 12px; }
.cs-duo dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.62); font-weight: 700; }
.cs-duo dd { margin: 3px 0 0; font-weight: 800; font-size: 1.2rem; }
.cs-duo dd small { font-weight: 600; font-size: .72rem; color: rgba(255,255,255,.7); }
.cs-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.1); }
.cs-bar i { display: block; height: 100%; transition: width var(--dur-med); }
.cs-leg { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; }
.cs-leg li { display: grid; grid-template-columns: 12px 1fr auto; gap: 9px; align-items: center; font-size: .9rem; color: rgba(255,255,255,.9); }
.cs-leg i { width: 12px; height: 12px; border-radius: 3px; }
.cs-leg b { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.cs-leg .t { color: rgba(255,255,255,.55); font-size: .74rem; font-weight: 600; margin-left: 6px; }
.c1 { background: #FFBF00; } .c2 { background: #7C9BFF; } .c3 { background: #5EE0B0; } .c4 { background: #D7B8FF; } .c5 { background: #FF9E80; }
.cs-neto { margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid rgba(255,255,255,.16); display: grid; gap: 6px; font-size: .9rem; }
.cs-neto div { display: flex; justify-content: space-between; color: rgba(255,255,255,.85); }
.cs-neto div b { color: #fff; font-variant-numeric: tabular-nums; }
.cs-neto .tot { font-weight: 800; color: #fff; padding-top: 6px; border-top: 1px dashed rgba(255,255,255,.22); }
.cs-nota { margin: 12px 0 0; font-size: .76rem; color: rgba(255,255,255,.62); line-height: 1.4; }
.cs-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.cs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: var(--r-sm); font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none; border: 1.5px solid rgba(255,255,255,.3); background: transparent; color: #fff; }
.cs-btn.pri { background: var(--accent); border-color: var(--accent); color: var(--brand); }

/* Lo que viene después del número */
.cs-after { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.cs-mini { padding: 18px 20px; }
.cs-mini h3 { font-family: "RobotoSlab", serif; font-size: 1rem; margin: 0 0 4px; color: var(--text); }
.cs-mini p { margin: 0; color: var(--text-2); font-size: .9rem; line-height: 1.45; }
.cs-anios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.cs-anios div { background: var(--brand-light); border-radius: var(--r-sm); padding: 10px 8px; text-align: center; }
.cs-anios span { display: block; font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.cs-anios b { display: block; font-family: "RobotoSlab", serif; font-size: 1.15rem; color: var(--brand); margin-top: 2px; }
.cs-plazas { border-left: 4px solid var(--accent); }
.cs-plazas .n { font-family: "RobotoSlab", serif; font-weight: 800; font-size: 1.9rem; color: var(--brand); line-height: 1; }
.cs-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; color: var(--brand-mid); text-decoration: underline; text-underline-offset: 3px; font-size: .92rem; }

/* Contenido que lee Google */
.cs-sec { margin-top: 28px; padding: 26px 28px; }
.cs-sec h2 { font-family: "RobotoSlab", serif; font-size: 1.35rem; margin: 0 0 6px; color: var(--text); }
.cs-sec > p { color: var(--text-2); margin: 0 0 14px; line-height: 1.55; max-width: 76ch; }
.cs-tw { overflow-x: auto; }
.cs-t { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.cs-t th, .cs-t td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.cs-t th:first-child, .cs-t td:first-child { text-align: left; }
.cs-t thead th { background: var(--brand); color: #fff; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.cs-t thead th:first-child { border-radius: var(--r-sm) 0 0 0; } .cs-t thead th:last-child { border-radius: 0 var(--r-sm) 0 0; }
.cs-t tbody tr.on td, .cs-t tbody tr.on th { background: var(--brand-light); font-weight: 700; }
.cs-t tbody th { font-weight: 800; color: var(--brand); }
.cs-faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.cs-faq summary { font-weight: 700; color: var(--text); cursor: pointer; }
.cs-faq p { margin: 8px 0 0; color: var(--text-2); line-height: 1.55; max-width: 76ch; }
.cs-src { font-size: .88rem; color: var(--text-2); line-height: 1.6; }
.cs-src a { color: var(--brand-mid); font-weight: 600; }

/* Barra fija del móvil: el número siempre a la vista mientras eliges */
.cs-bottom { display: none; }

@media (max-width: 980px) {
  .cs-wrap { padding: calc(var(--header-h) + 12px) 14px 150px; }
  .cs-hero { padding: 16px 18px 18px; border-radius: var(--r); }
  .cs-hero p { font-size: .93rem; }
  .cs-hero { display: block; }
  .cs-trust { display: none; }
  .cs-chips { flex-wrap: nowrap; gap: 6px; }
  .cs-chip { flex: 1 1 0; min-width: 0; padding: 0; }
  .cs-step-h small { display: none; }
  .cs-crumb > span { display: none; }
  .cs-anios span { font-size: .66rem; }
  .cs-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 14px; }
  .cs-steps { padding: 2px 16px 16px; }
  .cs-step { padding: 16px 0; }
  .cs-row, .cs-after, .cs-acc { grid-template-columns: 1fr; }
  .cs-range { grid-template-columns: 1fr 120px; }
  .cs-res { position: static; padding: 22px 18px 18px; }
  .cs-big { font-size: 3rem; }
  .cs-sec { padding: 20px 16px; }
  .cs-bottom { display: flex; position: fixed; z-index: 900; left: 0; right: 0; bottom: 0; background: var(--brand); color: #fff; padding: 10px 14px; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 -6px 24px rgba(4,6,77,.28); border-top: 3px solid var(--accent); transition: transform var(--dur-med); }
  .cs-bottom.fuera { transform: translateY(140%); }
  .cs-bottom small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.66); font-weight: 700; }
  .cs-bottom b { font-family: "RobotoSlab", serif; font-size: 1.55rem; line-height: 1.1; }
  .cs-bottom b .u { font-family: "Archivo", sans-serif; font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.75); }
  .cs-bottom button { height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 0; background: var(--accent); color: var(--brand); font: inherit; font-weight: 800; font-size: .88rem; }
}

/* ── Paso «¿Dónde?»: tipo de administración, buscador y lo que sale según lo que sabemos ── */
.cs-tipos { gap: 6px; }
.cs-tipos .cs-chip { height: 40px; padding: 0 13px; font-size: .88rem; min-width: 0; }
.cs-busca { position: relative; margin-top: 14px; }
.cs-busca input[type=search] { width: 100%; height: 50px; border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E5C85' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 14px center / 18px no-repeat; padding: 0 12px 0 42px; font: inherit; font-size: 1rem; font-weight: 600; color: var(--text); -webkit-appearance: none; appearance: none; }
.cs-busca input[type=search]:focus { outline: none; box-shadow: var(--ring); border-color: var(--brand-mid); }
.cs-sug { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.cs-sug li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; color: var(--text); }
.cs-sug li:hover, .cs-sug li.on { background: var(--brand-light); }
.cs-sug li small { color: var(--text-3); font-weight: 500; font-size: .84rem; }
.cs-sug li .ok { margin-left: auto; background: var(--state-open-bg); color: var(--state-open); border-radius: var(--r-pill); padding: 2px 9px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.cs-sug li.nada { cursor: default; color: var(--text-3); font-weight: 500; }
.cs-medidas { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .84rem; color: var(--text-3); }
.cs-medidas button { border: 1.5px solid #BFE5D0; background: var(--state-open-bg); color: #0E5C39; border-radius: var(--r-pill); padding: 5px 11px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.cs-medidas button:hover { border-color: var(--state-open); }
.cs-elegida { display: flex; align-items: center; gap: 10px; background: var(--brand-light); border-radius: var(--r-sm); padding: 12px 14px; }
.cs-elegida[hidden] { display: none; }
.cs-elegida .p { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--state-closed); }
.cs-elegida.real .p { background: var(--state-open); }
.cs-elegida b { color: var(--text); }
.cs-elegida small { color: var(--text-3); }
.cs-elegida button { margin-left: auto; background: none; border: 0; font: inherit; font-weight: 700; font-size: .88rem; color: var(--brand-mid); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cs-real.gris { background: var(--state-closed-bg); color: #3F3E63; }
.cs-seg { display: inline-flex; border: 1.5px solid var(--border); border-radius: var(--r-sm); overflow: hidden; margin-top: 14px; }
.cs-seg button { border: 0; background: var(--surface-2); padding: 9px 14px; font: inherit; font-weight: 700; font-size: .88rem; color: var(--text-2); cursor: pointer; }
.cs-seg button[aria-pressed=true] { background: var(--brand); color: #fff; }

/* Resultado: horquilla y referencias */
.cs-sello { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 3px 10px; font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 10px; }
.cs-sello.real { background: #1B7F53; color: #fff; }
.cs-sello.tuyo { background: #7C9BFF; color: #04064D; }
.cs-sello.horq { background: var(--accent); color: var(--brand); }
.cs-sello.ref { background: rgba(255,255,255,.16); color: #fff; }
.cs-big.horq { font-size: 2.55rem; white-space: nowrap; }
.cs-big.horq i { font-style: normal; color: rgba(255,255,255,.55); font-weight: 600; margin: 0 2px; }
.cs-puntos { position: relative; height: 34px; margin: 20px 6px 6px; }
.cs-puntos::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, rgba(255,191,0,.9) 0 6px, rgba(255,191,0,.35) 6px 10px); }
.cs-puntos i { position: absolute; top: 4px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); box-shadow: 0 0 0 2px var(--accent); }
.cs-extremos { display: flex; justify-content: space-between; font-size: .76rem; color: rgba(255,255,255,.7); margin-bottom: 14px; }
.cs-lm { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.16); display: grid; gap: 2px; }
.cs-lm li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; font-size: .9rem; color: rgba(255,255,255,.9); cursor: pointer; }
.cs-lm li:hover { background: rgba(255,255,255,.09); }
.cs-lm b { color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-lm .t { color: rgba(255,255,255,.55); font-size: .74rem; margin-left: 6px; }
.cs-lm-h { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.6); margin: 0 0 4px; }
.cs-fijo { margin: 14px 0 0; background: rgba(255,255,255,.08); border-radius: var(--r-sm); padding: 11px 13px; font-size: .88rem; color: rgba(255,255,255,.88); line-height: 1.45; }
.cs-fijo b { color: #fff; }
@media (max-width: 980px) {
  .cs-tipos { flex-wrap: wrap !important; }
  .cs-tipos .cs-chip { flex: 0 0 auto; padding: 0 12px; }
  .cs-big.horq { font-size: 2.2rem; }
  .cs-bottom b.horq { font-size: 1.2rem; }
}

/* ── Media oficial de Función Pública ── */
.cs-sello.ofi { background: #fff; color: var(--brand); }
.cs-fijo a, .cs-nota a { color: inherit; font-weight: 700; text-underline-offset: 2px; }
.cs-sug li.dos { flex-direction: column; align-items: flex-start; gap: 1px; }
.cs-ojo { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: .88rem; line-height: 1.4; color: #FFD666; }
.cs-ojo svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.cs-lm li.of { cursor: default; border-top: 1px dashed rgba(255,255,255,.22); border-radius: 0; margin-top: 4px; padding-top: 10px; color: rgba(255,255,255,.78); }
.cs-lm li.of:hover { background: none; }
.cs-espera { min-height: 180px; display: flex; align-items: center; color: rgba(255,255,255,.6); }

/* Tabla de niveles, plegada bajo la de grupos */
.cs-niv { margin-top: 16px; }
.cs-niv summary { font-weight: 700; color: var(--brand-mid); cursor: pointer; }
.cs-niv .cs-tw { margin-top: 12px; }
.cs-niv .cs-t { min-width: 0; max-width: 480px; }
/* Si no hay tarjeta «con los años», la de convocatorias ocupa todo el ancho */
.cs-after > [hidden] + .cs-plazas { grid-column: 1 / -1; }
/* Cuando en lugar de una cifra va una frase */
.cs-big.txt { font-size: 1.75rem; line-height: 1.15; }
/* En móvil, ni la cabecera ni la barra fija de abajo deben tapar el campo al que salta el navegador */
@media (max-width: 980px) { html { scroll-padding: calc(var(--header-h) + 12px) 0 96px; } }
/* En móvil, el resultado va justo después del formulario; las dos tarjetas pequeñas, detrás */
@media (max-width: 980px) { .cs-izq { display: contents; } .cs-res { order: 2; } .cs-after { order: 3; margin-top: 0; } }
