/**
 * ==========================================================================
 * QueryKey Cases – cases.css
 *
 * @fileOverview
 * Styling contract for the public Cases catalogue. Aligns typography,
 * layout grids, and component skins so case cards match the collections
 * experience while respecting dark and light themes.
 * @author
 * QueryKey Cases Web Team
 * @maintainer
 * Cases Engineering Lead
 * @usage
 * <link rel="stylesheet" href="/assets/css/pages/cases.css">
 * @dependencies
 * variables.css, base.css, components/cards.css
 * @notes
 * Update alongside collections.css whenever shared card shells change.
 * @license
 * QueryKey™ is a trademark of Farrel Wilson. All rights reserved.
* @timestamp
* 2025-11-05 05:20:00 UTC
 * ==========================================================================
 */

.p-cases .expand-indicator {
  font-size: 12px;
  color: var(--qk-accent-orange);
  font-style: italic;
  opacity: .9;
}

.p-cases .rollback-content, .p-cases .prevention-content {
  padding: 16px;
  background: linear-gradient(180deg, rgb(12 18 30 / 60%), rgb(14 16 22 / 60%));
  color: #dfe7f3;
  border-top: 1px solid rgb(255 255 255 / 8%);
}

.p-cases .time-estimate {
  font-size: 12px;
  color: rgb(255 255 255 / 85%);
  background: rgb(41 40 229 / 15%);
  border: 1px solid rgb(62 71 255 / 35%);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Inline badge used when a case references a parent via derived_from lineage metadata. */

/*
 * Cases page shell overrides ensure the navigation background blends with the
 * hero gradient so the header/hero transition renders as a single surface.
 * This mirrors the collections page tokens and eliminates the white band the
 * team observed above the hero.
 */
body.p-cases {
  overflow-x: hidden;
  --nav-link-color: var(--light-text, #E0E7F5);
  --nav-link-hover-color: var(--qk-accent-orange);
  --account-link-border-color: var(--qk-accent-orange);
  --account-link-color: var(--qk-accent-orange);
  --account-link-hover-bg: var(--qk-accent-orange);
  --account-link-hover-text: #fff;
  --menu-toggle-color: var(--qk-accent-orange);
  --theme-switch-track-color: var(--primary-dark-blue, #162C50);
  --theme-switch-thumb-color: var(--light-text, #E0E7F5);
  --theme-switch-active-track-color: var(--qk-accent-orange);
  --theme-switch-active-thumb-color: #fff;
  --footer-bg: transparent;
  --footer-border: rgb(255 255 255 / 10%);
  --footer-heading-color: var(--qk-accent-orange);
  --footer-link-color: var(--white, #fff);
  --footer-link-hover-color: var(--qk-accent-orange);
  --mobile-nav-divider: rgb(255 255 255 / 12%);

  background-color: #060b22;
  background-image:
    radial-gradient(circle at 22% -16%, rgb(59 130 246 / 26%), transparent 64%),
    radial-gradient(circle at 84% -12%, rgb(249 115 22 / 20%), transparent 68%),
    linear-gradient(180deg, rgb(4 8 21) 0%, rgb(10 16 40) 44%, rgb(5 9 24) 100%);
  background-repeat: no-repeat;
}

body.light-mode.p-cases {
  --nav-link-color: var(--dark-text, #1a202c);
  --nav-link-hover-color: var(--qk-accent-orange);
  --account-link-color: var(--qk-accent-orange);
  --account-link-border-color: var(--qk-accent-orange);
  --menu-toggle-color: var(--qk-accent-orange);
  --theme-switch-track-color: #cbd5ff;
  --theme-switch-thumb-color: #fff;
  --footer-bg: #fff;
  --footer-border: rgb(0 0 0 / 10%);
  --footer-link-color: var(--light-text, #4a5568);
  --footer-link-hover-color: var(--qk-accent-orange);
  --mobile-nav-divider: rgb(0 0 0 / 8%);

  background-color: #eef2ff;
  background-image:
    radial-gradient(circle at 20% -18%, rgb(59 130 246 / 20%), transparent 70%),
    radial-gradient(circle at 82% -16%, rgb(249 115 22 / 18%), transparent 74%),
    linear-gradient(180deg, rgb(238 244 255) 0%, rgb(248 250 252) 100%);
  background-repeat: no-repeat;
}

.p-cases .derived-from-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cfe0ff;
  background: rgb(230 151 90 / 12%);
  border: 1px solid rgb(230 151 90 / 35%);
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.4;
}

/* stylelint-disable-next-line no-descending-specificity */
.p-cases .derived-from-link a {
  color: var(--qk-accent-orange);
  text-decoration: none;
}

.p-cases .derived-from-link a:hover {
  text-decoration: underline;
  color: #ffd7b0;
}

body.light-mode.p-cases .derived-from-link {
  color: rgb(100 116 139);
  background: rgb(253 186 116 / 18%);
  border-color: rgb(249 115 22 / 40%);
}

body.light-mode.p-cases .derived-from-link a {
  color: rgb(194 65 12);
}

body.light-mode.p-cases .derived-from-link a:hover {
  color: rgb(154 52 18);
}

.p-cases .cases-section .cases-container {
  /* Center the catalog container so both case-derived grids share identical alignment. */
  max-width: 1200px;
  margin: 0 auto;
}

.p-cases .form-group {
  margin-bottom: 20px;
}

.p-cases .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.p-cases .form-input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #0f1d38;
  color: var(--white-text);
  font-size: 1rem;
  transition: all .3s ease;
}

body.light-mode.p-cases .form-input {
  background: #e2e8f0;
  color: #1a202c;
}


.p-cases .main-search-component {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(2.8rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3rem) clamp(2.6rem, 5vw, 3.5rem);
  background: linear-gradient(145deg, rgb(18 32 62 / 92%), rgb(12 24 50 / 88%));
  border-radius: 36px;
  border: 1px solid rgb(108 123 178 / 35%);
  box-shadow: 0 32px 64px rgb(7 14 35 / 52%), 0 0 0 1px rgb(99 120 188 / 22%);
  overflow: hidden;
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.p-cases .main-search-component::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: repeating-linear-gradient(
    to right,
    rgb(84 102 160 / 42%) 0,
    rgb(84 102 160 / 42%) 1px,
    transparent 1px,
    transparent 30px
  );
}

/* Soft radial glows add depth without overpowering the indigo canvas. */
.p-cases .main-search-component::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 12%, rgb(255 255 255 / 20%), transparent 68%),
    radial-gradient(circle at 82% 18%, rgb(249 115 22 / 18%), transparent 72%);
  pointer-events: none;
}

body.light-mode.p-cases .main-search-component {
  background: linear-gradient(145deg, rgb(244 247 255 / 95%), rgb(232 239 255 / 92%));
  border: 1px solid rgb(160 178 232 / 60%);
  box-shadow: 0 28px 60px rgb(148 163 184 / 32%), 0 0 0 1px rgb(167 185 235 / 45%);
  padding: clamp(2.8rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3rem) clamp(2.6rem, 5vw, 3.5rem);
}

body.light-mode.p-cases .main-search-component::after {
  background:
    radial-gradient(circle at 22% 10%, rgb(96 165 250 / 28%), transparent 72%),
    radial-gradient(circle at 78% 16%, rgb(249 115 22 / 18%), transparent 78%);
}

body.light-mode.p-cases .main-search-component::before {
  background-image: repeating-linear-gradient(
    to right,
    rgb(148 163 184 / 26%) 0,
    rgb(148 163 184 / 26%) 1px,
    transparent 1px,
    transparent 30px
  );
}

.p-cases .main-search-container {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
  color: rgb(239 244 255 / 90%);
}

body.light-mode.p-cases .main-search-container {
  color: rgb(30 41 59 / 92%);
}

.p-cases .main-search-title {
  margin: 0 0 clamp(0.75rem, 2.5vw, 1.4rem);
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgb(240 244 255 / 96%);
}

body.light-mode.p-cases .main-search-title {
  color: #1f2937;
}

.p-cases .main-search-tagline {
  margin: 0 0 clamp(0.5rem, 2vw, 1rem);
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  font-weight: 600;
  color: rgb(210 222 255 / 88%);
}

body.light-mode.p-cases .main-search-tagline {
  color: rgb(71 85 105);
}

.p-cases .main-search-description {
  margin: 0 0 clamp(1.2rem, 3vw, 1.8rem);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: rgb(200 210 235 / 82%);
}

body.light-mode.p-cases .main-search-description {
  color: rgb(96 107 123);
}

.p-cases .search-form.main-search {
  margin: clamp(2rem, 4vw, 3rem) auto clamp(0.5rem, 2vw, 1rem);
  max-width: 760px;
}

.p-cases .search-input-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 16px 58px;
  border-radius: 20px;
  border: 1px solid rgb(116 138 200 / 45%);
  background: rgb(17 29 54 / 78%);
  box-shadow: 0 22px 40px rgb(8 14 36 / 46%), 0 0 0 1px rgb(102 124 188 / 28%) inset;
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.p-cases .search-input-group:focus-within {
  border-color: rgb(255 186 116 / 65%);
  box-shadow: 0 0 0 4px rgb(249 115 22 / 28%), 0 26px 48px rgb(8 14 36 / 58%);
  background: rgb(20 34 64 / 82%);
}

body.light-mode.p-cases .search-input-group {
  border-color: rgb(167 185 235 / 55%);
  background: rgb(248 249 255 / 78%);
  box-shadow: 0 20px 40px rgb(148 163 184 / 30%), 0 0 0 1px rgb(167 185 235 / 40%) inset;
}

body.light-mode.p-cases .search-input-group:focus-within {
  border-color: rgb(59 130 246 / 80%);
  box-shadow: 0 0 0 4px rgb(96 165 250 / 25%), 0 28px 46px rgb(148 163 184 / 28%);
  background: rgb(244 248 255 / 90%);
}

.p-cases .search-icon {
  position: absolute;
  left: 22px;
  width: 24px;
  height: 24px;
  color: rgb(201 211 235 / 85%);
}

body.light-mode.p-cases .search-icon {
  color: rgb(118 132 154);
}

.p-cases .search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: rgb(255 255 255 / 95%);
  font-size: 1.1rem;
}

.p-cases .search-input::placeholder {
  color: rgb(194 206 231 / 60%);
}

body.light-mode.p-cases .search-input {
  color: rgb(30 41 59);
}

body.light-mode.p-cases .search-input::placeholder {
  color: rgb(148 163 184);
}

.p-cases .search-button {
  flex: 0 0 auto;
  padding: 14px 30px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, rgb(249 115 22) 0%, rgb(255 154 76) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 20px 38px rgb(249 115 22 / 48%);
}

.p-cases .search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 44px rgb(249 115 22 / 60%);
}

body.light-mode.p-cases .search-button {
  background: linear-gradient(135deg, rgb(249 126 37) 0%, rgb(255 175 107) 100%);
  color: rgb(30 41 59);
  box-shadow: 0 20px 36px rgb(249 115 22 / 28%);
}

.p-cases .search-hint {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  color: rgb(198 208 230 / 78%);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

body.light-mode.p-cases .search-hint {
  color: rgb(120 134 160);
}

.p-cases .filter-section {
  margin: clamp(2rem, 4vw, 3rem) auto clamp(0.5rem, 2vw, 1rem);
  padding: clamp(1rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.75rem) clamp(0.5rem, 2vw, 1rem);
  width: 100%;
  max-width: 960px;
}

.p-cases .filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border-radius: 24px;
  border: 1px solid rgb(116 138 200 / 40%);
  background: rgb(18 32 60 / 82%);
  box-shadow: 0 26px 48px rgb(7 14 34 / 46%), 0 0 0 1px rgb(90 112 176 / 22%);
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.light-mode.p-cases .filter-bar {
  border: 1px solid rgb(180 197 230 / 55%);
  background: rgb(248 250 255 / 90%);
  box-shadow: 0 24px 42px rgb(148 163 184 / 26%), 0 0 0 1px rgb(187 205 240 / 38%);
}

.p-cases .filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-cases .filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(198 208 230 / 82%);
}

body.light-mode.p-cases .filter-label {
  color: rgb(116 129 149);
}

.p-cases .filter-select-wrapper {
  position: relative;
}

.p-cases .filter-select {
  appearance: none;
  width: 100%;
  padding: 14px 46px 14px 20px;
  border-radius: 999px;
  border: 1px solid rgb(115 137 201 / 48%);
  background: rgb(20 34 64 / 82%);
  color: rgb(255 255 255 / 95%);
  font-weight: 600;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  cursor: pointer;
}

.p-cases .filter-select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(190 204 232 / 80%);
  pointer-events: none;
}

