:root{
  --green:#1e4a3b;
  --green-dark:#12281f;
  --gold:#a9a55c;
  --cream:#f7f3e9;
  --cream-light:#fbf9f4;
  --white:#fff;
  --charcoal:#2b2b26;
  --muted:#6f746f;
  --line:rgba(30,74,59,.14);
  --line-strong:rgba(30,74,59,.23);
  --soft:rgba(30,74,59,.055);
  --shadow:0 24px 60px rgba(18,40,31,.08);
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  background:var(--cream-light);
  color:var(--charcoal);
  font-family:"Inter",sans-serif;
  font-size:15px;
  line-height:1.5;
  font-variant-numeric:tabular-nums;
}

a{
  color:inherit;
  text-decoration:none;
}

button,
input,
select{
  font:inherit;
}

button{
  cursor:pointer;
}

img{
  display:block;
  max-width:100%;
}

.shell{
  width:min(1180px,calc(100% - 40px));
  margin:0 auto;
}


/* ==================================================
   HEADER COMPARTIDO · RECURSOS MALAK
================================================== */

.site-header{
    position:sticky;
    top:0;
    z-index:100;
    background:rgba(251,249,244,.96);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    border-bottom:1px solid var(--line);
}

.header-inner{
    width:min(1180px,calc(100% - 40px));
    min-height:82px;
    margin:0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:28px;
}

.brand{
    display:flex;
    align-items:center;
    flex-shrink:0;
}

.brand img{
    display:block;
    width:235px;
    height:auto;
}

.main-nav{
    display:flex;
    align-items:center;
    gap:25px;
}

.main-nav a{
    font-family:"Inter",sans-serif;
    font-size:12px;
    font-weight:800;
    line-height:1.2;
    letter-spacing:0;
    text-transform:none;
    color:var(--green-dark);
}

.main-nav a:hover{
    color:var(--gold);
}

.menu-toggle{
    display:none;
    width:44px;
    height:44px;
    padding:0;
    border:0;
    background:transparent;
    cursor:pointer;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:5px;
}

.menu-toggle span{
    display:block;
    width:24px;
    height:2px;
    border-radius:50px;
    background:var(--green-dark);
}

@media(max-width:700px){

    .header-inner{
        width:min(100% - 28px,1180px);
        min-height:72px;
    }

    .brand img{
        width:190px;
    }

    .menu-toggle{
        display:flex;
    }

    .main-nav{
        display:none;
        position:absolute;
        top:72px;
        left:14px;
        right:14px;
        padding:12px;
        flex-direction:column;
        align-items:stretch;
        gap:0;
        background:#fff;
        border:1px solid var(--line);
        border-radius:16px;
        box-shadow:var(--shadow);
    }

    .main-nav.mobile-open{
        display:flex;
    }

    .main-nav a{
        padding:13px 11px;
        border-bottom:1px solid var(--line);
    }

    .main-nav a:last-child{
        border-bottom:0;
    }
}

/* ==================================================
   FOOTER COMPARTIDO · RECURSOS MALAK
================================================== */

.resource-footer{
    padding:48px 0;
    color:var(--white);
    background:#0d1d17;
}

.resource-footer-inner{
    width:min(1180px,calc(100% - 40px));
    margin:0 auto;
    display:grid;
    grid-template-columns:1fr auto auto;
    gap:35px;
    align-items:center;
}

.resource-footer-logo{
    display:block;
    width:230px;
    height:auto;
    justify-self:start;
}

.resource-footer p,
.resource-footer a{
    margin:0;
    font-family:"Inter",sans-serif;
    font-size:11px;
    line-height:1.5;
    color:rgba(255,255,255,.56);
}

.resource-footer a{
    font-weight:700;
    color:var(--gold);
    white-space:nowrap;
}

.resource-footer a:hover{
    color:var(--white);
}

@media(max-width:820px){
    .resource-footer-inner{
        grid-template-columns:1fr;
        gap:18px;
    }
}

