:root {
  --ink: #101322;
  --muted: #667085;
  --line: #e7e8ee;
  --paper: #ffffff;
  --soft: #f7f7fb;
  --purple: #321191;
  --gold: #ffb915;
  --red: #e62117;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, "Noto Sans Devanagari", "Nirmala UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

button,
input {
  font: inherit;
}

.card-page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 26px 18px 56px;
}

.card-hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 19, 34, .08);
}

.back-link {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--purple);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 720px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}

.search-box {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d8d9e2;
  border-radius: 999px;
  background: #fff;
  padding: 0 14px 0 18px;
}

.search-icon {
  color: #111827;
  font-size: 23px;
  line-height: 1;
  transform: rotate(-20deg);
}

.search-box input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.clear-search {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #f0f0f4;
  color: #555;
  cursor: pointer;
  display: none;
  font-size: 20px;
  line-height: 1;
}

.clear-search.show {
  display: grid;
  place-items: center;
}

.card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.card-chip {
  border: 1px solid #e0dde8;
  border-radius: 999px;
  background: #fff;
  color: #222;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.card-chip.active {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.list-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.1;
}

.card-count {
  margin: 0 0 6px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.card-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 19, 34, .04);
}

.question-link {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.question-title {
  display: block;
  color: #071d33;
  font-family: "Noto Sans Devanagari", "Nirmala UI", Inter, sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
}

.question-link:hover .question-title {
  color: var(--purple);
  text-decoration: underline;
}

.question-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  min-width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff3c4;
  color: #201400;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,185,21,.42);
}

.icon-button:hover,
.icon-button.playing {
  background: var(--gold);
}

.icon-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.mp3-download {
  font-size: 11px;
}

.row-audio {
  display: none;
}

.answer-text {
  grid-column: 1 / -1;
  display: none;
}

.empty-state {
  margin-top: 18px;
  padding: 32px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.78);
}

.image-modal[hidden] {
  display: none;
}

.image-modal img {
  max-width: min(92vw, 820px);
  max-height: 92vh;
  display: block;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
}

.modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 680px) {
  .card-page {
    padding: 12px 10px 40px;
  }

  .card-hero {
    padding: 22px 16px;
    border-radius: 16px;
  }

  .controls {
    padding: 12px;
    border-radius: 15px;
  }

  .card-row {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .question-title {
    font-size: 18px;
  }
}