.p-cases .filter-select:focus {
  border-color: rgb(255 186 116 / 70%);
  box-shadow: 0 0 0 3px rgb(249 115 22 / 25%);
  background: rgb(26 42 76 / 86%);
  outline: none;
}

.p-cases .filter-select#sortCases {
  border-color: rgb(249 115 22 / 75%);
  box-shadow: 0 18px 32px rgb(249 115 22 / 28%);
}

.p-cases .filter-select#sortCases:focus {
  border-color: rgb(249 115 22);
  box-shadow: 0 0 0 3px rgb(249 115 22 / 26%);
}

body.light-mode.p-cases .filter-select {
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(185 203 240 / 65%);
  color: rgb(30 41 59);
}

body.light-mode.p-cases .filter-select:focus {
  border-color: rgb(59 130 246);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 20%);
  background: rgb(248 250 255);
}

body.light-mode.p-cases .filter-select#sortCases {
  border-color: rgb(249 115 22 / 70%);
  box-shadow: 0 16px 30px rgb(249 115 22 / 18%);
}

body.light-mode.p-cases .filter-select#sortCases:focus {
  border-color: rgb(249 115 22);
  box-shadow: 0 0 0 3px rgb(249 115 22 / 18%);
  background: rgb(255 247 237);
}

body.light-mode.p-cases .filter-select-wrapper::after {
  color: rgb(100 116 139);
}