@media(max-width:600px){
    .resource-footer-inner{
        width:min(100% - 32px,1180px);
    }

    .resource-footer-logo{
        width:200px;
    }
}

/* ==================================================
   HERO
================================================== */

.hero{
  padding:92px 0 84px;
  background:
    radial-gradient(
      circle at 88% 18%,
      rgba(169,165,92,.16),
      transparent 28%
    ),
    linear-gradient(
      135deg,
      var(--cream-light),
      var(--cream)
    );
}

.hero-grid{
  display:grid;
  grid-template-columns:minmax(0,1.18fr) minmax(300px,.82fr);
  gap:72px;
  align-items:center;
}

.eyebrow{
  display:inline-block;
  margin-bottom:17px;
  font-family:"Archivo",sans-serif;
  font-size:10px;
  font-weight:800;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--gold);
}

.hero h1{
  max-width:850px;
  margin:0 0 23px;
  font-family:"Archivo",sans-serif;
  font-size:clamp(48px,5.7vw,76px);
  line-height:.97;
  letter-spacing:-.05em;
  color:var(--green-dark);
}

.hero-copy > p{
  max-width:760px;
  margin:0;
  font-size:16px;
  line-height:1.75;
  color:#61645e;
}

.hero-actions{
  display:flex;
  gap:11px;
  flex-wrap:wrap;
  margin-top:30px;
}

.btn{
  min-height:48px;
  padding:14px 21px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:800;
}

.btn-primary{
  background:var(--green);
  color:#fff;
}

.btn-secondary{
  border:1px solid var(--green);
  color:var(--green);
}

.hero-card{
  padding:30px;
  border-radius:28px;
  background:
    linear-gradient(
      145deg,
      var(--green-dark),
      var(--green)
    );
  color:#fff;
  box-shadow:var(--shadow);
}

.hero-card-label{
  display:block;
  margin-bottom:10px;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.15em;
  color:#cbc88d;
}

.hero-card strong{
  display:block;
  font-family:"Archivo",sans-serif;
  font-size:29px;
  line-height:1.08;
}

.hero-card-flow{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:22px 0;
}

.hero-card-flow span{
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:999px;
  font-size:10px;
  font-weight:700;
}

.hero-card-flow b{
  color:var(--gold);
}

.hero-card p{
  margin:0;
  font-size:12.5px;
  line-height:1.65;
  color:rgba(255,255,255,.68);
}


/* ==================================================
   ÁREA DE CALCULADORA
================================================== */

.calculator-area{
  padding:54px 0 100px;
}

.calculator-wrap{
  width:min(1240px,calc(100% - 40px));
  margin:0 auto;
}

.resource-intro{
  display:grid;
  grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);
  gap:34px;
  align-items:end;
  margin-bottom:28px;
}

.resource-intro .eyebrow{
  margin-bottom:8px;
}

.resource-intro h2{
  margin:0;
  font-family:"Archivo",sans-serif;
  font-size:34px;
  letter-spacing:-.035em;
  color:var(--green-dark);
}

.resource-intro p{
  margin:0;
  font-size:13px;
  line-height:1.7;
  color:var(--muted);
}


/* ==================================================
   DOS COLUMNAS
================================================== */

.calculator-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 390px;
  gap:28px;
  align-items:start;
}

.calculator-form{
  min-width:0;
}

.calculator-sidebar{
  min-width:0;
  align-self:start;
}

.calculator-sidebar-sticky{
  position:sticky;
  top:96px;
}

.live-result-label{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 0 10px;
  font-family:"Archivo",sans-serif;
  font-size:9px;
  font-weight:900;
  letter-spacing:.13em;
  text-transform:uppercase;
  color:var(--green);
}

.live-result-label::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--gold);
  box-shadow:
    0 0 0 4px rgba(169,165,92,.13);
}


/* ==================================================
   BOTONES SUPERIORES
================================================== */

.tools{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
  margin:0 0 18px;
}

