:root {

  --page-gap: 20px;
  --card-gap: 12px;

  --font: 'Instrument Sans', sans-serif;
}

body {

  margin: 0;
  font-family: var(--font);

  color: white;
}

/* WRAPPER */

.binder-wrapper {

  width: 100%;
}

/* HEADER */

.binder-header {

  display: flex;
  flex-direction: column;

  gap: 12px;
}

/* PANELS */

.header-panel,
.navigation-group,
.search-group,
.binder-filters {

  border-radius: 12px;

  border: none;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.02),
      rgba(255,255,255,0.008)
    );
  
}

/* =================================
   CARD FILTERS
================================= */

.binder-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-title {
  margin-right: 4px;
  color: rgba(225,240,210,0.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.filter-toggle {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.filter-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.filter-toggle span {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  font-weight: 700;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.filter-toggle span::before {
  content: "✓";
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: transparent;
  font-size: 10px;
  font-weight: 900;
}

.filter-toggle input:checked + span {
  border-color: rgba(198,255,135,0.42);
  background: rgba(198,255,135,0.07);
  color: white;
}

.filter-toggle input:checked + span::before {
  border-color: #caef7d;
  background: #caef7d;
  color: #1b2220;
}

.filter-toggle input:focus-visible + span {
  outline: 2px solid #caef7d;
  outline-offset: 2px;
}

.binder-stack-switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.binder-stack-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.binder-stack-switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  box-sizing: border-box;
  transition: border-color .18s ease, background .18s ease;
}

.binder-stack-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.72);
  transition: transform .18s ease, background .18s ease;
}

.binder-stack-switch input:checked + .binder-stack-switch-track {
  border-color: #caef7d;
  background: rgba(198,255,135,0.22);
}

.binder-stack-switch input:checked + .binder-stack-switch-track::after {
  transform: translateX(18px);
  background: #caef7d;
}

.binder-stack-switch input:focus-visible + .binder-stack-switch-track {
  outline: 2px solid #caef7d;
  outline-offset: 2px;
}

.binder-stack-switch-label {
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-weight: 700;
}

/* =================================
   SIZE PANEL
================================= */

.header-panel {

  padding: 22px;
}

.selection-title {

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 3px;

  color: rgba(225,240,210,0.68);

  margin-bottom: 16px;
}

/* SIZE OPTIONS */

.size-options {

  display: flex;

  gap: 10px;
}

.size-btn {

  flex: 1;

  min-height: 118px;

  border-radius: 20px;

  border: 1px solid rgba(255,255,255,0.08);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.018),
      rgba(255,255,255,0.006)
    );

  transition:
    border-color .2s ease,
    transform .2s ease,
    background .2s ease;

  cursor: pointer;

  overflow: hidden;
}

.size-btn:hover {

  border-color: rgba(198,255,135,0.18);
}

.size-btn.active {

  border-color: rgba(198,255,135,0.42);

  background:
    radial-gradient(
      circle at top left,
      rgba(198,255,135,0.08),
      transparent 60%
    ),
    linear-gradient(
      180deg,
      rgba(255,255,255,0.018),
      rgba(255,255,255,0.006)
    );

  box-shadow:
    inset 0 0 45px rgba(198,255,135,0.05);
}

.size-btn-inner {

  height: 100%;

  display: flex;
  align-items: center;

  gap: 10px;

  padding: 10px;
}

/* ICON */

.size-icon {

  width: 64px;
  height: 64px;

  border-radius: 16px;

  border: 1px solid rgba(255,255,255,0.07);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.02),
      rgba(255,255,255,0.008)
    );

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}

.size-icon svg {

  width: 28px;
  height: 28px;
}

.size-icon rect {

  fill: rgba(255,255,255,0.52);
}

.size-btn.active rect {

  fill: #caef7d;
}

/* TEXT */

.size-text {

  display: flex;
  flex-direction: column;

  justify-content: center;
}

.size-text strong {

  font-size: 1.9rem;
  line-height: 1;

  font-weight: 800;

  margin-bottom: 6px;
}

.size-text span {

  font-size: 1rem;

  color: rgba(255,255,255,0.58);
}

/* =================================
   PAGINATION
================================= */

