/* ==========================================================================
   components.css — buttons, forms, chips, badges, search box, suggestions,
   filters, results bar, list view, pagination, breadcrumb, location, empty state
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s var(--ease), box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 2px 0 var(--primary-2); }
.btn--primary:hover { background: var(--primary-2); color: #fff; }
.btn--gold {
  background: linear-gradient(180deg, #E1BE77, var(--gold));
  color: #2A1D08;
  border-color: #A87C33;
  box-shadow: 0 2px 0 #8C6628, inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn--gold:hover { background: linear-gradient(180deg, #E9C985, #C4953F); color: #1E1405; }
.btn--ghost { background: var(--card); color: var(--primary-2); border-color: var(--line-2); }
.btn--ghost:hover { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn--quiet { background: transparent; color: var(--primary); padding-inline: 10px; }
.btn--quiet:hover { background: var(--paper-2); }
.btn--sm { min-height: 36px; padding: 5px 14px; font-size: .875rem; }
.btn--block { width: 100%; }
.btn.is-done { border-color: var(--ok); color: var(--ok); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: #fff; transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   Chips & badges
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink-2);
  font-size: .9063rem;
  text-decoration: none;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.chip__count { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.chip--light {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(232, 207, 143, .38);
  color: #F6F1E7;
}
.chip--light:hover { background: rgba(255, 255, 255, .16); border-color: var(--gold-ink); color: #fff; }
.chip--light .chip__count { color: #D6D4EE; }
.chip--remove { background: #F4EBDA; border-color: #E0CFAE; color: var(--ink); padding-inline-end: 8px; }
.chip--remove .icon { width: 1.05em; height: 1.05em; padding: 2px; border-radius: 50%; background: rgba(0, 0, 0, .07); }
.chip--remove:hover { background: #fff; border-color: var(--danger); color: var(--danger); }
.chip--remove:hover .icon { background: var(--danger); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; align-items: center; }
.chips__label { color: var(--muted); font-size: .875rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  background: var(--paper-2);
  color: var(--ink-2);
}
.badge--type { background: var(--primary-soft); color: var(--primary-2); }
.badge--mag { background: #F6E7C9; color: #6A4A12; }
.badge--vol {
  background: transparent;
  border: 1px solid var(--gold-2);
  color: var(--gold-text);
  font-family: var(--font-ui);
}

/* --------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field__label, .filter legend, .filter > label:not(.check) {
  font-weight: 600;
  font-size: .9063rem;
  color: var(--ink);
}
.input, .select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: #8C8475; }
.input:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 5, 131, .15);
  outline: none;
}
.input:focus-visible, .select:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-start: 12px;
  padding-inline-end: 38px;
  /* chevron on the left (the end side in RTL) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233C4A50' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: 12px 50%;
  background-size: 16px 16px;
  background-repeat: no-repeat;
}
.select optgroup { font-style: normal; font-weight: 700; color: var(--primary-2); }
.select option { color: var(--ink); font-weight: 400; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  cursor: pointer;
  font-size: .9375rem;
}
.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.check__count { margin-inline-start: auto; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Search box (hero + compact) and suggestions
   -------------------------------------------------------------------------- */
.search-box { position: relative; }
.search-box__field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-1);
  transition: box-shadow .2s, border-color .2s;
}
.search-box__field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(14, 5, 131, .14), var(--sh-1);
}
.search-box__icon { flex: none; display: grid; place-items: center; width: 34px; color: var(--muted); padding-inline-start: 6px; }
.search-box__input {
  flex: 1 1 auto;
  width: 0;          /* no intrinsic width: the box never overflows a narrow flex parent */
  min-width: 0;
  min-height: 42px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
}
.search-box__input::placeholder { color: #857D6E; opacity: 1; }
.search-box__input:focus { outline: none; }
.search-box__input::-webkit-search-cancel-button { cursor: pointer; }
.search-box__submit { flex: none; padding-inline: 20px; }
.search-box__submit .icon { display: none; }

.search-box--hero .search-box__field {
  padding: 8px;
  border: 0;
  box-shadow: 0 14px 40px rgba(6, 4, 50, .42), 0 0 0 6px rgba(255, 255, 255, .10);
}
.search-box--hero .search-box__field:focus-within {
  box-shadow: 0 14px 40px rgba(6, 4, 50, .42), 0 0 0 6px rgba(210, 178, 108, .45);
}
.search-box--hero .search-box__icon { width: 44px; font-size: 1.35rem; color: var(--primary); }
.search-box--hero .search-box__input { min-height: 54px; font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem); }
.search-box--hero .search-box__submit { min-height: 54px; padding-inline: 30px; font-size: 1.05rem; }
@media (max-width: 519px) {
  .search-box--hero .search-box__submit { padding-inline: 16px; }
  .search-box--hero .search-box__submit span { display: none; }
  .search-box--hero .search-box__submit .icon { display: inline-block; font-size: 1.3rem; }
  .search-box--hero .search-box__icon { display: none; }
  .search-box--hero .search-box__input { padding-inline-start: 14px; }
}