.tools button,
.addBtn{
  min-height:42px;
  padding:10px 15px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--green-dark);
  font-size:11px;
  font-weight:800;
  transition:.2s ease;
}

.tools button:hover,
.addBtn:hover{
  border-color:var(--green);
  transform:translateY(-1px);
}

.addBtn{
  width:100%;
  border-style:dashed;
  margin-top:8px;
}


/* ==================================================
   TARJETAS
================================================== */

.tool-card{
  position:relative;
  margin:0 0 18px;
  padding:30px 32px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:
    0 12px 38px rgba(18,40,31,.035);
}

.tool-card > h2{
  margin:0 0 7px;
  display:flex;
  align-items:center;
  gap:13px;
  font-family:"Archivo",sans-serif;
  font-size:25px;
  line-height:1.08;
  color:var(--green-dark);
  letter-spacing:-.02em;
}

.num{
  flex:0 0 auto;
  width:42px;
  height:42px;
  display:inline-grid;
  place-items:center;
  border-radius:50%;
  background:var(--cream);
  font-family:"Archivo",sans-serif;
  font-size:10px;
  font-weight:900;
  color:var(--green);
}

.hint{
  margin:0 0 20px;
  padding-left:55px;
  font-size:12.5px;
  line-height:1.65;
  color:var(--muted);
}

.hint.tight{
  margin-bottom:12px;
}

.sub{
  margin:25px 0 12px;
  padding-top:19px;
  border-top:1px solid var(--line);
  font-family:"Archivo",sans-serif;
  font-size:10px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--gold);
}

.sub:first-of-type{
  margin-top:16px;
}


/* ==================================================
   CAMPOS
================================================== */

.row{
  display:flex;
  align-items:center;
  gap:18px;
  min-height:60px;
  padding:9px 0;
  border-bottom:
    1px solid rgba(30,74,59,.085);
}

.row:last-child{
  border-bottom:0;
}

.row > label,
.row > .chk{
  flex:1;
  min-width:0;
  font-size:12.5px;
  font-weight:700;
  color:#4d534e;
  line-height:1.4;
}

.note{
  display:block;
  margin-top:3px;
  font-size:10.5px;
  font-weight:500;
  line-height:1.45;
  color:var(--muted);
}

input[type=number],
input[type=text],
select{
  width:100%;
  min-height:43px;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--cream-light);
  color:var(--charcoal);
  outline:none;
  font-size:13px;
}

input[type=number]{
  -moz-appearance:textfield;
  text-align:right;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

input:focus,
select:focus{
  border-color:var(--green);
  box-shadow:
    0 0 0 3px rgba(30,74,59,.08);
}

.w-money{
  width:128px;
  flex:0 0 128px;
}

.w-sm{
  width:82px;
  flex:0 0 82px;
}

.w-md{
  width:170px;
  flex:0 0 170px;
}

.money,
.pct{
  position:relative;
}

.money input{
  padding-left:24px;
}

.money::before{
  content:"$";
  position:absolute;
  z-index:1;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  font-size:11px;
  color:var(--muted);
}

.pct input{
  padding-right:27px;
}

.pct::after{
  content:"%";
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  font-size:10px;
  color:var(--muted);
}

.chk{
  display:flex !important;
  align-items:flex-start;
  gap:10px;
  cursor:pointer;
}

.chk input{
  width:19px;
  height:19px;
  min-height:0;
  flex:0 0 auto;
  margin:1px 0 0;
  accent-color:var(--green);
}

.chk > span{
  min-width:0;
}

.off{
  opacity:.42;
}


/* ==================================================
   SELECTORES
================================================== */

.seg{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin:6px 0 18px;
}

.seg button{
  min-height:40px;
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--cream-light);
  color:var(--charcoal);
  font-size:11px;
  font-weight:700;
}

.seg button[aria-pressed="true"]{
  background:var(--green);
  border-color:var(--green);
  color:#fff;
}