.navigation-group {

  display: grid;

  grid-template-columns:
    minmax(140px, 1fr)
    auto
    minmax(140px, 1fr);

  align-items: center;

  column-gap: 56px;

  padding: 18px 22px;

  border-radius: 28px;

  border: 1px solid rgba(255,255,255,0.08);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.02),
      rgba(255,255,255,0.008)
    );

  
}

.nav-btn {

  height: 62px;

  padding: 0 34px;

  border-radius: 20px;

  border: 1px solid rgba(255,255,255,0.08);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.02),
      rgba(255,255,255,0.008)
    );

  color: white;

  font-size: 14px;
  font-weight: 800;

  letter-spacing: 0.5px;

  cursor: pointer;

  transition:
    border-color .2s ease,
    background .2s ease,
    transform .2s ease;

  justify-self: start;
}

.nav-btn:last-child {

  justify-self: end;
}

.nav-btn:hover {

  border-color: rgba(198,255,135,0.18);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.03),
      rgba(255,255,255,0.012)
    );
}

.page-indicator {

  display: flex;
  align-items: center;

  gap: 16px;

  white-space: nowrap;

  font-size: 18px;
  font-weight: 700;

  color: white;
}

.page-indicator input {

  width: 74px;
  height: 62px;

  border-radius: 20px;

  border: 1px solid rgba(255,255,255,0.08);

  background:
    radial-gradient(
      circle at top left,
      rgba(198,255,135,0.08),
      transparent 70%
    ),
    rgba(255,255,255,0.03);

  color: white;

  text-align: center;

  font-size: 20px;
  font-weight: 800;

  outline: none;

  box-shadow:
    inset 0 0 28px rgba(198,255,135,0.04);
}

#pageTotal {

  color: rgba(255,255,255,0.92);
}

/* =================================
   SEARCH
================================= */

.search-group {

  display: flex;
  align-items: center;

  gap: 12px;

  padding: 0;

  border-radius: 28px;

  border: none;

  background: transparent;

  
}

.search-wrapper {

  flex: 1;

  min-width: 0;

  min-height: 78px;
  padding: 0 22px 0 26px;

  border-radius: 28px;

  border: 1px solid rgba(255,255,255,0.08);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.02),
      rgba(255,255,255,0.008)
    );

  display: flex;
  align-items: center;

  gap: 16px;
}

.search-icon {

  width: 30px;
  height: 30px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon svg {

  width: 100%;
  height: 100%;

  stroke: rgba(255,255,255,0.92);

  fill: none;

  stroke-width: 2.2;

  stroke-linecap: round;

  stroke-linejoin: round;
}

#binderSearch {

  flex: 1;

  height: 100%;

  border: none;
  outline: none;

  background: transparent;

  color: white;

  font-size: 18px;
  font-weight: 500;

  font-family: var(--font);
padding-left: 8px;
}

#binderSearch::placeholder {

  color: rgba(255,255,255,0.48);
}

/* CONTROLS */

.search-controls {

  display: flex;
  align-items: center;

  gap: 8px;

  opacity: 1;

  transition:
    opacity .18s ease,
    transform .18s ease;
}

.search-controls.hidden {

  opacity: 0;

  pointer-events: none;

  transform: translateX(6px);
}

.search-controls button,
.search-clear {

  width: 34px;
  height: 34px;

  border-radius: 50%;

  border: 1px solid rgba(255,255,255,0.08);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.03),
      rgba(255,255,255,0.012)
    );

  color: white;

  font-size: 13px;
  font-weight: 700;

  cursor: pointer;

  transition:
    border-color .18s ease,
    background .18s ease;
}

.search-clear {

  flex: 0 0 44px;

  width: 44px;
  height: 44px;

  font-size: 15px;

  opacity: 1;

  transition:
    opacity .18s ease,
    transform .18s ease,
    flex-basis .18s ease,
    width .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.search-clear.hidden {

  flex-basis: 0;

  width: 0;

  opacity: 0;

  pointer-events: none;

  transform: scale(.86);

  border-width: 0;
}

.search-controls button:hover,
.search-clear:hover {

  border-color: rgba(198,255,135,0.18);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.05),
      rgba(255,255,255,0.018)
    );
}

#searchCount {

  min-width: 54px;

  text-align: center;

  color: rgba(255,255,255,0.82);

  font-size: 13px;
  font-weight: 700;
}

/* MOBILE */

