:root {
  --text: #1c1915;
  --muted: #5e584e;
  --line: #ddd4c6;
  --bg: #f3efe6;
  --card: #fffaf3;
  --ink: #172033;
  --ink-soft: #243044;
  --accent: #9a3412;
  --accent-hover: #7c2d12;
  --accent-soft: #f3e0d4;
  --ad-bg: #ece6da;
  --max: 64rem;
  --radius: 0.2rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img, canvas { max-width: 100%; height: auto; }
button, input { font: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.site-header { background: var(--ink); color: #f6f1e8; }
.search-top {
  background: var(--ink);
  border-bottom: 1px solid var(--ink-soft);
  padding: 0.85rem 0 0.95rem;
}
.search-top .header-search,
.identity-bar .header-inner,
.footer-inner,
.container,
.home {
  width: min(var(--max), calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}
.header-search {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.header-search input {
  flex: 1;
  border: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 0.9rem 1.1rem;
  background: #fffaf3;
  color: var(--text);
  font-size: 1.05rem;
  min-width: 0;
}
.header-search button, .btn {
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent);
  color: #fff;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 650;
}
.btn { border-radius: var(--radius); }
.header-search button:hover, .btn:hover { background: var(--accent-hover); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: #efe8dc; color: var(--text); }

.identity-bar {
  background: var(--ink-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 0.35rem 0;
  flex-wrap: wrap;
}
.logo {
  color: #f6f1e8;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
}
.logo:hover { color: #fff; }
.header-tools {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.nav { display: flex; gap: 1.1rem; }
.nav a, .lang-switch a {
  color: #c9c2b4;
  text-decoration: none;
  font-size: 0.9rem;
}
.nav a:hover, .nav a.active,
.lang-switch a:hover, .lang-switch a.active { color: #fff; }
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
}
.lang-switch a.active { font-weight: 600; }
.lang-switch span { color: #8b8578; }

.site-footer {
  background: var(--ink);
  color: #c9c2b4;
  margin-top: 4rem;
  padding: 2rem 0 2.5rem;
  font-size: 0.9rem;
}
.footer-inner { display: grid; gap: 0.75rem; }
.footer-inner strong { color: #f6f1e8; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.85rem 1.1rem; }
.footer-links a { color: #c9c2b4; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-note { font-size: 0.8rem; color: #8b8578; }

.page { padding: 1.75rem 0 3rem; }
.page h1 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  font-weight: 700;
}
.lede, .muted { color: var(--muted); }
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 1.25rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; }
.breadcrumbs .sep { color: #b3a898; }

.home { padding: 1.75rem 0 4rem; text-align: left; }
.home-intro { max-width: 36rem; margin: 0 0 1.75rem; }
.home .eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 650;
}
.home h1 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
  font-weight: 700;
}
.home .lede { margin: 0; font-size: 1.02rem; }
.home .ad-slot { margin: 0 0 2rem; }
.home-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 2.5rem;
  align-items: start;
}
.home h2, .section-gap + h2, .page h2, .home-split h2 {
  font-size: 0.78rem;
  font-weight: 650;
  margin: 0 0 0.85rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-list, .list { display: grid; gap: 0.55rem; margin: 0; }
.brand-grid { display: grid; gap: 0.55rem; }
.brand-card, .cat-card, .model-card, .manual-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--card);
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: inherit;
}
.brand-card:hover, .cat-card:hover, .model-card:hover, .manual-row:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.06);
}
.brand-card .brand-name { display: block; font-weight: 650; }
.brand-card .brand-meta, .cat-card .meta, .model-card .meta, .manual-row .meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed #c9bfb0;
  border-radius: 0.2rem;
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a9082;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
#ad-listing-top { min-height: 5.5rem; }
#ad-reader-above-viewer { min-height: 5.5rem; margin: 150px 0 1.25rem; }
#ad-reader-sidebar { min-height: 16rem; width: 100%; }

.section-gap { margin-top: 2rem; }
.meta-line { color: var(--muted); font-size: 0.95rem; margin: 0 0 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }

.reader-layout {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-top: 0.5rem;
}
.reader-layout .viewer { grid-column: 2; grid-row: 1; }
.reader-layout #ad-reader-sidebar { grid-column: 1; grid-row: 1; }
.viewer {
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  background: #d8d2c6;
  min-width: 0;
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.viewer-toolbar button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.viewer-toolbar button:disabled { opacity: 0.4; cursor: default; }
.viewer-stage {
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  min-height: 20rem;
  background: #cfc7b8;
}
.viewer-stage canvas { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.viewer-status { color: #555; padding: 2rem 1rem; text-align: center; }
.disclaimer { margin-top: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.legal-body { max-width: 42rem; }
.legal-body h2 { font-size: 1.15rem; margin: 1.75rem 0 0.6rem; }
.legal-body ul, .legal-body ol { padding-left: 1.25rem; }
.empty { color: var(--muted); margin: 1.5rem 0; }

@media (max-width: 800px) {
  .home-split { grid-template-columns: 1fr; gap: 1.75rem; }
  .header-search input { font-size: 1rem; padding: 0.8rem 0.9rem; }
  .reader-layout { grid-template-columns: 1fr; }
  .reader-layout .viewer, .reader-layout #ad-reader-sidebar { grid-column: auto; grid-row: auto; }
  #ad-reader-sidebar { min-height: 6rem; }
}
