      .shelf {
        position: relative;
        min-height: 392px;
        border-radius: 8px;
        padding: 10px 12px 18px;
      }

      .books {
        display: grid;
        gap: 0;
        min-height: 292px;
        border-radius: 6px;
        background:
          radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.04), transparent 26rem),
          var(--shelf-back);
        padding: 0 12px 12px;
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
        scrollbar-width: thin;
      }

      .books::-webkit-scrollbar {
        height: 6px;
      }

      .books::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.2);
      }

      .shelf-tier-name-chip {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        padding: 3px 10px 4px 11px;
        border-radius: 4px 4px 3px 3px;
        background:
          linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 24%),
          linear-gradient(180deg, rgba(57, 34, 22, 0.82), rgba(34, 20, 14, 0.88));
        color: var(--text);
        box-shadow:
          inset 0 1px 0 rgba(255, 255, 255, 0.08),
          inset 0 -1px 0 rgba(0, 0, 0, 0.22),
          0 4px 10px rgba(0, 0, 0, 0.16);
        transform: translateY(4px);
      }

      .shelf-tier-books {
        display: flex;
        align-items: flex-end;
        gap: 3px;
        min-height: 252px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 22px 8px 0;
      }

      .shelf-tier {
        position: relative;
        min-width: 0;
      }

      .shelf-tier-board {
        position: relative;
        overflow: visible;
        height: 18px;
        border-radius: 2px 2px 6px 6px;
        background:
          linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 18%, rgba(0, 0, 0, 0.14) 72%, rgba(255, 255, 255, 0.05)),
          linear-gradient(180deg, #6b472e 0%, var(--wood-top) 20%, var(--wood-mid) 64%, var(--wood-dark) 100%);
        box-shadow:
          inset 0 2px 3px rgba(255, 255, 255, 0.11),
          inset 0 -4px 8px rgba(0, 0, 0, 0.32),
          0 9px 13px rgba(0, 0, 0, 0.46);
      }

      .shelf-tier-board::before {
        position: absolute;
        top: 3px;
        right: 12px;
        left: 12px;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(239, 227, 204, 0.22), transparent);
        content: "";
      }

      .shelf-row-visual-gap {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 22px;
        margin: 5px 0;
        padding: 0 8px;
        opacity: 0;
        pointer-events: none;
      }

      .shelf-row-visual-gap[hidden] {
        display: none;
      }

      .sort-view-divider {
        position: relative;
        flex: 0 0 auto;
        align-self: flex-end;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 230px;
        margin: 0;
        padding: 12px 5px 11px 6px;
        border-radius: 0;
        background:
          linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 24px, rgba(0, 0, 0, 0.18) 24px 100%),
          linear-gradient(180deg, #a67a52 0%, #8b603d 14%, #6d452b 52%, #55331f 100%);
        box-shadow:
          inset 2px 0 0 rgba(255, 244, 221, 0.2),
          inset -4px 0 0 rgba(56, 33, 18, 0.42),
          inset 0 1px 0 rgba(255, 246, 229, 0.14),
          inset 0 -4px 7px rgba(0, 0, 0, 0.22),
          0 5px 10px rgba(0, 0, 0, 0.24);
        color: var(--text);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.08em;
        line-height: 1;
        pointer-events: none;
        user-select: none;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        opacity: 0.95;
      }

      .sort-view-divider::before,
      .sort-view-divider::after {
        position: absolute;
        left: 0;
        right: 0;
        content: "";
        pointer-events: none;
      }

      .sort-view-divider::before {
        top: 0;
        height: 8px;
        background: linear-gradient(180deg, rgba(255, 246, 227, 0.18), rgba(255, 246, 227, 0));
      }

      .sort-view-divider::after {
        top: 8px;
        bottom: 0;
        width: 4px;
        left: auto;
        right: 0;
        background: linear-gradient(180deg, rgba(45, 27, 15, 0.08), rgba(45, 27, 15, 0.24));
      }

      .sort-view-divider-label {
        display: block;
        max-height: 100%;
        padding: 0 1px;
        overflow: hidden;
        writing-mode: vertical-lr;
        text-orientation: mixed;
      }

      .sort-view-ndc-number {
        text-orientation: upright;
      }

      .sort-view-group-boundary-gap,
      .sort-view-divider-gap {
        display: block;
        flex: 0 0 auto;
        height: 1px;
        opacity: 0;
        pointer-events: none;
      }

      .spine-layer {
        position: absolute;
        pointer-events: none;
      }

      .spine-layer-base {
        border-radius: inherit;
      }

      .spine-layer-band,
      .spine-layer-mark {
        border: 0;
      }

      .spine-layer-text {
        right: 50%;
        display: block;
        line-height: 1.1;
        overflow: hidden;
        text-align: center;
        text-orientation: mixed;
        transform: translateX(50%);
        white-space: nowrap;
        writing-mode: vertical-rl;
      }

      /* Definition text supplies its own left/anchor/width semantics inline. */
      .spine-layer-definition-text {
        right: auto;
      }

      @media (max-width: 640px) {
        .shelf {
          padding: 6px 6px 14px;
        }

        .books {
          min-height: 260px;
          gap: 16px;
          padding: 14px 8px 10px;
        }

        .shelf-tier-books {
          min-height: 238px;
          padding: 18px 4px 0;
        }

        .shelf-tier-board {
          height: 16px;
        }

        .sort-view-divider {
          width: 26px;
          height: 214px;
          padding: 10px 4px 10px 5px;
          font-size: 9px;
        }
      }
