/* Talevara Explore — catalogue and discovery surface */
.explore-page {
  background:
    radial-gradient(circle at 9% 7%, rgba(255, 228, 214, 0.26), transparent 27rem),
    linear-gradient(180deg, #fffaf6 0%, #fffdfb 34%, #fffaf6 100%);
}

.explore-page .primary-nav a[aria-current="page"] {
  color: var(--coral-dark);
}

.explore-page .primary-nav a[aria-current="page"]::after {
  width: 100%;
}

.explore-shell {
  min-height: 70vh;
  padding: 56px 0 84px;
}

.explore-intro {
  max-width: 710px;
}

.explore-intro .eyebrow,
.filter-drawer .eyebrow {
  margin: 0 0 8px;
  color: var(--coral-dark);
  font-size: var(--type-eyebrow);
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.25;
  text-transform: uppercase;
}

.explore-intro h1 {
  margin: 0;
  color: #242929;
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 4.45rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: .98;
}

.explore-intro > p:last-child {
  max-width: 620px;
  margin: 16px 0 0;
  color: #666b69;
  font-size: var(--type-lead);
  line-height: 1.55;
}

.catalogue-search {
  position: relative;
  max-width: 850px;
  margin-top: 32px;
}

.catalogue-search input {
  width: 100%;
  height: 60px;
  padding: 0 56px 0 52px;
  border: 1px solid #dfd4cd;
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 28px rgba(65, 42, 29, .045);
  font-size: 1rem;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.catalogue-search input:focus {
  border-color: #bd8e7e;
  box-shadow: 0 0 0 4px rgba(185,85,61,.1), 0 10px 28px rgba(65,42,29,.05);
}

.catalogue-search input::placeholder { color: #858986; }

.search-icon {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 22px;
  height: 22px;
  color: #6e7371;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-icon svg,
.search-clear svg,
.filter-button svg,
.drawer-close svg,
.filter-search-box svg,
.layout-toggle-button svg,
.custom-select-trigger svg,
.empty-icon svg,
.bookmark-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #666b69;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.search-clear svg { width: 19px; height: 19px; }
.search-clear:hover { background: var(--surface-warm); color: var(--coral-dark); }

.discovery-tabs {
  display: flex;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: nowrap;
  overflow: visible;
  padding: 0 0 7px;
  border-bottom: 1px solid var(--line);
}

.discovery-tabs a {
  position: relative;
  flex: 0 0 auto;
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 10px 10px 0 0;
  color: #656a68;
  font-size: var(--type-ui);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.discovery-tabs a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -8px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
}

.discovery-tabs a:hover { color: #343a38; background: rgba(255,255,255,.58); }
.discovery-tabs a[aria-current="page"] { color: var(--coral-dark); }
.discovery-tabs a[aria-current="page"]::after { background: var(--coral); }

.catalogue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 17px;
}

.toolbar-filters {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.filter-button,
.custom-select-trigger {
  height: 46px;
  border: 1px solid #ddd2ca;
  border-radius: 11px;
  color: #3f4543;
  background: rgba(255,255,255,.88);
  font-family: inherit;
  font-size: var(--type-secondary);
  font-weight: 600;
  line-height: 1.2;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  cursor: pointer;
}

.filter-button:hover,
.custom-select-trigger:hover,
.custom-select.is-open .custom-select-trigger {
  border-color: #c8b7ac;
  background: #fff;
}

.filter-button svg { width: 18px; height: 18px; }

.filter-count {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--coral);
  font-size: 11px;
  font-weight: 700;
}

.custom-select {
  position: relative;
  width: 190px;
  flex: 0 0 auto;
}
.quick-filter-ai { width: 194px; }
.custom-select-sort { width: 168px; }

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.custom-select.is-open .custom-select-trigger {
  border-color: #c9a897;
  box-shadow: 0 0 0 3px rgba(194,82,58,.08);
}
.custom-select-trigger > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-trigger svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #777d7a;
  transition: transform 140ms ease;
}
.custom-select.is-open .custom-select-trigger svg { transform: rotate(180deg); }

.custom-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
  max-height: 310px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #e2d6ce;
  border-radius: 13px;
  background: rgba(255,253,251,.985);
  box-shadow: 0 18px 45px rgba(56,38,28,.14), 0 3px 10px rgba(56,38,28,.06);
  scrollbar-width: thin;
  scrollbar-color: #d8c8be transparent;
}
.custom-select-menu-right { left: auto; right: 0; }

.custom-select-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #444a47;
  background: transparent;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.custom-select-option:hover,
.custom-select-option:focus-visible {
  outline: none;
  color: #303532;
  background: #f8f1ec;
}
.custom-select-option[aria-selected="true"] {
  color: var(--coral-dark);
  background: #fff0e9;
  font-weight: 650;
}
.custom-option-check {
  width: 16px;
  flex: 0 0 16px;
  color: var(--coral);
  font-size: .83rem;
  text-align: center;
}

.toolbar-sort {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sort-label {
  color: #747976;
  font-size: var(--type-secondary);
  font-weight: 500;
}

.ranking-note {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #eadfd8;
  border-radius: 10px;
  color: #646967;
  background: rgba(255,255,255,.7);
  font-size: var(--type-secondary);
  line-height: 1.3;
  white-space: nowrap;
}

.applied-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0 24px;
}

.applied-chips { display: flex; gap: 7px; flex-wrap: wrap; }

.applied-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 11px;
  border: 1px solid #e3d5cc;
  border-radius: 999px;
  color: #4a504e;
  background: #fff;
  font-size: var(--type-meta);
  font-weight: 500;
  line-height: 1.2;
}

.applied-chip button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #747976;
  background: transparent;
  font-size: 17px;
  cursor: pointer;
}

