:root {
  --bg: #07111f;
  --bg-soft: #0b1829;
  --panel: #102238;
  --panel-2: #132941;
  --line: #264560;
  --text: #f4f8fc;
  --muted: #aac0d4;
  --cyan: #36d6ca;
  --blue: #66a9ff;
  --amber: #f8bd4f;
  --coral: #ff6b6b;
  --green: #65d39a;
  --shadow: 0 22px 60px rgba(0, 0, 0, .25);
  --radius: 22px;
  --max: 1240px;
}

html[data-theme="light"] {
  --bg: #f5f9fc;
  --bg-soft: #eaf2f8;
  --panel: #ffffff;
  --panel-2: #edf5fa;
  --line: #bfd0dd;
  --text: #102237;
  --muted: #52677a;
  --shadow: 0 20px 50px rgba(24, 49, 74, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
body.focus-mode .field-guide,
body.focus-mode .reference-card,
body.focus-mode .status-strip span { display: none; }
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }
.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 1000;
  background: var(--cyan); color: #041119; padding: 12px 18px; border-radius: 0 0 12px 12px; font-weight: 800;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px);
}
.nav-shell { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--panel); }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { letter-spacing: .01em; }
.brand small { color: var(--muted); margin-top: 4px; }
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a, .control-button {
  border: 0; background: transparent; color: var(--muted); text-decoration: none; padding: 9px 11px; border-radius: 10px; cursor: pointer;
}
.nav-links a:hover, .control-button:hover { background: var(--panel); color: var(--text); }
.status-strip { border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.status-strip .wrap { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; color: var(--muted); font-size: .88rem; }
.status-strip strong { color: var(--cyan); }

.hero { padding: 72px 0 54px; overflow: hidden; background: radial-gradient(circle at 78% 18%, rgba(54, 214, 202, .15), transparent 28%), radial-gradient(circle at 18% 0, rgba(102, 169, 255, .13), transparent 32%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 42px; align-items: center; }
.eyebrow { color: var(--cyan); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 900; }
h1, h2, h3 { line-height: 1.08; margin-top: 0; }
h1 { max-width: 800px; font-size: clamp(2.6rem, 6vw, 5.6rem); letter-spacing: -.055em; margin: 16px 0 22px; }
h1 em { color: var(--cyan); font-style: normal; }
h2 { font-size: clamp(2rem, 3.8vw, 3.35rem); letter-spacing: -.04em; margin-bottom: 0; }
.hero-lead { max-width: 760px; color: var(--muted); font-size: 1.2rem; }
.hero-search { max-width: 760px; margin-top: 28px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.hero-search label { display: block; font-weight: 850; margin-bottom: 9px; }
.search-row { display: flex; gap: 10px; }
input[type="search"] { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 12px; padding: 0 15px; background: var(--bg); color: var(--text); }
input[type="search"]::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
.hero-search p { margin: 8px 2px 0; color: var(--muted); font-size: .84rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 15px; background: var(--panel); color: var(--text); text-decoration: none; font-weight: 800; cursor: pointer; }
.button:hover { transform: translateY(-1px); border-color: var(--cyan); }
.button-primary { background: var(--cyan); color: #041119; border-color: var(--cyan); }
.button-ghost { background: transparent; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.emergency-card { position: relative; padding: 28px; border-radius: var(--radius); border: 1px solid rgba(255, 107, 107, .45); background: linear-gradient(155deg, rgba(255, 107, 107, .12), var(--panel)); box-shadow: var(--shadow); }
.emergency-card .pulse { position: absolute; top: 26px; right: 26px; width: 12px; height: 12px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 8px rgba(255, 107, 107, .1); }
.emergency-card p { color: var(--muted); margin: 0 0 6px; }
.emergency-card strong { display: block; font-size: 1.45rem; margin-right: 28px; }
.emergency-card ul { padding-left: 20px; margin-bottom: 0; color: var(--muted); }
.emergency-card li + li { margin-top: 8px; }

.section { padding: 72px 0; }
.section-tint { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.section-heading p { max-width: 560px; margin: 0; color: var(--muted); }
.quick-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.quick-grid li { min-height: 160px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.quick-grid b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--cyan); color: #041119; margin-bottom: 18px; }
.quick-grid strong { display: block; font-size: 1.05rem; }
.quick-grid span { display: block; color: var(--muted); margin-top: 6px; font-size: .92rem; }
.alert-line { margin-top: 18px; padding: 15px 18px; border-left: 4px solid var(--amber); background: color-mix(in srgb, var(--amber) 10%, var(--panel)); border-radius: 0 12px 12px 0; }

.catalog-toolbar { display: flex; gap: 12px; align-items: end; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.catalog-search { flex: 1; }
.catalog-search span { display: block; margin: 0 0 7px 2px; color: var(--muted); font-size: .84rem; font-weight: 850; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; background: var(--panel); padding: 8px 13px; color: var(--muted); cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: #041119; font-weight: 900; }
.result-status { display: flex; gap: 10px; align-items: baseline; margin: 20px 0; }
.result-status span { color: var(--muted); }
.empty-state { padding: 34px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty-state strong { color: var(--text); font-size: 1.15rem; }
.pattern-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pattern-card { overflow: hidden; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 12px 30px rgba(0, 0, 0, .08); }
.pattern-card:hover { border-color: color-mix(in srgb, var(--cyan) 70%, var(--line)); }
.pattern-image-button { position: relative; width: 100%; padding: 0; border: 0; background: #07111f; cursor: zoom-in; aspect-ratio: 16 / 9; overflow: hidden; }
.pattern-image-button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-label { display: none; }
.pattern-body { display: flex; flex-direction: column; flex: 1; padding: 18px; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.urgency { font-weight: 900; }
.urgency-emergencia { color: var(--coral); }
.urgency-urgente { color: var(--amber); }
.urgency-contexto, .urgency-base { color: var(--cyan); }
.pattern-card h3 { margin: 10px 0 7px; font-size: 1.35rem; }
.pattern-card p { margin: 0 0 15px; color: var(--muted); }
.first-look { margin-top: auto; padding: 12px; background: var(--bg-soft); border-radius: 12px; font-size: .9rem; }
.first-look strong { color: var(--cyan); display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.card-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.compare-button[aria-pressed="true"] { background: var(--amber); color: #201400; border-color: var(--amber); }

.compare-tray { position: fixed; left: 50%; bottom: 18px; z-index: 45; transform: translateX(-50%); width: min(800px, calc(100% - 28px)); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--cyan); border-radius: 18px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.compare-tray[hidden] { display: none; }
.compare-tray span { display: block; color: var(--muted); font-size: .86rem; }
.tray-actions { display: flex; gap: 8px; }

.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field-guide { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.field-guide small { color: var(--cyan); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.field-guide h3 { margin: 9px 0 14px; }
.field-guide ul { margin: 0; padding-left: 20px; color: var(--muted); }
.field-guide li + li { margin-top: 8px; }
.safety-layout { display: grid; grid-template-columns: .7fr 1.3fr; gap: 45px; }
.safety-copy { border-left: 4px solid var(--coral); padding-left: 24px; }
.safety-copy p { margin-top: 0; color: var(--muted); }
.safety-copy strong { color: var(--text); }
.reference-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.reference-card { display: block; min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-decoration: none; }
.reference-card:hover { border-color: var(--cyan); }
.reference-card small { color: var(--cyan); }
.reference-card strong { display: block; margin: 8px 0; }
.reference-card span { color: var(--muted); font-size: .85rem; }
.license-note { color: var(--muted); font-size: .88rem; margin-top: 20px; }

footer { padding: 36px 0; border-top: 1px solid var(--line); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; }
.footer-grid p { margin: 5px 0 0; color: var(--muted); }
.footer-grid > div:last-child { display: flex; flex-direction: column; gap: 7px; text-align: right; }
.footer-grid a { color: var(--muted); }

dialog { width: min(1080px, calc(100% - 26px)); max-height: calc(100vh - 26px); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--bg); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2, 8, 15, .82); backdrop-filter: blur(5px); }
.dialog-close-form { position: sticky; top: 0; z-index: 3; display: flex; justify-content: flex-end; height: 0; margin: 0; }
.icon-button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); margin: 12px; font-size: 1.8rem; cursor: pointer; }
.detail-shell { padding-bottom: 26px; }
.detail-hero { position: relative; background: #07111f; }
.detail-hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.detail-copy { padding: 28px; }
.detail-copy h2 { padding-right: 50px; }
.detail-sub { color: var(--muted); font-size: 1.05rem; }
.detail-key { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.key-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.key-card strong { display: block; color: var(--cyan); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px; }
.decision-30s { margin: 0 0 18px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--coral) 58%, var(--line)); border-radius: 17px; background: var(--panel); }
.decision-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; background: color-mix(in srgb, var(--coral) 12%, var(--panel)); }
.decision-heading span { color: var(--coral); font-size: .79rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.decision-heading strong { text-align: right; }
.decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.decision-grid > div { padding: 16px 17px; border-top: 1px solid var(--line); }
.decision-grid > div + div { border-left: 1px solid var(--line); }
.decision-grid h3 { margin: 0 0 9px; color: var(--cyan); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.decision-grid ul { margin: 0; padding-left: 19px; color: var(--muted); }
.decision-grid li + li { margin-top: 6px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.detail-section { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.detail-section h3 { margin-bottom: 12px; }
.detail-section ul { margin: 0; padding-left: 20px; color: var(--muted); }
.detail-section li + li { margin-top: 7px; }
.detail-section.action { border-color: color-mix(in srgb, var(--amber) 65%, var(--line)); }
.detail-section.limit { border-color: color-mix(in srgb, var(--coral) 55%, var(--line)); }
.source-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.source-pills a { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); text-decoration: none; font-size: .82rem; }
.compare-shell { padding: 28px; }
.compare-shell h2 { padding-right: 50px; }
.comparison-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.comparison-column { min-width: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
.comparison-column img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #07111f; }
.comparison-column > div { padding: 18px; }
.comparison-column h3 { margin-bottom: 15px; }
.comparison-row { padding: 11px 0; border-top: 1px solid var(--line); }
.comparison-row strong { display: block; color: var(--cyan); font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; }
.comparison-row span { color: var(--muted); }
.noscript { padding: 18px; background: var(--coral); color: #210204; font-weight: 800; }

@media (max-width: 1050px) {
  .pattern-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .reference-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links a { display: none; }
}

@media (max-width: 720px) {
  .wrap { width: min(100% - 24px, var(--max)); }
  .nav-shell { min-height: 64px; }
  .brand small { display: none; }
  .control-button { padding: 8px; }
  .status-strip .wrap { display: block; }
  .status-strip span { display: block; margin-top: 3px; }
  .hero { padding: 44px 0 36px; }
  .hero-grid, .safety-layout { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.5rem, 15vw, 4rem); }
  .search-row, .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .section { padding: 52px 0; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .quick-grid, .pattern-grid, .field-grid, .reference-grid, .detail-key, .detail-grid, .comparison-grid { grid-template-columns: 1fr; }
  .decision-heading { align-items: flex-start; flex-direction: column; }
  .decision-heading strong { text-align: left; }
  .decision-grid { grid-template-columns: 1fr; }
  .decision-grid > div + div { border-left: 0; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid li:last-child { grid-column: 1 / -1; }
  .pattern-card h3 { font-size: 1.25rem; }
  .compare-tray { align-items: stretch; flex-direction: column; bottom: 8px; }
  .tray-actions .button { flex: 1; }
  .footer-grid { flex-direction: column; }
  .footer-grid > div:last-child { text-align: left; }
  .detail-copy, .compare-shell { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  :root { --bg: #fff; --panel: #fff; --panel-2: #fff; --text: #000; --muted: #333; --line: #aaa; }
  .topbar, .status-strip, .hero-search, .hero-actions, .catalog-toolbar, .filter-row, .card-actions, .compare-tray, footer { display: none !important; }
  .hero, .section { padding: 18px 0; }
  .pattern-grid { grid-template-columns: repeat(2, 1fr); }
  .pattern-card { break-inside: avoid; box-shadow: none; }
}