/* ==================================================
   AYUDAS
================================================== */

.note-box,
.flag{
  margin-top:16px;
  padding:15px 16px;
  border-radius:14px;
  background:var(--cream);
  font-size:12px;
  line-height:1.65;
  color:#59605a;
}

.flag{
  border-left:4px solid var(--gold);
  border-radius:3px 14px 14px 3px;
  background:rgba(169,165,92,.11);
}

.flag b{
  color:var(--green-dark);
}

.markSmall{
  display:inline-block;
  width:42px;
  max-height:18px;
  object-fit:contain;
  vertical-align:middle;
  margin-right:8px;
}

details.ref{
  margin-top:16px;
  padding-top:15px;
  border-top:1px solid var(--line);
  font-size:12px;
  color:var(--muted);
}

details.ref summary{
  cursor:pointer;
  font-weight:800;
  color:var(--green);
}

details.ref ul{
  padding-left:20px;
  margin:10px 0 0;
}

details.ref li{
  margin-bottom:7px;
  line-height:1.55;
}


/* ==================================================
   TABLAS
================================================== */

.tbl{
  margin-top:6px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:16px;
}

.thead,
.trow{
  display:flex;
  gap:8px;
  align-items:center;
}

.thead{
  padding:10px 12px;
  background:var(--cream);
  font-size:8.5px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--muted);
}

.trow{
  padding:9px 12px;
  border-top:1px solid var(--line);
}

.trow .t1,
.thead .t1{
  flex:1;
  min-width:0;
}

.thead .t2,
.trow .t2{
  width:112px;
  flex:0 0 112px;
}

.thead .t3,
.trow .t3{
  width:58px;
  flex:0 0 58px;
}

.thead .t4,
.trow .t4{
  width:88px;
  flex:0 0 88px;
}

.thead .t2,
.thead .t3,
.thead .t4{
  text-align:right;
}

.trow .t1{
  font-size:11.5px;
  line-height:1.35;
}

.trow input,
.trow select{
  min-height:37px;
  padding:7px 8px;
  font-size:11.5px;
}

.trow .money input{
  padding-left:18px;
}

.trow .money::before{
  left:7px;
  font-size:9px;
}


/* ==================================================
   TIPOS DE HABITACIÓN
================================================== */

.rtCard{
  margin:10px 0;
  padding:15px;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--cream-light);
}

.rtTop{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:10px;
}

.rtTop input{
  flex:1;
}

.rtDel,
.cmpDel{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--muted);
  font-size:17px;
}

.rtBeds{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.rtBeds label{
  flex:1;
  min-width:100px;
  font-size:9.5px;
  font-weight:700;
  color:var(--muted);
}

.rtBeds input{
  margin-top:4px;
  text-align:center;
}

.rtFoot{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:11px;
  padding-top:11px;
  border-top:1px solid var(--line);
  font-size:11px;
  font-weight:700;
  color:#4d534e;
}

.rtFoot span{
  flex:1;
}

.rtFoot input{
  width:86px;
  flex:0 0 86px;
}


/* ==================================================
   COMPETENCIA
================================================== */

.cmpRow{
  display:flex;
  gap:8px;
  align-items:center;
  padding:8px 0;
  border-bottom:1px solid var(--line);
}

.cmpRow .cmpName{
  flex:1;
  min-width:0;
}

.cmpRow .money{
  width:120px;
  flex:0 0 120px;
}


/* ==================================================
   RESULTADO EN TIEMPO REAL
================================================== */

.result{
  overflow:hidden;
  color:#fff;
  border:0;
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(169,165,92,.24),
      transparent 30%
    ),
    linear-gradient(
      145deg,
      var(--green-dark),
      var(--green)
    );
  box-shadow:var(--shadow);
}

.result > h2{
  color:#fff;
}

.result .num{
  background:rgba(255,255,255,.12);
  color:#fff;
}

