:root {
  color-scheme: light;
  --ink: #17251d;
  --muted: #4c5c51;
  --paper: #f7f6f0;
  --line: #d5dcd1;
  --accent: #305e44;
  --danger: #963b31;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.55 "Instrument Sans", system-ui, sans-serif;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header nav {
  max-width: 72rem;
  margin: auto;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.25rem;
}

.site-header a { color: inherit; font-weight: 600; text-decoration: none; }
.site-header a:hover { text-decoration: underline; }
.site-header .brand { font: 1.85rem/1 "Instrument Serif", Georgia, serif; }
.site-header .brand span { color: var(--accent); }
main { width: min(100% - 2rem, 39rem); margin: 2rem auto 4rem; }
main.wide { width: min(100% - 2rem, 68rem); }
.calc, .card {
  min-width: 0;
  margin-bottom: 1rem;
  padding: clamp(1rem, 4vw, 2rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

h1, h2 { margin: 0 0 .75rem; line-height: 1.08; }
h1 { font: 400 clamp(2.55rem, 7vw, 4rem)/1 "Instrument Serif", Georgia, serif; }
h2 { font-size: 1.2rem; }
h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
p { margin: .25rem 0; }
label { display: block; margin: .75rem 0 .25rem; font-weight: 600; }
input, select, button { font: inherit; }
input, select { accent-color: var(--accent); }
input:not([type="radio"]):not([type="checkbox"]):not([type="range"]), select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 2.75rem;
  padding: .55rem .7rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #879589;
  border-radius: .55rem;
}
[type="range"] { width: 100%; }
[type="checkbox"], [type="radio"] { width: 1rem; height: 1rem; margin: 0; }
.radio-group, .checks, .buttons, .actions, .output {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
}
.radio-group label, .checks label { display: flex; align-items: center; gap: .55rem; }
.output input { flex: 1 1 13rem; font-family: monospace; }
button {
  min-height: 2.75rem;
  padding: .5rem 1rem;
  margin: .65rem 0;
  border: 1px solid var(--accent);
  border-radius: .55rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: var(--ink); }
button:disabled { opacity: .55; cursor: wait; }
button.danger, button.secondary, .copy-btn {
  color: var(--accent);
  background: #fff;
}
button.danger { color: var(--danger); border-color: var(--danger); }
button:is(.danger, .secondary, .copy-btn):hover { background: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.resultado, .status, .box {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #edf3ec;
  overflow-wrap: anywhere;
}
.resultado:empty { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.box { background: var(--paper); }
.info, .note, .small, .meta { margin-block: .65rem; color: var(--muted); }
.ok { color: #23533a; font-weight: 700; }
.error { color: var(--danger); font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: var(--paper); }
.mini-btn { margin: .15rem; }
.ticket { display: none; }

@media print {
  body * { visibility: hidden; }
  .ticket, .ticket * { visibility: visible; }
  .ticket { display: block; position: absolute; inset: 0; padding: 1.25rem; font-family: monospace; }
}