@media (max-width: 800px) {

  .search-group {

    gap: 10px;
  }

  .search-wrapper {

    min-height: 68px;
    padding: 0 18px;
    gap: 12px;
  }

  .search-icon {

    visibility: hidden
  }

 #binderSearch {
  flex: 1;
  min-width: 0;
  box-sizing: border-box; 
  width: 100%;
  background: transparent; /* Remove background icon logic */
  font-size: 16px;
  padding: 0 10px; /* Simplified padding since the icon is outside in the flexbox */
}

  .search-controls {

    gap: 6px;
  }

  .search-controls button,
  .search-clear {

    width: 30px;
    height: 30px;

    font-size: 11px;
  }

  .search-clear {

    flex-basis: 38px;

    width: 38px;
    height: 38px;
  }

  #searchCount {

    min-width: 46px;

    font-size: 12px;
  }
}

/* =================================
   BINDER
================================= */

.binder-viewport {

  position: relative;

  display: flex;

  justify-content: center;

  align-items: flex-start;

  padding: 10px 84px 24px;
gap: 2px;
  min-height: calc(100vh - 260px);
}

.binder-side-nav {

  position: absolute;

  top: 50%;

  z-index: 120;

  width: 46px;
  height: 112px;

  border: 0;
  border-radius: 12px;

  background: rgba(5,12,9,0.18);

  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  transform: translateY(-50%);

  transition:
    background .18s ease,
    transform .18s ease,
    opacity .18s ease;
}

.binder-side-nav svg {

  width: 18px;
  height: 34px;

  fill: none;
  stroke: rgba(255,255,255,0.78);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;

  transition: stroke .18s ease, transform .18s ease;
}

.binder-side-nav:hover {

  background: rgba(5,12,9,0.34);

  transform: translateY(-50%) scale(1.04);
}

.binder-side-nav:hover svg {

  stroke: #caef7d;
}

.binder-side-nav:focus-visible {

  outline: 2px solid #caef7d;
  outline-offset: 3px;
}

.binder-side-nav-prev {

  left: 20px;
}

.binder-side-nav-next {

  right: 20px;
}

.book-container {

  display: flex;

  flex-direction: column;

  gap: var(--page-gap);

  width: 100%;

  max-width: 1600px;
}

.binder-loading {

  width: 100%;

  min-height: 220px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: rgba(225,240,210,0.72);

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 2.4px;

  text-transform: uppercase;
}

.page {

  display: flex;

  gap: var(--page-gap);

  justify-content: center;

  align-items: flex-start;
}

.page-face {

  background: #1b2220;

  border-radius: 18px;

  padding: 16px;

  display: grid;

  gap: var(--card-gap);

  flex: 1;
}

.page-face.empty {

  background: transparent;

  box-shadow: none;

  pointer-events: none;
}

.grid-3x3 {

  grid-template-columns: repeat(3, 1fr);
}

.grid-4x3 {

  grid-template-columns: repeat(4, 1fr);
}

.grid-4x4 {

  grid-template-columns: repeat(4, 1fr);
}

/* =================================
   CARDS
================================= */

.card-slot {

  position: relative;

  aspect-ratio: 5 / 7;

  overflow: hidden;

  border-radius: 8px;

  cursor: pointer;

  touch-action: manipulation;

  -webkit-tap-highlight-color: transparent;

  transform: translateZ(0);

  contain: layout paint;

  backface-visibility: hidden;

  transition:
    transform .16s ease,
    box-shadow .16s ease,
    outline-color .16s ease;
}


.card-slot img.base {

  width: 100%;
  height: 100%;

  object-fit: cover;

  display: block;

  opacity: 1;

  transition: none !important;
}

.card-slot img.base.loaded {

  opacity: 1;
}

.variant-stack-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 12;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(5, 12, 9, 0.88);
  color: #caef7d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.card-variant-label {
  position: absolute;
  left: 50%;
  bottom: 7px;
  z-index: 12;
  max-width: calc(100% - 14px);
  padding: 5px 7px 6px;
  border-radius: 9px;
  background: rgba(5, 12, 9, 0.68);
  color: rgba(255,255,255,0.92);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  pointer-events: none;
}

/* SEARCH HIGHLIGHT */

.card-slot.search-match {

  outline: 4px solid #ffd84d;

  outline-offset: -4px;

  transform: scale(1.035);

  box-shadow:
    0 0 0 3px rgba(255,216,77,0.85),
    0 0 30px rgba(255,216,77,0.6);

  z-index: 20;
}