/* Collapse layout into stacked controls on small screens while keeping parity. */
@media (width <= 720px) {
  .p-cases .search-input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }

  .p-cases .search-icon {
    position: static;
    transform: none;
  }

  .p-cases .search-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgb(79 70 229 / 40%);
    background: rgb(255 255 255 / 9%);
  }

  .p-cases .search-button {
    width: 100%;
  }

  .p-cases .filter-bar {
    grid-template-columns: 1fr;
  }

}

/* ===============================
   Cases – Results Grid
   =============================== */
.p-cases .cases-grid {
  display: grid;

  /* min() clamps the column floor to the viewport so narrow screens never overflow */
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 28px;

  /* Center tracks so single-card pages stay balanced inside the shared container. */
  justify-content: center;
  justify-items: center;
  margin-top: 24px;
  counter-reset: case-counter;
}

.p-cases .cases-grid > * {
  /* The grid now delegates its presentation to the redesigned card shell. */
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 28px;
  box-shadow: none;
  transition: transform .22s ease, box-shadow .22s ease;

  /* Constrain card width so centered tracks remain visually balanced when fewer columns render. */
  width: min(100%, 540px);
}

/* Align with `.collections-page .unified-cases-grid` mobile rules (collections.css loads after). */
@media (width <= 720px) {
  .p-cases .cases-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
    box-sizing: border-box;
  }

  .p-cases .cases-grid > * {
    width: 100%;
    max-width: 100%;
  }
}

  /* Hide time-estimate chips globally on Cases */
  .p-cases .time-estimate,
  .p-cases .case-card .time-estimate {
    display: none !important;
  }

