.catalog-paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.catalog-paging[hidden] {
  display: none;
}
.catalog-paging button {
  min-height: 44px;
  padding: 10px 18px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--line-bright);
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}
.catalog-paging button:disabled {
  opacity: 0.45;
  cursor: default;
}
.compact-subject {
  display: none;
}
.controls-row {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.view-switcher {
  flex-wrap: wrap;
}
@media (max-width: 860px) {
  .workspace-grid {
    align-content: start;
  }
  .compact-subject {
    display: block;
    max-inline-size: 100%;
  }
  .sidebar-group:has(#genres-list),
  .sidebar-footer {
    display: none;
  }
  .sidebar:has(#private-library-shelves-group[hidden]) {
    padding: 0;
    border: 0;
    gap: 0;
  }
  .stage {
    padding: 20px 16px 40px;
  }
  .controls-row,
  .search-box {
    inline-size: 100%;
  }
  .search-box input {
    inline-size: 100%;
    min-height: 44px;
  }
  .view-btn,
  .sort-select {
    min-height: 44px;
  }
  .catalog-paging {
    gap: 12px;
    justify-content: space-between;
  }
  .catalog-paging button {
    padding-inline: 14px;
  }
}
@media (pointer: coarse) {
  .view-btn,
  .sort-select,
  .shelf-btn,
  .top-nav a {
    min-height: 44px;
  }
  .book-card {
    touch-action: manipulation;
  }
}
@media (pointer: coarse) {
  .controls-row input,
  .sort-select {
    font-size: 16px;
  }
  .view-btn {
    font-size: 14px;
  }
}
@media (display-mode: standalone) {
  .topbar {
    padding-block-start: calc(0.65rem + env(safe-area-inset-top));
  }
}
.compact-catalog-footer {
  display: none;
}
@media (max-width: 860px) {
  .compact-catalog-footer {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    font-size: 13px;
  }
  .compact-catalog-footer a {
    color: var(--text-muted);
    padding: 12px 0;
  }
}
@media (max-width: 600px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 16px;
  }
  .brand-cluster {
    min-width: 0;
  }
  .brand-sub,
  .theme-picker-label {
    display: none;
  }
  .brand-link {
    gap: 8px;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
  }
  .brand-title {
    font-size: 18px;
  }
  .utility-cluster {
    grid-column: 2;
    grid-row: 1;
    gap: 8px;
  }
  .theme-select {
    width: 140px;
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
  }
  .owner-key-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .mode-tabs {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .mode-tabs > * {
    flex: 1;
    min-height: 44px;
    text-align: center;
  }
}

.subgenre-filter { max-inline-size: 19rem; }
@media (max-width:860px) { .subgenre-filter { max-inline-size:100%; inline-size:100%; } }

.catalog-table th button { display:flex;align-items:center;gap:8px;width:100%;border:0;background:none;padding:10px 0;color:inherit;font:inherit;text-align:left;cursor:pointer;min-height:44px; }
.catalog-table th[aria-sort="ascending"] button,.catalog-table th[aria-sort="descending"] button {color:var(--signal);}

.catalog-table{table-layout:fixed;min-inline-size:900px;}
.catalog-table thead th:nth-child(1){width:23%;}.catalog-table thead th:nth-child(2){width:24%;}.catalog-table thead th:nth-child(3){width:16%;}.catalog-table thead th:nth-child(4){width:12%;}.catalog-table thead th:nth-child(5){width:12%;}.catalog-table thead th:nth-child(6){width:6%;}.catalog-table thead th:nth-child(7){width:7%;}
.table-book{border:0;padding:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;min-height:44px;}
.table-cell-text,.table-book span{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;}
.catalog-table:has(thead th:nth-child(8):not([hidden])) thead th:nth-child(1){width:20%;}
.catalog-table:has(thead th:nth-child(8):not([hidden])) thead th:nth-child(2){width:21%;}
.catalog-table:has(thead th:nth-child(8):not([hidden])) thead th:nth-child(3){width:15%;}
.catalog-table:has(thead th:nth-child(8):not([hidden])) thead th:nth-child(4){width:11%;}
.catalog-table:has(thead th:nth-child(8):not([hidden])) thead th:nth-child(5){width:11%;}
.catalog-table:has(thead th:nth-child(8):not([hidden])) thead th:nth-child(8){width:9%;}

.section-order {
  min-block-size: 44px;
  max-inline-size: 100%;
}
.sidebar .section-order {
  inline-size: 100%;
  margin-block-end: 0.5rem;
}
.compact-section-order {
  display: none;
}
@media (max-width: 860px) {
  .compact-section-order {
    display: inline-block;
  }
}

/* Coarse pointers get the 44px palette and lock targets chosen in the
   November 26 comparison; fine pointers keep the compact desktop header. */
@media (pointer: coarse) {
  .theme-select {
    min-block-size: 44px;
  }
  .owner-key-btn {
    inline-size: 44px;
    block-size: 44px;
  }
}