.search-box__examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: .9375rem;
}
.search-box__examples-label { color: var(--gold-ink); font-weight: 600; }

.search-box--compact .search-box__field { box-shadow: none; }

/* suggestions dropdown (combobox listbox) */
.suggest {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  inset-inline: 0;
  max-height: min(70vh, 460px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  text-align: start;
  color: var(--ink);
  transform-origin: top center;
  animation: pop-in .18s var(--ease);
}
.suggest .loader { display: none; padding: 10px 12px; }
.suggest.is-loading .loader { display: flex; }
.suggest.is-loading .suggest__list:empty { display: none; }
.suggest__list { list-style: none; }
.suggest__opt {
  display: grid;
  gap: 1px;
  padding: 9px 12px;
  border-radius: var(--r);
  cursor: pointer;
  line-height: 1.5;
}
.suggest__opt + .suggest__opt { margin-top: 2px; }
.suggest__opt:hover { background: var(--paper); }
.suggest__opt.is-active {
  background: var(--primary-soft);
  box-shadow: inset -3px 0 0 var(--primary); /* marker on the start (right) side */
}
.suggest__title { font-family: var(--font-title); font-weight: 700; font-size: 1.08rem; color: var(--ink); }
.suggest__vol { margin-inline-start: 8px; font-family: var(--font-ui); font-size: .78rem; font-weight: 600; color: var(--gold-text); }
.suggest__author { font-size: .875rem; color: var(--muted); }
.suggest__opt--all {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--line);
  border-radius: 0 0 var(--r) var(--r);
  color: var(--primary);
  font-weight: 600;
  font-size: .9375rem;
}
.suggest__empty { padding: 8px 12px; color: var(--muted); font-size: .9375rem; }

/* --------------------------------------------------------------------------
   Filters (sidebar on desktop, slide-in panel on mobile)
   -------------------------------------------------------------------------- */
.filters-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.filters-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.filters-panel__head h2 { margin: 0; font-size: 1.25rem; color: var(--primary-2); display: flex; gap: 8px; align-items: center; }
.filters-panel__close { display: none; }

.filters { display: grid; gap: 4px; padding: 8px 18px 18px; }
.filter { margin: 0; padding: 12px 0; border: 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.filter:last-of-type { border-bottom: 0; }
.filter legend { padding: 0; margin-bottom: 6px; }
.filter > label:not(.check) { display: block; margin-bottom: 6px; }
.filter__radios { display: grid; gap: 0; }
.filter__years { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter__years label { display: grid; gap: 4px; font-size: .875rem; color: var(--ink-2); }
.filter__hint { margin: 6px 0 0; font-size: .8125rem; color: var(--muted); }
.filters__actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 12px; }

.filters-toggle { display: none; }
.filters-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(20, 16, 10, .5);
  animation: fade-in .2s ease;
}

@media (max-width: 959px) {
  .filters-toggle { display: inline-flex; }
  .filters-panel {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(360px, 88vw);
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: 0;
    box-shadow: var(--sh-3);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform .32s var(--ease), visibility 0s linear .32s;
  }
  .filters-panel.is-open {
    transform: none;
    visibility: visible;
    transition: transform .32s var(--ease), visibility 0s;
  }
  .filters-panel__close { display: inline-grid; }
  .filters { overflow: auto; flex: 1; align-content: start; }
  .filters__actions {
    position: sticky;
    bottom: 0;
    margin: 0 -18px -18px;
    padding: 12px 18px;
    background: var(--card);
    border-top: 1px solid var(--line);
  }
}

/* --------------------------------------------------------------------------
   Results bar, view toggle
   -------------------------------------------------------------------------- */
.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}
.results-bar__info { margin-inline-end: auto; min-width: 0; }
.results-bar__count {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
}
.results-bar__count .num { color: var(--primary); }
.results-bar__meta { margin: 0; font-size: .875rem; color: var(--muted); }
.results-bar__meta .icon { color: var(--gold); }

.view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.view-toggle a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.view-toggle a:hover { color: var(--primary); }
.view-toggle a[aria-current="true"] { background: var(--card); color: var(--primary-2); box-shadow: var(--sh-1); }