/* (Removed earlier hover block; consolidated before light-mode overrides) */

/* ===============================
   Cases – Empty State (moved earlier to satisfy selector ordering)
   =============================== */
.p-cases .cases-empty-state {
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 28px 0;
}

.p-cases .cases-empty-state.active {
  display: flex;
}

.p-cases .cases-empty-state p {
  color: var(--muted-text);
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------

/* Live results status mirrors the card accents so counts remain visible. */
.p-cases .cases-pagination-row {
  margin: 32px auto 0;
  padding: 0 16px;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.p-cases .case-results-status {
  max-width: 960px;
  margin: 0;
  padding: 12px 24px;
  border-radius: 18px;

  /* Orange accent and text as requested */
  border: 1px solid rgb(249 115 22 / 45%);
  background: rgb(249 115 22 / 12%);
  color: var(--qk-accent-orange);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
  box-shadow: 0 18px 32px rgb(15 23 42 / 18%);
}

body.light-mode.p-cases .case-results-status {
  border-color: rgb(251 146 60);
  background: rgb(255 247 237);
  color: rgb(194 65 12);
  box-shadow: 0 16px 28px rgb(148 163 184 / 18%);
}

body.light-mode.p-cases .cases-pagination-row {
  margin-top: 28px;
}

/* Case card internals moved to /assets/css/components/case-card-catalog.css */

/* ===============================
   Cases – Pagination
   =============================== */
.p-cases .pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 24px 0 10px;
}

/* stylelint-disable-next-line no-descending-specificity */
.p-cases .pagination a,
.p-cases .pagination button {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgb(148 163 184 / 18%);
  background: rgb(15 23 42 / 55%);
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.02em;
  min-width: 44px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  box-shadow: 0 8px 16px rgb(2 6 23 / 40%);
}
/* stylelint-disable-next-line no-descending-specificity */
.p-cases .pagination .active,
.p-cases .pagination [aria-current="page"] {
  border-color: rgb(251 146 60 / 55%);
  background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgb(251 146 60 / 38%);
}

.p-cases .pagination a:hover:not(.active, :disabled),
.p-cases .pagination button:hover:not(.active, :disabled) {
  border-color: rgb(59 130 246 / 45%);
  background: rgb(30 41 59 / 65%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgb(30 64 175 / 35%);
}

.p-cases .pagination a:focus-visible,
.p-cases .pagination button:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.p-cases .pagination a:disabled,
.p-cases .pagination button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

 
/* Light-mode pagination before hover link states in sources-info to avoid conflicts */

 
/* ===============================
   Cases – Sources Info (after pagination for ordering)
   =============================== */
/* Light-mode pagination after sources-info link block to satisfy ordering */
body.light-mode.p-cases .pagination a,
body.light-mode.p-cases .pagination button {
  background: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 6px 12px rgb(15 23 42 / 10%);
}

body.light-mode.p-cases .pagination a:hover:not(.active, :disabled),
body.light-mode.p-cases .pagination button:hover:not(.active, :disabled) {
  border-color: #93c5fd;
  background: #fff;
  color: #0f172a;
}

body.light-mode.p-cases .pagination .active,
body.light-mode.p-cases .pagination [aria-current="page"] {
  border-color: #ea580c;
  background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
  color: #fff;
}

 
/* Error signature block enhanced for readability */


/* ===============================
   Cases – Bundle Download Popup
   =============================== */
.p-cases .bundle-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 60%);
  z-index: 2100;
  display: none;
}

