:root {
  --bg: #f6f1e7;
  --bg2: #fbf8f2;
  --card: rgba(255, 255, 255, 0.75);
  --card-solid: #ffffff;
  --text: #1d1a14;
  --muted: rgba(29, 26, 20, 0.7);
  --hairline: rgba(29, 26, 20, 0.12);
  --shadow: 0 14px 40px rgba(29, 26, 20, 0.10);
  --shadow-soft: 0 10px 24px rgba(29, 26, 20, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --focus: rgba(132, 98, 54, 0.35);
  --accent: #846236;
  --accent2: #9c7a4a;
  --ok: #2f7a52;
  --danger: #9a2d2d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(1000px 600px at 80% 0%, rgba(250, 241, 227, 0.9) 0%, rgba(250, 241, 227, 0) 55%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 60%, #f3eee4 100%);
}

.sr-only {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(251, 248, 242, 0.75);
  border-bottom: 1px solid rgba(29, 26, 20, 0.08);
}

.topbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.topbar__side {
  min-height: 1px;
}

.topbar__titleWrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.topbar__searchWrap {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 360px;
  justify-self: end;
}

.search {
  width: 100%;
  max-width: 360px;
  border: 1px solid rgba(29, 26, 20, 0.12);
  border-radius: 999px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 18px rgba(29, 26, 20, 0.06);
  outline: none;
  color: var(--text);
}

.search::placeholder {
  color: rgba(29, 26, 20, 0.55);
}

.search:focus-visible {
  border-color: rgba(132, 98, 54, 0.45);
  box-shadow: 0 0 0 4px var(--focus), 0 10px 24px rgba(29, 26, 20, 0.10);
}

.page {
  padding: 26px 0 48px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 18px;
}

.meta__count {
  font-size: 13px;
  color: var(--muted);
}

.btn {
  border: 1px solid rgba(29, 26, 20, 0.12);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: rgba(29, 26, 20, 0.88);
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(29, 26, 20, 0.10);
}

.btn:active {
  transform: translateY(0px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 10px 22px rgba(29, 26, 20, 0.12);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.45);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.card {
  border-radius: var(--radius);
  border: 1px solid rgba(29, 26, 20, 0.10);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.card[data-checked="true"] {
  background: linear-gradient(165deg, rgba(47, 122, 82, 0.11) 0%, rgba(255, 255, 255, 0.78) 42%, rgba(245, 250, 247, 0.95) 100%);
  border-color: rgba(47, 122, 82, 0.22);
  box-shadow:
    0 0 0 1px rgba(47, 122, 82, 0.08),
    0 10px 28px rgba(47, 122, 82, 0.14),
    0 24px 56px rgba(29, 26, 20, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.card[data-checked="true"]:hover {
  box-shadow:
    0 0 0 1px rgba(47, 122, 82, 0.1),
    0 12px 32px rgba(47, 122, 82, 0.17),
    0 28px 64px rgba(29, 26, 20, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.card[data-checked="true"] .check {
  background: rgba(47, 122, 82, 0.14);
  border-color: rgba(47, 122, 82, 0.28);
  box-shadow: 0 4px 16px rgba(47, 122, 82, 0.18), 0 10px 28px rgba(47, 122, 82, 0.1);
}

.card__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
}

.qbtn {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 2px 0;
}

.qbtn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
  border-radius: 10px;
}

.qbtn__chev {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(132, 98, 54, 0.10);
  border: 1px solid rgba(132, 98, 54, 0.16);
  flex: 0 0 auto;
  transition: transform 160ms ease, background 160ms ease;
}

.card[data-open="true"] .qbtn__chev {
  transform: rotate(180deg);
  background: rgba(132, 98, 54, 0.14);
}

.card[data-selected="true"] .qbtn__chev {
  background: rgba(47, 122, 82, 0.18);
  border-color: rgba(47, 122, 82, 0.28);
  color: rgba(47, 122, 82, 0.95);
}

.qbtn__title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  margin: 0;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(29, 26, 20, 0.10);
  background: rgba(255, 255, 255, 0.55);
}

.counter__btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(29, 26, 20, 0.10);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.counter__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(29, 26, 20, 0.10);
}

.counter__btn:active {
  transform: translateY(0px);
}

.counter__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.counter__value {
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: rgba(29, 26, 20, 0.86);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(29, 26, 20, 0.10);
  background: rgba(255, 255, 255, 0.55);
  user-select: none;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--ok);
}

.check span {
  font-size: 13px;
  color: rgba(29, 26, 20, 0.82);
  font-weight: 600;
}

.answer {
  padding: 0 14px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 220ms ease, opacity 180ms ease;
}

.card[data-open="true"] .answer {
  padding: 0 14px 14px;
  max-height: min(2400px, 92vh);
  opacity: 1;
}

.answer__inner {
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid rgba(29, 26, 20, 0.08);
  color: rgba(29, 26, 20, 0.86);
  line-height: 1.55;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer__text {
  white-space: pre-line;
}

.answer__skicaWrap {
  margin-top: 2px;
}

.answer__skicaLabel {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(29, 26, 20, 0.55);
  margin-bottom: 8px;
}

.answer__skica {
  margin: 0;
  padding: 14px 16px;
  font-family: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(29, 26, 20, 0.88);
  background: rgba(132, 98, 54, 0.06);
  border: 1px solid rgba(132, 98, 54, 0.14);
  border-radius: 12px;
  overflow-x: auto;
  tab-size: 4;
  white-space: pre;
}

.chapter {
  margin-bottom: 28px;
}

.chapter:last-child {
  margin-bottom: 0;
}

.chapter__title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(29, 26, 20, 0.88);
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(29, 26, 20, 0.10);
}

.chapter__cards {
  gap: 14px;
}

.answer__media {
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(29, 26, 20, 0.10);
  background: rgba(255, 255, 255, 0.65);
}

.answer__media img {
  display: block;
  width: 100%;
  height: auto;
}

.empty {
  margin: 20px 0;
}

.empty__card {
  border-radius: var(--radius);
  border: 1px dashed rgba(29, 26, 20, 0.18);
  background: rgba(255, 255, 255, 0.55);
  padding: 18px 16px;
}

.empty__title {
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.empty__subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .topbar__inner {
    grid-template-columns: 1fr;
  }
  .topbar__titleWrap {
    justify-content: flex-start;
  }
  .topbar__searchWrap {
    justify-content: flex-start;
  }
  .card__header {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .controls {
    justify-content: flex-start;
  }
}