.active-filters { margin-bottom: 16px; }

/* --------------------------------------------------------------------------
   List view
   -------------------------------------------------------------------------- */
.book-list { list-style: none; display: grid; gap: 12px; }
.book-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 16px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  transition: border-color .2s, box-shadow .25s, transform .25s var(--ease);
}
.book-row:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.book-row__body { min-width: 0; }
.book-row__title {
  margin: 0 0 2px;
  font-size: 1.3rem;
  line-height: 1.45;
}
.book-row__title a { color: var(--ink); text-decoration: none; }
.book-row__title a:hover { color: var(--primary); text-decoration: underline; }
.book-row__title a::after { content: ""; }
.book-row__author { margin: 0 0 6px; color: var(--ink-2); display: flex; gap: 6px; align-items: baseline; }
.book-row__author .icon { color: var(--muted); align-self: center; }
.book-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  font-size: .875rem;
  color: var(--muted);
}
.book-row__meta li { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.book-row__meta .icon { color: var(--gold); }
.book-row__meta a { color: var(--ink-2); }
.book-row__side {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: .875rem;
}
.book-row__reg { color: var(--muted); margin-inline-start: auto; }
.book-row__reg b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (min-width: 720px) {
  .book-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .book-row__side {
    grid-column: auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 0 0 0;
    border-top: 0;
    min-width: 150px;
  }
  .book-row__reg { margin-inline-start: 0; margin-top: auto; }
}

/* mini generated cover */
.mini-cover {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 86px;
  border-radius: 3px 5px 5px 3px;
  background-color: var(--bk, #5C5446);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, .05), rgba(255, 255, 255, .08) 40%, rgba(0, 0, 0, .25) 88%, rgba(0, 0, 0, .4));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 2px 3px 8px rgba(30, 20, 10, .25);
  color: var(--gold-ink);
  text-decoration: none;
  overflow: hidden;
  transition: transform .3s var(--ease);
}
.book-row:hover .mini-cover { transform: rotate(-2deg) translateY(-2px); }
.mini-cover::before {
  content: "";
  position: absolute;
  inset: 6px 11px 6px 6px;
  border: 1px solid rgba(232, 207, 143, .6);
  border-radius: 2px;
}
.mini-cover::after {
  /* the spine side (right) */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 6px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .1));
}
.mini-cover[data-kind="magazine"]::before { inset: 16px 11px 6px 6px; }
.mini-cover[data-kind="magazine"] { background-image: linear-gradient(180deg, rgba(232, 207, 143, .85) 0 12px, transparent 12px), linear-gradient(90deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .35)); }
.mini-cover__orn { width: 18px; height: 18px; position: relative; margin-inline-end: 5px; }
.mini-cover__orn::before, .mini-cover__orn::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1.5px solid currentColor;
}
.mini-cover__orn::after { transform: rotate(45deg); }
.mini-cover__vol {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(calc(-50% - 3px));
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.4;
  padding: 0 4px;
  border-radius: 2px;
  background: var(--gold-ink);
  color: #2A1D08;
  white-space: nowrap;
  max-width: 44px;
  overflow: hidden;
}

/* location chip */
.loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #F2E6CB;
  color: #5B420F;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.loc-chip .icon { color: var(--danger); }
.loc-chip--none { background: var(--paper-2); color: var(--muted); font-weight: 500; }
.loc-chip--none .icon { color: var(--muted); }

/* --------------------------------------------------------------------------
   Pagination (RTL: "previous" sits on the right)
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}
.pagination__pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; }
.pagination a, .pagination span[aria-current], .pagination__gap, .pagination__edge {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.pagination a { background: var(--card); border: 1px solid var(--line); color: var(--ink-2); transition: border-color .2s, color .2s, transform .2s var(--ease); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.pagination span[aria-current] { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.pagination__gap { min-width: 24px; padding: 0; color: var(--muted); }
.pagination .pagination__edge { display: inline-flex; align-items: center; gap: 6px; }
.pagination__edge.is-disabled { color: #B3AA99; border: 1px dashed var(--line); background: transparent; }
.pagination__status { flex-basis: 100%; text-align: center; font-size: .875rem; color: var(--muted); margin: 0; }
@media (max-width: 559px) {
  .pagination, .pagination__pages { gap: 4px; }
  .pagination a, .pagination span[aria-current], .pagination .pagination__edge { min-width: 40px; min-height: 42px; padding: 0 8px; }
  .pagination__gap { min-width: 16px; }
  .pagination__pages li.is-far { display: none; }
  .pagination__edge span { display: none; }
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  list-style: none;
  font-size: .875rem;
  color: var(--muted);
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.breadcrumb li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--gold);
  border-left: 1.5px solid var(--gold);
  transform: rotate(-45deg);
  margin-inline-end: 4px;
}
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb [aria-current] {
  color: var(--ink);
  font-weight: 600;
  max-width: 38ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Location («أين أجد هذا الكتاب؟») and the small bookcase diagram
   -------------------------------------------------------------------------- */