/* Popup adopts a luminous indigo gradient so copy stays legible on dark surfaces. */
.p-cases .bundle-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2101;
  width: min(960px, 92vw);
  max-width: 960px;
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(155deg, rgb(13 24 48 / 95%) 0%, rgb(23 36 70 / 96%) 55%, rgb(32 46 85 / 96%) 100%);
  border: 1px solid rgb(59 130 246 / 32%);
  border-radius: 18px;
  display: none;
  box-shadow: 0 28px 62px rgb(3 8 24 / 58%);
  box-sizing: border-box;
  color: rgb(226 232 255 / 92%);
  /* stylelint-disable-next-line property-no-vendor-prefix */
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Header keeps a transparent navy glaze so sticky content doesn’t obscure anything underneath. */
.p-cases .bundle-popup .popup-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(180deg, rgb(30 41 82 / 94%) 0%, rgb(17 26 55 / 85%) 100%);
  border-bottom: 1px solid rgb(59 130 246 / 35%);
  box-shadow: 0 10px 24px rgb(3 8 24 / 32%);
}

.p-cases .bundle-popup .popup-title {
  /* Use brand orange for modal headers across Cases and Collections */
  color: var(--qk-accent-orange);
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgb(233 151 90 / 18%);
}

.p-cases .bundle-popup .close-popup {
  background: rgb(15 23 42 / 35%);
  border: 1px solid rgb(148 163 184 / 40%);
  color: rgb(226 232 255 / 80%);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.p-cases .bundle-popup .close-popup:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgb(2 6 23 / 40%);
  color: #fff;
}

.p-cases .bundle-popup .popup-content {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
  padding: 22px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Info column leans on soft glows to outline key metadata without sacrificing contrast. */
.p-cases .bundle-popup .bundle-info {
  background:
    radial-gradient(circle at 18% 15%, rgb(59 130 246 / 28%), transparent 56%),
    radial-gradient(circle at 82% 85%, rgb(249 115 22 / 22%), transparent 60%),
    rgb(9 16 34 / 75%);
  border: 1px solid rgb(94 234 212 / 18%);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 20px 38px rgb(5 12 32 / 40%);
}

.p-cases .bundle-popup .bundle-id {
  color: var(--muted-text);
  font-size: .9rem;
  background: linear-gradient(135deg, rgb(26 32 44 / 92%) 0%, rgb(41 37 36 / 88%) 100%);
  border: 1px solid rgb(249 115 22 / 36%);
  border-left: 4px solid rgb(251 146 60 / 82%);
  box-shadow: 0 12px 24px rgb(5 12 32 / 26%), inset 0 1px 0 rgb(255 255 255 / 6%);
}

.p-cases .bundle-popup .bundle-id::before {
  opacity: .72;
  filter: drop-shadow(0 6px 14px rgb(249 115 22 / 24%));
}

.p-cases .bundle-popup .bundle-details h4 {
  margin: 10px 0 6px;
  color: var(--white-text);
}

.p-cases .bundle-popup .bundle-details,
.p-cases .bundle-popup .file-format-info {
  position: relative;
  border: 1px solid rgb(249 115 22 / 30%);
  border-left: 4px solid rgb(251 146 60 / 82%);
  border-radius: 16px;
  padding: 16px 18px;
  background: linear-gradient(160deg, rgb(26 32 44 / 88%) 0%, rgb(24 24 27 / 82%) 100%);
  box-shadow: 0 16px 28px rgb(5 12 32 / 18%);
}

.p-cases .bundle-popup .bundle-features li {
  background: linear-gradient(160deg, rgb(20 26 43 / 92%) 0%, rgb(17 24 39 / 84%) 100%);
  border-color: rgb(148 163 184 / 22%);
  color: rgb(226 232 240 / 88%);
  box-shadow: 0 16px 26px rgb(5 12 32 / 18%);
}

.p-cases .bundle-popup .bundle-features li::before {
  filter: drop-shadow(0 2px 6px rgb(0 0 0 / 28%));
}

.p-cases .bundle-popup .file-format-info {
  margin-top: 16px;
}

.p-cases .bundle-popup .file-format-info p {
  margin: 0;
  color: rgb(226 232 240 / 88%);
}

.p-cases .bundle-popup .file-format-info p + p {
  margin-top: 10px;
}

.p-cases .bundle-popup .file-format-info strong {
  color: rgb(96 165 250);
}


.p-cases .bundle-case-overview {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.p-cases .bundle-case-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white-text);
}

