:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5d6677;
  --primary: #0f766e;
  --primary-dark: #0b5952;
  --border: #e3e6ec;
  --ad-bg: #f1f3f6;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --surface: #1b2029;
    --text: #e8ebf0;
    --muted: #a3acbb;
    --primary: #2dd4bf;
    --primary-dark: #5eead4;
    --border: #2c3340;
    --ad-bg: #222834;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); }
img { max-width: 100%; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.3rem; text-decoration: none; color: var(--text); }
.logo span { color: var(--primary); }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--primary); }

/* Layout */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin: 24px auto 48px; }
.layout.full { grid-template-columns: 1fr; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.content { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.sidebar .card { padding: 18px; }
.sticky { position: sticky; top: 88px; }

h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 12px; }
h2 { margin-top: 28px; }
.lead { color: var(--muted); font-size: 1.1rem; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary), #155e75); color: #fff; padding: 48px 0; }
.hero h1 { color: #fff; }
.hero p { color: #e0f2f1; font-size: 1.15rem; max-width: 640px; }

/* Grid of tools/articles */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; display: block; }
.tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.tile .icon { font-size: 1.8rem; }
.tile h3 { margin: 8px 0 4px; }
.tile p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Forms / calculators */
.calc label { display: block; font-weight: 600; margin: 14px 0 6px; }
.calc input, .calc select {
  width: 100%; padding: 12px; font-size: 1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.btn { display: inline-block; margin-top: 18px; padding: 12px 22px; background: var(--primary); color: #fff; border: 0; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--primary-dark); }
.result { margin-top: 18px; padding: 16px; border-radius: 8px; background: var(--ad-bg); font-size: 1.15rem; font-weight: 600; min-height: 1em; }
.result:empty { display: none; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 8px; border-bottom: 1px solid var(--border); text-align: right; }
th:first-child, td:first-child { text-align: left; }
.table-wrap { overflow-x: auto; max-height: 360px; margin-top: 16px; }

/* Ad slots */
.ad-slot { margin: 24px auto; text-align: center; overflow: hidden; }
.ad-slot .ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--ad-bg); border: 2px dashed var(--border); border-radius: 8px;
  color: var(--muted); font-size: .9rem; margin: 0 auto;
}
.ad-leaderboard .ad-placeholder { max-width: 728px; height: 90px; }
.ad-rectangle .ad-placeholder { max-width: 300px; height: 250px; }
.ad-skyscraper .ad-placeholder { max-width: 300px; height: 600px; }
.ad-infeed .ad-placeholder { height: 120px; }
@media (max-width: 760px) { .ad-leaderboard .ad-placeholder { height: 60px; } }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); margin-right: 14px; }

/* Botones */
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