.resultMark{
  position:absolute;
  right:-28px;
  bottom:-24px;
  width:200px;
  opacity:.055;
  pointer-events:none;
}

.result .cap{
  margin:18px 0 0;
  padding:0;
  font-size:11px;
  color:rgba(255,255,255,.7);
}

.big{
  margin:8px 0 8px;
  font-family:"Archivo",sans-serif;
  font-size:clamp(44px,7vw,70px);
  line-height:.95;
  font-weight:900;
  letter-spacing:-.05em;
}

.big small{
  display:block;
  margin-top:7px;
  font-family:"Inter",sans-serif;
  font-size:11px;
  font-weight:600;
  letter-spacing:0;
  color:rgba(255,255,255,.62);
}

.split{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:16px;
}

.tile{
  padding:15px;
  border:1px solid rgba(255,255,255,.11);
  border-radius:15px;
  background:rgba(255,255,255,.07);
}

.tile .k{
  font-size:9px;
  line-height:1.4;
  color:rgba(255,255,255,.66);
}

.tile .v{
  margin-top:5px;
  font-family:"Archivo",sans-serif;
  font-size:24px;
  font-weight:800;
  line-height:1.1;
}

.qbtn{
  width:20px;
  height:20px;
  margin-left:4px;
  padding:0;
  border:1px solid rgba(255,255,255,.35);
  border-radius:50%;
  background:rgba(255,255,255,.1);
  color:#fff;
  font-size:10px;
  font-weight:800;
  vertical-align:1px;
}

.qbtn[aria-expanded="true"]{
  background:#fff;
  color:var(--green-dark);
}

.qpanel{
  margin-top:12px;
  padding:15px;
  border-radius:14px;
  background:rgba(255,255,255,.1);
  font-size:11.5px;
  line-height:1.65;
  color:rgba(255,255,255,.88);
}

.qpanel h4{
  margin:0 0 8px;
  font-family:"Archivo",sans-serif;
  font-size:13px;
  color:#fff;
}

.qpanel .fx{
  display:block;
  margin-top:9px;
  padding:9px 10px;
  border-radius:9px;
  background:rgba(0,0,0,.15);
  color:#fff;
}

.qpanel .paso{
  margin-top:8px;
}


/* ==================================================
   RESULTADO LATERAL
================================================== */

.calculator-sidebar .tool-card{
  margin-bottom:16px;
  padding:24px;
  border-radius:22px;
}

.calculator-sidebar .result .big{
  font-size:clamp(42px,4.6vw,60px);
}

.calculator-sidebar .result .tile .v{
  font-size:20px;
}

.calculator-sidebar .flag{
  font-size:10.5px;
  line-height:1.55;
}


/* ==================================================
   GRÁFICA DE PASTEL
================================================== */

.pieWrap{
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
  gap:34px;
  align-items:center;
  margin-top:18px;
}

#pieSvg{
  width:220px;
  position:relative;
  margin:0 auto;
}

#pieSvg svg{
  display:block;
  width:220px;
  height:220px;
  filter:
    drop-shadow(
      0 12px 24px rgba(18,40,31,.08)
    );
}

.pieMid{
  font-family:"Archivo",sans-serif;
  fill:var(--green-dark);
  font-weight:800;
}

.pieCap{
  fill:var(--muted);
  font-family:"Inter",sans-serif;
}

.leg{
  min-width:0;
}

.legRow{
  display:grid;
  grid-template-columns:
    12px minmax(0,1fr) auto 42px;
  gap:9px;
  align-items:center;
  padding:8px 0;
  border-bottom:1px solid var(--line);
  font-size:11.5px;
}

.legRow:last-child{
  border-bottom:0;
}

.chip{
  width:11px;
  height:11px;
  border-radius:3px;
}

.lv{
  text-align:right;
  font-weight:700;
  color:var(--green-dark);
}

.lp{
  text-align:right;
  color:var(--muted);
  font-size:10px;
}


/* PASTEL EN COLUMNA DERECHA */

