:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #2d3031;
  background: #f8faf6;
  --line: #cdd6ce;
  --green: #285d4a;
  --muted: #515c55;
}
* { box-sizing: border-box; }
body { margin: 0; background: url('../ebook-20261102-0c7b8209ee36/paper-grid.png') repeat; background-size: 768px 768px; }
[hidden] { display: none !important; }
a { color: var(--green); }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #4d874e; outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; padding: .75rem; background: #fff; z-index: 2; }
.masthead { display: flex; gap: 2rem; align-items: center; padding: 0 clamp(1rem, 4vw, 2rem); min-height: 68px; background: #fff; border-bottom: 3px solid #2d3031; }
.masthead a { text-decoration: none; color: inherit; }
.masthead nav { display: flex; gap: 1.5rem; align-self: stretch; align-items: stretch; font-size: .9rem; }
.masthead nav a { display: flex; align-items: center; position: relative; }
.masthead nav [aria-current] { font-weight: 700; }
.masthead nav [aria-current]::after { content: ''; position: absolute; inset: auto 0 0; border-bottom: 4px solid #db3c43; }
main { width: min(76rem, 100% - 3rem); margin: 2.5rem auto; }
.eyebrow { margin: 0 0 .65rem; color: var(--green); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.intro > .button { white-space: nowrap; flex-shrink: 0; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.5rem); letter-spacing: -.04em; }
h2 { margin: 0 1.7rem .75rem 0; line-height: 1.25; overflow-wrap: anywhere; }
p { line-height: 1.5; }
.lead, .muted, #status, footer { color: var(--muted); }
.button { min-height: 42px; padding: .55rem .9rem; border: 1px solid #839789; border-radius: .4rem; background: #fff; color: #26372e; }
.button:hover, .group-card:hover { background: #eef4ed; }
.button.primary { background: var(--green); color: #fff; border-color: var(--green); }
.button:disabled { opacity: .45; cursor: default; }
#list-count { font-variant-numeric: tabular-nums; font-weight: 700; margin-left: .25rem; }
dialog summary { color: var(--green); font-weight: 700; }
.filters { display: grid; grid-template-columns: 1fr 1.75fr 1.75fr; gap: .85rem; margin-top: 1.15rem; }
.filter-field { display: grid; gap: .35rem; min-width: 0; }
.filters label { display: grid; gap: .35rem; font-weight: 700; font-size: .86rem; min-width: 0; }
.filters input, .filters select { padding: .65rem .7rem; min-height: 44px; min-width: 0; width: 100%; color: inherit; border: 1px solid #8d9e92; border-radius: .4rem; background: #fff; }
.groups { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(11.8rem,100%),1fr)); gap: .8rem; }
.group-card { text-align: left; padding: .6rem; border: 1px solid var(--line); border-radius: .5rem; background: #fff; color: inherit; }
.group-card { display: grid; grid-template-rows: 110px auto; }
.group-card img { width: 100%; height: 100%; object-fit: contain; }
.group-card strong { display: block; padding-top: .3rem; }
.group-card small, .part-meta { display: block; color: var(--muted); font-size: .82rem; margin-top: .3rem; }
.parts { display: flex; align-items: flex-start; gap: 1rem; }
.diagram { width: min(38%, 26rem); flex-shrink: 0; background: #fff; padding: 1rem; border: 1px solid var(--line); border-radius: .5rem; position: sticky; top: 1rem; }
.diagram img { width: 100%; max-height: 330px; object-fit: contain; }
.results { flex: 1; min-width: 0; }
#results, #shopping-items, #kit-items { margin: 0; padding: 0; list-style: none; }
#results li, #shopping-items li, #kit-items li { padding: .75rem .9rem; border: 1px solid var(--line); border-radius: .45rem; background: #fff; margin-bottom: .45rem; }
.part-link { display: block; border: 0; text-align: left; padding: .15rem 0; color: var(--green); font-weight: 700; background: transparent; }
.part-link:hover { text-decoration: underline; }
.part-meta code { font-size: .9rem; overflow-wrap: anywhere; }
footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: .85rem 0; font-size: .9rem; }
dialog { width: min(37rem,100% - 2rem); max-height: 90dvh; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: .65rem; padding: 1.25rem; color: inherit; }
dialog::backdrop { background: #15241dbb; }
.dialog-close { position: absolute; top: .6rem; right: .6rem; }
.dialog-close button { appearance: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: .35rem; border: 1px solid var(--line); background: #fff; color: #26372e; font-size: 1.6rem; line-height: 1; }
#add-kit { margin-top: .5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.lightbox { width: min(62rem, 100% - 1rem); }
#image-stage { overflow: auto; margin-top: .8rem; max-height: 66dvh; }
#diagram-image { display: block; width: 100%; max-width: none; }
#shopping-items input { width: 5.5rem; min-height: 36px; margin: .35rem .45rem .35rem 0; }
@media(max-width: 680px) {
  .masthead { flex-direction: column; align-items: flex-start; gap: .5rem; padding-top: .8rem; }
  .masthead nav { flex-wrap: wrap; gap: .2rem .85rem; min-height: 38px; font-size: .83rem; }
  .masthead nav a { min-height: 38px; }
  main { width: calc(100% - 1.5rem); margin: 1.3rem auto; }
  .intro h1 { font-size: clamp(1.5rem, 7.4vw, 2.1rem); }
  .filters { grid-template-columns: 1fr; }
  .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .group-card { grid-template-rows: 88px auto; overflow-wrap: anywhere; }
  .button { min-height: 44px; }
  .part-link { min-height: 44px; }
  dialog { width: calc(100% - 1.25rem); max-height: calc(100dvh - 1.5rem); padding: 1rem; }
  #add-kit { width: 100%; }
  .parts { display: block; }
  .diagram { width: 100%; position: static; margin-bottom: .8rem; }
  .diagram img { max-height: 235px; }
}

.section-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.section-tabs [aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }

.filters.accessory-filters {
  grid-template-columns: minmax(0, 34rem);
}
.group-card.group-card-without-image { grid-template-rows: auto; align-content: start; }
.accessory-variant-photo img { display: block; width: 68px; height: 48px; object-fit: contain; }