.card-slot.active-match {

  outline: 5px solid #ffffff;

  outline-offset: -5px;

  transform: scale(1.06);

  box-shadow:
    0 0 0 4px rgba(255,255,255,0.95),
    0 0 42px rgba(255,235,120,0.95);

  z-index: 100;
}


/* REVERSE HOLO */

.reverse-holo::after {

  content: "";

  position: absolute;

  inset: 0;

  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(255,255,255,0.3) 0%,
      transparent 2%
    ),
    linear-gradient(
      115deg,
      rgba(255,255,255,0) 25%,
      rgba(255,255,255,0.15) 45%,
      rgba(255,255,255,0.5) 50%,
      rgba(255,255,255,0.15) 55%,
      rgba(255,255,255,0) 75%
    );

  z-index: 10;

  pointer-events: none;

  opacity: 0;
}

.reverse-holo.image-ready::after {

  opacity: 1;
}

/* --------------------------------
   LIGHTBOX
-------------------------------- */

#lightbox {

  position: fixed !important;

  inset: 0;

  width: 100vw;
  max-width: none;

  height: 100vh;
  max-height: none;

  margin: 0;
  padding: 24px;

  border: 0;
  outline: 0;

  display: none;

  justify-content: center;
  align-items: center;

  background: rgba(5, 12, 9, 0.72);

  z-index: 2147483647 !important;

  box-sizing: border-box;
}

#lightbox[open] {

  display: flex !important;
}

#lightbox::backdrop {

  background: rgba(5, 12, 9, 0.72);
}

body.lightbox-open {
  overflow: hidden;
  touch-action: none;
}

/* PREVENT PAGE SCROLL WHEN OPEN */

body.lightbox-open {

  overflow: hidden;

  height: 100vh;

  touch-action: none;
}

.lightbox-content {

  position: relative;

  display: inline-block;

  max-width: min(90vw, 520px);

  max-height: min(86vh, 760px);
}

.lightbox-content img {

  display: block;

  width: auto;
  height: auto;

  max-width: min(90vw, 520px);
  max-height: min(86vh, 760px);

  border-radius: 22px;

  object-fit: contain;

  transform: translateZ(0);

  will-change: transform;
}

.close-btn {

  position: absolute;

  top: 20px;
  right: 30px;

  font-size: 2rem;

  color: white;

  cursor: pointer;

  z-index: 100001;
}

.lightbox-cta {

  position: absolute;

  top: -40px;
  right: -40px;

  width: 110px;
  height: 110px;

  border: 0 !important;
  border-radius: 50%;
  outline: 0 !important;

  background: #f3d9f9;

  color: #007b40;

  display: flex;

  align-items: center;
  justify-content: center;

  text-align: center;
  line-height: 1.05;

  font-size: 0.82rem;

  font-weight: 800;

  text-transform: uppercase;

  text-decoration: none;

  box-shadow: none !important;
  filter: none !important;
  -webkit-tap-highlight-color: transparent;

  transform: rotate(8deg);

  transition: transform .2s ease;

  z-index: 100002;
}

.lightbox-cta,
.lightbox-cta:visited,
.lightbox-cta:hover,
.lightbox-cta:focus,
.lightbox-cta:focus-visible,
.lightbox-cta:active {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}

.lightbox-cta[hidden] {
  display: none !important;
}

.lightbox-cta::after {
  content: none !important;
  display: none !important;
}

.lightbox-cta::before {
  content: "";

  position: absolute;

  width: 92%;
  height: 92%;

  border-radius: 50%;

  border: 1.5px solid #007b40;

  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;

  pointer-events: none;
}

/* =================================
   DESKTOP HEADER LAYOUT
================================= */

