*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f7f7f5;
}

/* HEADER */
header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: #1a6b3c;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo span { color: #1a1a1a; }
nav { display: flex; flex-wrap: wrap; gap: 0; }
nav a {
  margin-left: 1.25rem;
  text-decoration: none;
  color: #555;
  font-size: 0.875rem;
  white-space: nowrap;
}
nav a:hover { color: #1a6b3c; }
nav a.active { color: #1a6b3c; font-weight: 500; }

/* MAIN */
main {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* TIPOGRAFÍA */
h1 {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
h2 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.6rem; color: #1a1a1a; }
h3 { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.3rem; }
p { color: #444; margin-bottom: 0.75rem; font-size: 0.95rem; }
.intro { color: #555; margin-bottom: 1.75rem; font-size: 0.95rem; }
ol, ul { padding-left: 1.4rem; color: #444; font-size: 0.95rem; }
li { margin-bottom: 0.35rem; }

/* TOOL CARD */
.tool-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

/* INPUTS */
.input-group { margin-bottom: 1rem; }
.input-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #444;
  margin-bottom: 0.35rem;
}
input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: #fafafa;
  color: #1a1a1a;
  transition: border-color 0.15s, background 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: #1a6b3c;
  background: #fff;
}

/* WEGING TABLE */
.weging-table { width: 100%; margin-bottom: 0.75rem; }
.weging-table thead th {
  font-size: 0.8rem;
  font-weight: 500;
  color: #666;
  padding: 0 4px 6px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.weging-table tbody tr td { padding: 4px; }
.weging-table input { font-size: 0.9rem; padding: 0.4rem 0.5rem; }
.add-row-btn {
  font-size: 0.8rem;
  color: #1a6b3c;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.add-row-btn:hover { text-decoration: underline; }
.del-row-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 1rem;
  padding: 0 4px;
  line-height: 1;
}
.del-row-btn:hover { color: #e74c3c; }

/* RESULT */
.result {
  background: #f0f8f3;
  border: 1.5px solid #a8d8bc;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
  display: none;
}
.result.visible { display: block; }
.result-label {
  display: block;
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.result-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1a6b3c;
  line-height: 1.2;
}
.result-sub { font-size: 0.85rem; color: #555; margin-top: 0.3rem; }

/* ERROR */
.error {
  background: #fff0f0;
  border: 1.5px solid #f5c0c0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #c0392b;
  display: none;
}
.error.visible { display: block; }

/* BTN CALCULAR */
.calc-btn {
  width: 100%;
  padding: 0.7rem;
  background: #1a6b3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s;
}
.calc-btn:hover { background: #145c31; }

/* TOOL NAV CARDS */
.tool-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 2rem;
}
.tool-nav a {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem;
  text-decoration: none;
  color: #1a1a1a;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-nav a:hover { border-color: #1a6b3c; }
.tool-nav a .tn-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 3px; }
.tool-nav a .tn-desc { font-size: 0.8rem; color: #666; }

/* FAQ */
.faq { margin-top: 0.5rem; }
.faq-item { border-bottom: 1px solid #eee; padding: 0.9rem 0; }
.faq-item:last-child { border-bottom: none; }

/* ADSENSE */
.ad-slot {
  margin: 2rem 0;
  text-align: center;
  overflow: hidden;
  min-height: 100px;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: #888;
  border-top: 1px solid #eee;
  margin-top: 3rem;
}
footer a { color: #888; text-decoration: none; }
footer a:hover { color: #1a6b3c; }
.footer-sep { margin: 0 0.5rem; }

/* MOBILE */
@media (max-width: 600px) {
  header { flex-wrap: wrap; }
  nav a:first-child { margin-left: 0; }
  .tool-card { padding: 1.1rem; }
  .result-value { font-size: 1.6rem; }
  .input-row { grid-template-columns: 1fr 90px; }
}
