:root {
  --bg: #e9efee;
  --surface: #f8fbfa;
  --ink: #17262f;
  --muted: #55666e;
  --line: #c7d3d1;
  --net: #0d6b57;
  --ss: #3d6f9e;
  --tax: #b0522c;
  --focus: #0d6b57;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111b20;
    --surface: #18252c;
    --ink: #e4ecea;
    --muted: #9cafb2;
    --line: #2d3f46;
    --net: #4cc3a3;
    --ss: #7eaedb;
    --tax: #e69067;
    --focus: #4cc3a3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111b20; --surface: #18252c; --ink: #e4ecea; --muted: #9cafb2;
  --line: #2d3f46; --net: #4cc3a3; --ss: #7eaedb; --tax: #e69067; --focus: #4cc3a3;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 20px 64px; }

header.top { margin-bottom: 28px; max-width: 680px; }
h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 12px;
}
.lede { color: var(--muted); margin: 0; font-size: 1.05rem; }

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) { .calc { grid-template-columns: 1fr; } }

form.inputs {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  display: grid;
  gap: 18px;
}
.field label, .field .lbl { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.field .hint { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.money { position: relative; }
.money input {
  width: 100%;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  padding: 12px 44px 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}
.money span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--muted); font-weight: 600; }
select, input[type="number"].small {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 10px 6px; cursor: pointer;
  font-weight: 500; font-size: 0.95rem; background: var(--bg);
}
.seg input:checked + span { background: var(--ink); color: var(--surface); font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--net); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }

/* La nómina */
.slip {
  position: sticky;
  top: calc(16px + env(safe-area-inset-top, 0px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px 4px 14px 14px;
  border-top: 6px solid var(--ink);
  padding: 22px 22px 18px;
}
.slip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.slip-head h2 { margin: 0; font-size: 1.05rem; }
.period { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.period button {
  font: inherit; font-size: 0.85rem; border: 0; background: transparent; color: var(--ink);
  padding: 5px 14px; cursor: pointer;
}
.period button[aria-pressed="true"] { background: var(--ink); color: var(--surface); font-weight: 700; }

.net-label { color: var(--muted); font-size: 0.9rem; margin: 0; }
.net {
  font-size: clamp(2.6rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--net);
  margin: 2px 0 6px;
}
.net-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; min-height: 1.4em; }

/* Barra: a dónde va tu sueldo */
.bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.bar div { transition: flex-grow 0.35s ease; min-width: 0; }
.bar .b-net { background: var(--net); }
.bar .b-ss { background: var(--ss); }
.bar .b-tax { background: var(--tax); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); margin-bottom: 18px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

table.lines { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.lines td { padding: 9px 0; border-bottom: 1px dashed var(--line); }
table.lines td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
table.lines tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 800; padding-top: 12px; }
.minus { color: var(--muted); }
.note { font-size: 0.8rem; color: var(--muted); margin: 14px 0 0; }

/* Contenido */
article { max-width: 700px; margin-top: 56px; }
article h2 { font-size: 1.6rem; letter-spacing: -0.02em; line-height: 1.2; margin: 44px 0 12px; }
article h3 { font-size: 1.12rem; margin: 28px 0 6px; }
article p, article li { color: var(--ink); }
article ol { padding-left: 22px; }
.tablewrap { overflow-x: auto; }
.rates { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 380px; }
.rates th, .rates td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rates th { font-weight: 700; }
.rates td:last-child, .rates th:last-child { text-align: right; }
.brand{display:inline-block;font-weight:800;letter-spacing:-.02em;font-size:1.1rem;color:var(--ink);text-decoration:none;margin-bottom:28px}
.brand b{color:var(--net)}
footer a{color:var(--muted)}
footer { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) { .bar div { transition: none; } }