.p-cases .bundle-case-meta {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgb(255 255 255 / 8%);
  background: rgb(15 27 48 / 60%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.p-cases .bundle-case-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-cases .bundle-case-meta dt {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(148 163 184 / 82%);
  margin: 0;
}

.p-cases .bundle-case-meta dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white-text);
}

.p-cases .bundle-case-summary {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--light-text);
}

.p-cases .bundle-case-summary .use-case-pills {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.p-cases .bundle-case-summary .use-case-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  /* Updated to orange accent to match brand and request */
  background: linear-gradient(135deg, rgb(253 186 116), rgb(249 115 22));
  color: rgb(15 23 42);
  box-shadow: 0 12px 22px rgb(249 115 22 / 32%);
}

/* Empty state pill keeps the redesigned summary stable before data arrives. */
.p-cases .bundle-case-summary .use-case-pill.empty {
  border: 1px dashed rgb(148 163 184 / 40%);
  background: rgb(59 130 246 / 12%);
  color: rgb(203 213 225 / 80%);
  box-shadow: none;
}

body.light-mode.p-cases .bundle-case-summary .use-case-pill {
  /* Light mode orange tone */
  background: linear-gradient(135deg, rgb(253 230 138), rgb(249 192 82));
  color: rgb(15 23 42);
  box-shadow: 0 10px 18px rgb(249 192 82 / 28%);
}

body.light-mode.p-cases .bundle-case-summary .use-case-pill.empty {
  border-color: rgb(148 163 184 / 45%);
  background: rgb(226 232 240 / 50%);
  color: rgb(71 85 105 / 85%);
}

.p-cases .bundle-info section h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white-text);
}

.p-cases .bundle-use-cases {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgb(37 99 235 / 22%);
  background:
    radial-gradient(circle at top left, rgb(56 189 248 / 18%), transparent 58%),
    radial-gradient(circle at bottom right, rgb(249 115 22 / 18%), transparent 60%),
    rgb(13 26 52 / 78%);
  box-shadow: 0 18px 34px rgb(15 23 42 / 32%);
}

.p-cases .bundle-context-list,
.p-cases .bundle-use-case-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--light-text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-cases .bundle-context-list li,
.p-cases .bundle-use-case-list li {
  line-height: 1.5;
}

.p-cases .bundle-context-list li.empty,
.p-cases .bundle-use-case-list li.empty {
  list-style: none;
  padding-left: 0;
  font-style: italic;
  color: rgb(148 163 184 / 70%);
}

.p-cases .bundle-use-case-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.p-cases .bundle-use-case-list li {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgb(37 99 235 / 28%);
  background: rgb(15 27 48 / 68%);
  color: rgb(226 232 240);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.p-cases .bundle-use-case-list .use-case-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgb(15 23 42);
  background: linear-gradient(135deg, rgb(253 186 116), rgb(249 115 22));
  box-shadow: 0 10px 20px rgb(249 115 22 / 36%);
}

.p-cases .bundle-popup .bundle-features {
  margin: 8px 0 0;
  padding-left: 18px;
}

.p-cases .bundle-popup .security-badge {
  display: inline-block;
  margin-right: 8px;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(0 0 0 / 25%);
  border: 1px solid var(--card-border);
  color: var(--light-text);
  font-size: .85rem;
}

