:root {
  --ink: #263238;
  --muted: #647176;
  --paper: #fffdf8;
  --line: #d8ddd8;
  --accent: #44665a;
  --accent2: #b9854d;
  --bg: #f4f1eb;
  --soft: color-mix(in srgb, var(--accent) 10%, #fffdf8);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,253,248,0.78), rgba(255,253,248,0.12) 50%, rgba(255,253,248,0.72)),
    var(--bg);
}

.topbar {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: end;
  padding: 30px clamp(18px, 4vw, 54px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, #fffdf8), #fffdf8 48%, color-mix(in srgb, var(--accent2) 10%, #fffdf8));
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

h1, h2 { margin: 0; line-height: 1.1; }
h1 { font-size: clamp(30px, 4vw, 52px); max-width: 960px; }
h2 { font-size: 22px; }
.lede { max-width: 840px; margin: 12px 0 0; color: var(--muted); font-size: 17px; line-height: 1.5; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
button {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
.actions > button:nth-of-type(2) { background: #5f6868; }
.actions > button:nth-of-type(3) { background: var(--accent2); }
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}
.segmented button {
  min-width: 46px;
  padding: 9px 10px;
  background: transparent;
  color: var(--ink);
}
.segmented button.is-active {
  background: var(--accent);
  color: white;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 360px) 1fr;
  gap: 24px;
  padding: 24px clamp(16px, 4vw, 48px) 48px;
}

.panel, .sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(42, 54, 52, 0.08);
}

.inputs {
  padding: 20px;
  position: sticky;
  top: 16px;
  align-self: start;
}

label { display: grid; gap: 7px; margin: 14px 0; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd3cf;
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  color: var(--ink);
  background: white;
}
select { min-height: 42px; }
textarea { min-height: 92px; resize: vertical; }
.check { grid-template-columns: 18px 1fr; align-items: center; font-weight: 650; }
.check input { width: 16px; height: 16px; }
.note { color: var(--muted); font-size: 13px; line-height: 1.45; }

.preview { display: grid; gap: 18px; }
.sheet { padding: 26px; min-height: 210px; }
.hero-sheet { border-left: 6px solid var(--accent); }
.value-sheet {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, #fffdf8), #fffdf8 58%, color-mix(in srgb, var(--accent2) 10%, #fffdf8));
}
.tag { margin: 0 0 16px; color: var(--accent2); font-weight: 900; text-transform: uppercase; font-size: 12px; letter-spacing: 0; }
.sheet p, .sheet li { line-height: 1.6; }
.sheet ul { margin: 0; padding-left: 20px; }
.sheet span[data-out] {
  background: #fff0d4;
  border-radius: 4px;
  padding: 1px 4px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.mini-card, .copy-card, .tracker-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.74);
  padding: 14px;
}
.mini-card h3, .copy-card h3 { margin: 0 0 8px; font-size: 16px; }
.mini-card p, .copy-card p { margin: 0; color: var(--muted); }
.copy-card button, .mini-card button {
  margin-top: 12px;
  background: var(--accent2);
}
.tracker {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.tracker-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(160px, 1.3fr) minmax(120px, 0.9fr);
  gap: 10px;
  align-items: center;
}
.utility-card {
  margin: 18px 0;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: 8px;
  background: var(--soft);
}
#qrCode {
  display: grid;
  place-items: center;
  min-height: 148px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}
#qrCode canvas, #qrCode img { max-width: 132px; height: auto; }
.language-note {
  display: none;
  margin-top: 14px;
  color: var(--muted);
}
html[data-lang="es"] .language-note.es,
html[data-lang="en"] .language-note.en { display: block; }

@media (max-width: 860px) {
  .topbar, .workspace { grid-template-columns: 1fr; display: grid; }
  .inputs { position: static; }
  .tracker-row { grid-template-columns: 1fr; }
}

@media print {
  body { background: white; }
  .topbar, .inputs, .copy-card button, .mini-card button { display: none; }
  .workspace { display: block; padding: 0; }
  .preview { gap: 0; }
  .sheet { break-inside: avoid; box-shadow: none; border-radius: 0; margin: 0 0 14px; }
}