.calculator-sidebar .pieWrap{
  grid-template-columns:1fr;
  gap:18px;
  margin-top:14px;
}

.calculator-sidebar #pieSvg,
.calculator-sidebar #pieSvg svg{
  width:190px;
  height:190px;
}

.calculator-sidebar .legRow{
  grid-template-columns:
    11px minmax(0,1fr) auto 38px;
  gap:7px;
  padding:7px 0;
  font-size:10.5px;
}


/* ==================================================
   TABLA DE OCUPACIÓN
================================================== */

table.occ{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  font-size:11.5px;
}

table.occ th,
table.occ td{
  padding:11px 8px;
  border-bottom:1px solid var(--line);
  text-align:right;
}

table.occ th{
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--muted);
}

table.occ th:first-child,
table.occ td:first-child{
  text-align:left;
}

table.occ tr.now td{
  background:var(--cream);
  font-weight:800;
  color:var(--green-dark);
}


/* ==================================================
   RESUMEN
================================================== */

.quick-summary{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:12px;
  align-items:center;
  margin:26px 0 18px;
  padding:17px 19px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:
    0 12px 35px rgba(18,40,31,.04);
}

.quick-summary .d{
  min-width:0;
}

.quick-summary .dk{
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.07em;
  color:var(--muted);
}

.quick-summary .dv{
  margin-top:3px;
  font-family:"Archivo",sans-serif;
  font-size:25px;
  font-weight:800;
  color:var(--green-dark);
}

.quick-summary .dv.g{
  color:var(--gold);
}

.quick-summary button{
  min-height:43px;
  padding:10px 15px;
  border:0;
  border-radius:999px;
  background:var(--green);
  color:#fff;
  font-size:10px;
  font-weight:800;
}

.scope-note{
  padding:22px 24px;
  border-radius:18px;
  background:var(--cream);
  font-size:11.5px;
  line-height:1.65;
  color:#666b66;
}

.scope-note strong{
  font-family:"Archivo",sans-serif;
  font-size:13px;
  color:var(--green-dark);
}

.scope-note p{
  margin:8px 0 0;
}


/* ==================================================
   TABLET
================================================== */

@media(max-width:1000px){

  .calculator-wrap{
    width:min(940px,calc(100% - 40px));
  }

  .calculator-layout{
    grid-template-columns:1fr;
  }

  .calculator-sidebar-sticky{
    position:static;
  }

  .live-result-label{
    margin-top:4px;
  }

  .calculator-sidebar .pieWrap{
    grid-template-columns:
      220px minmax(0,1fr);
    gap:28px;
  }

  .calculator-sidebar #pieSvg,
  .calculator-sidebar #pieSvg svg{
    width:210px;
    height:210px;
  }
}


@media(max-width:900px){

  .hero-grid{
    grid-template-columns:1fr;
    gap:34px;
  }

  .hero-card{
    max-width:600px;
  }

  .resource-intro{
    grid-template-columns:1fr;
    gap:10px;
  }
}


/* ==================================================
   MÓVIL
================================================== */

