.tray-library {
  --tray-dim: #5d635b;
}
.tray-library .section-heading {
  align-items: end;
  padding-bottom: clamp(20px,2.6vw,48px);
}
.tray-library .section-heading h2 {
  font-size: clamp(2.7rem,5.35vw,6rem);
  letter-spacing: -.067em;
}
.tray-index-controls {
  display: grid;
  grid-template-columns: minmax(0,1.55fr) minmax(180px,.65fr);
  align-items: end;
  gap: clamp(22px,4vw,72px);
  border-block: 1px solid var(--rule);
  padding-block: 16px 14px;
  margin-bottom: clamp(21px,2.2vw,39px);
}
.tray-textures {
  display: flex;
  align-items: start;
  flex-wrap: wrap;
  gap: 0 clamp(12px,1.45vw,27px);
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.tray-textures legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 3px;
  font-size: .85rem;
  font-weight: 600;
}
.tray-textures label {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.tray-textures input {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
}
.tray-textures label span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .98rem;
  border-bottom: 2px solid transparent;
}
.tray-textures small {
  font-size: .73rem;
  color: var(--tray-dim);
  font-variant-numeric: tabular-nums;
}
.tray-textures input:checked + span { color: var(--wine); border-color: currentColor; font-weight: 650; }
.tray-textures input:focus-visible + span { outline: 2px solid var(--wine); outline-offset: 3px; }
.tray-index-controls .series-jump { max-width: none; margin: 0; }
.tray-library .tray-result { font-size: .9rem; color: var(--tray-dim); margin: -7px 0 17px; }
.tray-manual { margin-bottom: 24px; }
.tray-manual summary { min-height: 44px; cursor: pointer; }
.tray-manual ul { list-style: none; margin: 0; padding: 0; }
.tray-manual li { margin-bottom: 10px; }
.tray-manual strong { margin-right: .5em; }
.tray-library .family-grid { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: clamp(30px,3.5vw,62px) clamp(17px,2vw,36px); }
.tray-library .family-model { border-bottom: 0; }
.tray-library .model-photo img { aspect-ratio: 1.52; mix-blend-mode: normal; object-fit: cover; object-position: center 68%; }
.tray-library :is(#serie-f, #serie-g, #serie-k, #serie-l, #serie-p, #serie-t, #serie-v, #serie-fp, #serie-fq) .model-photo img { object-position: center bottom; }
.tray-library .family-model[data-texturas=""] .model-photo img { object-fit: contain; background: white; }
.tray-library .model-content { padding: 16px 0 1px; }
.tray-library .model-content h3 { font-size: clamp(1.4rem,2.2vw,2.65rem); font-weight: 545; }
.tray-library .model-content p { margin-bottom: 6px; }
.tray-library .model-links { border-bottom: 1px solid var(--rule); }
.tray-library .tray-gallery { margin: 0; border: 0; }
.tray-library .tray-gallery summary { color: var(--tray-dim); font-size: .83rem; }
.tray-library .tray-gallery > div { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.tray-library .tray-gallery > div figure:last-child img { object-fit: contain; background: white; }
@media (max-width: 900px) {
  .tray-index-controls { grid-template-columns: 1fr; gap: 14px; }
  .tray-index-controls .series-jump { width: min(100%, 24rem); }
}
@media (max-width: 720px) {
  .tray-library .section-heading { align-items: flex-start; }
  .tray-library .family-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 500px) {
  .tray-index-controls { gap: 17px; padding-top: 13px; }
  .tray-library .family-grid { grid-template-columns: 1fr; }
  .tray-textures { column-gap: 18px; }
  .tray-library .model-content { padding-top: 12px; }
}

.tray-sheet { width:min(1160px,calc(100vw - 40px)); max-width:none; max-height:calc(100dvh - 32px); margin:auto; padding:0; border:0; background:var(--paper); color:var(--ink); overflow:auto; overscroll-behavior:contain; }
.tray-sheet:not([open]) { display:none; }
.tray-sheet::backdrop { background:rgba(21,24,21,.8); }
body.tray-sheet-open { overflow:hidden; }
.tray-sheet-top { position:sticky; z-index:1; top:0; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:7px clamp(16px,2vw,28px); background:var(--paper); border-bottom:1px solid var(--rule); }
.tray-sheet-top > span { font-size:14px; font-weight:550; }
#tray-sheet-close { display:inline-flex; align-items:center; gap:10px; padding:4px 0 4px 12px; min-height:40px; border:0; font:500 14px/1.2 "DM Sans",sans-serif; background:none; color:inherit; }
#tray-sheet-close span { font:400 22px/1 Arial,sans-serif; }
.tray-sheet-body { display:grid; grid-template-columns:minmax(0,1.48fr) minmax(0,1fr); }
.tray-sheet-gallery { min-width:0; padding:clamp(16px,2vw,28px); background:#e8ebe4; }
.tray-sheet-photo { margin:0; }
.tray-sheet-photo img { display:block; width:100%; height:clamp(260px,44vw,480px); max-height:54dvh; object-fit:contain; background:#f4f5f0; }
.tray-sheet-photo figcaption { margin:9px 0 11px; font-size:13px; color:var(--muted); min-height:1.4em; }
#tray-sheet-thumbnails { display:flex; flex-wrap:wrap; align-items:flex-start; gap:10px; }
#tray-sheet-thumbnails[hidden] { display:none; }
#tray-sheet-thumbnails button { display:flex; flex-direction:column; gap:5px; align-items:flex-start; padding:0 0 5px; width:clamp(67px,8vw,96px); border:0; border-bottom:2px solid transparent; color:var(--muted); background:none; font:450 12px/1.3 "DM Sans",sans-serif; text-align:left; }
#tray-sheet-thumbnails img { display:block; width:100%; height:52px; object-fit:cover; }
#tray-sheet-thumbnails button[aria-pressed=true] { border-color:var(--wine); color:var(--wine); font-weight:650; }
.tray-sheet-details { display:flex; flex-direction:column; justify-content:center; min-width:0; padding:clamp(22px,3vw,45px); gap:clamp(24px,3.3vw,44px); }
#tray-sheet-title { margin:0; font:520 clamp(35px,4vw,58px)/1.01 "DM Sans",sans-serif; letter-spacing:-.065em; overflow-wrap:anywhere; }
.tray-sheet-spec { border-block:1px solid var(--rule); padding:17px 0 19px; }
.tray-sheet-spec h3 { font-size:13px; font-weight:600; color:var(--muted); margin:0 0 11px; }
#tray-sheet-specs { margin:0; font-size:clamp(16px,1.5vw,21px); line-height:1.55; letter-spacing:-.025em; }
#tray-sheet-specs br { display:block; content:""; margin-bottom:8px; }
.tray-sheet-actions { display:flex; align-items:flex-start; flex-direction:column; gap:7px; }
.tray-sheet-actions a { display:inline-flex; align-items:center; min-height:42px; gap:12px; font-size:14px; font-weight:550; }
#tray-sheet-contact { padding:8px 15px; background:var(--wine); color:white; text-decoration:none; }
#tray-sheet-contact:hover { background:#571323; }
#tray-sheet-document { color:var(--ink); text-underline-offset:4px; }
.tray-sheet :focus-visible { outline:2px solid var(--wine); outline-offset:3px; }
@media(max-width:700px) {
  .tray-sheet { width:calc(100vw - 18px); max-height:calc(100dvh - 18px); }
  .tray-sheet-body { grid-template-columns:minmax(0,1fr); }
  .tray-sheet-gallery { padding:12px 15px; }
  .tray-sheet-photo img { height:clamp(120px,26dvh,260px); max-height:none; }
  .tray-sheet-photo figcaption { margin-block:6px 8px; font-size:12px; }
  #tray-sheet-thumbnails { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
  #tray-sheet-thumbnails button { width:100%; }
  #tray-sheet-thumbnails img { height:clamp(40px,13vw,65px); }
  .tray-sheet-details { padding:18px; gap:15px; }
  #tray-sheet-title { font-size:34px; }
  .tray-sheet-spec { padding:10px 0 12px; }
  .tray-sheet-spec h3 { margin-bottom:5px; }
  #tray-sheet-specs { font-size:16px; line-height:1.4; }
  #tray-sheet-specs br { margin-bottom:5px; }
  .tray-sheet-actions { gap:3px; }
}
