:root {
  --bg: #f8fafb;
  --surface: #fff;
  --text: #1d303c;
  --muted: #70828d;
  --line: #dce5e9;
  --accent: #236b8b;
  --accent-dark: #173e55;
  --accent-light: #e9f3f6;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; }
button, select, summary { cursor: pointer; }
a { color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #1c89b0; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 8px 12px; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.wrap { max-width: 1240px; width: calc(100% - 48px); margin-inline: auto; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 61px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 790; letter-spacing: -.052em; white-space: nowrap; }
.brand > span span { font-weight: 500; }
.brand i { font-style: normal; color: #2d8ca7; }
.header-description { font: 10px var(--mono); color: #8b9ba3; letter-spacing: .09em; }

.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 28px 0 22px; }
.page-heading h1 { font-size: 27px; font-weight: 730; line-height: 1.15; letter-spacing: -.045em; margin: 0 0 4px; }
.page-heading p { color: var(--muted); margin: 0; font-size: 13px; }
.archive-total { font: 11px var(--mono); color: #638394; white-space: nowrap; padding: 8px 10px; border: 1px solid #d7e5e9; background: #f0f6f7; border-radius: 4px; }
.toolbar { display: flex; gap: 10px; align-items: stretch; }
.search-box { height: 47px; background: #fff; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; border: 1px solid #cbd9df; border-radius: 5px; padding: 0 14px; }
.search-box:focus-within { border-color: #4491aa; box-shadow: 0 0 0 2px #e1f0f4; }
.search-box svg { color: #8ca0aa; flex-shrink: 0; }
.search-box input { flex: 1; min-width: 0; outline: 0; border: 0; background: transparent; color: var(--text); font-size: 14px; }
.search-box input::placeholder { color: #9eaeb6; }
.search-box kbd { display: inline-flex; min-width: 20px; height: 21px; border: 1px solid #e0e8ec; border-radius: 3px; background: #f6f8f9; align-items: center; justify-content: center; color: #9aabb2; font: 11px var(--mono); }
.sort-box { border: 1px solid #cbd9df; border-radius: 5px; display: flex; align-items: center; gap: 10px; background: white; padding: 0 10px 0 13px; min-width: 180px; }
.sort-box label { font: 10px var(--mono); color: #91a1a9; }
.sort-box select { min-width: 0; width: 100%; border: none; outline-offset: 3px; background: transparent; color: #2b495b; font-weight: 620; font-size: 12px; }
.filters { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin: 13px 0 22px; }
.filter-btn { background: transparent; color: #607784; border: 1px solid #d5e1e5; border-radius: 4px; padding: 7px 10px; line-height: 1.2; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 680; }
.filter-btn:hover { background: #edf4f6; border-color: #b5cdd6; }
.filter-btn.active { color: white; background: var(--accent-dark); border-color: var(--accent-dark); }
.filter-count { color: #98aab3; font: 10px var(--mono); }
.filter-btn.active .filter-count { color: #b6d8e3; }

.list-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.list-top > span:first-child { font-weight: 700; font-size: 12px; }
.list-top > span:last-child { color: #a3b0b7; font: 10px var(--mono); letter-spacing: .04em; }
.column-head, .device-record summary { display: grid; grid-template-columns: 22px minmax(0, 1fr) 125px 100px 165px; gap: 12px; align-items: center; }
.column-head { height: 34px; padding: 0 16px; background: #eaf0f2; border: 1px solid #dbe5e9; border-bottom: 0; color: #738994; font: 10px var(--mono); letter-spacing: .06em; }
.device-list { border: 1px solid #dbe5e9; background: white; border-radius: 0 0 6px 6px; overflow: hidden; }
.device-record { border-bottom: 1px solid #e8edef; }
.device-record:last-child { border-bottom: 0; }
.device-record summary { list-style: none; min-height: 50px; padding: 9px 16px; transition: background .14s; }
.device-record summary::-webkit-details-marker { display: none; }
.device-record summary::marker { content: ''; }
.device-record summary:hover { background: #f2f7f9; }
.device-record[open] > summary { background: #edf4f6; border-bottom: 1px solid #d5e3e8; }
.chevron { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d4e1e6; border-radius: 3px; color: #5a7e90; font-size: 18px; line-height: 1; transition: transform .13s; }
.device-record[open] .chevron { transform: rotate(90deg); border-color: #c5dce5; color: #2c7393; }
.record-name { font-size: 13px; line-height: 1.35; font-weight: 640; letter-spacing: -.012em; min-width: 0; }
.aftermarket-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  background: #e9f3f6;
  color: #38667d;
  border: 1px solid #c5dce5;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
}
.device-record[open] .record-name { color: #125371; }
.record-category { font-size: 11px; color: #718894; }
.record-panel { font-size: 11px; color: #718894; font-weight: 400; }
.record-levels { font: 10px var(--mono); color: #9baab1; white-space: nowrap; }
.details-panel { background: #f7fafb; padding: 17px 19px 22px 50px; }
.level-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 14px; }
.level-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.level-title { font: 10px var(--mono); color: #8aa0aa; letter-spacing: .06em; margin-right: 6px; }
.level-btn { color: #537387; background: white; border: 1px solid #cddfe5; border-radius: 4px; padding: 6px 11px; font-size: 12px; font-weight: 670; }
.level-btn.active { color: white; background: #236b8b; border-color: #236b8b; }
.level-caption { font: 10px var(--mono); color: #899ea9; }
.capture-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.capture-grid.single { grid-template-columns: minmax(0, 1fr); max-width: 800px; }
.capture-card { background: white; border: 1px solid #dfe8eb; border-radius: 5px; overflow: hidden; min-width: 0; }
.capture-open { position: relative; display: block; width: 100%; padding: 0; background: white; border: 0; }
.capture-open img { display: block; width: 100%; height: auto; aspect-ratio: 2358 / 1483; object-fit: contain; }
.capture-open::after { position: absolute; content: 'ENLARGE ↗'; right: 9px; bottom: 9px; background: rgba(24, 61, 79, .92); color: white; font: 9px var(--mono); padding: 5px 8px; border-radius: 3px; }
.capture-open:hover::after { background: #247e9d; }
.capture-meta { padding: 10px 12px; border-top: 1px solid #e8eef0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px 12px; }
.capture-meta strong { font-size: 11px; font-weight: 675; color: #466576; }
.capture-meta a { color: #387d99; font-size: 10px; text-decoration: none; white-space: nowrap; }
.capture-meta a:hover { text-decoration: underline; }
.empty-state { padding: 45px 20px; border: 1px dashed #cadce3; text-align: center; background: #fff; border-radius: 5px; display: flex; align-items: center; flex-direction: column; gap: 5px; }
.empty-state strong { font-size: 16px; }
.empty-state span { color: var(--muted); }
.empty-state button { margin-top: 10px; padding: 7px 14px; border: 1px solid #8cb2c2; background: white; border-radius: 4px; color: #245f7b; }
.archive-note { margin: 18px 0 60px; color: #8a9ca5; font-size: 12px; max-width: 940px; line-height: 1.7; }
.archive-note p {
  margin: 0 0 10px;
}
.site-footer { border-top: 1px solid var(--line); color: #9aaab2; background: #f4f7f8; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 0; font-size: 11px; }
.site-footer .wrap span:first-child { font: 11px var(--mono); font-weight: 700; letter-spacing: .04em; color: #69818d; }

.image-viewer { max-width: none; max-height: none; width: min(96vw, 1750px); height: min(96dvh, 1120px); border: 1px solid #42647a; border-radius: 5px; background: #132e3b; color: white; padding: 0; margin: auto; overflow: hidden; }
.image-viewer::backdrop { background: rgba(5, 18, 24, .92); }
.viewer-header { height: 53px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 0 16px; border-bottom: 1px solid #2e5265; font: 11px var(--mono); }
.viewer-header > span { color: #96b8c7; }
.viewer-header strong { text-align: center; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-header button { border: 1px solid #53798b; background: #214b5f; color: #e8f2f5; border-radius: 3px; padding: 5px 9px; }
.viewer-header button span { font-size: 17px; padding-left: 5px; }
.viewer-stage { height: calc(100% - 101px); display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; gap: 8px; padding: 10px; }
.viewer-stage img { display: block; max-width: 100%; max-height: 100%; height: auto; width: auto; margin: auto; background: #fff; object-fit: contain; }
.viewer-stage button { height: 100%; border: 0; background: transparent; color: #bad8e3; font-size: 39px; }
.viewer-stage button:hover { background: #1e4558; color: white; }
.viewer-footer { height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid #2e5265; padding: 0 18px; font: 10px var(--mono); color: #abc6d2; }
.viewer-footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-footer a { color: #e4f5fa; text-decoration: none; white-space: nowrap; }
.viewer-footer a:hover { text-decoration: underline; }

@media (max-width: 850px) {
  .column-head, .device-record summary { grid-template-columns: 22px minmax(0, 1fr) 95px 80px; }
  .column-head > :last-child, .record-levels { display: none; }
  .details-panel { padding-left: 17px; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 28px); }
  .header-inner { min-height: 54px; }
  .header-description { display: none; }
  .page-heading { align-items: start; gap: 7px; margin: 20px 0 15px; flex-direction: column; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 12px; }
  .archive-total { padding: 0; background: transparent; border: 0; font-size: 10px; }
  .toolbar { gap: 7px; }
  .search-box { height: 44px; padding: 0 10px; }
  .search-box kbd { display: none; }
  .search-box input { font-size: 13px; }
  .sort-box { min-width: 130px; padding: 0 7px; }
  .sort-box label { display: none; }
  .sort-box select { font-size: 11px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 7px; margin: 10px 0 15px; scrollbar-width: thin; }
  .filter-btn { flex: 0 0 auto; padding: 7px 9px; font-size: 11px; }
  .list-top > span:last-child { display: none; }
  .column-head, .device-record summary { grid-template-columns: 20px minmax(0, 1fr); gap: 8px; }
  .column-head { padding: 0 9px; }
  .column-head > :nth-child(3), .column-head > :nth-child(4), .record-category, .record-panel { display: none; }
  .device-record summary { min-height: 49px; padding: 8px 9px; }
  .record-name { font-size: 12px; }
      .details-panel { padding: 13px 10px 16px; }
  .level-title { width: 100%; margin-right: 0; }
  .level-toolbar { gap: 7px; }
  .level-group { gap: 5px; }
  .level-btn { padding: 6px 10px; font-size: 11px; }
  .level-caption { font-size: 9px; }
  .capture-grid, .capture-grid.single { grid-template-columns: 1fr; gap: 10px; }
  .capture-meta { padding: 9px; }
  .archive-note { margin-bottom: 40px; }
  .site-footer .wrap { align-items: start; flex-direction: column; gap: 5px; }
  .image-viewer { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .viewer-header { height: 52px; grid-template-columns: auto minmax(0,1fr) auto; gap: 6px; padding: 0 9px; font-size: 9px; }
  .viewer-stage { height: calc(100% - 98px); grid-template-columns: 22px minmax(0, 1fr) 22px; gap: 2px; padding: 4px; }
  .viewer-stage button { font-size: 26px; }
  .viewer-footer { height: 46px; padding: 0 9px; font-size: 9px; }
  .viewer-footer > span { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition-duration: .01ms !important; } }
/* Reddit community link */
.community-link {
  font-size: 12px;
  font-weight: 600;
  color: #236b8b;
  text-decoration: none;
  white-space: nowrap;
}

.community-link:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 620px) {
  .community-link {
    font-size: 11px;
    white-space: normal;
    text-align: right;
    max-width: 145px;
  }
}

/* PWM explanation expandable section */

.page-heading {
  align-items: flex-start;
}

.page-intro {
  flex: 1;
  min-width: 0;
}

.pwm-info {
  margin-top: 7px;
  max-width: 760px;
}

.pwm-info summary {
  color: #236b8b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pwm-info summary span {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pwm-info summary:hover {
  color: #173e55;
}

.pwm-info-body {
  margin-top: 12px;
  padding: 16px 18px;
  background: #e9f3f6;
  border: 1px solid #d0e1e8;
  border-radius: 5px;
}

.page-heading .pwm-info-body p {
  color: #1d303c;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 12px;
}

.page-heading .pwm-info-body p:last-child {
  margin-bottom: 0;
}

.pwm-info-body strong {
  color: #173e55;
}

.page-heading .pwm-info-body ul {
  color: #1d303c;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 12px;
  padding-left: 20px;
}

.new-badge {
  display: inline-block;
  background: #ffeb00;
  color: #000000;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  padding: 1px 3px;
  margin-left: 6px;
  border-radius: 2px;
  vertical-align: middle;
  white-space: nowrap;
  letter-spacing: 0;
}