@media(max-width:700px){

  .shell,
  .header-inner,
  .calculator-wrap{
    width:min(100% - 28px,1180px);
  }

.main-nav.mobile-open{
    display:flex;
  }

.main-nav a:last-child{
    border-bottom:0;
  }

  .hero{
    padding:66px 0 58px;
  }

  .hero h1{
    font-size:clamp(42px,13vw,58px);
  }

  .hero-copy > p{
    font-size:14px;
  }

  .calculator-area{
    padding:38px 0 70px;
  }

  .calculator-layout{
    gap:8px;
  }

  .tool-card{
    padding:23px 18px;
    border-radius:20px;
  }

  .tool-card > h2{
    font-size:22px;
  }

  .num{
    width:38px;
    height:38px;
  }

  .hint{
    padding-left:51px;
  }

  .row{
    gap:12px;
  }

  .w-money{
    width:112px;
    flex-basis:112px;
  }

  .w-sm{
    width:76px;
    flex-basis:76px;
  }

  .w-md{
    width:142px;
    flex-basis:142px;
  }

  .thead,
  .trow{
    gap:6px;
    padding-left:9px;
    padding-right:9px;
  }

  .thead .t2,
  .trow .t2{
    width:88px;
    flex-basis:88px;
  }

  .thead .t3,
  .trow .t3{
    width:48px;
    flex-basis:48px;
  }

  .thead .t4,
  .trow .t4{
    width:72px;
    flex-basis:72px;
  }

  .trow .t1{
    font-size:10.5px;
  }

  .trow input,
  .trow select{
    font-size:10.5px;
    padding:6px;
  }

  .split{
    grid-template-columns:1fr;
  }

  .pieWrap{
    grid-template-columns:1fr;
    gap:18px;
  }

  #pieSvg,
  #pieSvg svg{
    width:190px;
    height:190px;
  }

  .calculator-sidebar .tool-card{
    padding:24px 20px;
  }

  .calculator-sidebar .pieWrap{
    grid-template-columns:1fr;
    gap:18px;
  }

  .calculator-sidebar #pieSvg,
  .calculator-sidebar #pieSvg svg{
    width:190px;
    height:190px;
  }

  .quick-summary{
    grid-template-columns:1fr 1fr;
  }

  .quick-summary button{
    grid-column:1/-1;
  }

}


/* ==================================================
   CELULARES PEQUEÑOS
================================================== */

@media(max-width:480px){

  .hero-actions{
    display:grid;
  }

  .btn{
    width:100%;
  }

  .tool-card{
    padding:21px 15px;
  }

  .tool-card > h2{
    align-items:center;
  }

  .hint{
    padding-left:0;
    margin-top:12px;
  }

  .row{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .row > label,
  .row > .chk{
    flex:1 1 calc(100% - 130px);
  }

  .w-money,
  .w-sm,
  .w-md{
    margin-left:auto;
  }

  .seg{
    gap:6px;
  }

  .seg button{
    font-size:10px;
    padding:8px 10px;
  }

  .tbl{
    overflow-x:auto;
  }

  .thead,
  .trow{
    min-width:520px;
  }

  .cmpRow{
    flex-wrap:wrap;
  }

  .cmpRow .cmpName{
    flex:1 1 180px;
  }

  .cmpRow .money{
    width:105px;
    flex-basis:105px;
  }

  .legRow{
    grid-template-columns:
      11px minmax(0,1fr) auto 36px;
    font-size:10.5px;
  }

  table.occ{
    font-size:10px;
  }

  table.occ th,
  table.occ td{
    padding:9px 4px;
  }

  .quick-summary{
    grid-template-columns:1fr;
  }

  .quick-summary button{
    grid-column:auto;
  }
}


/* ==================================================
   ACCESIBILIDAD
================================================== */

@media(prefers-reduced-motion:reduce){

  *{
    scroll-behavior:auto !important;
    transition:none !important;
  }
}

/* ==================================================
   PANEL DERECHO · SEGUIMIENTO AUTOMÁTICO DEL SCROLL
   Mantiene los tamaños originales.
   El contenido derecho avanza de Resultado → Pastel → Tabla
   conforme se recorren las secciones de la izquierda.
================================================== */

@media (min-width:1001px){

  .calculator-sidebar{
    min-width:0;
    align-self:stretch;
    position:relative;
  }

  .calculator-sidebar-sticky{
    position:sticky;
    top:96px;
    height:calc(100vh - 116px);
    overflow:hidden;
  }

  .calculator-sidebar-track{
    width:100%;
    will-change:transform;
    transform:translate3d(0,0,0);
  }
}

@media (max-width:1000px){

  .calculator-sidebar{
    align-self:start;
  }

  .calculator-sidebar-sticky{
    position:static;
    top:auto;
    height:auto;
    overflow:visible;
  }

  .calculator-sidebar-track{
    transform:none !important;
  }
}

/* ==================================================
   ALINEACIÓN GENERAL DE CAMPOS EDITABLES
================================================== */

:root{
  --edit-width:170px;
}


/* --------------------------------
   CAMPOS NORMALES
-------------------------------- */

.tool-card .row{
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--edit-width);
  gap:24px;
  align-items:center;
}