.location__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1.3rem;
  color: var(--primary-2);
}
.location__title .icon { color: var(--danger); }
.loc-path {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin-bottom: 14px;
}
.loc-path__item {
  position: relative;
  display: grid;
  gap: 0;
  padding: 8px 12px;
  border-radius: var(--r);
  background: #fff;
  border: 1px solid var(--line);
  line-height: 1.45;
}
.loc-path__label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.loc-path__value {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.loc-path__item:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.loc-path__item:first-child .loc-path__value { font-size: 1rem; }

.location__note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  font-size: .9063rem;
  color: var(--ink-2);
}
.location__note .icon { color: var(--gold); margin-top: .3em; }
.location__note.is-alone {
  padding: 14px;
  border-radius: var(--r);
  background: #F6EBD3;
  border: 1px solid #E6D2A8;
  color: #4A3A1A;
}

.loc-case {
  --case-row: 20px;
  width: min(100%, 230px);
  margin: 0 auto 14px;
  padding: 0 8px 8px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--wood-hi), var(--wood) 40%, var(--wood-2));
  box-shadow: 0 8px 16px -8px rgba(46, 28, 15, .6), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.loc-case__crown {
  display: grid;
  place-items: center;
  height: 24px;
  margin: 0 -8px 0;
  color: #2A1D08;
  font-size: .75rem;
  font-weight: 700;
}
.loc-case__crown span {
  padding: 0 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, #EBD299, #C99A48);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .5);
  line-height: 1.5;
  white-space: nowrap;
}
.loc-case__body {
  padding: 3px 6px;
  background: #3B2414;
  box-shadow: inset 0 4px 6px -2px rgba(0, 0, 0, .6);
}
.loc-case__row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: var(--case-row);
  border-bottom: 3px solid #8A5E3A;
}
.loc-case__n {
  flex: none;
  width: 14px;
  font-size: .625rem;
  line-height: 1;
  color: #D9C29A;
  text-align: center;
  align-self: center;
}
.loc-case__books {
  flex: 1;
  height: 72%;
  background:
    repeating-linear-gradient(90deg,
      #7A2E2E 0 5px, #2F5D4E 5px 9px, transparent 9px 10px,
      #25406B 10px 16px, #9A6A22 16px 20px, transparent 20px 21px,
      #5A3A5E 21px 25px, #1F5F63 25px 31px, #6B4226 31px 35px, transparent 35px 36px);
  opacity: .55;
  -webkit-mask-image: linear-gradient(180deg, #000, #000);
  border-radius: 1px 1px 0 0;
}
.loc-case__row.is-here {
  z-index: 1;
  background: rgba(210, 178, 108, .18);
  box-shadow: 0 0 0 2px var(--gold-2), 0 0 14px 2px rgba(210, 178, 108, .55);
  border-radius: 2px;
}
.loc-case__row.is-here .loc-case__books { opacity: 1; }
.loc-case__row.is-here .loc-case__n { color: #fff; font-weight: 700; }
.loc-case__pin {
  position: absolute;
  top: -10px;
  left: -14px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: .8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  animation: pin-bob 1.8s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 34px 20px 38px;
  text-align: center;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px dashed var(--line-2);
}
.empty__art { width: 200px; height: 150px; color: var(--primary); margin-bottom: 6px; }
.empty h2 { margin: 0; color: var(--primary-2); }
.empty p { margin: 0; color: var(--ink-2); max-width: 52ch; }
.empty__tips {
  display: grid;
  gap: 6px;
  margin: 12px auto 6px;
  padding: 14px 18px;
  list-style: none;
  text-align: start;
  border-radius: var(--r);
  background: var(--paper);
  font-size: .9375rem;
  color: var(--ink-2);
}
.empty__tips li { display: flex; gap: 8px; align-items: flex-start; }
.empty__tips .icon { color: var(--gold); margin-top: .35em; }
.empty__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
.print-slip { display: none; }

.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: 24px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: .9375rem;
  box-shadow: var(--sh-2);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: transform .25s var(--ease), opacity .25s;
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

.card-note {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.card-note .icon { color: var(--gold); margin-top: .3em; }
.shelf-note { margin: 14px 0 0; font-size: .9063rem; }