@media (min-width: 801px) {

  .header-panel,
  .navigation-group {

    background: transparent;

    border: none;

    box-shadow: none;

    backdrop-filter: none;

    padding-left: 0;
    padding-right: 0;
  }

  /* keep search bar container */
  .search-group {

    grid-area: search;

    margin: 0 22px;

    padding: 0;

    border-radius: 28px;

    border: none;

    background: transparent;

    backdrop-filter: none;

    box-shadow: none;
  }

  .binder-header {

    display: grid;

    grid-template-columns:
      auto
      1fr;

    grid-template-areas:
      "sizes nav"
      "filters filters"
      "search search";

    column-gap: 24px;

    row-gap: 10px;

    align-items: center;
  }

  .binder-filters {
    grid-area: filters;
    margin: 0 22px;
  }

  /* ================================
     LEFT SIDE (BINDER SIZE)
  ================================= */

  .header-panel {

    grid-area: sizes;

    padding: 8px 25px 10px;

    width: fit-content;
  }

  .selection-title {

    margin-bottom: 8px;

    font-size: 10px;

    letter-spacing: 2px;
  }

  .size-options {

    display: flex;

    gap: 8px;

    width: auto;
  }

  .size-btn {

    flex: 0 0 auto;

    width: 156px;

    min-height: 68px;

    border-radius: 16px;
  }

  .size-btn-inner {

    min-height: 68px;
    height: auto;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    gap: 10px;

    padding: 6px 12px;

    box-sizing: border-box;
  }

  .size-icon {

    width: 42px;
    height: 42px;
    min-width: 42px;

    border-radius: 10px;

    flex-shrink: 0;
  }

  .size-icon svg {

    width: 19px;
    height: 19px;
  }

  .size-text {

    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }

  .size-text strong {

    margin-bottom: 2px;

    font-size: 1rem;
    line-height: 1;

    white-space: nowrap;
  }

  .size-text span {

    font-size: 0.68rem;
    line-height: 1.1;

    white-space: nowrap;
  }

  /* ================================
     RIGHT SIDE (PAGINATION)
  ================================= */

  .navigation-group {

    grid-area: nav;

    justify-self: end;

    width: auto;

    padding: 10px 12px;

    display: grid;

    grid-template-columns:
      auto
      auto
      auto;

    align-items: center;

    column-gap: 16px;
  }

  .nav-btn {

    height: 46px;

    padding: 0 16px;

    border-radius: 14px;

    font-size: 11px;
  }

  .page-indicator {

    gap: 10px;

    font-size: 13px;
  }

  .page-indicator input {

    width: 52px;
    height: 46px;

    border-radius: 14px;

    font-size: 15px;
  }

  /* ================================
     SEARCH
  ================================= */

.search-wrapper {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translateY(-50%);
}

  #binderSearch {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 15px;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  padding: 0 0 0 44px !important;
}

  .search-controls button,
  .search-clear {

    width: 28px;
    height: 28px;

    font-size: 10px;
  }

  .search-clear {

    flex-basis: 36px;

    width: 36px;
    height: 36px;
  }

  #searchCount {

    min-width: 42px;

    font-size: 11px;
  }

  /* ================================
     DESKTOP FIT-TO-SCREEN BINDER
  ================================= */

  .binder-viewport {

    min-height: 0;

    height: var(--desktop-fit-height, calc(100vh - 96px));

    align-items: flex-start;

    padding: 2px 20px 8px;

    overflow: hidden;

    box-sizing: border-box;
  }

  .book-container {

    height: 100%;

    justify-content: flex-start;
  }

  .page {

    height: 100%;

    max-height: 100%;

    align-items: flex-start;
  }

  .page-face {

    flex: 0 0 var(--desktop-face-width, auto);

    width: var(--desktop-face-width, auto);

    height: var(--desktop-face-height, auto);

    max-width: calc((100vw - 80px - var(--page-gap)) / 2);

    max-height: 100%;

    box-sizing: border-box;

    grid-auto-rows: minmax(0, 1fr);
  }

  .grid-3x3 {

    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  .grid-4x3 {

    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  .grid-4x4 {

    grid-template-rows: repeat(4, minmax(0, 1fr));
  }

  .card-slot {

    width: 100%;

    height: 100%;

    aspect-ratio: auto;
  }

}
/* =================================
   MOBILE
================================= */

@media (max-width: 800px) {

  /* ================================
     REMOVE OUTER SHELLS
  ================================= */

  .header-panel,
  .navigation-group {

    background: transparent;

    border: none;

    box-shadow: none;

    backdrop-filter: none;

    padding-left: 0;
    padding-right: 0;
  }

  /* keep search in its mobile position */

  .search-group {

    order: 3;

    margin: 0 16px;

    padding: 0;

    gap: 10px;

    border-radius: 22px;

    border: none;

    background: transparent;
  }

  /* ================================
     MOBILE ORDER
  ================================= */

  .binder-header {

    display: flex;

    flex-direction: column;
    gap: 2px;
  }

  .header-panel {

    order: 1;

    padding: 4px 12px 8px;
  }

  .search-group {

    order: 3;
  }

  .navigation-group {

    order: 4;
  }

  .binder-filters {
    order: 2;
    margin: 0 12px 8px;
    padding: 10px;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .filter-group {
    gap: 7px;
  }

  .filter-title {
    width: 100%;
    margin: 0 0 2px;
  }

  .filter-toggle span {
    min-height: 36px;
    padding: 0 10px;
    font-size: 11px;
  }

  .binder-stack-switch {
    align-self: flex-start;
  }

  /* ================================
     SIZE SELECTOR
  ================================= */

  .header-panel {

    padding: 4px 12px 8px;
  }

  .selection-title {

    margin-bottom: 8px;

    font-size: 10px;
    letter-spacing: 2.4px;
  }

  .size-options {

    display: flex;

    gap: 8px;
  }

  .size-btn {

    flex: 1;

    min-height: 76px;

    border-radius: 14px;
  }

  .size-btn-inner {

    min-height: 76px;
    height: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 6px 8px;

    box-sizing: border-box;
  }

  .size-icon {

    width: 36px;
    height: 36px;
    min-width: 36px;

    border-radius: 10px;

    flex-shrink: 0;
  }

  .size-icon svg {

    width: 17px;
    height: 17px;
  }

  .size-text {

    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }

  .size-text strong {

    margin-bottom: 2px;

    font-size: 0.95rem;
    line-height: 1;

    white-space: nowrap;
  }

  .size-text span {

    font-size: 0.64rem;
    line-height: 1.1;

    white-space: nowrap;
  }

  /* ================================
     SEARCH
  ================================= */

  .search-wrapper {

  min-height: 66px;
  padding: 0 16px;
  display: flex;

  align-items: center;

  gap: 14px;
}

  .search-icon {

    width: 22px;
    height: 22px;

    min-width: 22px;

    flex: 0 0 20px;

    display: flex;

    align-items: center;

    justify-content: center;
  }

  .search-icon svg {

    width: 100%;
    height: 100%;
  }

  #binderSearch {

    flex: 1;
    min-width: 0;
box-sizing: border-box; 
width: 100%;
background-position: 15px center; background-repeat: no-repeat;
    font-size: 16px;
    padding: 0;
  }

  .search-controls {

    gap: 6px;
  }

  .search-controls button,
  .search-clear {

    width: 30px;
    height: 30px;

    font-size: 11px;
  }

  .search-clear {

    flex-basis: 38px;

    width: 38px;
    height: 38px;
  }

  #searchCount {

    min-width: 46px;

    font-size: 12px;
  }

  /* ================================
     PAGINATION
  ================================= */

  .navigation-group {

    display: grid;

    grid-template-columns:
      minmax(0,1fr)
      auto
      minmax(0,1fr);

    align-items: center;

    column-gap: 10px;

    padding: 20px 16px;
  }

  .nav-btn {

    height: 54px;

    padding: 0 18px;

    font-size: 12px;

    border-radius: 18px;
  }

  .page-indicator {

    gap: 10px;

    font-size: 15px;
  }

  .page-indicator input {

    width: 58px;
    height: 54px;

    font-size: 18px;

    border-radius: 18px;
  }

  /* ================================
     BINDER
  ================================= */

  .binder-viewport {

    padding:
      8px
      6px
      24px;
  }

  .binder-side-nav {

    display: none;
  }

  .page {

    flex-direction: column;

    gap: 12px;
  }

  .page-face {

    padding: 10px;

    border-radius: 14px;
  }

  /* ================================
     LIGHTBOX
  ================================= */

  #lightbox {

    align-items: center;

    justify-content: center;

    padding: 18px;

    box-sizing: border-box;
  }

  #lightbox[open] {

    display: flex !important;
  }

  .lightbox-content {

    max-width: 84vw;

    max-height: 78vh;
  }

  .lightbox-content img {

    max-width: 84vw;
    max-height: 78vh;
  }

  .lightbox-cta {

    width: 86px;
    height: 86px;

    font-size: 11px;

    top: -24px;
    right: -16px;
  }
}