.tool-card .row > label{
  min-width:0;
}

.tool-card .row .w-sm,
.tool-card .row .w-md,
.tool-card .row .w-money{
  width:var(--edit-width);
  min-width:var(--edit-width);
  max-width:var(--edit-width);
  margin:0;
}

.tool-card .row .w-sm input,
.tool-card .row .w-md input,
.tool-card .row .w-money input,
.tool-card .row .w-sm select,
.tool-card .row .w-md select,
.tool-card .row .w-money select{
  width:100%;
}


/* Valores calculados que aparecen donde normalmente hay un campo */
.tool-card .row #kgMixVal{
  width:var(--edit-width) !important;
  min-width:var(--edit-width);
  max-width:var(--edit-width);
  text-align:right !important;
}


/* --------------------------------
   CHECKBOX QUE OCUPA TODA LA FILA
-------------------------------- */

.tool-card .row > .chk:only-child{
  grid-column:1 / -1;
}


/* --------------------------------
   TABLAS DE BLANCOS Y AMENIDADES
-------------------------------- */

.tbl{
  width:100%;
}

.thead,
.trow{
  display:grid;
  grid-template-columns:
    minmax(180px,1fr)
    112px
    58px
    88px;
  gap:10px;
  align-items:center;
}

.thead .t1,
.trow .t1,
.thead .t2,
.trow .t2,
.thead .t3,
.trow .t3,
.thead .t4,
.trow .t4{
  width:auto;
  min-width:0;
}

.thead .t2,
.thead .t3,
.thead .t4{
  text-align:center;
}

.trow .t2 input,
.trow .t3 input,
.trow .t4 input,
.trow .t4 select{
  width:100%;
}


/* --------------------------------
   TIPOS DE HABITACIÓN
-------------------------------- */

.rtTop{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
}

.rtTop .rtName{
  width:100%;
}

.rtBeds{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}

.rtBeds label{
  min-width:0;
}

.rtBeds input{
  width:100%;
  text-align:center;
}

.rtFoot{
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--edit-width);
  gap:24px;
  align-items:center;
}

.rtFoot .rtN{
  width:var(--edit-width);
  max-width:var(--edit-width);
  text-align:right;
}


/* --------------------------------
   COMPETENCIA
-------------------------------- */

.cmpRow{
  display:grid;
  grid-template-columns:
    minmax(0,1fr)
    var(--edit-width)
    34px;
  gap:10px;
  align-items:center;
}

.cmpRow .cmpName{
  width:100%;
  min-width:0;
}

.cmpRow .money{
  width:var(--edit-width);
  min-width:var(--edit-width);
}

.cmpRow .cmpT{
  width:100%;
}


/* Cuando no aparece botón eliminar */
.cmpRow:last-child{
  align-items:center;
}


/* --------------------------------
   MÓVIL
-------------------------------- */

@media(max-width:600px){

  :root{
    --edit-width:125px;
  }

  .tool-card .row{
    grid-template-columns:minmax(0,1fr) var(--edit-width);
    gap:12px;
  }

  .rtFoot{
    grid-template-columns:minmax(0,1fr) var(--edit-width);
    gap:12px;
  }

  .rtBeds{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .cmpRow{
    grid-template-columns:minmax(0,1fr) 105px 34px;
    gap:7px;
  }

  .cmpRow .money{
    width:105px;
    min-width:105px;
  }

  .tbl{
    overflow-x:auto;
  }

  .thead,
  .trow{
    min-width:520px;
    grid-template-columns:
      minmax(180px,1fr)
      112px
      58px
      88px;
  }
}