.applied-chip button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.applied-chip button:hover { color: var(--coral-dark); background: var(--surface-warm); }

.clear-all {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 3px;
  color: var(--coral-dark);
  background: transparent;
  font-size: var(--type-secondary);
  font-weight: 600;
  cursor: pointer;
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.results-heading h2 {
  margin: 0;
  color: #292e2d;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.55rem);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.results-heading p {
  margin: 7px 0 0;
  color: #717673;
  font-size: var(--type-secondary);
}

.layout-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #ded3cb;
  border-radius: 12px;
  background: rgba(255,255,255,.76);
}
.layout-toggle-button {
  width: 38px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #747976;
  background: transparent;
  cursor: pointer;
}
.layout-toggle-button svg { width: 19px; height: 19px; }
.layout-toggle-button:hover { color: #444a47; background: #faf5f1; }
.layout-toggle-button[aria-pressed="true"] {
  color: var(--coral-dark);
  background: #fff0e9;
  box-shadow: inset 0 0 0 1px rgba(194,82,58,.1);
}

.story-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 34px 24px;
}

.story-card {
  position: relative;
  width: calc((100% - 72px) / 4);
  min-width: 0;
}

.story-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.story-cover-wrap {
  position: relative;
  width: 100%;
}

.story-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(70,56,47,.08);
  border-radius: 15px;
  background:
    radial-gradient(circle at 70% 22%, rgba(255,255,255,.55), transparent 20%),
    linear-gradient(145deg, var(--cover-a), var(--cover-b));
  box-shadow: 0 13px 31px rgba(54,35,25,.08);
  transform: translateZ(0);
}

.story-cover::before,
.story-cover::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.story-cover::before {
  width: 72%;
  aspect-ratio: 1;
  right: -22%;
  bottom: 12%;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 46% 54% 58% 42%;
  transform: rotate(-18deg);
  box-shadow: 0 0 0 18px rgba(255,255,255,.055), 0 0 0 42px rgba(255,255,255,.035);
}

.story-cover::after {
  left: 14%;
  bottom: 13%;
  width: 40%;
  height: 1px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 7px 0 rgba(255,255,255,.28), 0 14px 0 rgba(255,255,255,.18);
}