.p-cases .remedy-steps.minimal ol {
  margin: 10px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-cases .remedy-steps.minimal li {
  padding-left: 36px;
  font-size: 0.9rem;
  color: rgb(219 234 254 / 90%);
}

.p-cases .remedy-steps.minimal li::before {
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  box-shadow: 0 6px 16px rgb(59 130 246 / 28%);
}

.p-cases .validation-callout {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgb(94 234 212 / 28%);
  background: linear-gradient(135deg, rgb(16 185 129 / 12%), rgb(45 212 191 / 15%));
  color: rgb(209 250 229 / 85%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

body.light-mode.p-cases .validation-callout {
  border-color: rgb(134 239 172 / 40%);
  background: linear-gradient(135deg, rgb(187 247 208 / 70%), rgb(209 250 229 / 80%));
  color: rgb(22 101 52);
}

body.light-mode.p-cases .validation-chip {
  background: rgb(21 128 61 / 85%);
  color: rgb(240 253 244);
}

.p-cases .validation-chip {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(22 101 112 / 75%);
  color: rgb(240 253 250);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.p-cases .context-info.condensed {
  padding: 0;
}

.p-cases .context-grid {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.p-cases .context-grid div {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgb(37 99 235 / 18%);
  background: rgb(11 22 48 / 60%);
}

.p-cases .context-grid div.empty {
  border-style: dashed;
  color: rgb(148 163 184 / 85%);
}

body.light-mode.p-cases .context-grid div {
  border-color: rgb(148 163 184 / 45%);
  background: rgb(241 245 249);
}

body.light-mode.p-cases .context-grid div.empty {
  color: rgb(100 116 139);
}

body.light-mode.p-cases .context-grid dt {
  color: rgb(100 116 139);
}

body.light-mode.p-cases .context-grid dd {
  color: rgb(30 41 59);
}

.p-cases .context-grid dt {
  margin: 0 0 6px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(148 163 184 / 82%);
}

.p-cases .context-grid dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgb(226 232 240);
}

.p-cases .stat-chip.warning {
  border-color: rgb(249 115 22 / 45%);
  background: rgb(249 115 22 / 18%);
  color: rgb(254 215 170);
}

body.light-mode.p-cases .stat-chip.warning {
  border-color: rgb(249 115 22 / 50%);
  background: rgb(254 215 170 / 50%);
  color: rgb(154 52 18);
}

.p-cases .case-footer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 60%;
}

.p-cases .case-footer-meta .footnote-id {
  font-size: 0.78rem;
  color: rgb(148 163 184 / 80%);
}

body.light-mode.p-cases .case-footer-meta .footnote-id {
  color: rgb(100 116 139 / 80%);
}



/* Bundle access card mirrors the case card aesthetic while reflecting downloadPolicy quotas */
.p-cases .bundle-access {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: 1px solid rgb(96 165 250 / 18%);
  background: linear-gradient(160deg, rgb(22 35 72 / 84%) 0%, rgb(27 42 84 / 90%) 100%);
  box-shadow: 0 22px 34px rgb(6 13 32 / 24%);
}

.p-cases .bundle-access-message {
  margin: 0;
  color: rgb(226 232 240 / 92%);
  font-size: 0.98rem;
  line-height: 1.5;
}

.p-cases .bundle-actions {
  display: grid;
  gap: 10px;
  align-items: start;
}

.p-cases .bundle-section-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white-text);
}

.p-cases .bundle-section-subtitle {
  margin: 0;
  color: rgb(226 232 255 / 82%);
  line-height: 1.6;
  font-size: 0.96rem;
}

.p-cases .bundle-account-card {
  position: relative;
  padding: 26px;
  border-radius: 22px;
  border: 1px solid rgb(37 99 235 / 38%);
  background:
    linear-gradient(160deg, rgb(12 22 48 / 92%) 0%, rgb(17 32 68 / 94%) 65%, rgb(23 39 82 / 96%) 100%);
  box-shadow: 0 26px 44px rgb(6 13 32 / 48%);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.p-cases .bundle-account-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.p-cases .account-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-cases .account-badge {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;

  /* Switch to orange accent */
  background: rgb(249 115 22 / 18%);
  border: 1px solid rgb(249 115 22 / 45%);
  color: var(--qk-accent-orange);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.p-cases .account-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white-text);
}

.p-cases .bundle-account-list {
  margin: 0;
  padding-left: 20px;
  color: var(--light-text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.p-cases .bundle-account-list strong {
  color: var(--white-text);
}

.p-cases .bundle-footnote {
  margin: 0;
  font-size: 0.85rem;
  color: rgb(203 213 225 / 70%);
  line-height: 1.55;
}

.p-cases .bundle-footnote a {
  color: inherit;
  text-decoration: underline;
}

@media (width <= 880px) {
  .p-cases .bundle-popup .popup-content {
    grid-template-columns: 1fr;
  }
}

/* Light-mode bundle popup flip */
body.light-mode.p-cases .bundle-popup {
  background: #fff;
  border-color: rgb(0 0 0 / 12%);
  box-shadow: 0 20px 48px rgb(0 0 0 / 15%);
}

body.light-mode.p-cases .bundle-popup .popup-header {
  background: rgb(0 0 0 / 4%);
  border-bottom: 1px solid rgb(0 0 0 / 10%);
}

body.light-mode.p-cases .bundle-popup .popup-title {
  color: #0f172a;
}

body.light-mode.p-cases .bundle-popup .bundle-info {
  background:
    radial-gradient(circle at 16% 14%, rgb(59 130 246 / 10%), transparent 54%),
    radial-gradient(circle at 82% 84%, rgb(249 115 22 / 10%), transparent 56%),
    linear-gradient(180deg, rgb(255 255 255 / 98%), rgb(241 245 249 / 96%));
  border-color: rgb(148 163 184 / 28%);
  box-shadow: 0 20px 34px rgb(148 163 184 / 18%), inset 0 1px 0 rgb(255 255 255 / 92%);
}

body.light-mode.p-cases .bundle-popup .bundle-details h4 {
  color: rgb(30 64 175);
  text-shadow: none;
}

body.light-mode.p-cases .bundle-popup .bundle-details h4::before {
  filter: saturate(1.05) brightness(0.98);
}

body.light-mode.p-cases .bundle-popup .bundle-id {
  color: rgb(51 65 85);
  background: linear-gradient(135deg, rgb(255 247 237) 0%, rgb(255 255 255) 52%, rgb(248 250 252) 100%);
  border-color: rgb(249 115 22 / 24%);
  border-left-color: rgb(249 115 22 / 88%);
  box-shadow: 0 12px 24px rgb(249 115 22 / 10%), 0 10px 22px rgb(148 163 184 / 14%);
}

body.light-mode.p-cases .bundle-popup .bundle-details,
body.light-mode.p-cases .bundle-popup .file-format-info {
  background: linear-gradient(135deg, rgb(255 247 237) 0%, rgb(255 255 255) 52%, rgb(248 250 252) 100%);
  border-color: rgb(249 115 22 / 24%);
  border-left-color: rgb(249 115 22 / 88%);
  box-shadow: 0 12px 24px rgb(249 115 22 / 10%), 0 10px 22px rgb(148 163 184 / 14%);
}

body.light-mode.p-cases .bundle-popup .bundle-id::before {
  opacity: .8;
  filter: drop-shadow(0 6px 12px rgb(249 115 22 / 20%));
}

body.light-mode.p-cases .bundle-popup .bundle-features li {
  background: linear-gradient(180deg, rgb(255 255 255 / 98%), rgb(248 250 252 / 96%));
  border-color: rgb(148 163 184 / 26%);
  color: rgb(51 65 85);
  box-shadow: 0 10px 20px rgb(148 163 184 / 16%);
}

body.light-mode.p-cases .bundle-popup .file-format-info {
  background: linear-gradient(180deg, rgb(255 255 255 / 98%), rgb(241 245 249 / 96%));
  border-color: rgb(148 163 184 / 24%);
  box-shadow: 0 10px 22px rgb(148 163 184 / 14%);
}

body.light-mode.p-cases .bundle-popup .file-format-info p {
  color: rgb(51 65 85);
}

body.light-mode.p-cases .bundle-popup .file-format-info strong {
  color: rgb(37 99 235);
}

body.light-mode.p-cases .bundle-access {
  background: linear-gradient(180deg, rgb(255 255 255 / 98%), rgb(241 245 249 / 96%));
  border-color: rgb(148 163 184 / 24%);
  box-shadow: 0 14px 28px rgb(148 163 184 / 16%), inset 0 1px 0 rgb(255 255 255 / 92%);
}

body.light-mode.p-cases .bundle-access-message {
  color: rgb(51 65 85);
}

body.light-mode.p-cases .bundle-footnote {
  color: rgb(100 116 139 / 88%);
}

body.light-mode.p-cases .bundle-case-meta {
  background: rgb(248 250 255);
  border-color: rgb(148 163 184 / 25%);
}

body.light-mode.p-cases .bundle-case-meta dt {
  color: rgb(100 116 139);
}

body.light-mode.p-cases .bundle-case-meta dd {
  color: #0f172a;
}

body.light-mode.p-cases .bundle-case-summary {
  color: rgb(51 65 85);
}

body.light-mode.p-cases .bundle-context-list,
body.light-mode.p-cases .bundle-use-case-list {
  color: rgb(51 65 85);
}

body.light-mode.p-cases .bundle-context-list li.empty,
body.light-mode.p-cases .bundle-use-case-list li.empty {
  color: rgb(100 116 139);
}

body.light-mode.p-cases .bundle-use-cases {
  background: linear-gradient(135deg, rgb(248 250 255), rgb(226 232 240));
  border-color: rgb(148 163 184 / 35%);
  box-shadow: 0 16px 28px rgb(148 163 184 / 18%);
}

body.light-mode.p-cases .bundle-use-case-list li {
  background: rgb(255 255 255 / 92%);
  border-color: rgb(148 163 184 / 35%);
  color: rgb(51 65 85);
}

body.light-mode.p-cases .bundle-use-case-list .use-case-pill {
  color: #0f172a;
  background: linear-gradient(135deg, rgb(253 230 138), rgb(249 192 82));
  box-shadow: 0 12px 22px rgb(249 192 82 / 32%);
}

body.light-mode.p-cases .bundle-account-card {
  background: linear-gradient(130deg, rgb(255 255 255) 0%, rgb(248 250 255) 62%, rgb(226 232 240) 100%);
  border-color: rgb(0 0 0 / 10%);
  box-shadow: 0 14px 28px rgb(15 23 42 / 12%);
}

body.light-mode.p-cases .account-badge {
  background: rgb(254 215 170 / 45%);
  border-color: rgb(251 146 60 / 55%);
  color: rgb(194 65 12);
}

body.light-mode.p-cases .account-title {
  color: #0f172a;
}

body.light-mode.p-cases .bundle-account-list {
  color: rgb(30 41 59);
}

body.light-mode.p-cases .bundle-account-list strong {
  color: rgb(15 23 42);
}

body.light-mode.p-cases .purchase-btn.secondary:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}
