/* PWadhd — bare-bones test layout. No real styling yet. */
body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 24px;
  background: #eef1f5;
  color: #111;
}
a { color: #14499b; }
.boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 820px;
  margin: 24px auto;
}
.boxes a {
  display: block;
  padding: 36px 16px;
  border: 2px solid #14499b;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.boxes a:hover { background: #14499b; color: #fff; }
.hub-logo { display: block; margin: 0 auto 8px; width: min(320px, 70vw); }
.back { display: inline-block; margin-top: 24px; }

/* ---- generated parts pages ---- */
h1 { max-width: 1000px; margin: 8px auto 4px; }
.meta { max-width: 1000px; margin: 0 auto 10px; color: #555; font-size: .9rem; }
.meta code { font-size: .85em; }
.boxes.small { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); max-width: 1000px; }
.boxes.small a { padding: 16px 12px; font-size: .82rem; text-transform: none; letter-spacing: 0; line-height: 1.45; }
.boxes.small small { color: #777; font-weight: 400; }
.boxes.small a:hover small { color: #e8dccb; }
.diagram { margin: 16px auto; max-width: 1000px; text-align: center;
           background: #000; border-radius: 6px; padding: 12px; }
.diagram img { width: 100%; max-width: 760px; height: auto; display: block; margin: 0 auto; }
.diagram figcaption { font-size: .85rem; color: #9aa3b2; margin-top: 10px; }
.table-scroll { max-width: 1000px; margin: 16px auto; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; background: #fff; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #e3e3e3; }
thead th { background: #14499b; color: #fff; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:hover { background: #f4f7fc; }
td.num, th.num { text-align: right; width: 1%; white-space: nowrap; }
td.pn { font-family: ui-monospace, Menlo, monospace; white-space: nowrap; }
.muted { color: #aaa; }
.pagenav { max-width: 1000px; margin: 16px auto; font-size: .9rem; }

/* ---- parts tiles ---- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  max-width: 1100px;
  margin: 22px auto;
}
.tile {
  display: flex; flex-direction: column;
  border: 1px solid #000; border-radius: 8px;
  overflow: hidden; text-decoration: none;
  background: #000; transition: .15s;
}
.tile:hover {
  border-color: #14499b;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.tile .thumb { display: block; background: #000; line-height: 0; }
.tile .thumb img { width: 100%; height: auto; display: block; }
.tile .label {
  display: block;
  background: #000;
  padding: 11px 13px 13px;
  line-height: 1.3;
}
.tile .label strong {
  display: block;
  color: #fff;
  font-size: .94rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.tile:hover .label strong { color: #7fb2ff; }

/* Part numbers: tap to copy. The number is the affordance -- no icon, no
   trailing button, nothing that survives past the moment of feedback. */
td.pn {
  position: relative;
  cursor: pointer;
  -webkit-touch-callout: default;
  -webkit-tap-highlight-color: transparent;
  border-radius: 3px;
  transition: background .12s;
}
td.pn:hover { background: #eaf0fb; }
td.pn.copied { background: #dff3e4; }
td.pn.copied::after {
  content: "copied";
  position: absolute;
  top: 50%; right: -4px;
  transform: translateY(-50%) translateX(100%);
  font-family: var(--sans, system-ui, sans-serif);
  font-size: .64rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #2b7a44;
  pointer-events: none;
  animation: fadeout .9s ease forwards;
}
@keyframes fadeout { 0%,65% { opacity: 1; } 100% { opacity: 0; } }
/* Part numbers are monospace and come in 11, 12 and 15 character lengths.
   Reserving the widest keeps SEARCH in a straight column instead of tracking
   each number's ragged right edge. */
td.pn .pnv {
  display: inline-block;
  min-width: 15.5ch;
  -webkit-user-select: all; user-select: all;
}

/* Google search: a small square icon button. Inline SVG referenced from a
   single sprite, so it stays crisp at any density and costs ~30 bytes a row. */
a.gs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-left: 4px;
  border: 1px solid #c9d2df;
  border-radius: 4px;
  background: #fff;
  color: #8e97a6;
  vertical-align: middle;
  transition: background .12s, border-color .12s, color .12s;
  -webkit-user-select: none; user-select: none;
}
a.gs .i { width: 12px; height: 12px; display: block; }
a.gs:hover, a.gs:focus-visible {
  background: #14499b; border-color: #14499b; color: #fff;
}
a.gs:active { transform: translateY(1px); }
@media (hover: none) { td.pn:hover { background: none; } }

}
/* swipe target: don't let the browser claim horizontal gestures */
.diagram { touch-action: pan-y; }
.diagram img { -webkit-user-drag: none; user-select: none; }

/* Swiping between assemblies is a real page load. Keep it from feeling chunky:
   the neighbours are prefetched, the image has explicit dimensions so nothing
   reflows, and the document cross-fades where the browser supports it. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
.diagram img { background: #000; }

/* Yamaha marks sub-components of an assembly with leading dots. Shown as
   indentation with a guide rule: these are the parts inside the line above,
   which is what tells you whether you can buy one on its own. */
.sub1, .sub2 { display: inline-block; position: relative; color: #4a5260; }
.sub1 { padding-left: 18px; }
.sub2 { padding-left: 36px; }
.sub1::before, .sub2::before {
  content: ""; position: absolute; top: .15em; bottom: .15em;
  border-left: 2px solid #cfd6e0;
}
.sub1::before { left: 6px; }
.sub2::before { left: 24px; }
