/* Inventory templates use the shared type and control tokens. The light surfaces
   here are scoped to the truck browsing and detail layouts. */
@media screen {
  .utd-inventory {
    --inv-refresh-paper: var(--utd-paper);
    --inv-refresh-line: var(--utd-line);
    --inv-refresh-white: #fff;
    --inv-refresh-gap: clamp(1.5rem, 4vw, 4rem);
    --inv-refresh-anchor: calc(var(--utd-head, 72px) + 1.5rem);
  }

  .utd-inventory.admin-bar {
    --inv-refresh-anchor: calc(var(--utd-head, 72px) + 4.5rem);
  }

  .utd-inventory main :is(.inv-category-head, .inv-refresh-index, .inv-refresh-detail) {
    background: var(--inv-refresh-paper);
    color: var(--utd-deep);
  }

  .utd-inventory main :is(.inv-category-head, .inv-refresh-index) { background: #fff; }

  .inv-category-head {
    padding-block: clamp(1.25rem, 2vw, 2.25rem);
    border-bottom: 1px solid var(--inv-refresh-line);
  }

  .inv-category-head__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(1rem, 2.5vw, 2rem);
  }

  .utd-inventory main .inv-category-head h1 {
    margin-top: clamp(1.15rem, 2.4vw, 2.1rem);
    color: var(--utd-deep);
    font-size: clamp(2.5rem, 4vw, 3.75rem);
    line-height: 1.04;
    letter-spacing: -.045em;
  }

  .utd-inventory main .inv-category-head__copy > p {
    max-width: 46ch;
    margin-top: .9rem;
    font-size: clamp(1.125rem, 1.6vw, 1.4375rem);
    line-height: 1.45;
  }

  .inv-category-head__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    margin-top: clamp(1.2rem, 2.3vw, 2rem);
    padding-top: clamp(.85rem, 1.7vw, 1.5rem);
    border-top: 1px solid var(--inv-refresh-line);
  }

  .utd-inventory main .inv-category-head__actions p {
    color: var(--utd-deep);
    font-size: var(--t-h3);
    font-weight: 750;
  }

  .inv-category-head__image {
    margin: .45rem 0 0;
  }

  .utd-inventory main .inv-category-head__image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    border-radius: var(--r-badge);
    object-fit: cover;
  }

  .inv-category-head__image figcaption {
    margin-top: .35rem;
    color: var(--utd-body-ink);
    font-size: var(--t-min);
    font-style: italic;
    line-height: 1.45;
  }

  .inv-refresh-state {
    display: grid;
    gap: .35rem;
    margin-top: 1.5rem;
  }

  .inv-refresh-state > span {
    justify-self: start;
    padding: .35em .75em;
    border: 1px solid #bccfe2;
    border-radius: 100px;
    background: #e8f1fa;
    color: #14304f;
    font-size: var(--t-min);
    font-weight: 700;
    line-height: 1.4;
  }

  .utd-inventory main .inv-refresh-index .inv-refresh-state p {
    max-width: 48ch;
    margin: 0;
    font-size: var(--t-small);
    line-height: 1.5;
  }

  .inv-refresh-actions {
    gap: .5rem 1rem;
    margin-top: 1.2rem;
  }

  .inv-category-search {
    margin-top: var(--sp-5);
  }

  .inv-category-search .inv-cat-search {
    margin: 0;
    border-color: var(--inv-refresh-line);
  }

  .inv-category-request {
    padding-block: clamp(1.75rem, 3vw, 3.5rem);
    background: var(--inv-refresh-paper);
  }

  .inv-category-request__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--inv-refresh-gap);
  }

  .utd-inventory main .inv-category-request h2 {
    color: var(--utd-deep);
    font-size: clamp(1.55rem, 2.45vw, 2.125rem);
    line-height: 1.15;
  }

  .utd-inventory main .inv-category-request h2 + p {
    max-width: 50ch;
    margin-top: .35rem;
    line-height: 1.5;
  }

  .inv-category-request__specs {
    margin: 1.1rem 0 0;
  }

  .inv-category-request__specs > div {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.55fr);
    align-items: baseline;
    gap: .5rem 1rem;
    padding-block: .9rem;
    border-bottom: 1px solid var(--inv-refresh-line);
  }

  .inv-category-request__specs > div:last-child {
    border-bottom: 0;
  }

  .inv-category-request__specs dt {
    color: var(--utd-deep);
    font-weight: 750;
  }

  .inv-category-request__specs dd {
    margin: 0;
    color: var(--utd-body-ink);
    font-size: var(--t-small);
  }

  .inv-category-request__form {
    padding-inline-start: var(--inv-refresh-gap);
    border-inline-start: 1px solid var(--inv-refresh-line);
  }

  .utd-inventory main .inv-category-request .home-form {
    margin: 1rem 0 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .utd-inventory main .inv-category-request .home-form__submit {
    width: 100%;
  }

  .utd-inventory main .inv-refresh-index {
    padding-block: clamp(1.25rem, 3vw, 3rem);
    border-bottom: 1px solid var(--inv-refresh-line);
  }

  .inv-refresh-index__inner {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem 2rem;
  }

  .inv-refresh-index__inner > a {
    flex-shrink: 0;
  }

  .utd-inventory main .inv-refresh-index h1 {
    max-width: 26ch;
    margin-top: .5rem;
    color: var(--utd-deep);
    font-size: clamp(2.25rem, 4.4vw, 4rem);
    line-height: 1.05;
    letter-spacing: -.045em;
    text-wrap: balance;
  }

  .utd-inventory main .inv-refresh-index--empty {
    padding-block: clamp(2rem, 5vw, 4.5rem);
  }

  .utd-inventory main .inv-refresh-index--empty h1 {
    max-width: 18ch;
  }

  .utd-inventory main .inv-refresh-request {
    background: var(--inv-refresh-white);
    border-color: var(--inv-refresh-line);
  }

  .utd-inventory main .inv-refresh-request .inv-request {
    gap: var(--inv-refresh-gap);
  }

  .utd-inventory main .inv-refresh-request .inv-request__copy h2 {
    max-width: 21ch;
    text-wrap: balance;
  }

  .utd-inventory main .inv-refresh-request .home-form {
    border-color: var(--inv-refresh-line);
  }

  .inv-refresh-request .inv-request,
  .inv-refresh-request #truck-types,
  .inv-cat-stock,
  .inv-category-request__form,
  .inv-refresh-nomatch .inv-request,
  .inv-refresh-detail [id^="truck-"] {
    scroll-margin-top: var(--inv-refresh-anchor);
  }

  .inv-refresh-nomatch .inv-request {
    margin-top: .75rem;
    padding-top: 1.5rem;
  }

  .utd-inventory main .inv-refresh-guide {
    background: var(--inv-refresh-paper);
    border-color: var(--inv-refresh-line);
  }

  .inv-refresh-guide .inv-guide__more {
    margin-top: .8rem;
  }

  .inv-refresh-guide .inv-guide__list {
    border-top: 1px solid var(--inv-refresh-line);
  }

  .inv-refresh-guide .inv-guide__list article {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.45fr);
    border-bottom-color: var(--inv-refresh-line);
  }

  .utd-inventory main :is(.inv-category-search + .inv-cat-stock, .inv-browser, .inv-similar) .inv-card {
    border-color: var(--inv-refresh-line);
  }

  .utd-inventory main :is(.inv-category-search + .inv-cat-stock, .inv-browser, .inv-similar) .inv-card:hover {
    border-color: #9bb2cc;
    box-shadow: 0 .6rem 1.8rem rgba(12, 35, 64, .08);
  }

  .inv-refresh-detail .inv-panel {
    border-color: var(--inv-refresh-line);
    box-shadow: 0 .6rem 1.8rem rgba(12, 35, 64, .07);
  }

  .inv-refresh-detail .inv-gallery__slide img {
    object-fit: contain;
  }

  .inv-refresh-detail .inv-gallery__track:focus-visible {
    outline: 3px solid var(--utd-sky);
    outline-offset: -4px;
  }

  .inv-detail-jumps {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 1.25rem;
    margin-top: 1.2rem;
    padding-block: .35rem;
    border-block: 1px solid var(--inv-refresh-line);
  }

  .inv-detail-jumps + .inv-section {
    margin-top: var(--sp-6);
  }

  .inv-detail-costs {
    padding: clamp(1rem, 2vw, 1.5rem);
    border: 1px solid var(--inv-refresh-line);
    border-radius: var(--r-card);
    background: var(--inv-refresh-white);
  }

  .utd-inventory main .inv-detail-costs p {
    max-width: 50ch;
    margin-block: .5rem;
  }

  @media (max-width: 760px) {
    .inv-category-head__inner,
    .inv-category-request__inner {
      grid-template-columns: minmax(0, 1fr);
    }

    .utd-inventory main .inv-category-head__image img {
      aspect-ratio: 16 / 9;
    }

    .inv-category-request__form {
      padding: 1.5rem 0 0;
      border-inline-start: 0;
      border-top: 1px solid var(--inv-refresh-line);
    }

    .inv-category-search .inv-cat-search {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 640px) {
    .inv-refresh-index__inner {
      display: block;
    }

    .inv-refresh-index__inner > a {
      margin-top: .35rem;
    }

    .inv-refresh-guide .inv-guide__list article {
      grid-template-columns: minmax(0, 1fr);
    }

    .utd-inventory main .inv-refresh-request .inv-request__phone {
      display: inline-flex;
      margin-top: .75rem;
      font-size: var(--t-h3);
    }

    .inv-detail-jumps {
      column-gap: .8rem;
    }

    .utd-inventory main .inv-detail-jumps a {
      font-size: var(--t-min);
    }
  }

  @media (max-width: 400px) {
    .inv-category-search .inv-cat-search,
    .inv-category-request__specs > div {
      grid-template-columns: minmax(0, 1fr);
    }
  }
}

@media print {
  .inv-detail-jumps, .inv-detail-costs { display: none !important; }
}