.cover-kicker {
  position: absolute;
  top: 8%;
  left: 10%;
  right: 10%;
  color: rgba(255,255,255,.82);
  font-size: clamp(.54rem, .8vw, .7rem);
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.cover-title {
  position: absolute;
  left: 10%;
  right: 9%;
  top: 24%;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  line-height: .98;
  letter-spacing: -.025em;
  text-wrap: balance;
  text-shadow: 0 1px 10px rgba(37,30,27,.12);
}

.cover-mark {
  position: absolute;
  left: 10%;
  bottom: 7%;
  color: rgba(255,255,255,.75);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.story-card:hover .story-cover { box-shadow: 0 18px 36px rgba(54,35,25,.13); }

.bookmark-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(185,85,61,.12);
  border-radius: 13px;
  color: #4b504e;
  background: rgba(255,250,246,.93);
  box-shadow: 0 7px 20px rgba(46,31,22,.08);
  cursor: pointer;
  backdrop-filter: blur(9px);
}
.bookmark-button svg { width: 18px; height: 18px; }
.bookmark-button:hover { color: var(--coral-dark); background: #fff; border-color: rgba(185,85,61,.24); }
.bookmark-button.is-saved svg { fill: currentColor; }

.story-badges {
  position: absolute;
  left: 10px;
  right: 58px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.story-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #343a38;
  background: rgba(255,255,255,.91);
  box-shadow: 0 3px 12px rgba(43,30,22,.06);
  font-size: .66rem;
  font-weight: 700;
  line-height: 1.1;
  backdrop-filter: blur(8px);
}

.story-badge-ai { color: #5d4f75; background: rgba(247,243,252,.94); }

.story-info { padding: 13px 2px 0; }

.story-title {
  margin: 0;
  color: #292e2d;
  font-family: var(--font-ui);
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -.012em;
  line-height: 1.3;
}

.story-author {
  margin: 4px 0 0;
  color: #7a7f7c;
  font-size: var(--type-meta);
  line-height: 1.35;
}

.story-meta-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  color: #5f6562;
  font-size: var(--type-meta);
  line-height: 1.3;
}

.rating-star { color: #a45b35; font-size: 1rem; line-height: 1; }
.story-rating { color: #424745; font-weight: 650; }
.meta-separator { color: #bbb5b0; }

.story-genres {
  margin: 8px 0 0;
  color: #626865;
  font-size: var(--type-meta);
  line-height: 1.4;
}

.story-description {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: #737875;
  font-size: var(--type-meta);
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.story-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #777c79;
  font-size: .76rem;
  line-height: 1.35;
}

.status-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #6a8a76; }
.status-dot.status-completed { background: #657a9b; }
.status-dot.status-hiatus { background: #a27a54; }
.status-dot.status-discontinued { background: #98716f; }

.story-grid.is-list { display: block; }
.story-grid.is-list .story-card {
  width: 100%;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #e8ded7;
  border-radius: 16px;
  background: rgba(255,255,255,.62);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.story-grid.is-list .story-card:hover {
  border-color: #ddcec4;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 25px rgba(54,35,25,.055);
}
.story-grid.is-list .story-card-link {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.story-grid.is-list .story-cover-wrap { width: 126px; }
.story-grid.is-list .story-cover { border-radius: 11px; box-shadow: 0 8px 20px rgba(54,35,25,.07); }
.story-grid.is-list .cover-title { font-size: 1rem; }
.story-grid.is-list .cover-kicker,
.story-grid.is-list .cover-mark { font-size: .45rem; }
.story-grid.is-list .story-badges { left: 6px; right: 6px; bottom: 6px; }
.story-grid.is-list .story-badge { min-height: 21px; padding: 2px 6px; font-size: .58rem; }
.story-grid.is-list .story-info { min-width: 0; padding: 3px 54px 0 0; }
.story-grid.is-list .story-title { font-size: 1.18rem; }
.story-grid.is-list .story-description { max-width: 760px; -webkit-line-clamp: 2; }
.story-grid.is-list .bookmark-button { top: 14px; right: 14px; }

.load-more-wrap { display: flex; justify-content: center; margin-top: 44px; }
.load-more { min-width: 180px; }

.empty-state {
  max-width: 620px;
  margin: 54px auto 20px;
  padding: 46px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  text-align: center;
}
.empty-icon { display:grid;place-items:center;width:58px;height:58px;margin:0 auto 18px;border:1px solid rgba(185,85,61,.12);border-radius:16px;color:#a24e3c;background:#fff0e8; }
.empty-icon svg { width:30px;height:30px; }
.empty-state h3 { margin: 0; font-family: var(--font-display); font-size: 1.8rem; font-weight: 400; line-height: 1.15; }
.empty-state p { margin: 12px auto 20px; max-width: 460px; color: #707572; font-size: var(--type-secondary); line-height: 1.55; }
.empty-actions { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; margin-bottom: 19px; }
.empty-suggestion { min-height: 36px; padding: 0 12px; border: 1px solid #decfc5; border-radius: 999px; color: #5e6461; background: #fff; font-size: var(--type-meta); font-weight: 600; cursor: pointer; }
.empty-suggestion:hover { color: var(--coral-dark); border-color: #cdb6a8; }

.filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(31,30,29,.27);
  backdrop-filter: blur(2px);
}

.filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(420px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #fffdfb;
  box-shadow: -20px 0 60px rgba(44,31,24,.12);
  transform: translateX(102%);
  transition: transform 180ms ease;
}

.filter-drawer.is-open { transform: translateX(0); }
body.filters-open { overflow: hidden; }

.filter-drawer-head {
  flex: 0 0 auto;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 16px 24px;
  border-bottom: 1px solid var(--line);
}
.filter-drawer-head h2 { margin: 0; font-family: var(--font-display); font-size: 2rem; font-weight: 400; line-height: 1; }
.filter-drawer-head .eyebrow { margin-bottom: 5px; }
.drawer-close { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #5f6462; background: transparent; cursor: pointer; }
.drawer-close svg { width: 20px; height: 20px; }
.drawer-close:hover { color: var(--coral-dark); background: var(--surface-warm); }

.filter-scroll { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 28px; }

.filter-section { padding: 23px 0 24px; border-bottom: 1px solid #eee6e1; }
.filter-section:last-child { border-bottom: 0; }
.filter-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.filter-section-head h3 { margin: 0; color: #343937; font-family: var(--font-ui); font-size: var(--type-ui); font-weight: 700; line-height: 1.3; }
.filter-section-head span { color: #8a8e8c; font-size: .72rem; line-height: 1.3; text-align: right; }
.filter-help { margin: -2px 0 13px; color: #7d827f; font-size: .76rem; line-height: 1.45; }

.filter-options { display: flex; flex-direction: column; gap: 9px; }
.filter-options label,
.ai-detail-options label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #565c59;
  font-size: var(--type-secondary);
  line-height: 1.35;
  cursor: pointer;
}
.filter-options input,
.ai-detail-options input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--coral); }
.option-count { margin-left: auto; color: #969a98; font-size: .73rem; }
.option-zero { color: #aaa; }

.facet-state-list { display: flex; flex-direction: column; gap: 7px; }
.facet-state-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 4px 4px 10px;
  border: 1px solid #ece2dc;
  border-radius: 10px;
  background: rgba(255,255,255,.58);
}
.facet-state-name { min-width: 0; flex: 1 1 auto; color: #515754; font-size: var(--type-secondary); line-height: 1.25; }
.facet-state-count { color: #929694; font-size: .72rem; }
.facet-state-actions { display: flex; gap: 4px; }
.facet-action {
  min-width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #777c79;
  background: transparent;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.facet-action:hover { background: #f7f2ee; }
.facet-action.is-include { color: #326458; border-color: #bed6ce; background: #edf6f2; }
.facet-action.is-exclude { color: #8a4d43; border-color: #e4c5bd; background: #fbefeb; }
.facet-action[disabled] { opacity: .36; cursor: default; }

.filter-search-box {
  position: relative;
  display: block;
  margin-bottom: 11px;
}
.filter-search-box svg { position: absolute; top: 50%; left: 11px; width: 17px; height: 17px; color: #858a87; transform: translateY(-50%); pointer-events: none; }
.filter-search-box input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid #e1d7d0; border-radius: 9px; color: var(--ink); background: #fff; font-size: var(--type-secondary); outline: none; }
.filter-search-box input:focus { border-color: #c9a99b; box-shadow: 0 0 0 3px rgba(185,85,61,.08); }

.ai-detail-options { display: none; flex-direction: column; gap: 7px; margin: 12px 0 0 26px; padding: 12px; border-radius: 10px; background: #faf6f3; }
.ai-detail-options.is-visible { display: flex; }
.ai-detail-options label { min-height: 30px; font-size: .78rem; }

.filter-drawer-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 14px 18px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255,253,251,.96);
}
.filter-drawer-foot .button-ghost { flex: 0 0 auto; }
.filter-drawer-foot .button-primary { flex: 1 1 auto; }

@media (max-width: 1120px) {
  .story-card { width: calc((100% - 48px) / 3); }
}

@media (max-width: 920px) {
  .explore-shell { padding-top: 42px; }
  .catalogue-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-sort { width: 100%; justify-content: flex-end; }
  .story-card { width: calc((100% - 24px) / 2); }
  .cover-title { font-size: clamp(1.45rem, 3.2vw, 2rem); }
}

@media (max-width: 680px) {
  .explore-shell { padding: 34px 0 66px; }
  .explore-intro h1 { font-size: 3rem; }
  .explore-intro > p:last-child { margin-top: 12px; font-size: 1rem; }
  .catalogue-search { margin-top: 24px; }
  .catalogue-search input { height: 54px; padding-left: 47px; }
  .search-icon { left: 15px; }
  .discovery-tabs { margin-top: 27px; margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; flex-wrap: wrap; overflow: visible; }
  .discovery-tabs a::after { bottom: -2px; }
  .catalogue-toolbar { padding-top: 17px; }
  .toolbar-filters { width: 100%; flex-wrap: wrap; overflow: visible; padding-bottom: 4px; }
  .filter-button, .quick-filter { flex: 0 0 auto; }
  .quick-filter { width: min(190px, calc(50% - 5px)); }
  .quick-filter-ai { width: min(194px, calc(50% - 5px)); }
  .toolbar-sort { justify-content: space-between; }
  .ranking-note { white-space: normal; }
  .applied-bar { align-items: flex-start; }
  .results-heading { align-items: center; }
  .story-grid { gap: 28px 16px; }
  .story-card { width: calc((100% - 16px) / 2); }
  .story-description { display: none; }
  .story-title { font-size: .94rem; }
  .story-author, .story-genres, .story-meta-row { font-size: .74rem; }
  .story-status { font-size: .7rem; }
  .story-badges { left: 7px; right: 7px; bottom: 7px; }
  .story-badge { min-height: 22px; padding: 2px 6px; font-size: .6rem; }
  .bookmark-button { top: 7px; right: 7px; width: 36px; height: 36px; }
  .cover-title { font-size: clamp(1rem, 5vw, 1.55rem); }
  .cover-kicker, .cover-mark { font-size: .5rem; }
  .story-grid.is-list .story-description { display: -webkit-box; }
  .custom-select-menu { max-width: min(280px, calc(100vw - 36px)); }
}

@media (max-width: 430px) {
  .story-grid { gap: 25px 12px; }
  .story-card { width: calc((100% - 12px) / 2); }
  .story-info { padding-top: 9px; }
  .story-title { font-size: .9rem; }
  .story-meta-row { gap: 4px; flex-wrap: wrap; }
  .story-meta-row .meta-separator { display: none; }
  .story-genres { margin-top: 6px; }
  .story-status { margin-top: 7px; }
  .story-badges { display: none; }
  .bookmark-button { width: 34px; height: 34px; }

  .story-grid.is-list .story-card { width: 100%; margin-bottom: 12px; padding: 11px; }
  .story-grid.is-list .story-card-link { grid-template-columns: 96px minmax(0, 1fr); gap: 13px; }
  .story-grid.is-list .story-cover-wrap { width: 96px; }
  .story-grid.is-list .story-info { padding: 1px 35px 0 0; }
  .story-grid.is-list .story-title { font-size: 1rem; }
  .story-grid.is-list .story-author,
  .story-grid.is-list .story-genres,
  .story-grid.is-list .story-meta-row { font-size: .72rem; }
  .story-grid.is-list .story-description { display: -webkit-box; -webkit-line-clamp: 2; font-size: .72rem; }
  .story-grid.is-list .story-status { font-size: .68rem; }
  .story-grid.is-list .bookmark-button { top: 10px; right: 10px; }

  .layout-toggle-button { width: 36px; height: 34px; }
  .results-heading { margin-bottom: 18px; }
  .filter-drawer { width: 100%; max-width: none; border-left: 0; }
  .filter-drawer-head { min-height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .filter-drawer { transition: none; }
}

/* Hidden state must win over component display declarations. */
.explore-page [hidden] {
  display: none !important;
}

/* Keep the closed drawer completely outside layout/interaction calculations. */
.filter-drawer {
  visibility: hidden;
  pointer-events: none;
  transition: transform 180ms ease, visibility 0s linear 180ms;
}

.filter-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
  transition: transform 180ms ease, visibility 0s linear 0s;
}

.filter-drawer[aria-hidden="true"] {
  display: none;
}

@media (max-width: 680px) {
  .discovery-tabs {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: wrap;
    overflow: visible;
  }
}

/* v22 managed cover assets */
.story-cover {
  background: #eee8e1;
}
.story-cover::before,
.story-cover::after { display: none; }
.story-cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Step 20 discovery feedback */
.story-card{position:relative}
.not-interested-button{position:absolute;right:54px;top:10px;z-index:3;min-height:36px;padding:0 10px;border:1px solid rgba(65,52,45,.14);border-radius:999px;background:rgba(255,250,246,.94);color:#64564f;font:600 11px/1 var(--font-ui);cursor:pointer;box-shadow:0 4px 14px rgba(31,24,20,.06);opacity:0;transform:translateY(-2px);transition:opacity .16s ease,transform .16s ease,background .16s ease}
.story-card:hover .not-interested-button,.not-interested-button:focus-visible,.not-interested-button[aria-pressed="true"]{opacity:1;transform:none}
.not-interested-button:hover,.not-interested-button:focus-visible{background:#fff;color:#2f2824}
.not-interested-button[aria-pressed="true"]{background:#f2ebe6;color:#6e5d54}
.story-grid.is-list .not-interested-button{right:54px}
@media (hover:none),(max-width:760px){.not-interested-button{opacity:1;transform:none;top:auto;bottom:12px;right:50px;background:rgba(255,250,246,.97)}}
