:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #14181f; --muted: #667085; --line: #e4e7ec;
  --accent: #0e7c66; --accent-ink: #fff; --accent-soft: #e6f4f0; --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1216; --panel: #171b21; --ink: #e8eaed; --muted: #98a2b3; --line: #2a3039;
          --accent: #34c4a0; --accent-ink: #062019; --accent-soft: #15302a; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: .4em 0; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
section { margin: 32px 0; }

/* header */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; gap: 20px; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; text-decoration: none; white-space: nowrap; }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }

/* search */
.search { position: relative; display: flex; flex: 1; max-width: 560px; }
.search input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search button { padding: 0 16px; font: inherit; font-weight: 600; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border-radius: 0 var(--radius) var(--radius) 0; }
.search-lg { max-width: 640px; margin: 20px auto 0; }
.search-lg input { height: 50px; font-size: 1.05rem; background: var(--panel); }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; z-index: 30; text-align: left; }
.suggest a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; text-decoration: none; }
.suggest a:hover, .suggest a.sel { background: var(--accent-soft); }
.suggest small { color: var(--muted); }
.suggest p { margin: 0; padding: 10px 12px; }

.hero { text-align: center; padding: 40px 0 8px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.hero p { color: var(--muted); margin: 0; }

.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.sec-head > a { color: var(--accent); text-decoration: none; font-weight: 500; }
.tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.tabs a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); text-decoration: none; font-weight: 500; }
.chip small { color: var(--muted); font-weight: 400; }
.chip:hover, .chip.on { border-color: var(--accent); color: var(--accent); }
.chips.small { margin: 16px 0 20px; }
.letter { margin: 24px 0 0; }

/* categorías */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; }
.cat span { color: var(--muted); font-size: .88rem; }
.cat small { color: var(--accent); margin-top: 4px; }
.cat:hover { border-color: var(--accent); }

/* tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.card { display: flex; gap: 12px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s; }
.card:hover { border-color: var(--accent); }
.card-thumb { flex: none; width: 48px; height: 64px; border-radius: 4px; overflow: hidden; background: var(--accent-soft); display: grid; place-items: center; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { font-weight: 700; color: var(--accent); font-size: 1.3rem; }
.card-body { display: flex; flex-direction: column; min-width: 0; }
.card-brand { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.card-model { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: .85rem; color: var(--muted); margin-top: auto; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 24px 0; }
.pager a, .pager span { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); text-decoration: none; }
.pager .cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.crumbs { margin: 18px 0 4px; font-size: .88rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-head { display: flex; gap: 16px; align-items: center; }
.brand-logo { height: 48px; }

/* página de manual */
.manual-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); }
.badge { background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.rate { display: flex; align-items: center; gap: 2px; }
.rate button { border: 0; background: none; font-size: 1.3rem; color: var(--line); cursor: pointer; padding: 0 2px; }
.rate:hover button { color: #f5b301; }
.rate button:hover ~ button { color: var(--line); }

.manual-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.viewer { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; scroll-margin-top: 80px; }
.viewer-bar { display: flex; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 64px; background: var(--panel); z-index: 5; }
.vbtn { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: inherit; text-decoration: none; font: inherit; font-size: 1.1rem; cursor: pointer; }
.vbtn.wide { font-size: .88rem; font-weight: 600; }
.vbtn[aria-disabled] { opacity: .4; pointer-events: none; }
.goto { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.goto input { width: 62px; height: 34px; text-align: center; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.spacer { flex: 1; }
.canvas-wrap { position: relative; padding: 16px; background: #e9ebef; min-height: 500px; overflow: auto; text-align: center; }
@media (prefers-color-scheme: dark) { .canvas-wrap { background: #0b0d10; } }
.canvas-wrap canvas { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); max-width: none; }
.viewer-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 20px; }
.viewer-msg[hidden] { display: none; }

.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.box h2 { margin-bottom: 10px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc .pg { color: var(--muted); font-variant-numeric: tabular-nums; }
.spec { width: 100%; border-collapse: collapse; }
.spec th, .spec td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { color: var(--muted); font-weight: 500; width: 40%; }

.qa { margin-top: 24px; }
.ask { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.ask textarea { grid-column: 1 / -1; min-height: 90px; }
.ask input, .ask textarea { font: inherit; color: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ask button { justify-self: start; padding: 9px 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
.ask-msg { grid-column: 1 / -1; margin: 0; }
.q { border-top: 1px solid var(--line); padding: 10px 0; }
.q p { margin: 4px 0; }
.a { margin: 8px 0 0 16px; padding-left: 12px; border-left: 3px solid var(--accent-soft); }

.foot { margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--line); background: var(--panel); font-size: .9rem; }

@media (max-width: 900px) {
  .manual-layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .top-in { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .top .search { flex-basis: 100%; }
  .viewer-bar { top: 0; position: static; }
  .canvas-wrap { padding: 8px; min-height: 300px; }
  .ask { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}

/* texto de la página + buscar en el manual */
.page-text { margin-top: 20px; }
.page-text .txt { white-space: pre-line; color: var(--muted); font-size: .92rem; max-height: 420px; overflow: auto; overflow-wrap: anywhere; }
.toc li.sub a { padding-left: 14px; font-size: .92rem; }
.find input { width: 100%; height: 38px; padding: 0 11px; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.find-res { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow: auto; }
.find-res a { display: block; padding: 7px 0; border-bottom: 1px dashed var(--line); text-decoration: none; font-size: .88rem; }
.find-res a:hover { color: var(--accent); }
.find-res b { color: var(--accent); }
.find-res mark { background: var(--accent-soft); color: inherit; }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
